Data processing method, data processing system, electronic device, and storage medium
Patent Information
- Application Number
- CN202411252812.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-09-06
AI Technical Summary
[0002]随着互联网技术的发展,我国网民规模日益壮大,特别是在一些数字金融的场景,比如电子支付、电子商务等场景下,很容易出现超高并发流量,在这些超高并发场景下,短时间内会产生有数以千万甚至数以亿计的访问请求,大量访问请求的瞬间涌入会对后端服务器以及业务的数据库造成较大的访问压力,对服务器的稳定性造成影响
[0045]This application provides a data processing method, a data processing system, an electronic device, and a computer-readable storage medium. The method includes: receiving a service request sent by a client through a front-end interface and forwarding the service request to an external server; querying and/or modifying a first dynamic cache component and/or a second dynamic cache component according to the service request; returning first response information to the client according to the first and second dynamic cache components to enable the client to determine the service data in the state of completing the service request, wherein the first response information includes comprehensive service data cached in the first dynamic cache component and pending service data cached in the second dynamic cache component; sending the service request to a second service component to enable the second service component to invoke the transaction manager; generating a transaction through the transaction manager and operating the service database according to the generated transaction to modify the service data corresponding to the service request; and, if the service data is successfully modified, modifying the comprehensive service data and/or rolling back the pending service data according to the service database. This application embodiment deploys a distributed caching module and an off-domain server. A first dynamic caching component caches comprehensive business data, and a second dynamic caching component caches pending business data. Upon receiving a business request, the request is forwarded to the off-domain server. A first service component deployed off-domain queries and/or modifies the first and/or second dynamic caching components. Then, based on the comprehensive business data cached in the first dynamic caching component and the pending business data cached in the second dynamic caching component, a response is returned to the client. Simultaneously, the business request is forwarded to the second service component, allowing the second service component to asynchronously call the transaction manager deployed within the domain to operate on the actual business database. Based on this, the data processing method disclosed in this embodiment utilizes the first dynamic caching component deployed off-domain and... The second dynamic caching component first determines the data after executing the business request and returns the response data to the client accordingly. Then, it asynchronously sends the business request to the second service component, which asynchronously calls the transaction manager of the module within the domain to perform actual operations on the business database deployed in the module within the domain. By decoupling the steps of returning response information to the client and operating the business database, the response information is returned to the client after modifying the distributed cache outside the domain. In this way, no firewall access to the domain is required before returning response information to the client, which greatly improves the system's response speed. After returning response information to the client, the transaction manager is asynchronously called to perform the actual modification of the business database. In the face of ultra-high concurrency scenarios, this asynchronous call mechanism can effectively alleviate the database access pressure.Based on this, the data processing method proposed in this application embodiment will not cause resource redundancy, while ensuring the system's response speed in ultra-high concurrency scenarios, reducing the database pressure on the system in ultra-high concurrency scenarios, and improving the system's stability and availability in ultra-high concurrency scenarios.
Smart Images

Figure CN119226338B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital financial technology, and in particular to a data processing method, a data processing system, an electronic device, and a storage medium. Background Technology
[0002] With the development of internet technology, the number of internet users in my country is growing rapidly. Especially in some digital finance scenarios, such as electronic payment and e-commerce, it is easy to experience extremely high concurrent traffic. In these scenarios, tens of millions or even hundreds of millions of access requests will be generated in a short period of time. The instantaneous influx of a large number of access requests will put great pressure on the backend server and the business database, affecting the stability of the server.
[0003] Existing methods for handling ultra-high concurrency scenarios, such as traffic offloading and caching, require the pre-deployment of a large amount of hardware and software resources for traffic offloading or caching to handle high-concurrency traffic. However, ultra-high concurrency scenarios often only occur for a short period of time. This results in the hardware resources deployed to cope with ultra-high concurrency scenarios being in a redundant state most of the time, causing resource waste. There is a lack of existing technologies that can maintain system availability and stability in ultra-high concurrency scenarios without relying on resource redundancy. Summary of the Invention
[0004] The main objective of this application is to provide a data processing method, a data processing system, an electronic device, and a computer-readable storage medium that can improve the availability and stability of the data processing system in ultra-high concurrency scenarios without causing resource redundancy.
[0005] To achieve the above objectives, a first aspect of this application proposes a data processing method applied to a data processing system. The data processing system includes an intra-domain module, an extra-domain module, and a front-end interface. The front-end interface is used to receive business requests sent by clients. The intra-domain module includes a transaction manager and a business database. The extra-domain module includes at least one extra-domain server and a distributed cache. The distributed cache includes a first dynamic caching component and a second dynamic caching component. The extra-domain server includes a first service component, a message component, and a second service component. The first service component is used to query and / or modify the first dynamic caching component and / or the second dynamic caching component according to the business request. The first service component communicates asynchronously with the second service component through the message component. The intra-domain module and the extra-domain module are isolated by a firewall. The extra-domain module calls the transaction manager through the second service component. The method includes:
[0006] The front-end interface receives the business request sent by the client and forwards the business request to the external server.
[0007] Query and / or modify the first dynamic cache component and / or the second dynamic cache component according to the business request;
[0008] The first response information is returned to the client by the first dynamic caching component and the second dynamic caching component so that the client can determine the business data in the state of completing the business request. The first response information includes comprehensive business data cached in the first dynamic caching component and pending business data cached in the second dynamic caching component.
[0009] The business request is sent to the second service component so that the second service component invokes the transaction manager;
[0010] The transaction manager generates a transaction and operates the business database according to the generated transaction to modify the business data corresponding to the business request;
[0011] If the business data is successfully modified, the comprehensive business data is modified and / or the pending business data is rolled back according to the business database.
[0012] In some embodiments, the business request is an inbound request, which includes a user identifier and an inbound amount. The first dynamic cache component includes a user balance column for storing the comprehensive business data, and the second dynamic cache component includes a user pending transfer column for caching the pending business data. The step of querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request includes:
[0013] Find the corresponding user's pending transfer column based on the user's identity identifier;
[0014] Write the incoming amount into the user pending transfer column corresponding to the user's identity identifier;
[0015] The step of modifying the integrated business data and / or rolling back the pending business data according to the business database includes:
[0016] Update the user balance column corresponding to the user identifier according to the business database;
[0017] Roll back the user's pending transfer column corresponding to the user's identity identifier to the state before the incoming amount was written.
[0018] In some embodiments, the business request is a payment request, which includes a payment amount and a user identity identifier. The first dynamic cache component includes a user balance column for storing the comprehensive business data, and the second dynamic cache component includes a user pending transfer column for caching the pending business data. The step of querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request includes:
[0019] The corresponding user balance column and the corresponding user pending transfer column are found based on the user identity identifier, and the comprehensive business data and the pending business data are read from the user balance column and the user pending transfer column;
[0020] The step of modifying the integrated business data and / or rolling back the pending business data according to the business database includes:
[0021] Update the user balance column and the user pending transfer column corresponding to the user identity identifier according to the business database.
[0022] In some embodiments, the business request is a query request, the query request includes a user identity identifier, the first dynamic caching component includes a user balance column for storing the comprehensive business data, the second dynamic caching component includes a user pending transfer column for caching the pending business data, and the step of returning first response information to the client based on the first dynamic caching component and the second dynamic caching component to enable the client to determine the business data in the completed business request state includes:
[0023] The user balance is determined based on the user balance column corresponding to the user identity identifier;
[0024] The amount to be credited to the user is determined based on the user pending transfer column corresponding to the user's identity identifier;
[0025] The user's actual balance is determined based on the user's balance and the amount to be credited to the user's account.
[0026] Return the actual balance to the client.
[0027] In some embodiments, the method further includes:
[0028] If modifying the business data fails, the second dynamic cache component is rolled back and a second response information is returned to the client based on the comprehensive business data and the rolled-back pending business data. The second response information includes the business data in the state where the business request has not been completed.
[0029] In some embodiments, before receiving service requests through the public gateway interface, the method further includes:
[0030] Determine at least one of the first service components corresponding to the service type based on the service type of the service request;
[0031] All the first service components corresponding to the business type are deployed on the same off-domain server, and the off-domain server and the business type are bound together.
[0032] In some embodiments, the distributed cache further includes a third dynamic caching component, and the off-domain server further includes a third service component. The third dynamic caching component is used to cache historical business requests, and the method further includes:
[0033] In response to the front-end interface receiving the business request, a business request item is generated in the third dynamic cache component;
[0034] In response to the transaction manager modifying the business database, the business request item is persistently stored as the historical business request;
[0035] In response to each preset period, the third service component verifies the accuracy of the integrated business data based on the historical business requests.
[0036] A second aspect of this application provides a data processing system, the system comprising:
[0037] The request forwarding module is used to receive business requests sent by clients through the front-end interface and forward the business requests to servers outside the domain.
[0038] The cache processing module queries and / or modifies the first dynamic cache component and / or the second dynamic cache component according to the business request;
[0039] The response module returns first response information to the client based on the first dynamic caching component and the second dynamic caching component, so that the client can determine the business data in the state of completing the business request. The first response information includes comprehensive business data cached in the first dynamic caching component and pending business data cached in the second dynamic caching component.
[0040] The transaction invocation module sends the business request to the second service component so that the second service component invokes the transaction manager;
[0041] The transaction processing module generates transactions through the transaction manager and operates the business database according to the generated transactions to modify the business data corresponding to the business request;
[0042] The cache update module, upon successfully modifying the business data, modifies the comprehensive business data and / or rolls back the pending business data based on the business database.
[0043] A third aspect of this application provides an electronic device, the electronic device including a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing communication between the processor and the memory, wherein the program is executed by the processor to implement the data processing method as described in any one of the embodiments of the first aspect.
[0044] A fourth aspect of this application provides a computer-readable storage medium for computer-readable storage, wherein the computer-readable storage medium stores one or more programs that can be executed by one or more processors to implement the data processing method as described in any one of the first aspect embodiments.
[0045] This application provides a data processing method, a data processing system, an electronic device, and a computer-readable storage medium. The method includes: receiving a service request sent by a client through a front-end interface and forwarding the service request to an external server; querying and / or modifying a first dynamic cache component and / or a second dynamic cache component according to the service request; returning first response information to the client according to the first and second dynamic cache components to enable the client to determine the service data in the state of completing the service request, wherein the first response information includes comprehensive service data cached in the first dynamic cache component and pending service data cached in the second dynamic cache component; sending the service request to a second service component to enable the second service component to invoke the transaction manager; generating a transaction through the transaction manager and operating the service database according to the generated transaction to modify the service data corresponding to the service request; and, if the service data is successfully modified, modifying the comprehensive service data and / or rolling back the pending service data according to the service database. This application embodiment deploys a distributed caching module and an off-domain server. A first dynamic caching component caches comprehensive business data, and a second dynamic caching component caches pending business data. Upon receiving a business request, the request is forwarded to the off-domain server. A first service component deployed off-domain queries and / or modifies the first and / or second dynamic caching components. Then, based on the comprehensive business data cached in the first dynamic caching component and the pending business data cached in the second dynamic caching component, a response is returned to the client. Simultaneously, the business request is forwarded to the second service component, allowing the second service component to asynchronously call the transaction manager deployed within the domain to operate on the actual business database. Based on this, the data processing method disclosed in this embodiment utilizes the first dynamic caching component deployed off-domain and... The second dynamic caching component first determines the data after executing the business request and returns the response data to the client accordingly. Then, it asynchronously sends the business request to the second service component, which asynchronously calls the transaction manager of the module within the domain to perform actual operations on the business database deployed in the module within the domain. By decoupling the steps of returning response information to the client and operating the business database, the response information is returned to the client after modifying the distributed cache outside the domain. In this way, no firewall access to the domain is required before returning response information to the client, which greatly improves the system's response speed. After returning response information to the client, the transaction manager is asynchronously called to perform the actual modification of the business database. In the face of ultra-high concurrency scenarios, this asynchronous call mechanism can effectively alleviate the database access pressure.Based on this, the data processing method proposed in this application embodiment will not cause resource redundancy, while ensuring the system's response speed in ultra-high concurrency scenarios, reducing the database pressure on the system in ultra-high concurrency scenarios, and improving the system's stability and availability in ultra-high concurrency scenarios. Attached Figure Description
[0046] Figure 1 This is a flowchart of the data processing method provided in the embodiments of this application;
[0047] Figure 2 This is a network topology diagram of the data processing system provided in the embodiments of this application;
[0048] Figure 3 This is a sub-flowchart of steps S102 and S106 provided in one embodiment of this application;
[0049] Figure 4 This is a sub-flowchart of steps S102 and S106 under another scenario provided in the embodiments of this application;
[0050] Figure 5 This is a sub-flowchart of step S102 under another scenario provided in the embodiments of this application.
[0051] Figure 6 This is a flowchart of another data processing method provided in an embodiment of this application;
[0052] Figure 7 This is a flowchart of another data processing method provided in an embodiment of this application;
[0053] Figure 8 This is a modular schematic diagram of the data processing system provided in the embodiments of this application;
[0054] Figure 9 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0058] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0059] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0060] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual order of execution may change depending on the specific circumstances.
[0061] First, let's analyze some of the terms used in this application:
[0062] Throughput: refers to the amount of data successfully transmitted per unit of time to a network, device, port, virtual circuit or other facility.
[0063] Response time: refers to the time required for a system to respond to user input or requests.
[0064] Concurrent users: The total number of users whose clients interact with the server within a unit of time.
[0065] Transactions Per Second (TPS): This refers to the number of messages a system can process per second, used to measure a system's processing capacity.
[0066] Query per second (QPS): This measures the amount of traffic a specific query server processes within a given time period.
[0067] A transaction is a set of database operations required to complete the same request. To ensure data consistency and integrity, multiple database operations within the same transaction will either all succeed or all be completed.
[0068] Transaction manager: A software component used to manage database transactions.
[0069] Synchronous message: A synchronous message is a message in which the sender waits for a response from the receiver after sending the message, and blocks the sender's operations until a response is received.
[0070] Asynchronous message: An asynchronous message means that after sending a message, the sender does not immediately wait for the receiver's response, but continues to perform other operations without blocking the sender.
[0071] Asynchronous processing: Asynchronous processing is a processing method that reduces the blocking time of the main thread and improves the system's concurrency performance and response speed by delegating tasks to other threads, processes, or services.
[0072] Dynamic caching component: A dynamic caching component refers to caching data in memory according to the data access pattern and demand, and performing cache update and invalidation processing according to certain strategies.
[0073] Rollback: Rollback refers to the process of undoing operations that have already been performed in transaction processing when an error or exception occurs, restoring the data to its previous state to ensure data consistency and integrity.
[0074] Resource redundancy refers to providing multiple identical or similar resources in a system to improve its availability and fault tolerance, such as hardware redundancy and data redundancy. When one resource fails, it can automatically switch to another available resource to continue working.
[0075] Message-oriented middleware: Message middleware is a software component or service used to support asynchronous communication and message passing in distributed systems. It provides functions such as message storage, routing, and delivery to achieve decoupling and collaboration between different components.
[0076] Producer: A producer is an application or service that sends messages to a message queue or message middleware. It is responsible for sending messages to designated destinations for consumers to process.
[0077] Message queues (Broker): A message queue is a container for storing messages, used for decoupling and asynchronous communication between producers and consumers. It can store large amounts of messages and distribute and process them according to certain rules.
[0078] Consumer: A consumer is an application or service that receives and processes messages from a message queue or message middleware. It is responsible for subscribing to messages and executing the corresponding business logic.
[0079] Remote Dictionary Server (RDS): The Remote Dictionary Server is an in-memory data storage system that stores data in key-value pairs. It supports various data structures and operations and features high performance and high availability.
[0080] Topic: A topic is a publish-subscribe pattern in message brokers. Producers publish messages to a specific topic, while consumers can subscribe to topics of interest and receive corresponding messages.
[0081] An intranet is a private computer network or restricted access network that uses internet technologies (such as network protocols and IP addresses). Intranets are typically used to host internal websites, databases, and resources for enterprise communication, file sharing, and collaboration, and often store sensitive or confidential information. Intranets generally use a browser / server (B / S) architecture, which divides the server side of the traditional client / server (C / S) architecture into an application server and one or more data servers. Intranets are usually isolated from the internet by firewalls and have strict access controls, allowing only authorized users to access them.
[0082] The Internet refers to a globally interconnected public network. This network connects computers and devices around the world using various protocols and technologies, enabling global information exchange, resource sharing, and service access.
[0083] With the development of internet technology, the number of internet users in my country is growing rapidly. In digital financial scenarios such as electronic payment and e-commerce, it is easy to encounter extremely high concurrency scenarios. In a short period of time, tens of millions or even hundreds of millions of traffic surge into the server, putting great pressure on the server's backend database. At this time, the server cannot respond to requests in a timely manner, which leads to increased response latency, resulting in a decline in user experience. It may also cause network congestion, which slows down the data transmission between the client and the server, further increasing response latency, reducing server throughput, and even causing the server to crash due to excessive access traffic.
[0084] In existing technologies, ultra-high concurrency scenarios are generally handled by resource redundancy. Specifically, this involves configuring a large number of hardware and software units for caching or traffic offloading to handle ultra-high concurrency traffic. However, ultra-high concurrency scenarios often only occur within a specific time period, which means that the hardware and software resources deployed to cope with ultra-high concurrency scenarios are idle in most cases, resulting in resource waste.
[0085] Based on this, embodiments of this application propose a data processing method and apparatus, an electronic device, and a computer-readable storage medium, which are specifically described through the following embodiments. First, the data processing method in the embodiments of this application is described.
[0086] The data processing method provided in this application relates to the field of data processing. The data processing method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and data processing platforms; the software can be an application implementing the data processing method, but is not limited to the above forms.
[0087] The embodiments of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote storage media, including storage devices.
[0088] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0089] Reference Figure 1 and Figure 2 The first aspect of this application discloses a data processing method, applied to, for example... Figure 2The data processing system shown includes an intra-domain module 210, an extra-domain module 220, and a front-end interface 230. The front-end interface 230 is used to receive business requests sent by clients. The intra-domain module 210 includes a transaction manager 211 and a business database 212. The extra-domain module 220 includes at least one extra-domain server 221 and a distributed cache 222. The distributed cache 222 includes a first dynamic cache component 223 and a second dynamic cache component 224. The extra-domain server includes a first service component 225, a message component 226, and a second service component 227. The first service component 225 is used to query and / or modify the first dynamic cache component 223 and / or the second dynamic cache component 224 according to the business request. The first service component 225 communicates asynchronously with the message component 226 and the second service component 227. The intra-domain module 210 and the extra-domain module 220 are isolated by a firewall 240. The extra-domain module 220 calls the transaction manager 211 through the second service component 227. The method includes:
[0090] Step S101: Receive the business request sent by the client through the front-end interface and forward the business request to the server outside the domain;
[0091] Step S102: Query and / or modify the first dynamic cache component and / or the second dynamic cache component according to the business request;
[0092] Step S103: Return first response information to the client according to the first dynamic caching component and the second dynamic caching component so that the client can determine the business data in the completed business request state. The first response information includes the comprehensive business data cached in the first dynamic caching component and the pending business data cached in the second dynamic caching component.
[0093] Step S104: Send the business request to the second service component so that the second service component can call the transaction manager;
[0094] Step S105: Generate a transaction through the transaction manager and operate the business database according to the generated transaction to modify the business data corresponding to the business request;
[0095] Step S106: If the business data is successfully modified, modify the comprehensive business data and / or roll back the pending business data according to the business database.
[0096] It is understandable that an intranet module refers to the intranet of an organization or enterprise. An intranet module includes a transaction manager deployed in the intranet and at least one business database. The business database stores business data related to the business of the data processing system. The transaction manager is used to generate corresponding transaction items according to business requests and perform a series of operations on the business database based on the generated transaction items.
[0097] In one possible implementation, the data processing system is used in digital finance scenarios such as electronic payments and e-commerce. The business database can be used to store each user's account balance, each account's transaction logs, etc. When an electronic payment request is generated, the transaction manager generates a transfer transaction, deducts the transaction amount from the payer's account balance, writes the transaction amount into the payee's account balance, and simultaneously writes the transfer details into the transaction log data of both the payee and the payer. When the data processing system is used to handle commodity transaction business, the business database stores transaction data such as merchant's commodity data, merchant and buyer's account balance data, buyer's purchase log data, and merchant's sales log data. It can be understood that this data can be stored separately in different dedicated databases. For example, the business database deployed in the domain module includes commodity database, transaction database, and log database. When a commodity transaction request is generated, the transaction manager generates a commodity transaction transaction and operates on the commodity database, transaction database, and log database respectively according to the generated commodity transaction transaction. It deducts the corresponding quantity of commodity inventory from the commodity data stored in the commodity database, and simultaneously operates on the transaction database to deduct the corresponding commodity payment from the buyer's balance and write the corresponding commodity payment to the merchant's account balance. It operates on the log database to write the purchase details and sales details into the log list corresponding to the buyer and merchant in the log database. In this way, a commodity transaction request is completed.
[0098] The modules within and outside the domain are isolated by a firewall. Based on this, the security of core services and business databases deployed in the modules within the domain can be guaranteed, and the data stored in the business database can be prevented from being illegally tampered with, thereby ensuring the security of business data.
[0099] The off-domain module includes at least one off-domain server and a distributed cache. The distributed cache includes a first dynamic cache component and a second dynamic cache component. The first dynamic cache component is used to cache comprehensive business data related to business requests. Specifically, the first dynamic cache component and the business database store the same type of business data. It should be noted that the comprehensive business data cached in the first dynamic cache component and the business data stored in the business database have eventual consistency. For example, when the data processing system is used in digital financial scenarios such as electronic payments, both the first dynamic cache component and the business database cache the balance of each user. Or, when the data processing system is used for commodity transactions, both the first dynamic cache component and the business database store the merchant's commodity inventory and balance, as well as the buyer's account balance. Specifically, the first dynamic cache component can be a Redis cache. Based on the Redis cache, fast data read and write operations can be achieved, further improving the speed at which the system returns response information to the client based on the data from the distributed cache.
[0100] The second dynamic caching component is used to cache pending business data related to business requests. Pending business data refers to temporary data generated in response to a business request and rolled back and eliminated after the request is completed. For example, when the business request is an invoice request, the second dynamic caching component caches the invoice amount as pending business data. When the invoice request is completed—that is, after the transaction manager operates on the business database based on the invoice request and writes the invoice amount to the corresponding user balance—the second dynamic caching component rolls back, deducting the corresponding invoice amount from the pending business data. Alternatively, when the data processing system is applied to commodity transactions, the second dynamic caching component caches the pending deduction quantity of commodity inventory, the pending invoice amount for merchants, and the pending deduction amount for buyers. Specifically, the second dynamic caching component can also be a Redis cache. Based on the Redis cache, it can achieve fast data read and write operations, further improving the speed at which the system returns response information to the client based on distributed cache data.
[0101] The first service component is used to respond to business requests by querying and / or modifying the first dynamic cache component and / or the second dynamic cache component. Specifically, for example, if the business request is an invoice request, the first service component will respond by modifying the second dynamic cache component, writing the invoice amount into the second dynamic cache component as the amount to be invoiced. In this way, the front-end interface can return the user balance after the invoice request is completed to the client based on the user balance cached in the first dynamic cache component and the amount to be invoiced cached in the second dynamic cache component. Thus, all steps before returning the response information to the client are completed in the external module, without needing to access the internal module through a firewall, thereby effectively improving the system's response speed.
[0102] The messaging component is used for asynchronous communication between the first and second service components. The messaging component can be an asynchronous message queue. The first service component, acting as a message producer, writes business requests to the asynchronous message queue, and the second service component, acting as a message consumer, retrieves business requests from the asynchronous message queue. The first service component first writes the business request to the messaging component, which then asynchronously sends the business request to the second service component. The asynchronous messaging component can perform rate limiting based on a pre-configured rate limiting strategy, ensuring that the number of business requests sent to the second service component per unit time does not exceed a set threshold. The asynchronous message queue can also add messages that are not sent in time to the queue, sending them only when the queue has available capacity. This can smooth out peak traffic of a large number of business requests in ultra-high concurrency scenarios, preventing the second service component from frequently calling the transaction manager to operate on the business database in a short period of time, thus avoiding excessive pressure on the business database from a sudden surge in high-concurrency requests. Specifically, the messaging component can be, but is not limited to, at least one of Kafka, RocketMQ, RabbitMQ, and ActiveMQ.
[0103] The second service component is used to call the transaction manager. Specifically, in response to the message component sending the business request to the second service component, the second service component sends the business request to the transaction manager so that the transaction manager can generate the corresponding transaction based on the business request.
[0104] The transaction manager is deployed within the domain and is used to generate corresponding transactions based on the received business requests, and to operate the business database based on the generated transactions.
[0105] The business database stores business data related to the business requests that the data processing system needs to process. Specifically, the data stored in the business database depends on the application scenario. For example, if the data processing system is used in digital finance scenarios such as electronic payments, the business database stores payment data such as the account balance and transaction logs of each user participating in the transaction. Alternatively, if the data processing system is used in commodity transactions, the business database stores transaction data such as the account balances of merchants and buyers, and the merchant's inventory levels.
[0106] In step S101 of some embodiments, the data processing system provides at least one front-end interface. The client initiates a business request to the data processing system through the front-end interface. After receiving the business request initiated by the client, the front-end interface forwards the business request to the corresponding extra-domain server. Specifically, the extra-domain module may include multiple extra-domain servers, each of which is used to handle different types of business requests. By diverting different types of business requests to different extra-domain servers for processing, the workload of a single extra-domain server can be reduced, thereby improving the response speed of the extra-domain server.
[0107] In step S102 of some embodiments, after forwarding the business request to an off-domain server, a first service component deployed on the off-domain server is invoked. The first service component responds to the business request by querying and / or modifying a first dynamic cache component and / or a second dynamic cache component. Specifically, the transactions required to be performed on the first and second dynamic cache components differ for different business requests. For example, for query-type business requests, it is often unnecessary to modify the business database, and therefore, there is no need to modify the distributed cache. When a query-type business request is required, the actual data related to the business request can be determined by querying the comprehensive business data cached in the first dynamic cache component and the pending business data cached in the second dynamic cache component. For example, when a data processing system is applied to digital financial scenarios such as electronic payments, the first dynamic cache component caches the user's account balance, and the second dynamic cache component caches the user's pending transfer amount. When a balance query request is received, the system queries the corresponding user balance from the first dynamic cache component and the corresponding pending transfer amount from the second dynamic cache component. Combining these two queries yields the user's actual balance. Understandably, for some business requests, it is necessary to modify the business database. In this case, it is necessary to modify the first dynamic cache component and / or the second dynamic cache component. For instance, when a deposit request is received, the system can modify the pending business data cached in the second dynamic cache component and write the deposit amount into the second dynamic cache component as the user's pending deposit amount.
[0108] In step S103 of some embodiments, after querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request, the corresponding response data can be returned to the client. For example, when the data processing system is applied to digital finance such as electronic payment, the first dynamic cache component caches the user's account balance, and the second dynamic cache component caches the user's pending transfer amount. Based on the two, the user's actual balance can be determined. Therefore, based on the user's balance cached in the first dynamic cache component and the pending transfer amount cached in the second dynamic cache component, the user's actual balance after completing all transfer requests can be returned to the client. Based on this, this application deploys a first dynamic caching component and a second dynamic caching component in an off-domain module, and deploys a first service component in an off-domain server to query and / or modify the first dynamic caching component and / or the second dynamic caching component. When the off-domain server receives a business request, it can determine the business data in the completed business request state by querying and / or modifying the first dynamic caching component and / or the second dynamic caching component, and thus return response information to the client. Based on this, the entire process from receiving a business request to returning a response to the client is completed in the off-domain module. It does not require accessing the on-domain module through a firewall, nor does it require operation on the business database, effectively reducing the pressure on the business database in ultra-high concurrency scenarios, while also taking into account the system's response speed, and does not require a large amount of hardware support, thus avoiding resource redundancy.
[0109] In step S104 of some embodiments, asynchronous communication is achieved between the first service component and the second service component via a message component. Specifically, after responding to a business request to query and / or modify the first dynamic cache component and / or the second dynamic cache component, the first service component writes the business request to the message component. The message component then asynchronously sends the business request to the second service component. Upon receiving the business request, the second service component bypasses the firewall to access the domain module and invokes the transaction manager. It is understood that the message component limits the number of business requests sent to the second service component per unit time according to a preset rate limiting policy. Thus, in the event of extremely high concurrency, excessive business requests will be temporarily stored in the message queue and sent to the second service component when the capacity is available. This avoids the second service component frequently invoking the transaction manager to operate on the business database in extremely high concurrency scenarios, thereby reducing the pressure on the business database caused by extremely high concurrency scenarios and improving the availability and stability of the system in extremely high concurrency scenarios.
[0110] In step S105 of some embodiments, the transaction manager, as a component for managing the database, can generate corresponding transactions based on the received business requests. It can be understood that a transaction refers to a set of database operations. The transaction manager generates corresponding transactions based on the business requests and uses them to operate on the business database, which can modify the data stored in the business database to the business data after the business request is completed.
[0111] In step S106 of some embodiments, after the modification of the business database is completed, it means that the business request has been actually completed. At this time, it is necessary to roll back the pending business data corresponding to the business request cached in the second dynamic cache component and synchronize the comprehensive business data cached in the first dynamic cache component with the business data stored in the business database, so as to ensure the eventual consistency between the comprehensive business data cached in the first dynamic cache component and the business data stored in the business database.
[0112] This application embodiment deploys a distributed cache and an off-domain server. A first service component and a second service component are deployed on the off-domain server. The first and second service components communicate asynchronously via a message component. The distributed cache includes a first dynamic cache component for caching comprehensive business data with eventual consistency with the business database, and a second dynamic cache component for caching pending business data generated by business requests. Thus, upon receiving a business request, it is directly forwarded to the off-domain server. The off-domain server calls the first service component to query and / or modify the first and / or second dynamic cache components, and returns response information to the client based on the first and second dynamic cache components. Simultaneously, the first service component writes the business request to the message component, which asynchronously sends the business request to the second service component. The second service component then bypasses the firewall to access the on-domain module, and based on the business request, calls the transaction manager to operate on the business database, thereby modifying the business data stored in the business database based on the business request. In this embodiment, the first service component queries and / or modifies the first and second dynamic caching components deployed outside the domain to quickly determine the response data. This decouples the process of returning the response to the client from the process of modifying the business database. The system can directly return the response data to the client based on the comprehensive business data cached in the first dynamic caching component and the pending business data cached in the second dynamic caching component, without waiting for the business database to be modified. Furthermore, the first and second service components communicate asynchronously through a message component. When the message component receives a business request, it checks the current message... If the number of messages has reached the rate limiting threshold, the business request is immediately sent to the second service component. If it has reached the threshold, the message component will queue the newly received business requests and wait. When the message component has free capacity, it will asynchronously send these business requests to the second service component. Based on this, the asynchronous sending of the message component controls the number of business requests sent to the second service component per unit time. In the event of ultra-high concurrency, the system can smooth out the peak of ultra-high concurrency traffic that occurs in a short period of time, avoid excessive business request volume in a short period of time, reduce the pressure on the business database, and improve the stability and availability of the system in ultra-high concurrency scenarios.
[0113] In some embodiments, if modifying business data fails, the second dynamic cache component is rolled back, and a second response is returned to the client based on the comprehensive business data and the rolled-back pending business data. The second response includes the business data in the state of incomplete business request. It is understood that failure to modify business data indicates that the business request was not successfully processed. In this case, the business database has not been actually modified. Therefore, the data in the first dynamic cache component does not need to be modified; only the pending data generated by the business request in the second dynamic cache component needs to be rolled back.
[0114] In some embodiments, refer to Figure 3 The business request is an inflow request, which includes at least a user identity identifier and an inflow amount. The first dynamic caching component includes a user balance column that caches each user's account balance as comprehensive business data. The second dynamic caching component includes a user transfer column that caches the inflow amount as pending business data. Step S102 includes, but is not limited to, the following steps S301 to S302:
[0115] Step S301: Locate the corresponding user's pending transfer column based on the user's identity identifier;
[0116] Understandably, in digital financial scenarios such as electronic payment, the first dynamic cache component is used to cache the user balance column of each user's account balance, and the second dynamic cache component is used to cache the pending transfer column of the pending amount generated by the business request. Based on the user's identity identifier, the user's pending transfer column corresponding to the user's identity identifier can be found in the second dynamic cache component.
[0117] Step S302: Write the incoming amount into the user pending transfer column corresponding to the user's identity identifier;
[0118] Understandably, upon receiving the crediting request, the actual user's balance is not yet modified in the business database; that is, the crediting request is not actually completed. At this point, the crediting amount is first written to the user's pending transfer column corresponding to the user's identity identifier. Based on this, in step S103, the user's actual balance after crediting is completed can be returned to the client according to the user's balance cached in the first dynamic cache component and the crediting amount cached in the second dynamic cache component. This decouples the process of modifying the business database from the process of returning a response to the client, eliminating the need to wait for the business database to be modified before returning response data to the client. Furthermore, since this process is completed in the external module, it does not require accessing the internal module through a firewall, effectively improving the system's response speed.
[0119] Step S106 includes, but is not limited to, the following steps S303 to S304:
[0120] Step S303: Update the user balance column corresponding to the user identity identifier according to the business database;
[0121] Step S304: Roll back the user pending transfer column corresponding to the user identity identifier to the state before the deposit amount was written.
[0122] Understandably, once the transaction manager is invoked to operate the business database and successfully modify the business data, the actual receipt request has been completed. At this point, the user's account balance cached in the first dynamic cache component should be updated to the state after receipt, that is, the receipt amount should be written into the user balance column. At the same time, the pending business data cached in the second dynamic cache component should be rolled back, and the corresponding receipt amount should be cleared from the pending transfer column.
[0123] In some embodiments, refer to Figure 4 The business request is a payment request, which includes at least a user identity identifier and a payment amount. The first dynamic caching component includes a user balance column that caches each user's account balance as comprehensive business data. The second dynamic caching component includes a user transfer column that caches incoming amounts as pending business data. Step S102 includes, but is not limited to, the following step S401:
[0124] Step S401: Locate the corresponding user balance column and the corresponding user pending transfer column based on the user identity identifier, and read the comprehensive business data and pending business data from the user balance column and the user pending transfer column;
[0125] Understandably, in digital financial scenarios such as electronic payments, the data processing system uses a first dynamic cache component to cache the user balance column for each user's account balance, and a second dynamic cache component to cache the pending transfer column for amounts to be credited by business requests. Based on the user's identity identifier, the system can retrieve the user balance column corresponding to the user's identity identifier from the first dynamic cache component, and the pending transfer column corresponding to the user's identity identifier from the second dynamic cache component. Based on the user balance column and the pending transfer column, the system can determine the user's actual balance after all crediting requests are completed, thereby determining whether the user's actual balance is sufficient for payment. If so, the payment request is directly written to the second service component, which then calls the transaction manager to operate on the business database. In this way, the determination of whether there is sufficient balance for payment can be completed outside the domain, and the process of querying the balance and determining whether the balance is sufficient for payment can be completed outside the domain, without having to access the domain module through the firewall. This effectively improves the system's response speed and reduces queries to the business database, thus reducing the pressure on the business database.
[0126] Step S106 includes, but is not limited to, the following step S402:
[0127] Step S402: Update the user balance column and user pending transfer column corresponding to the user identity identifier according to the business database.
[0128] Understandably, once the transaction manager operates on the business database and successfully modifies the business data, the payment request has been completed. At this point, the corresponding payment amount can be deducted from the user balance cached in the user balance column and the pending transfer amount cached in the user pending transfer column.
[0129] In some embodiments, refer to Figure 5 The business request is a query request, which includes an identity identifier. The first dynamic cache component includes a user balance column for storing comprehensive business data, and the second dynamic cache component includes a user transfer column for caching business data to be processed. Step S102 includes, but is not limited to, steps S501 to S504.
[0130] Step S501: Determine the user balance based on the user balance column corresponding to the user identity identifier;
[0131] Step S502: Determine the amount to be credited to the user's account based on the user's pending transfer column corresponding to the user's identity identifier;
[0132] Step S503: Determine the user's actual balance based on the user's balance and the amount to be credited to the user's account;
[0133] Step S504: Return the actual balance to the client.
[0134] Understandably, based on the user's identity identifier, the corresponding user balance and pending credit amount can be retrieved from the first and second dynamic cache components, respectively. Based on the user's balance and pending credit amount, the corresponding actual user balance can be determined, and the actual balance can be returned to the client. In this embodiment, since the entire query process is completed in the external module without needing to access the internal module through the firewall, the system's response speed is effectively improved. At the same time, since the business database does not need to be accessed when processing query requests, the pressure on the business database is effectively reduced, improving the system's stability and availability.
[0135] In some embodiments, refer to Figure 6 The data processing method also includes, but is not limited to, the following steps S601 to S602.
[0136] Step S601: Determine at least one first service component corresponding to the service type based on the service type of the service request;
[0137] Step S602: Deploy all first service components corresponding to the business type on the same off-domain server, and bind the off-domain server to the business type.
[0138] In this embodiment, the first service components required to complete a request of a given business type are identified based on the business type of the request. All first service components corresponding to that business type are deployed on the same off-domain server, and this off-domain server is bound to the corresponding business type. By identifying the types of first service components required to complete the same type of business and deploying all first service components required to complete business requests of the same business type on the same off-domain server, latency caused by inter-service calls can be reduced. Furthermore, binding the off-domain server to the business type allows for the forwarding of business requests of different business types to the corresponding off-domain server. This achieves the distribution of different types of business requests, reducing the processing load on a single off-domain server and improving its stability.
[0139] In some embodiments, refer to Figure 7 The data processing method also includes, but is not limited to, steps S701 to S703.
[0140] Step S701: In response to the front-end interface receiving a business request, a business request item is generated in the third dynamic cache component;
[0141] Specifically, the distributed cache may also include a third dynamic cache component for caching historical business requests. A third service component is also deployed on the off-domain server. It can be understood that historical business requests refer to business requests that have been processed. When a business request is received, a corresponding business request item is created in the third dynamic cache component. It can be understood that at this time, the business request has not yet been processed and the business request item has not yet been used as a historical business request.
[0142] Step S702: In response to the transaction manager modifying the business database, the business request items are persistently stored as historical business requests.
[0143] It is understandable that when the food manager modifies the business database, it means that the business request has been processed. At this time, the business request item is persistently stored as a historical business request in the third dynamic cache component.
[0144] In step S703, in response to each preset period, the third service component verifies the accuracy of the comprehensive business data based on historical business requests.
[0145] The third service component can be a log reconciliation component. This third dynamic cache component caches historical business requests, essentially caching processing logs from external servers. Based on these historical business requests, the third service component can verify the accuracy of the comprehensive business data cached in the first dynamic cache component. For example, in a data processing system applied to digital finance scenarios such as electronic payments, the first dynamic cache component caches each user's account balance, while historical business requests are each user's transaction logs. In this case, the third service component acts as a log reconciliation component, verifying the accuracy of each user's account balance based on the transaction logs cached in the third dynamic cache component. Alternatively, in an e-commerce scenario, the first dynamic cache component caches the merchant's account balance, product inventory, and buyer's account balance, while historical business requests are the product transaction logs. The third service component verifies the accuracy of the merchant's account balance, product inventory, and buyer's account balance based on these product transaction logs cached in the third dynamic cache component.
[0146] In this embodiment, by setting up a third dynamic caching component outside the domain to cache historical business requests, and setting up a third service component on the server outside the domain, the third service component verifies whether the comprehensive business data cached in the first dynamic caching component is accurate based on the historical business requests. This can better ensure the accuracy of the comprehensive business data cached in the first dynamic caching component and maintain the final consistency between the comprehensive business data and the business data stored in the business database.
[0147] This application also provides a data processing system 800, such as... Figure 8 As shown, the above data processing method can be implemented. The data processing system includes:
[0148] The request forwarding module 801 is used to receive business requests sent by clients through the front-end interface and forward the business requests to servers outside the domain.
[0149] Cache processing module 802 queries and / or modifies the first dynamic cache component and / or the second dynamic cache component according to business requests;
[0150] The response module 803 returns first response information to the client based on the first dynamic caching component and the second dynamic caching component so that the client can determine the business data in the completed business request state. The first response information includes the comprehensive business data cached in the first dynamic caching component and the pending business data cached in the second dynamic caching component.
[0151] Transaction call module 804 sends the business request to the second service component so that the second service component calls the transaction manager;
[0152] The transaction processing module 805 generates transactions through the transaction manager and operates the business database according to the generated transactions to modify the business data corresponding to the business request;
[0153] The cache update module 806, upon successful modification of business data, modifies the overall business data and / or rolls back pending business data based on the business database.
[0154] The data processing device in this application embodiment is used to execute the data processing method in the above embodiment. Its specific processing procedure is the same as the data processing method in the above embodiment, and will not be described in detail here.
[0155] This application also provides an electronic device 900, including:
[0156] At least one processor, and,
[0157] A memory that is communicatively connected to at least one processor; wherein,
[0158] The memory stores instructions that are executed by at least one processor to cause the at least one processor to perform the method as described in any of the embodiments of the first aspect of this application when executing the instructions.
[0159] The following is combined with Figure 9 The hardware structure of electronic device 900 is described in detail. This computer device includes: processor 910, memory 920, input / output interface 930, communication interface 940, and bus 950.
[0160] The processor 910 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solutions provided in the embodiments of this application.
[0161] The memory 920 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 920 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 920 and is called and executed by the processor 910 using the data processing method of the embodiments of this application.
[0162] The input / output interface 930 is used to implement information input and output;
[0163] The communication interface 940 is used to enable communication and interaction between this device and other devices. Communication can be achieved via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).
[0164] Bus 950 transmits information between various components of the device (e.g., processor 910, memory 920, input / output interface 930, and communication interface 940);
[0165] The processor 910, memory 920, input / output interface 930 and communication interface 940 are connected to each other within the device via bus 950.
[0166] This application also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the data processing method of this application embodiment.
[0167] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0168] Those skilled in the art will understand that the technical solutions shown in the accompanying drawings do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0169] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0170] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0171] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0172] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0173] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not function. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0176] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to run all or part of the steps of the methods described in the various embodiments of this application. The aforementioned computer-readable storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0177] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A data processing method applied to a data processing system, the data processing system comprising an intra-domain module, an extra-domain module, and a front-end interface, the front-end interface being used to receive business requests sent by a client, the intra-domain module comprising a transaction manager and a business database, the extra-domain module comprising at least one extra-domain server and a distributed cache, the distributed cache comprising a first dynamic cache component and a second dynamic cache component, the extra-domain server comprising a first service component, a message component, and a second service component, the first service component being used to query and / or modify the first dynamic cache component and / or the second dynamic cache component according to the business request, the first service component communicating asynchronously with the second service component through the message component, the intra-domain module and the extra-domain module being isolated by a firewall, the extra-domain module calling the transaction manager through the second service component, characterized in that... The method includes: The front-end interface receives the business request sent by the client and forwards the business request to the external server. Query and / or modify the first dynamic cache component and / or the second dynamic cache component according to the business request; The first response information is returned to the client by the first dynamic caching component and the second dynamic caching component so that the client can determine the business data in the state corresponding to the completion of the business request. The first response information includes the comprehensive business data cached in the first dynamic caching component and the pending business data cached in the second dynamic caching component. The business request is sent to the second service component so that the second service component invokes the transaction manager; The transaction manager generates a transaction and operates the business database according to the generated transaction to modify the business data corresponding to the business request; If the business data is successfully modified, the integrated business data is modified and / or the pending business data is rolled back according to the business database. The business request is at least one of an invoice request, a payment request, and a query request; The incoming payment request includes a user identifier and an incoming payment amount; the payment request includes a payment amount and a user identifier; the query request includes a user identifier; the first dynamic caching component includes a user balance column for caching the comprehensive business data; and the second dynamic caching component includes a user pending transfer column for caching the pending business data. Before receiving the business request through the front-end interface, the following is also included: Determine at least one of the first service components corresponding to the service type based on the service type of the service request; All the first service components corresponding to the business type are deployed on the same off-domain server, and the off-domain server and the business type are bound together.
2. The data processing method according to claim 1, characterized in that, The step of querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request includes: Find the corresponding user's pending transfer column based on the user's identity identifier; Write the incoming amount into the user pending transfer column corresponding to the user's identity identifier; The step of modifying the integrated business data and / or rolling back the pending business data according to the business database includes: Update the user balance column corresponding to the user identifier according to the business database; Roll back the user's pending transfer column corresponding to the user's identity identifier to the state before the incoming amount was written.
3. The data processing method according to claim 1, characterized in that, The step of querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request includes: The corresponding user balance column and the corresponding user pending transfer column are found based on the user identity identifier, and the comprehensive business data and the pending business data are read from the user balance column and the user pending transfer column; The step of modifying the integrated business data and / or rolling back the pending business data according to the business database includes: Update the user balance column and the user pending transfer column corresponding to the user identity identifier according to the business database.
4. The data processing method according to claim 1, characterized in that, The step of returning first response information to the client based on the first dynamic caching component and the second dynamic caching component to enable the client to determine the business data corresponding to the completed business request includes: The user balance is determined based on the user balance column corresponding to the user identity identifier; The amount to be credited to the user is determined based on the user pending transfer column corresponding to the user's identity identifier; The user's actual balance is determined based on the user's balance and the amount to be credited to the user's account. Return the actual balance to the client.
5. The data processing method according to claim 1, characterized in that, The method further includes: If modifying the business data fails, the pending business data in the second dynamic cache component is rolled back, and a second response information is returned to the client based on the comprehensive business data and the rolled-back pending business data. The second response information includes the business data in the state where the business request has not been completed.
6. The data processing method according to claim 1, wherein the distributed cache further includes a third dynamic caching component, and the external server further includes a third service component, the third dynamic caching component being used to cache historical business requests, characterized in that, The method further includes: In response to the front-end interface receiving the business request, a business request item is generated in the third dynamic cache component; In response to the transaction manager modifying the business database, the business request item is persistently stored as the historical business request; In response to each preset period, the third service component verifies the accuracy of the integrated business data based on the historical business requests.
7. A data processing system, characterized in that, The system includes: The request forwarding module is used to receive business requests sent by clients through the front-end interface and forward the business requests to servers outside the domain. The cache processing module queries and / or modifies the first dynamic cache component and / or the second dynamic cache component according to the business request; The response module returns first response information to the client based on the first dynamic caching component and the second dynamic caching component, so that the client can determine the business data in the state corresponding to the completion of the business request. The first response information includes comprehensive business data cached in the first dynamic caching component and pending business data cached in the second dynamic caching component. The transaction invocation module sends the business request to the second service component so that the second service component invokes the transaction manager; The transaction processing module generates transactions through the transaction manager and operates the business database according to the generated transactions to modify the business data corresponding to the business request; The cache update module, upon successful modification of the business data, modifies the comprehensive business data and / or rolls back the pending business data according to the business database. The business request is at least one of an invoice request, a payment request, and a query request; The incoming payment request includes a user identifier and an incoming payment amount; the payment request includes a payment amount and a user identifier; the query request includes a user identifier; the first dynamic caching component includes a user balance column for caching the comprehensive business data; and the second dynamic caching component includes a user pending transfer column for caching the pending business data. Before receiving the business request through the front-end interface, the following is also included: Determine at least one first service component corresponding to the service type based on the service type of the service request; All the first service components corresponding to the business type are deployed on the same off-domain server, and the off-domain server and the business type are bound together.
8. An electronic device, characterized in that, The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for establishing communication between the processor and the memory. The program is executed by the processor to implement the data processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium for computer-readable storage, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the data processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Transaction data processing method and device, computer equipment and storage medium
CN117422466A
Consolidating transaction log requests and transaction logs in a database transaction log service
US20220382743A1