Search

CN-121984936-A - Data processing request recovery method, device, equipment and medium

CN121984936ACN 121984936 ACN121984936 ACN 121984936ACN-121984936-A

Abstract

The invention relates to the technical field of distributed computing and data processing, and discloses a data processing request recovery method, a device, equipment and a medium, wherein the method comprises the following steps: establishing communication connection between a client and a computing node, generating connection identification information, writing corresponding data processing request content information and execution state into a shared memory, establishing new communication connection when connection is interrupted, analyzing target connection identification information from the new connection, positioning a target storage area in the shared memory, marking the target storage area as a reconnection state, receiving a data processing request retransmitted by the client, reading the request content information in the target storage area, comparing the request content information with the execution state, executing the retransmission request when the comparison is consistent and the execution state is incomplete, and returning a processing result. The invention keeps the transaction information through the shared memory and checks and replays after reconnection, realizes uninterrupted recovery execution, avoids repeated processing and ensures service continuity.

Inventors

  • TENG HAO
  • FAN CHUANCHAO
  • YIN TAO
  • WANG YIBO
  • MU XIN

Assignees

  • 金篆信科有限责任公司

Dates

Publication Date
20260505
Application Date
20260123

Claims (10)

  1. 1. A data processing request recovery method, comprising the steps of: Responding to a connection request sent by a client to a computing node, establishing communication connection between the client and the computing node, and acquiring connection identification information for identifying the communication connection; storing request content information and request execution state of a raw data processing request corresponding to the connection identification information in a shared memory associated with the computing node; After the communication connection is interrupted, a new communication connection between the client and the computing node is established in response to a reconnection request initiated by the client; Analyzing target connection identification information carried in the new communication connection, searching and positioning a target storage area in the shared memory according to the target connection identification information, and marking the target storage area as a reconnection state; Responding to the target storage area marked as a reconnection state, receiving a retransmission data processing request sent by the client, reading request content information and a request execution state of a raw data processing request stored in the target storage area, and comparing the read request content information with request content information in the retransmission data processing request; and when the comparison results are consistent and the read request execution state is incomplete, executing the retransmission data processing request and returning the processing result to the client.
  2. 2. The data processing request recovery method according to claim 1, wherein establishing a communication connection between a client and a computing node in response to a connection request from the client to the computing node, and acquiring connection identification information for identifying the communication connection, comprises: Monitoring a network service port through a computing node to receive a connection request sent to the computing node by a client; in response to receiving the connection request, performing a handshake interaction of a network transport protocol with the client to establish a communication connection between the client and the computing node; After the communication connection is established, initializing a session context corresponding to the communication connection in the computing node, and generating a unique session serial number; And determining the session serial number as connection identification information for identifying the communication connection.
  3. 3. The data processing request recovery method according to claim 1, wherein storing, in a shared memory associated with the computing node, request content information and a request execution state of an original data processing request corresponding to the connection identification information, comprises: receiving an original data processing request submitted by the client through the communication connection, and analyzing the original data processing request to acquire request content information corresponding to the connection identification information; Positioning a storage space with a mapping relation with the connection identification information in a shared memory associated with the computing node by using the connection identification information as an index key; Writing the request content information into the storage space in the shared memory; And determining an initial request execution state according to the execution condition of the original data processing request in the computing node, and storing the initial request execution state into the storage space.
  4. 4. The data processing request recovery method of claim 1, wherein establishing a new communication connection between the client and the computing node in response to the client initiated reconnection request after the communication connection is broken, comprises: monitoring the network link state of the communication connection in real time, and confirming that the communication connection is interrupted when the heartbeat loss or the transmission timeout is detected; receiving a reconnection request sent to the computing node by the client after confirming the communication connection interruption; Responding to the reconnection request, executing handshake interaction of a network transmission protocol with the client, and distributing new network socket resources corresponding to the handshake interaction in the computing node; And constructing a data transmission channel based on the new network socket resource, taking the data transmission channel as a new communication connection, and setting the new communication connection into an active state.
  5. 5. The method of claim 1, wherein analyzing the target connection identifier information carried in the new communication connection, searching and locating a target storage area in the shared memory according to the target connection identifier information, and marking the target storage area as a reconnection state, comprises: Receiving a connection recovery message sent by the client through the new communication connection, and analyzing target connection identification information requested to be recovered by the client from the connection recovery message; taking the target connection identification information as a search key word, and executing matching inquiry in a session index table maintained by the shared memory; positioning and locking a memory block corresponding to the target connection identification information in the shared memory based on a memory address offset returned by the matching query, and determining the memory block as a target storage area; Accessing a session state field in the target storage area, and updating the value of the session state field to be a reconnection state representing a recovery process.
  6. 6. The data processing request recovery method according to claim 1, wherein receiving the retransmission data processing request transmitted by the client in response to the target storage area being marked as a reconnection state, and reading the request content information and the request execution state of the original data processing request stored in the target storage area, comparing the read request content information with the request content information in the retransmission data processing request, comprises: monitoring the marking state of the target storage area, and receiving a retransmission data processing request sent by the client through the new communication connection when the marking state is detected to be changed into a reconnection state; analyzing the retransmission data processing request, and extracting content information of the request to be compared contained in the retransmission data processing request; accessing the target storage area in the shared memory, and reading request content information and request execution state of a raw data processing request stored in the target storage area; and carrying out consistency comparison on the read request content information and the extracted request content information to be compared to obtain a comparison result.
  7. 7. The data processing request recovery method according to claim 1, wherein when the comparison result is consistent and the read request execution state is incomplete, executing the retransmission data processing request and returning the processing result to the client, comprising: judging whether the comparison result is consistent or not, and judging whether the read request execution state is incomplete or not; if the comparison result is consistent and the request execution state is incomplete, loading the retransmission data processing request to a service execution engine of the computing node to trigger execution operation; Monitoring the progress of the execution operation, and updating the request execution state in the target storage area in the shared memory to a completed state after the operation is completed; And obtaining a processing result generated by the service execution engine after the execution operation is finished, and sending the processing result to the client through the new communication connection.
  8. 8. A data processing request recovery apparatus, characterized in that the data processing request recovery apparatus comprises: The communication connection management module is used for responding to a connection request sent by a client to a computing node, establishing communication connection between the client and the computing node and acquiring connection identification information for identifying the communication connection; The request state recording module is used for storing request content information and request execution state of the original data processing request corresponding to the connection identification information in a shared memory associated with the computing node; the connection recovery processing module is used for responding to a reconnection request initiated by the client after the communication connection is interrupted, and establishing a new communication connection between the client and the computing node; The session positioning module is used for analyzing the target connection identification information carried in the new communication connection, searching and positioning a target storage area in the shared memory according to the target connection identification information, and marking the target storage area as a reconnection state; the request consistency verification module is used for responding to the condition that the target storage area is marked as reconnection, receiving a retransmission data processing request sent by the client, reading request content information and request execution state of an original data processing request stored in the target storage area, and comparing the read request content information with request content information in the retransmission data processing request; And the recovery execution module is used for executing the retransmission data processing request and returning the processing result to the client when the comparison result is consistent and the read request execution state is incomplete.
  9. 9. A computer device comprising a memory, a processor and a data processing request retrieval program stored on the memory and executable on the processor, the data processing request retrieval program when executed by the processor implementing the steps of the data processing request retrieval method according to any of claims 1 to 7.
  10. 10. A computer readable storage medium, characterized in that the storage medium has stored thereon a data processing request retrieval program, which when executed by a processor, implements the steps of the data processing request retrieval method according to any of claims 1-7.

Description

Data processing request recovery method, device, equipment and medium Technical Field The present invention relates to the field of distributed computing and data processing technologies, and in particular, to a method, an apparatus, a device, and a medium for recovering a data processing request. Background In the operating environment of a distributed database, the system is commonly tasked with multiple computing nodes for supporting high concurrent access and long-running online transactions. However, in the actual deployment process, the computing node may have communication interruption due to hardware failure, network jitter, system downtime, abnormal exit of threads, or switching between component updates. For the above-described interrupt event, current distributed database architectures generally rely on a retry mechanism at the client side to resume service requests, i.e., to reinitiate transactions by the client and to wait for the system to reprocess. In the prior art, once a computing node fails, data processing requests that have been submitted and are being executed by clients cannot be completed correctly. Because of the lack of a mechanism for maintaining session state, the computing node side generally cannot identify the execution progress of the task before interruption, and cannot distinguish whether or not the transaction already submitted has been executed or to which step, so that the client can only re-submit the request by means of error reporting. For users, this approach may cause interruption of the business process, and even require manual intervention to determine whether re-execution is required, which easily causes problems such as repeated execution of transactions, logic abnormality or inconsistent resources. Particularly, in business scenarios with high real-time performance and high reliability, such as financial clearing, real-time charging, online transaction processing and other systems, the short-time unavailability caused by interruption still causes the decrease of business continuity. Because the un-executed transaction cannot be automatically identified and continued after the fault occurs, the existing distributed computing nodes also lack the capability of quickly recovering the session context of the client, and further cannot realize transparent recovery without interrupting the service. Disclosure of Invention The invention mainly aims to provide a data processing request recovery method, a device, equipment and a storage medium, and aims to solve the technical problem that the prior art cannot automatically identify and recover incomplete data processing requests when the communication connection is interrupted, so that service interruption or repeated execution is caused. In order to achieve the above object, the present invention provides a data processing request recovery method, including: Responding to a connection request sent by a client to a computing node, establishing communication connection between the client and the computing node, and acquiring connection identification information for identifying the communication connection; storing request content information and request execution state of a raw data processing request corresponding to the connection identification information in a shared memory associated with the computing node; After the communication connection is interrupted, a new communication connection between the client and the computing node is established in response to a reconnection request initiated by the client; Analyzing target connection identification information carried in the new communication connection, searching and positioning a target storage area in the shared memory according to the target connection identification information, and marking the target storage area as a reconnection state; Responding to the target storage area marked as a reconnection state, receiving a retransmission data processing request sent by the client, reading request content information and a request execution state of a raw data processing request stored in the target storage area, and comparing the read request content information with request content information in the retransmission data processing request; and when the comparison results are consistent and the read request execution state is incomplete, executing the retransmission data processing request and returning the processing result to the client. Further, to achieve the above object, the present invention provides a data processing request recovery apparatus, including: The communication connection management module is used for responding to a connection request sent by a client to a computing node, establishing communication connection between the client and the computing node and acquiring connection identification information for identifying the communication connection; The request state recording module is used for storing request content information and request execu