Data processing method, data processing system, electronic equipment and storage medium
By deploying distributed cache and service components outside the domain, asynchronously calling the transaction manager to process the business database, solving the problems of resource waste and database pressure in ultra-high concurrency scenarios, and achieving efficient response speed and system stability.
Patent Information
- Application Number
- CN202411252812.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-06
AI Technical Summary
In the process of ultra-high concurrency scenarios, the prior art requires the deployment of a large number of resources in advance, resulting in waste of resources, and lacks a method to maintain system availability and stability without resource redundancy.
By deploying a distributed cache module and an extradomain server outside the domain, the first dynamic cache component caches the comprehensive business data, the second dynamic cache component caches the pending service data, and forwards the request to the extradomain server when receiving the service request, through deployment The service components outside the domain query and modify the cache components, and asynchronously call the transaction manager to operate on the business database, thereby decoupling the response and database operation steps before returning the response information to the client.
In ultra-high concurrency scenarios, improve system response speed, reduce database pressure, avoid resource redundancy, and ensure system stability and availability.
Smart Images

Figure CN119226338A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] With the development of Internet technology, the scale of Internet users in my country is growing. Especially in some digital financial scenarios, such as electronic payment and e-commerce, ultra-high concurrent traffic is very likely to occur. In these ultra-high concurrent 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 cause great access pressure on the back-end servers and business databases, and affect the stability of the servers.
[0003] Existing processing methods for ultra-high concurrency scenarios, such as diversion and caching, require the deployment of a large number of software and hardware resources for diversion or caching in advance to handle high-concurrency traffic. Ultra-high concurrency scenarios often only appear for a short period of time, which causes the hardware resources deployed to cope with ultra-high concurrency scenarios to be redundant most of the time, resulting in a waste of resources. The existing technology lacks a method that can maintain system availability and stability in ultra-high concurrency scenarios without relying on resource redundancy. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a data processing method, a data processing system, an electronic device and a computer-readable storage medium, which 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-mentioned purpose, a first aspect of an embodiment of the present application proposes a data processing method, which is applied to a data processing system, wherein the data processing system includes an intra-domain module, an extra-domain module and a front-end interface, wherein the front-end interface is used to receive a service request sent by a client, the intra-domain module includes a transaction manager and a service database, the extra-domain module includes at least one extra-domain server and a distributed cache, the distributed cache includes a first dynamic cache component and a second dynamic cache 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 cache component and / or the second dynamic cache component according to the service 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, and the extra-domain module calls the transaction manager through the second service component, and the method includes:
[0006] Receiving the service request sent by the client through the front-end interface, and forwarding the service request to the out-of-domain server;
[0007] querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request;
[0008] Returning first response information to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the service data in the service request state is completed, the first response information including the comprehensive service data cached in the first dynamic cache component and the to-be-processed service data cached in the second dynamic cache component;
[0009] sending the business request to the second service component so that the second service component calls the transaction manager;
[0010] 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;
[0011] In the case where the business data is successfully modified, the comprehensive business data is modified according to the business database and / or the to-be-processed business data is rolled back.
[0012] In some embodiments, the business request is an account entry request, the account entry request includes a user identity identifier and an account entry amount, the first dynamic cache component includes a user balance column for storing the comprehensive business data, the second dynamic cache component includes a user pending transfer column for caching the pending business data, and the querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request includes:
[0013] Searching the corresponding user pending transfer column according to the user identity identifier;
[0014] Writing the deposited amount into the user pending transfer column corresponding to the user identity identifier;
[0015] The modifying the comprehensive business data and / or rolling back the to-be-processed business data according to the business database includes:
[0016] updating the user balance column corresponding to the user identification identifier according to the business database;
[0017] The user pending transfer column corresponding to the user identity identifier is rolled back to a state before the input amount is written.
[0018] In some embodiments, the business request is a payment request, the payment request 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, the second dynamic cache component includes a user pending transfer column for caching the pending business data, and the querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request includes:
[0019] Searching the corresponding user balance column and the corresponding user pending transfer column according to the user identity identifier, and reading the comprehensive business data and the pending business data from the user balance column and the user pending transfer column;
[0020] The modifying the comprehensive business data and / or rolling back the to-be-processed business data according to the business database includes:
[0021] The user balance column and the user pending transfer column corresponding to the user identification identifier are updated according to the business database.
[0022] In some embodiments, the service request is a query request, the query request includes a user identity identifier, the first dynamic cache component includes a user balance column for storing the comprehensive service data, the second dynamic cache component includes a user pending transfer column for caching the pending service data, and the first response information is returned to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the service data in the service request state is completed, including:
[0023] determining a user balance according to the user balance column corresponding to the user identification identifier;
[0024] Determine the user's pending deposit amount according to the user pending transfer column corresponding to the user identity identifier;
[0025] Determine the actual balance of the user according to the user balance and the amount to be deposited by the user;
[0026] The actual balance is returned to the client.
[0027] In some embodiments, the method further comprises:
[0028] In the event of failure to modify the business data, the second dynamic cache component is rolled back and a second response message is returned to the client based on the comprehensive business data and the rolled-back pending business data, wherein the second response message includes the business data in a state where the business request is not completed.
[0029] In some embodiments, before receiving the service request through the common gateway interface, the method further includes:
[0030] Determine, according to the service type of the service request, at least one first service component corresponding to the service type;
[0031] All the first service components corresponding to the business type are deployed on the same out-of-domain server, and the out-of-domain server is bound to the business type.
[0032] In some embodiments, the distributed cache further includes a third dynamic cache component, the out-of-domain server further includes a third service component, the third dynamic cache component is used to cache historical service requests, and the method further includes:
[0033] In response to the front-end interface receiving the service request, generating a service request item in the third dynamic cache component;
[0034] In response to the transaction manager modifying the business database, persistently storing the business request item as the historical business request;
[0035] In response to each preset period, the third service component verifies the accuracy of the integrated service data according to the historical service request.
[0036] A second aspect of an embodiment of the present application provides a data processing system, the system comprising:
[0037] A request forwarding module, used to receive a service request sent by a client through a front-end interface, and forward the service request to an out-of-domain server;
[0038] A cache processing module, querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request;
[0039] A response module, which returns a first response message to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the service data in the service request state is completed, wherein the first response message includes the comprehensive service data cached in the first dynamic cache component and the to-be-processed service data cached in the second dynamic cache component;
[0040] A transaction calling module, sending the business request to the second service component so that the second service component calls the transaction manager;
[0041] A transaction processing module, generating a transaction through the transaction manager and operating a business database according to the generated transaction to modify business data corresponding to the business request;
[0042] The cache update module modifies the comprehensive business data and / or rolls back the pending business data according to the business database when the business data is successfully modified.
[0043] A third aspect of an embodiment of the present application proposes an electronic device, comprising a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing a connection and communication between the processor and the memory, wherein the program, when executed by the processor, implements a data processing method as described in any one of the embodiments of the first aspect.
[0044] The fourth aspect of the embodiments of the present application proposes a computer-readable storage medium for computer-readable storage, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement a data processing method as described in any one of the embodiments of the first aspect.
[0045] An embodiment of the present application proposes a data processing method, a data processing system, an electronic device and a computer-readable storage medium, the method comprising: receiving the business request sent by the client through the front-end interface, and forwarding the business request to the out-of-domain server; querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request; returning a first response information to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the business data under the business request state is completed, the first response information including the comprehensive business data cached in the first dynamic cache component and the pending business data cached in the second dynamic cache component; sending the business request to the second service component so that the second service component calls the transaction manager; generating a transaction through the transaction manager and operating the business database according to the generated transaction to modify the business data corresponding to the business request; in the case of successful modification of the business data, modifying the comprehensive business data and / or rolling back the pending business data according to the business database. The embodiment of the present application deploys a distributed cache module and an off-domain server outside the domain, caches comprehensive business data through a first dynamic cache component, and caches pending business data through a second dynamic cache component. When a business request is received, the request is forwarded to the off-domain server, and the first dynamic cache component and / or the second dynamic cache component are queried and / or modified through the first service component deployed outside the domain. Then, a response is returned to the client based on the comprehensive business data cached in the first dynamic cache component and the pending business data cached in the second dynamic cache component, and the business request is forwarded to the second service component, so that the second service component can asynchronously call the transaction manager deployed in the domain to operate the actual business database. Based on this, the data processing method disclosed in this embodiment is configured to be executed by the first dynamic cache component and the transaction manager deployed outside the domain. The second dynamic cache component first determines the data after executing the business request and returns the response data to the client based on it, and then asynchronously sends the business request to the second service component, and asynchronously calls the transaction manager of the module in the domain through the second service component, so as to perform actual operations on the business database deployed in the module in 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 the distributed cache is modified outside the domain. In this way, there is no need to access the domain through the firewall before returning the response information to the client, which greatly improves the response speed of the system. After returning the response information to the client, the transaction manager is asynchronously called to perform the actual operation of modifying the business database. In the face of ultra-high concurrency scenarios, this asynchronous call mechanism can effectively alleviate the access pressure of the database.Based on this, the data processing method proposed in the embodiment of the present application will not cause resource redundancy, while ensuring the response speed of the system in ultra-high concurrency scenarios, and can also reduce the database pressure of the system in ultra-high concurrency scenarios, and improve the stability and availability of the system in ultra-high concurrency scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flow chart of a data processing method provided in an embodiment of the present application;
[0047] Figure 2 is a network topology diagram of a data processing system provided in an embodiment of the present application;
[0048] Figure 3 It is a sub-flow chart of step S102 and step S106 in a case provided by an embodiment of the present application;
[0049] Figure 4 It is a sub-flow chart of step S102 and step S106 in another case provided by an embodiment of the present application;
[0050] Figure 5 This is a sub-flow chart of step S102 in another case provided by the embodiment of the present application.
[0051] Figure 6 is a flowchart of another data processing method provided by an embodiment of the present application;
[0052] Figure 7 is a flowchart of another data processing method provided by an embodiment of the present application;
[0053] Figure 8 It is a modular schematic diagram of a data processing system provided in an embodiment of the present application;
[0054] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] It should be noted that, although the functional modules are divided in the device schematic diagram and the 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 above 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 those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0058] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the 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 may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0060] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor do they necessarily have to be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual order of operation may change according to actual conditions.
[0061] First, some nouns involved in this application are analyzed:
[0062] Throughput: refers to the amount of data successfully transmitted per unit time for a network, device, port, virtual circuit or other facility.
[0063] Response time: refers to the time required for the system to respond to user input or request.
[0064] Number of concurrent users: the total number of users who interact with the server during a given period of time.
[0065] Transactions Per Second (TPS): refers to the number of messages that a system can process per second, used to measure a system's processing power
[0066] Query per second (QPS): A measure of the amount of traffic a specific query server handles within a specified time period.
[0067] Transaction: A set of database operations required to complete the same request. To ensure data consistency and integrity, multiple database operations of the same transaction will only succeed or complete.
[0068] Transaction manager: A software component used to manage database transactions.
[0069] Synchronous message: A synchronous message means that the sender will wait for the receiver's response after sending the message and block the sender's operation until the response is received.
[0070] Asynchronous message: Asynchronous message means that the sender does not wait for the receiver's response immediately after sending the message, but continues to perform other operations without blocking the sender.
[0071] Asynchronous processing: Asynchronous processing is a processing method that assigns tasks to other threads, processes, or services to reduce the blocking time of the main thread and improve the system's concurrency performance and response speed.
[0072] Dynamic Buffer: A dynamic buffer caches data in memory based on the data access pattern and requirements, and updates and invalidates the cache based on certain strategies.
[0073] Rollback: Rollback means that when an error or exception occurs in transaction processing, the operations that have been executed are undone and the data is restored to its previous state to ensure data consistency and integrity.
[0074] Resource redundancy: Resource redundancy refers to providing multiple identical or similar resources in the system to improve the availability and fault tolerance of the system, such as hardware redundancy and data redundancy. When a resource fails, it can automatically switch to other available resources to work.
[0075] Message-oriented middleware: Message-oriented middleware is a software component or service that supports asynchronous communication and message delivery 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 the specified destination for consumers to process.
[0077] Message Queue (Broker): A message queue is a container for storing messages, used for decoupling and asynchronous communication between producers and consumers. It can store a large number of messages and distribute and process messages 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 corresponding business logic.
[0079] Remote Dictionary Server (Red is): Remote Dictionary Server is an in-memory data storage system that stores data in key-value pairs. It supports a variety of data structures and operations and has the characteristics of high performance and high availability.
[0080] Topic: Topic is a publish-subscribe model in message middleware. Producers publish messages to a specific topic, and consumers can subscribe to topics of interest and receive corresponding messages.
[0081] Intranet: A private computer network or a restricted access network that uses Internet technologies (such as network protocols and IP addresses). Intranets are generally used to host internal websites, databases and resources for corporate communications, file sharing and collaboration, and often store sensitive or confidential information. Intranets generally use a B / S structure, which divides the server side of the traditional C / S (Client / Server) structure into an application server and one or more data servers. Intranets are generally isolated from the Internet by firewalls and have strict access controls, allowing only authorized users to access.
[0082] Internet: refers to the public network that is interconnected worldwide. Through various protocols and technologies, the extraterritorial network connects computers and devices around the world, realizing functions such as information exchange, resource sharing, and service access on a global scale.
[0083] With the development of Internet technology, the scale of Internet users in my country is growing. In digital financial scenarios such as electronic payment and e-commerce, ultra-high concurrency scenarios are likely to occur. In a short period of time, tens of millions or even hundreds of millions of traffic flows into the server, causing great pressure on the server's back-end database. At this time, the server cannot respond to the request in time, which will increase the response delay and cause a decline in user experience. It may also cause network congestion, resulting in slow data transmission between the client and the server, further increasing the response delay and reducing the server's throughput. It may even cause the server to crash due to excessive access traffic.
[0084] In the prior art, ultra-high concurrency scenarios are generally handled through resource redundancy methods. Specifically, ultra-high concurrency traffic is handled by configuring a large amount of software and hardware for caching or diversion. However, ultra-high concurrency scenarios often only occur within a specific time period, which results in the software and hardware resources deployed to cope with ultra-high concurrency scenarios being idle in most cases, resulting in a waste of resources.
[0085] Based on this, the embodiments of the present application propose a data processing method and device, an electronic device, and a computer-readable storage medium, which are specifically illustrated by the following embodiments. First, the data processing method in the embodiments of the present application is described.
[0086] The data processing method provided in the embodiment of the present application relates to the field of data processing. The data processing method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, or a smart watch, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and data processing platforms; the software can be an application that implements the data processing method, etc., but is not limited to the above forms.
[0087] Embodiments of the present application can be used in numerous general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present 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. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote storage media including storage devices.
[0088] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0089] Reference Figure 1 and Figure 2 In a first aspect, the present application discloses a data processing method, which is applied to Figure 2The data processing system shown in the figure 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 a service request sent by a client, the intra-domain module 210 includes a transaction manager 211 and a service 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 service request, the first service component 225 communicates asynchronously with the second service component 227, the intra-domain module 210 and the extra-domain module 220 are isolated by a firewall 240, and the extra-domain module 220 calls the transaction manager 211 through the second service component 227, and the method includes:
[0090] Step S101, receiving a service request sent by a client through a front-end interface, and forwarding the service request to an out-of-domain server;
[0091] Step S102, querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request;
[0092] Step S103, returning first response information to the client according to the first dynamic cache component and the second dynamic cache component so that the client can determine the service data in the service request state completed, the first response information including the comprehensive service data cached in the first dynamic cache component and the to-be-processed service data cached in the second dynamic cache component;
[0093] Step S104, sending the business request to the second service component so that the second service component calls the transaction manager;
[0094] Step S105, generating a transaction through the transaction manager and operating the business database according to the generated transaction to modify the business data corresponding to the business request;
[0095] Step S106, when the business data is successfully modified, the comprehensive business data is modified according to the business database and / or the pending business data is rolled back.
[0096] It can be understood that the intra-domain module refers to the intranet of a unit or enterprise. The intra-domain module includes a transaction manager and at least one business database deployed in the intranet. 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 according to the generated transaction items.
[0097] In a possible implementation, the data processing system is used in digital financial scenarios such as electronic payment and e-commerce, and the business database can be used to store the account balance of each user, the transaction log of each account, etc. When an electronic payment request is generated, the transaction manager generates a transfer transaction, deducts the transaction amount from the payee's account balance, writes the transaction amount to the payee's account balance, and writes the transfer details to the transaction log data of the payee and the payee. When the data processing system is used to process commodity transaction business, the business database stores transaction data such as the merchant's commodity data, the merchant and buyer's account balance data, the buyer's purchase log data, the merchant's sales log data, etc. It can be understood that these data can be stored in different dedicated databases respectively. For example, the business database deployed in the domain module includes transaction data such as the commodity database, the transaction database, and the log database. When a commodity transaction request is generated, the transaction manager generates a commodity transaction transaction, and operates the commodity database, the transaction database, and the log database respectively according to the generated commodity transaction transaction, deducts the corresponding amount of commodity inventory from the commodity data stored in the commodity database, and at the same time operates the transaction database to deduct the corresponding commodity payment from the buyer's balance and writes the corresponding commodity payment into the merchant's account balance, and operates the log database to write the purchase details and the sale details into the log list corresponding to the buyer and the merchant in the log database, thereby completing a commodity transaction request.
[0098] The in-domain modules and out-domain modules are isolated by firewalls. Based on this, the security of the core services and business databases deployed in the in-domain modules can be guaranteed, and the data stored in the business database can be prevented from being illegally tampered with, thereby ensuring the security of the business data.
[0099] The out-of-domain module includes at least one out-of-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 final consistency. For example, when the data processing system is used in digital financial scenarios such as electronic payment, the first dynamic cache component and the business database both cache the balance of each user, or when the data processing system is used for commodity transactions, the first dynamic cache component and the business database both store the merchant's commodity inventory and merchant balance and 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 distributed cache data.
[0100] The second dynamic cache component is used to cache pending business data related to the business request. The pending business data refers to temporary data generated in response to the business request and rolled back after the business request is processed. For example, when the business request is an account entry request, the second dynamic cache component caches the account entry amount as pending business data. When the account entry request is completed, the transaction manager operates the business database based on the account entry request, writes the account entry amount to the corresponding user balance, and then rolls back the second dynamic cache component to deduct the corresponding account entry amount from the pending business data. Alternatively, when the data processing system is applied to commodity transactions, the second dynamic cache component caches the commodity inventory to be deducted, the merchant to be accounted, and the buyer to be deducted. Specifically, the second dynamic cache component can also 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 distributed cache data.
[0101] The first service component is used to query and / or modify the first dynamic cache component and / or the second dynamic cache component in response to the business request. Specifically, for example, if the business request is an account entry request, the first service component modifies the second dynamic cache component in response to the account entry request and writes the account entry amount into the second dynamic cache component as the amount to be entered. In this way, the front-end interface can return the user balance after the account entry request is completed to the client based on the user balance cached in the first dynamic cache component and the amount to be entered cached in the second dynamic cache component. So far, all steps before returning the response information to the client are completed in the out-of-domain module without having to access the in-domain module through the firewall, thereby effectively improving the response speed of the system.
[0102] The message component is used for asynchronous communication between the first service component and the second service component. The message component can be an asynchronous message queue. The first service component writes the business request into the asynchronous message queue as a message producer, and the second service component obtains the business request from the asynchronous message queue as a message consumer. The first service component first writes the business request into the message component, and the message component then asynchronously sends the business request to the second service component. The asynchronous message component can perform certain flow limiting according to the pre-configured flow limiting strategy, so as to ensure that the number of business requests sent to the second service component per unit time does not exceed the set threshold. The asynchronous message queue can also add messages that are not sent in time to the queue, and send them when there is free capacity in the message queue. In this way, a large number of business requests in ultra-high concurrency scenarios can be peak-cut, avoiding the second service component from frequently calling the transaction manager to operate the business database in a short period of time, thereby avoiding the instantaneous high concurrency request volume from causing great pressure on the business database. Specifically, the message component can include 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 service request to the second service component, the second service component sends the service request to the transaction manager, so that the transaction manager generates a corresponding transaction according to the service request.
[0104] The transaction manager is deployed in the domain, and is used to generate corresponding transactions according to received business requests, and operate the business database according to 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 financial scenarios such as electronic payment, the business database is used to store payment data such as the account balance and transaction log 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 commodity inventory.
[0106] In step S101 of some embodiments, the data processing system provides at least one front-end interface, through which the client initiates a service request to the data processing system. After receiving the service request initiated by the client, the front-end interface forwards the service request to the corresponding out-of-domain server. Specifically, the out-of-domain module may include multiple out-of-domain servers, each of which is used to process different types of service requests. By diverting different types of service requests to different out-of-domain servers for processing, the task processing volume of a single out-of-domain server can be reduced, thereby improving the response speed of the out-of-domain server.
[0107] In step S102 of some embodiments, after the business request is forwarded to the out-of-domain server, the first service component deployed on the out-of-domain server is called. The first service component queries and / or modifies the first dynamic cache component and / or the second dynamic cache component in response to the business request. Specifically, for different business requests, the transactions required to be executed by the first dynamic cache component and the second dynamic cache component are different. For example, for query-type business requests, it is often not necessary to modify the business database, so 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 to-be-processed business data cached in the second dynamic cache component. For example, when the data processing system is applied to digital financial scenarios 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. When a balance query request is received, the corresponding user balance is queried from the first dynamic cache component and the corresponding pending transfer amount is queried from the second dynamic cache component. The actual balance of the user can be obtained by combining the two. It can be understood that for some business requests, the business database needs to be modified. At this time, the first dynamic cache component and / or the second dynamic cache component needs to be modified. For example, when an account entry request is received, the pending business data cached in the second dynamic cache component can be modified, and the account entry amount can be written into the second dynamic cache component as the user's pending account entry 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. The user's actual balance can be determined based on the two. Therefore, the user's actual balance after completing all transfer requests can be returned to the client based on the user balance cached in the first dynamic cache component and the pending transfer amount cached in the second dynamic cache component. Based on this, the present application deploys the first dynamic cache component and the second dynamic cache component in the out-of-domain module, and deploys the first service component in the out-of-domain server to query and / or modify the first dynamic cache component and / or the second dynamic cache component. When the out-of-domain server receives a business request, it can determine the business data in the state of completing the business request by querying and / or modifying the first dynamic cache component and / or the second dynamic cache component, and return response information to the client. Based on this, the entire process from receiving the business request to returning the response to the client is completed in the out-of-domain module. There is no need to cross the firewall to access the in-domain module, and there is no need to operate the business database. This effectively reduces the pressure on the business database caused by ultra-high concurrency scenarios, while taking into account the response speed of the system. It also does not require a large amount of hardware support to avoid resource redundancy.
[0109] In step S104 of some embodiments, asynchronous communication is performed between the first service component and the second service component through the message component. Specifically, after the first service component responds to the business request query and / or modifies the first dynamic cache component and / or the second dynamic cache component, it will write the business request into the message component, and the message component will asynchronously send the business request to the second service component. After receiving the business request, the second service component will access the module in the domain through the firewall and call the transaction manager. It can be understood that the message component will limit the number of business requests sent to the second service component per unit time according to the preset current limiting strategy. In this way, when an ultra-high concurrency scenario occurs, excessive business requests will be temporarily stored in the message queue and sent to the second service component when the capacity is free, thereby avoiding the second service component from frequently calling the transaction manager to operate the business database in the ultra-high concurrency scenario, thereby reducing the pressure on the business database caused by the ultra-high concurrency scenario and improving the availability and stability of the system in the ultra-high concurrency scenario.
[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 group of database operations. The transaction manager generates corresponding transactions based on the business requests and uses them to operate the business database. The data stored in the business database can be modified 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 ultimate consistency of the comprehensive business data cached in the first dynamic cache component and the business data stored in the business database.
[0112] In an embodiment of the present application, a distributed cache and an out-of-domain server are deployed outside the domain, and a first service component and a second service component are deployed in the out-of-domain server. The first service component and the second service component communicate asynchronously through a message component. The distributed cache includes a first dynamic cache component for caching comprehensive business data that is ultimately consistent with a business database and a second dynamic cache component for caching pending business data generated by a business request. Thus, after receiving a business request, the business request is directly forwarded to the out-of-domain server. The out-of-domain server calls the first service component to query and / or modify the first dynamic cache component and / or the second dynamic cache component, and returns response information to the client according to the first dynamic cache component and the second dynamic cache component. At the same time, the first service component writes the business request into the message component, and the message component asynchronously sends the business request to the second service component. The second service component then accesses the in-domain module across the firewall, and calls the transaction manager based on the business request to operate 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 dynamic cache component and the second dynamic cache component deployed outside the domain, so as to quickly determine the response data. In this way, the process of returning the response to the client and the process of modifying the business database are decoupled. The system can directly return the response data to the client based on the comprehensive business data cached in the first dynamic cache component and the pending business data cached in the second dynamic cache component without waiting for the business database to be modified. On this basis, the first service component and the second service component communicate asynchronously through the message component. At this time, when the message component receives the business request, it will detect the current message. The message component checks whether the number of messages has reached the flow limiting threshold. If not, the business request is immediately sent to the second service component. If it has reached the limit, the message component queues the newly received business requests and sends these business requests asynchronously to the second service component when the message component has free capacity. Based on this, the number of business requests sent to the second service component per unit time is controlled through asynchronous sending of the message component. In the event of an ultra-high concurrency scenario, the ultra-high concurrency traffic that occurs in a short period of time can be peak-cut to avoid excessive business requests in a short period of time from reducing the pressure on the business database of the system and improving the stability and availability of the system in ultra-high concurrency scenarios.
[0113] In some embodiments, in the case of a failure to modify the business data, the second dynamic cache component is rolled back and a second response message is returned to the client based on the comprehensive business data and the to-be-processed business data after the rollback, and the second response message includes the business data in the state of the uncompleted business request. It can be understood that the failure to modify the business data means that the business request has not been successfully processed. At this time, the business database has not been actually modified. Based on this, the data in the first dynamic cache component does not need to be modified, and only the to-be-processed data generated by the business request in the second dynamic cache component needs to be rolled back.
[0114] In some embodiments, reference Figure 3 The business request is an account entry request, the account entry request at least includes a user identity identifier and an account entry amount, the first dynamic cache component includes a user balance column for caching the account balance of each user as comprehensive business data, the second dynamic cache component includes a user pending transfer column for caching the account entry amount as pending business data, and step S102 includes but is not limited to the following steps S301 to S302:
[0115] Step S301, searching the corresponding user pending transfer column according to the user identity identifier;
[0116] It can be understood that 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 deposit amount generated by the business request. Based on the user identity identifier, the user pending transfer column corresponding to the user identity identifier can be found from the second dynamic cache component;
[0117] Step S302, writing the deposit amount into the user pending transfer column corresponding to the user identity identifier;
[0118] It is understandable that after receiving the account entry request, the business database is not actually called to modify the actual balance of the user, that is, the account entry request is not actually completed. At this time, the account entry amount is first written into the user pending transfer column corresponding to the user identity identifier. Based on this, the actual balance of the user after the account entry is completed can be returned to the client in step S103 according to the user balance cached in the first dynamic cache component and the account entry amount cached in the second dynamic cache component. In this way, the process of modifying the business database and the process of returning the response to the client are decoupled, and there is no need to wait for the business database to be modified before returning the response data to the client. At the same time, since the process is completed in the out-of-domain module, there is no need to cross the firewall to access the in-domain module, which effectively improves the response speed of the system.
[0119] Step S106 includes but is not limited to the following steps S303 to S304:
[0120] Step S303, updating the user balance column corresponding to the user identity identifier according to the business database;
[0121] Step S304, rolling back the user pending transfer column corresponding to the user identity identifier to the state before writing the deposited amount.
[0122] It can be understood that after calling the transaction manager to operate the business database and successfully modifying the business data, the account entry request has been actually completed. At this time, the user's account balance cached in the first dynamic cache component should be synchronously updated to the state after the account entry, that is, the account entry amount should be written to the user balance column, and at the same time, the pending business data cached in the second dynamic cache component should be rolled back, and the corresponding account entry amount should be cleared from the pending transfer column.
[0123] In some embodiments, reference Figure 4 The business request is a payment request, the payment request at least includes a user identity identifier and a payment amount, the first dynamic cache component includes a user balance column for caching the account balance of each user as comprehensive business data, the second dynamic cache component includes a user pending transfer column for caching the account amount as pending business data, step S102 includes but is not limited to the following step S401:
[0124] Step S401, searching the corresponding user balance column and the corresponding user pending transfer column according to the user identity identifier, and reading the comprehensive business data and pending business data from the user balance column and the user pending transfer column;
[0125] It can be understood that the data processing system is applied to 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 to-be-credited amount generated by the business request. The user balance column corresponding to the user identity identifier can be found from the first dynamic cache component based on the user identity identifier, and the user to-be-credited transfer column corresponding to the user identity identifier can be found from the second dynamic cache component; based on the user balance column and the user to-be-credited transfer column, the actual balance of the user after all crediting requests are completed can be determined, so as to judge whether the actual balance of the user is sufficient for payment. If so, the payment request is directly written to the second service component to call the transaction manager to operate the business database. In this way, the judgment of whether there is sufficient balance for payment can be completed outside the domain, and the process of querying the balance and judging whether the balance is sufficient for payment can be completed outside the domain without crossing the firewall to access the module within the domain, which effectively improves the response speed of the system, while reducing the query to the business database and reducing the pressure on the business database.
[0126] Step S106 includes but is not limited to the following step S402:
[0127] Step S402: updating the user balance column and the user pending transfer column corresponding to the user identity identifier according to the business database.
[0128] It is understandable that after calling the transaction manager to operate the business database and successfully modifying the business data, the payment request has been actually completed. At this time, the corresponding payment amount can be deducted from the user balance cached in the user balance column and the amount to be transferred cached in the user's pending transfer column.
[0129] In some embodiments, reference Figure 5 The business request is a query request, the query request includes an identity identifier, the first dynamic cache component includes a user balance column for storing comprehensive business data, the second dynamic cache component includes a user pending transfer column for caching pending business data, and step S102 includes but is not limited to steps S501 to S504.
[0130] Step S501, determining the user balance according to the user balance column corresponding to the user identity identifier;
[0131] Step S502, determining the amount to be deposited into the user's account according to the user's pending transfer column corresponding to the user's identity identifier;
[0132] Step S503, determining the actual balance of the user according to the user balance and the amount to be deposited by the user;
[0133] Step S504: Return the actual balance to the client.
[0134] It is understandable that the corresponding user balance and the amount of money to be credited to the user can be found from the first dynamic cache component and the second dynamic cache component respectively based on the user identity identifier. Based on the user balance and the amount of money to be credited to the user, the corresponding actual balance of the user can be determined, and the corresponding actual balance can be returned to the client. In this embodiment, since the entire query process is completed in the out-of-domain module, there is no need to cross the firewall to access the in-domain module, which effectively improves the response speed of the system. At the same time, since there is no need to access the business database when processing the query request, the pressure on the business database is effectively reduced, and the stability and availability of the system are improved.
[0135] In some embodiments, reference Figure 6 The data processing method also includes but is not limited to the following steps S601 to S602.
[0136] Step S601, determining at least one first service component corresponding to the service type according to the service type of the service request;
[0137] Step S602: deploy all first service components corresponding to the business type on the same out-of-domain server, and bind the out-of-domain server and the business type.
[0138] In this embodiment, the first service components required to complete the request of the business type are sorted out according to the business type of the business request, and all the first service components corresponding to the business type are deployed on the same out-of-domain server, and the out-of-domain server is bound to the corresponding business type. In this way, by sorting out the types of first service components required to complete the same type of business, and deploying all the first service components required to complete the business request of the same business type on the same out-of-domain server, the delay caused by mutual calls between the first service components can be reduced. At the same time, the out-of-domain server is bound to the business type, so that when business requests of different business types are received, they can be forwarded to the corresponding out-of-domain server. In this way, different types of business requests can be diverted, the processing pressure of a single out-of-domain server is reduced, and the stability of the out-of-domain server is improved.
[0139] In some embodiments, reference 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 service request, generating a service request item 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 in the out-of-domain server. It can be understood that a historical business request refers to a business request that has 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, persistently storing the business request item as a historical business request;
[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 in the third dynamic cache component as a historical business request.
[0144] Step S703: In response to each preset period, the third service component verifies the accuracy of the integrated service data according to historical service requests.
[0145] The third service component can be a log reconciliation component. The third dynamic cache component caches historical business requests, which is equivalent to caching the processing log of the out-of-domain server. The third service component can verify the accuracy of the comprehensive business data cached in the first dynamic cache component based on the historical business requests. For example, the data processing system is applied to digital financial scenarios such as electronic payment, and the first dynamic cache component caches the account balance of each user, and the historical business request is the transaction log of each user. At this time, the third service component is equivalent to the log reconciliation component, and verifies whether the account balance of each user is accurate based on the transaction log cached in the third dynamic cache component. Alternatively, the data processing system is applied to an e-commerce scenario, and the first dynamic cache component caches the merchant's account balance, commodity inventory, and buyer's account balance. The historical business request is the commodity transaction log. The third service component verifies whether the merchant's account balance and commodity inventory, as well as the buyer's account balance, etc. are accurate based on the commodity transaction log cached in the third dynamic cache component.
[0146] In this embodiment, a third dynamic cache component is set outside the domain to cache historical business requests, and a third service component is set in the outside domain server. The third service component verifies whether the comprehensive business data cached in the first dynamic cache 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 cache component and maintain the final consistency of the comprehensive business data with the business data stored in the business database.
[0147] The present application embodiment also provides a data processing system 800, such as Figure 8 As shown, the above data processing method can be implemented, and the data processing system includes:
[0148] The request forwarding module 801 is used to receive the service request sent by the client through the front-end interface and forward the service request to the out-of-domain server;
[0149] The cache processing module 802 queries and / or modifies the first dynamic cache component and / or the second dynamic cache component according to the service request;
[0150] The response module 803 returns a first response message to the client according to the first dynamic cache component and the second dynamic cache component so that the client can determine the service data in the service request state completed, and the first response message includes the comprehensive service data cached in the first dynamic cache component and the to-be-processed service data cached in the second dynamic cache component;
[0151] The transaction calling module 804 sends the service request to the second service component so that the second service component calls the transaction manager;
[0152] The transaction processing module 805 generates a transaction through a transaction manager and operates a business database according to the generated transaction to modify business data corresponding to the business request;
[0153] The cache update module 806 modifies the comprehensive business data and / or rolls back the pending business data according to the business database when the business data is successfully modified.
[0154] The data processing device of the embodiment of the present application is used to execute the data processing method in the above embodiment. Its specific processing process is the same as the data processing method in the above embodiment, and will not be described in detail here.
[0155] The embodiment of the present application further provides an electronic device 900, including:
[0156] at least one processor, and
[0157] a memory communicatively connected to at least one processor; wherein,
[0158] The memory stores instructions, and the instructions are executed by at least one processor so that when the at least one processor executes the instructions, a method as described in any one of the embodiments of the first aspect of the present application is implemented.
[0159] Combine the following Fig. 9 The hardware structure of the electronic device 900 is described in detail. The computer device includes: a processor 910 , a memory 920 , an input / output interface 930 , a communication interface 940 and a bus 950 .
[0160] The processor 910 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0161] The memory 920 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 920 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 920, and the processor 910 calls and executes the data processing method of the embodiments of this application;
[0162] Input / output interface 930, used to implement information input and output;
[0163] Communication interface 940, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.); and
[0164] bus 950 , which transmits information between the various components of the device (e.g., processor 910 , memory 920 , input / output interface 930 , and communication interface 940 );
[0165] The processor 910 , the memory 920 , the input / output interface 930 , and the communication interface 940 are connected to each other in communication within the device via a bus 950 .
[0166] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the data processing method of the embodiment of the present application.
[0167] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0168] Those skilled in the art will appreciate that the technical solutions shown in the accompanying drawings do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the drawings, or a combination of certain steps, or different steps.
[0169] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0171] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0172] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0173] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not run. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0174] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0175] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0176] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a computer-readable storage medium, including multiple instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to run all or part of the steps of the method described in each embodiment of the present application. The aforementioned computer-readable storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0177] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
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 a service request sent by a client, the intra-domain module comprising a transaction manager and a service 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 service request, the first service component communicating asynchronously with the second service component via the message component, the intra-domain module and the extra-domain module being isolated via a firewall, the extra-domain module calling the transaction manager via the second service component, characterized in that The method comprises: Receiving the service request sent by the client through the front-end interface, and forwarding the service request to the out-of-domain server; querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request; Returning first response information to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the service data in the service request state is completed, the first response information including the comprehensive service data cached in the first dynamic cache component and the to-be-processed service data cached in the second dynamic cache component; sending the business request to the second service component so that the second service component calls the transaction manager; 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; In the case where the business data is successfully modified, the comprehensive business data is modified according to the business database and / or the to-be-processed business data is rolled back.
2. The data processing method according to claim 1, wherein the business request is an account entry request, the account entry request includes a user identity identifier and an account entry amount, the first dynamic cache component includes a user balance column for caching the comprehensive business data, and the second dynamic cache component includes a user pending transfer column for caching the business data to be processed, characterized in that: The querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the service request includes: Searching the corresponding user pending transfer column according to the user identity identifier; Writing the deposited amount into the user pending transfer column corresponding to the user identity identifier; The modifying the comprehensive business data and / or rolling back the to-be-processed business data according to the business database includes: updating the user balance column corresponding to the user identification identifier according to the business database; The user pending transfer column corresponding to the user identity identifier is rolled back to a state before the input amount is written.
3. The data processing method according to claim 1, wherein the business request is a payment request, the payment request includes a payment amount and a user identity identifier, the first dynamic cache component includes a user balance column for caching the comprehensive business data, and the second dynamic cache component includes a user pending transfer column for caching the business data to be processed, characterized in that: The querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the service request includes: Searching the corresponding user balance column and the corresponding user pending transfer column according to the user identity identifier, and reading the comprehensive business data and the pending business data from the user balance column and the user pending transfer column; The modifying the comprehensive business data and / or rolling back the to-be-processed business data according to the business database includes: The user balance column and the user pending transfer column corresponding to the user identification identifier are updated according to the business database.
4. The data processing method according to claim 1, wherein the service request is a query request, the query request includes a user identity identifier, the first dynamic cache component includes a user balance column for storing the comprehensive service data, and the second dynamic cache component includes a user pending transfer column for caching the service data to be processed, characterized in that: The returning first response information to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the service data in the service request state is completed, includes: determining a user balance according to the user balance column corresponding to the user identification identifier; Determine the user's pending deposit amount according to the user pending transfer column corresponding to the user identity identifier; Determine the actual balance of the user according to the user balance and the amount to be deposited by the user; The actual balance is returned to the client.
5. The data processing method according to claim 1, characterized in that: The method further comprises: In the event of failure to modify the business data, the second dynamic cache component is rolled back and a second response message is returned to the client based on the comprehensive business data and the rolled-back pending business data, wherein the second response message includes the business data in a state where the business request is not completed.
6. The data processing method according to claim 1, characterized in that: Before receiving a service request through the public gateway interface, it also includes: Determine, according to the service type of the service request, at least one first service component corresponding to the service type; All the first service components corresponding to the business type are deployed on the same out-of-domain server, and the out-of-domain server is bound to the business type.
7. The data processing method according to claim 1, wherein the distributed cache further comprises a third dynamic cache component, and the out-of-domain server further comprises a third service component, and the third dynamic cache component is used to cache historical service requests, characterized in that: The method further comprises: In response to the front-end interface receiving the service request, generating a service request item in the third dynamic cache component; In response to the transaction manager modifying the business database, persistently storing the business request item as the historical business request; In response to each preset period, the third service component verifies the accuracy of the integrated service data according to the historical service request.
8. A data processing system, characterized in that: The system comprises: A request forwarding module, used to receive a service request sent by a client through a front-end interface, and forward the service request to an out-of-domain server; A cache processing module, querying and / or modifying the first dynamic cache component and / or the second dynamic cache component according to the business request; A response module, which returns a first response message to the client according to the first dynamic cache component and the second dynamic cache component so that the client determines that the service data in the service request state is completed, wherein the first response message includes the comprehensive service data cached in the first dynamic cache component and the to-be-processed service data cached in the second dynamic cache component; A transaction calling module, sending the business request to the second service component so that the second service component calls the transaction manager; A transaction processing module, generating a transaction through the transaction manager and operating a business database according to the generated transaction to modify business data corresponding to the business request; The cache update module modifies the comprehensive business data and / or rolls back the pending business data according to the business database when the business data is successfully modified.
9. 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 realizing connection and communication between the processor and the memory. When the program is executed by the processor, the data processing method according to any one of claims 1 to 7 is realized.
10. A computer-readable storage medium for computer-readable storage, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data processing method according to any one of claims 1 to 7.
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
