Resource transfer consistency processing method and device, computer equipment and storage medium
By generating and asynchronously sending resource status messages from the first server to the second server, the problem of inconsistent payment status in online payment services is solved, achieving efficient and stable resource transfer processes and consistency of status between devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-03
AI Technical Summary
In online payment transactions, inconsistent payment statuses lead to inconsistencies in resource transfer processing methods.
By receiving a resource service request on the first server, performing a resource transfer operation, generating a first resource status message, and writing it into a high-priority first message queue, the message is sent asynchronously to the second server in sequence, ensuring the synchronization and consistency of the status messages.
This ensures the efficiency and stability of the resource transfer transaction process, avoids data inconsistency issues, reduces the impact of network latency, and ensures the synchronization and consistency of the status between devices.
Smart Images

Figure CN121788134A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and in particular to a method, apparatus, computer equipment, and storage medium for processing resource transfer consistency. Background Technology
[0002] As online transaction scenarios continue to expand and the market size continues to grow, online payment volume is growing rapidly. Inconsistencies in payment status between payment services and accounting services due to request timeouts and transaction blockages occur frequently.
[0003] Therefore, traditional resource transfer processing methods suffer from inconsistent payment status. Summary of the Invention
[0004] Therefore, it is necessary to provide a processing method, apparatus, computer equipment, and storage medium that can improve the consistency of resource transfer and payment status in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for processing resource transfer consistency, the method being applied to a first server, the method comprising:
[0006] Receive a resource service request sent by a second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction initiated by the target user on the user terminal;
[0007] Execute the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0008] Write the first resource status message into the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0009] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server.
[0010] In one embodiment, performing the resource transfer operation and obtaining a first resource status message after the resource transfer operation includes:
[0011] Execute the resource transfer operation and obtain the resource status information after the resource transfer operation;
[0012] A unique identifier for generating the resource status information is generated based on the resource service request;
[0013] The unique identifier and the resource status information after the resource transfer operation are encapsulated to obtain the first resource status message.
[0014] In one embodiment, the first message queue has a higher priority than the second message queue;
[0015] The second message queue is used to store messages not generated by the resource transfer operation.
[0016] In one embodiment, the resource service request includes at least one of: resource service type, resource transfer quantity, and user level; writing the first resource status message into the first message queue includes:
[0017] The target message priority of the first resource status message is determined based on at least one of the resource service type, the number of resource transfers, and the user level.
[0018] Based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0019] In one embodiment, the resource service request further includes: a timeout waiting duration; a target message priority based on the first resource status message and the message priority of existing messages in the first message queue; and writing the first resource status message into the target position in the first message queue corresponding to the target message priority, including:
[0020] The timeout period of the resource service request is determined based on the timeout waiting duration and the time of receiving the resource service request.
[0021] Based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0022] In one embodiment, performing the resource transfer operation includes:
[0023] The resource service request is security verified based on the parameter information in the resource service request.
[0024] If the security check passes, the resource transfer operation is performed.
[0025] Secondly, this application also provides a method for handling resource transfer consistency, the method being applied to a second server, the method comprising:
[0026] Send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0027] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message; the first resource status message is obtained after performing a resource transfer operation based on the resource service request, and the first message queue is used to store the resource status message after the resource transfer operation;
[0028] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0029] Thirdly, this application also provides a resource transfer consistency processing apparatus, comprising:
[0030] The first receiving module is used to receive a resource service request sent by the second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction operation initiated by the target user on the user terminal;
[0031] An execution module is used to execute the resource transfer operation and obtain a first resource status message after the resource transfer operation;
[0032] The writing module is used to write the first resource status message into a first message queue, and the first message queue is used to store the resource status message after the resource transfer operation.
[0033] The first sending module is used to asynchronously send each of the resource status messages to the second server in the order of the resource status messages in the first message queue.
[0034] Fourthly, this application also provides a processing apparatus for resource transfer consistency, comprising:
[0035] The second sending module is used to send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction operation initiated by the target user on the user terminal;
[0036] The second receiving module is used to receive resource status messages sent asynchronously by the first server in the order of each resource status message in the first message queue, so as to obtain the first resource status message. The first resource status message is obtained after performing a resource transfer operation based on the resource service request. The first message queue is used to store the resource status message after the resource transfer operation.
[0037] The update module is used to update the local resource status corresponding to the resource service request based on the first resource status message.
[0038] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0039] Receive a resource service request sent by a second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction initiated by the target user on the user terminal;
[0040] Execute the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0041] Write the first resource status message into the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0042] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server.
[0043] Sixthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0044] Send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0045] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message; the first resource status message is obtained after performing a resource transfer operation based on the resource service request, and the first message queue is used to store the resource status message after the resource transfer operation;
[0046] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0047] Seventhly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0048] Receive a resource service request sent by a second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction initiated by the target user on the user terminal;
[0049] Execute the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0050] Write the first resource status message into the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0051] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server.
[0052] Eighthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0053] Send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0054] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message; the first resource status message is obtained after performing a resource transfer operation based on the resource service request, and the first message queue is used to store the resource status message after the resource transfer operation;
[0055] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0056] Ninthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0057] Receive a resource service request sent by a second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction initiated by the target user on the user terminal;
[0058] Execute the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0059] Write the first resource status message into the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0060] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server.
[0061] In a tenth aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0062] Send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0063] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message; the first resource status message is obtained after performing a resource transfer operation based on the resource service request, and the first message queue is used to store the resource status message after the resource transfer operation;
[0064] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0065] The aforementioned method, apparatus, computer equipment, and storage medium for handling resource transfer consistency involve a first server receiving a resource service request from a second server; executing a resource transfer operation and obtaining a first resource status message after the operation; writing the first resource status message into a first message queue; and asynchronously sending each resource status message to the second server in the order of its messages in the first message queue. The resource service request is used to request the execution of a corresponding resource transfer operation for a transaction initiated by a target user on a user terminal. The first message queue stores the resource status messages after the resource transfer operation. The first server only needs to write the first resource status message into its local first message queue, without waiting for a response from the second server or being constrained by its processing speed. This ensures the efficiency and stability of the core resource transfer transaction process. Simultaneously, sending messages to the second server in a sequential and asynchronous manner strictly guarantees the correct timing of resource status synchronization, avoiding data inconsistencies caused by out-of-order delivery. Furthermore, the asynchronous mechanism reduces the impact of network latency, ensuring consistency between devices throughout the entire resource transfer process. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is an application environment diagram of a resource transfer consistency processing method in one embodiment;
[0068] Figure 2 This is a flowchart illustrating a method for ensuring resource transfer consistency in one embodiment.
[0069] Figure 3 This is a flowchart illustrating a method for handling resource transfer consistency in another embodiment;
[0070] Figure 4 This is a flowchart illustrating a method for handling resource transfer consistency in another embodiment;
[0071] Figure 5 This is a flowchart illustrating a method for handling resource transfer consistency in another embodiment;
[0072] Figure 6 This is a flowchart illustrating a method for handling resource transfer consistency in another embodiment;
[0073] Figure 7 This is an asynchronous state transition diagram in one embodiment;
[0074] Figure 8 This is a flowchart illustrating a method for handling resource transfer consistency in another embodiment;
[0075] Figure 9 This is a structural block diagram of a resource transfer consistency processing device in one embodiment;
[0076] Figure 10 This is a structural block diagram of a resource transfer consistency processing apparatus in another embodiment;
[0077] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0078] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. It should be noted that existing industry solutions such as software, components, and models may be mentioned in the embodiments of this application. These should be considered exemplary and are intended only to illustrate the feasibility of implementing the technical solutions of this application, but do not imply that the applicant has already used or necessarily used such solutions.
[0079] The resource transfer consistency processing method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, the second server 104 communicates with both the user terminal 103 and the first server 102. The user initiates a transaction operation on the user terminal 103 and sends the corresponding transaction request to the second server 104. The second server 104 generates a resource service request based on the transaction request and sends it to the first server 102. The first server 102 performs a resource transfer operation based on the resource service request, obtains a first resource status message, and returns the resource status information to the second server 104. The user terminal 103 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Servers 102 and 104 can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide cloud computing services.
[0080] In one embodiment, such as Figure 2 As shown, a method for handling resource transfer consistency is provided, which is applied to... Figure 1 Taking the first server in the example, the explanation includes:
[0081] S201, Receive resource service request sent by the second server; the resource service request is used to request the execution of the corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal.
[0082] The resource service request may include information such as the target account information and the value of the resource to be transferred.
[0083] In this embodiment of the application, the user triggers a transaction operation on the user terminal, and the user terminal sends a transaction request to the second server based on the triggered transaction operation. The second server then sends a resource service request to the first server based on the transaction request.
[0084] Optionally, users can trigger a transaction by scanning a QR code, barcode, or other graphic code using their terminal; or, users can trigger a transaction by clicking on the interactive interface.
[0085] Optionally, the transaction request may include information such as the value of the resource to be transferred and the source of the resource. The source of the resource can be used to identify the financial institution where the resource is located; that is, the first server corresponding to the transaction request can be determined based on the resource to be transferred.
[0086] Furthermore, the second server generates a resource service request based on the transaction request, and sends the resource service request to the first server based on the transaction request.
[0087] S202, execute the resource transfer operation and obtain the first resource status message after the resource transfer operation.
[0088] The first resource status value can represent information such as whether the resource transfer was successful and the remaining resources in the target account.
[0089] In this embodiment of the application, the resource service request may include information such as target account information and resource value to be transferred. The first server can transfer the resource value to be transferred from the target account to the recipient according to the resource service request, and generate a first resource status message according to the resource transfer result.
[0090] Optionally, when the current resource value in the target account is less than the resource value to be transferred, the first resource status message is "resource transfer failed".
[0091] S203, write the first resource status message to the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0092] In this embodiment of the application, a first message queue is pre-configured in the first server for storing resource status messages after a resource transfer operation. After the resource transfer operation is performed, the resource status messages can be stored in the first message queue in the order of execution.
[0093] Optionally, the first message queue has a higher priority than the second message queue; the second message queue is used to store messages generated by non-resource transfer operations. In this embodiment, the first server includes a first message queue and a second message queue. The first server can respond to various business requests and store messages generated by resource transfer operations in the first message queue and messages generated by non-resource transfer operations in the second message queue.
[0094] S204. In accordance with the order of each resource status message in the first message queue, send each resource status message to the second server asynchronously in sequence.
[0095] In this embodiment of the application, when the first message queue is not empty, the first server retrieves the resource status message with the highest position from the head of the first message queue and sends the resource status message to the second server. Further, the step of retrieving the resource status message with the highest position from the head of the first message queue and sending the resource status message to the second server is continued.
[0096] For example, if the resource status information included in the first message queue includes message 1, message 2 and message 3 in sequence, then the order in which the first server sends the resource status messages is message 1, message 2 and message 3.
[0097] Optionally, the first server may receive feedback messages based on resource status messages returned by the second server.
[0098] In the above-described method for ensuring consistency during resource transfer, the first server receives a resource service request from the second server; executes a resource transfer operation and obtains a first resource status message after the operation; writes the first resource status message into a first message queue; and asynchronously sends each resource status message to the second server in the order of the messages in the first message queue. The resource service request is used to request the execution of the corresponding resource transfer operation for a transaction initiated by the target user on the user terminal. The first message queue is used to store the resource status messages after the transfer operation. The first server only needs to write the first resource status message into its local first message queue, without waiting for a response from the second server or being constrained by the processing speed of the second server. This ensures the efficiency and stability of the core resource transfer transaction process. Furthermore, by sending messages to the second server sequentially and asynchronously, the timing correctness of resource status synchronization is strictly guaranteed, avoiding data inconsistency issues that may result from out-of-order delivery. The asynchronous mechanism also reduces the impact of network latency, ensuring consistency between devices throughout the entire resource transfer process.
[0099] In one embodiment, one implementation of S202 above is provided, such as... Figure 3 As shown, the above-mentioned "performing a resource transfer operation and obtaining the first resource status message after the resource transfer operation" includes:
[0100] S301, execute the resource transfer operation and obtain the resource status information after the resource transfer operation.
[0101] Among them, the resource status information after the resource transfer operation can indicate whether the resource transfer was successful, the remaining resources in the target account, and other information.
[0102] In this embodiment of the application, the resource service request may include information such as target account information and resource value to be transferred. The first server can transfer the resource value to be transferred from the target account to the recipient according to the resource service request, and obtain the resource status information after the resource transfer operation based on the resource transfer result.
[0103] Optionally, when the current resource value in the target account is less than the resource value to be transferred, the resource status information after the resource transfer operation can be "resource transfer failed".
[0104] S302, a unique identifier for generating resource status information based on resource service requests.
[0105] In this embodiment, the first server generates a unique identifier for the resource status change triggered by the resource service request sent by the second server. For example, the first server can extract unique elements from the resource service request, such as the global serial number corresponding to the resource service request and the identifier of the target user. Further, the global serial number and the identifier of the target user can be combined to obtain a combined identifier, and this combined identifier can be processed using a preset algorithm to generate a unique identifier for the resource status information. The preset algorithm can be any algorithm capable of processing identifiers, such as a hash algorithm.
[0106] S303 encapsulates the unique identifier and resource status information after the resource transfer operation to obtain the first resource status message.
[0107] In this embodiment of the application, the unique identifier and the resource status information after the resource transfer operation are encapsulated to obtain a first resource status message, that is, the first resource status message includes the unique identifier and the resource status information after the resource transfer operation.
[0108] Optionally, the message structure of the first resource status message can be in JSON format to implement order verification and idempotency. The message structure can be as shown in Table 1:
[0109] Table 1
[0110]
[0111] The status change timestamp can be the time when the resource transfer operation is performed, avoiding the disorder caused by the clock deviation of multiple instances on the production side.
[0112] In the first server, a partitioned routing method is employed. Consistent hashing ensures that all messages with the same transaction number are sent to the same message queue partition, with each transaction number corresponding to a unique business primary key. Specifically, the hash value of the transaction number is first moduloed based on the number of partitions. Then, to distribute messages more evenly, a virtual node pool is constructed: each physical partition is mapped to 10 configurable virtual nodes. The ID of a virtual node is a combination of the physical partition ID and the node sequence number (e.g., partition 0 corresponds to virtual nodes 0-0, 0-1, and so on up to 0-9). Further, all virtual node IDs are hashed using MD5 and arranged in a ring structure from smallest to largest hash value. When a transaction number needs to be processed, its MD5 hash value is calculated first, the partition is mapped to the hash ring, and the hashed transaction number is located on a node on the ring, corresponding to the final target partition. By distributing the hash value of the transaction number to different virtual nodes and mapping it to different physical partitions, the transaction resource transfer operation can be distributed across 10 partitions. Each partition processes transaction resources sequentially and independently, avoiding any single partition becoming a performance bottleneck.
[0113] It's important to note that when expanding or shrinking partitions, new partitions are created by splitting hashes. Historical transactions with 100% single-route results remain unchanged, as the hash values still fall within the original partition's locking range, thus resolving the re-partitioning out-of-order issue. When redundancy is insufficient, new message topics are created by month and date sub-dimensions. New traffic enters the new message topic according to rules, while historical traffic remains in the original message topic, completely isolating historical and new traffic and preventing access to historical partition ranges from the outset. This ensures message consistency and ordering on the message server where the message queue resides.
[0114] Optionally, the message receiver can verify the validity of the status flow to further ensure message consistency.
[0115] In the above application embodiments, the unique identifier and the resource status information after the resource transfer operation are used together as the first resource status message, so that the unique identifier can be sent to the second server along with the resource status information, thereby enabling the second server to clearly and accurately associate the received resource status information with the initially initiated resource transfer operation.
[0116] In one embodiment, an implementation of the above-described S203 is provided, wherein the resource service request includes at least one of: resource service type, resource transfer quantity, and user level, such as... Figure 4 As shown, the above-mentioned "writing the first resource status message to the first message queue" includes:
[0117] S401, determine the target message priority of the first resource status message based on at least one of resource service type, resource transfer quantity, and user level.
[0118] In this embodiment of the application, the target message priority of the first resource status message is determined based on the information carried in the resource service request.
[0119] As an optional implementation, a score value corresponding to the resource service type, resource transfer quantity, and user level can be determined. Then, a total score value for the resource service request is determined based on these scores, and the target message priority of the first resource status message is further determined based on the total score value. For example, the resource service type can be related to the purpose of the resource transfer. A first correspondence between each resource service type and its corresponding score value, a second correspondence between the range of resource transfer quantities and their corresponding score values, a third correspondence between user levels and their corresponding score values, and a fourth correspondence between the total score value and message priority can be pre-established.
[0120] For example, the first correspondence may include: a rating of 1 for service type A, a rating of 2 for service type B, and a rating of 3 for service type C; the second correspondence may include: a rating of 1 for resource transfers between 0 and 10000, a rating of 2 for resource transfers between 10001 and 100000, and a rating of 3 for resource transfers above 10001; a rating of 1 for user level a, a rating of 2 for user level b, and a rating of 3 for user level c; the fourth correspondence may include: a total rating between 3 and 5 is the third priority, a total rating between 6 and 8 is the second priority, and a total rating of 9 is the first priority, with the first priority being higher than the second priority, and the second priority being higher than the third priority.
[0121] As an alternative implementation, the target message priority of the first resource status message can be determined to be high priority when at least two of the resource service type, resource transfer quantity, and user level meet preset requirements; otherwise, the target message priority of the first resource status message can be determined to be low priority. The preset requirements can be the target resource service type, target resource transfer quantity, and target user level, which are pre-defined.
[0122] S402, based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue, write the first resource status message into the target position in the first message queue corresponding to the target message priority.
[0123] In this embodiment of the application, the first resource status message is written into the first message queue according to the target message priority of the first resource status message and the target position in the first message queue.
[0124] As an optional implementation, the target message priority of the first resource status message can be determined in the location area of the first message queue, and the first resource status message can be written to the target location in the location area according to the formation time of the first resource status message.
[0125] As another optional implementation, the final priority of the first resource status message can be determined according to the preset weight of the message priority and the preset weight of the order in which they enter the first message queue, and the first resource status message can be written into the first message queue according to the final priority.
[0126] In the above application embodiments, the first resource status message is written into the first message queue according to the target message priority of the first resource status message, so that important messages can be sent to the second server faster.
[0127] In one embodiment, an implementation of the above S402 is provided, wherein the resource service request further includes: a timeout waiting duration; a target message priority based on the first resource status message, and a message priority of existing messages in the first message queue, such as... Figure 5 As shown, the above-mentioned "writing the first resource status message to the target position in the first message queue corresponding to the target message priority" includes:
[0128] S501, determine the timeout period of the resource service request based on the timeout waiting duration and the time of receiving the resource service request.
[0129] In this embodiment of the application, a timeout waiting period is added to the resource service request reception time to determine the timeout time of the resource service request.
[0130] S502, based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0131] In this embodiment of the application, a candidate position of the first resource status message in the first message queue is determined based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue. Further, it is determined whether the sending time corresponding to the candidate position exceeds the timeout time of the resource service request. If it exceeds, the candidate position is adjusted to obtain a target position that will not time out. At the same time, it is necessary to ensure that the existing messages in the first message queue will not time out.
[0132] In the above application embodiments, the target location of the first resource status message is determined according to the timeout time of the resource service request, which ensures the timeliness of message sending and avoids the inconsistency of resource transfer status between the first server and the second server due to message sending timeout.
[0133] One implementation of S202 above is provided, such as Figure 6 As shown, the above "perform resource transfer operation" includes:
[0134] S601, perform security verification on the resource service request based on the parameter information in the resource service request.
[0135] The parameter information may include user identity token, resource transfer quantity, target account, etc.; or, the parameter information may include target account, user account, password information or biometric information, etc.
[0136] In this application embodiment, at least one of the following can be verified: the legitimacy of the user's identity, the authorization to transfer resources, and whether the request exceeds the normal business scope, in order to perform security verification on the resource service request; or, the user account can be verified based on password information or biometric information, and when the password information matches the pre-stored information or the biometric information matches the pre-stored information, the security verification is determined to be successful.
[0137] Optionally, if it is determined that the user identity token is signed by a trusted authentication server, is within its validity period, and has not been cancelled, then the user identity is deemed legitimate; if it is determined that the target account is not in the preset blacklist, then the resource transfer permission is verified; if it is determined that the number of resources transferred is not greater than the preset number, then the request is deemed to have not exceeded the normal business scope.
[0138] Optional, such as Figure 7 As shown, the first server can support Figure 7 The payment service in the middle, the second server can support Figure 7 The payment and wallet services can be provided by a third-party server, or the first server can provide both payment and wallet services. Figure 1 Merchant services within the wallet are initiated and executed on the user's terminal. For example, when the wallet service is provided by a third-party server, such as... Figure 7 As shown, the first server sends a resource transfer instruction to the third server, which then performs a resource transfer operation (i.e., deducts the balance) according to the instruction.
[0139] S602, if the security check passes, execute the resource transfer operation.
[0140] In this embodiment of the application, if the security verification is passed, the first server can transfer the resource value to be transferred from the target account to the recipient according to the resource service request, and generate a first resource status message according to the resource transfer result.
[0141] In the above application embodiments, the security of the resource service request is verified before the resource transfer operation is performed, thereby improving the security of the resource transfer operation.
[0142] In one embodiment, such as Figure 8 As shown, a method for handling resource transfer consistency is provided, which is applied to... Figure 1 The second server in the example is used for illustration, including:
[0143] S701, Send a resource service request; the resource service request is used to request the execution of the corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal.
[0144] The resource service request may include information such as the target account information and the value of the resource to be transferred.
[0145] In this embodiment of the application, the user triggers a transaction operation on the user terminal, and the user terminal sends a transaction request to the second server based on the triggered transaction operation. The second server then sends a resource service request to the first server based on the transaction request.
[0146] Optionally, users can trigger a transaction by scanning a QR code, barcode, or other graphic code using their terminal; or, users can trigger a transaction by clicking on the interactive interface.
[0147] Optionally, the transaction request may include information such as the value of the resource to be transferred and the source of the resource. The source of the resource can be used to identify the financial institution where the resource is located; that is, the first server corresponding to the transaction request can be determined based on the resource to be transferred.
[0148] Optionally, before sending a resource service request to the first server, a security check can be performed on the transaction request. If the security check passes, the resource service request can be sent to the first server.
[0149] Furthermore, the second server generates a resource service request based on the transaction request, and sends the resource service request to the first server based on the transaction request.
[0150] S702, receive the resource status messages sent asynchronously by the first server in the order of each resource status message in the first message queue, and obtain the first resource status message; the first resource status message is obtained after performing a resource transfer operation based on the resource service request, and the first message queue is used to store the resource status messages after the resource transfer operation.
[0151] In this embodiment, the first server is pre-configured with a first message queue for storing resource status messages after a resource transfer operation. After the resource transfer operation is performed, the resource status messages can be stored in the first message queue in the order of execution. When the first message queue is not empty, the first server retrieves the resource status message with the earliest position from the head of the first message queue and sends it to the second server.
[0152] S703, based on the first resource status message, update the local resource status corresponding to the resource service request.
[0153] The status of local resources can include pending payment, in progress payment, payment successful, payment failed, refund in progress, and refund successful.
[0154] Optionally, when the local resource status is "Pending Payment", the next allowed status for updating is "Paying" or "Payment Failed"; when the local resource status is "Paying", the next allowed status for updating is "Payment Successful" or "Payment Failed"; when the local resource status is "Payment Successful", the next allowed status for updating is "Refunding"; when the local resource status is "Refunding", the next allowed status for updating is "Refund Successful" or "Refund Failed".
[0155] Optionally, in the second server, a partition-user binding rule is adopted, meaning that a partition can only be processed by one user in the same user group. The number of threads started by each user instance is equal to the number of partitions it is assigned. Each thread is specifically responsible for messages in one partition and processes them one by one, without parallel operations. To ensure that different payment states of the same transaction number are processed sequentially, a dual-check mechanism of timestamp verification and state transition verification is used: a cache is maintained to record the latest state timestamp of each transaction number. When processing messages, the timestamps are compared, and only new messages will update the state; old messages are discarded directly, thus guaranteeing the order.
[0156] In this embodiment of the application, the second server parses the first resource status message and can determine the resource service request corresponding to the first resource status message based on the unique identifier in the first resource status message, thereby updating the local resource status corresponding to the resource service request. For example, the local resource status can be updated to resource transfer successful or resource transfer failed based on the first resource status message.
[0157] In the above-described method for ensuring consistency in resource transfer, a resource service request is sent; resource status messages are received asynchronously from the first server in the order of resource status messages in the first message queue to obtain the first resource status message; based on the first resource status message, the local resource status corresponding to the resource service request is updated. The first resource status message is obtained after performing a resource transfer operation based on the resource service request. The resource service request is used to request the execution of the corresponding resource transfer operation for the transaction initiated by the target user on the user terminal; the first message queue is used to store the resource status message after the resource transfer operation. The first server only needs to write the first resource status message into its local first message queue, without waiting for the response from the second server or being constrained by the processing speed of the second server, thus ensuring the efficiency and stability of the core resource transfer transaction process. At the same time, by sending messages to the second server in a sequential and asynchronous manner, the timing correctness of resource status synchronization is strictly guaranteed, avoiding data inconsistency problems that may be caused by out-of-order delivery. The asynchronous mechanism also reduces the impact of network latency, ensuring the consistency between devices corresponding to the entire resource transfer process.
[0158] In one embodiment, a complete method for handling resource transfer consistency is provided, the method comprising:
[0159] S1, the first server receives the resource service request sent by the second server.
[0160] S2 performs security verification on the resource service request based on the parameter information in the resource service request.
[0161] S3, if the security check passes, executes the resource transfer operation and obtains the resource status information after the resource transfer operation.
[0162] S4 is a unique identifier for generating resource status information based on resource service requests.
[0163] S5 encapsulates the unique identifier and resource status information after the resource transfer operation to obtain the first resource status message.
[0164] S6. Determine the target message priority of the first resource status message based on at least one of resource service type, resource transfer quantity, and user level.
[0165] S7. Determine the timeout period for the resource service request based on the timeout waiting duration and the time it takes to receive the resource service request.
[0166] S8. Based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0167] S9, following the order of the resource status messages in the first message queue, asynchronously sends each resource status message to the second server in sequence.
[0168] S10, the second server updates the local resource status corresponding to the resource service request based on the first resource status message.
[0169] In the above-described method for ensuring consistency during resource transfer, the first server receives a resource service request from the second server; executes a resource transfer operation and obtains a first resource status message after the operation; writes the first resource status message into a first message queue; and asynchronously sends each resource status message to the second server in the order of the messages in the first message queue. The resource service request is used to request the execution of the corresponding resource transfer operation for a transaction initiated by the target user on the user terminal. The first message queue is used to store the resource status messages after the transfer operation. The first server only needs to write the first resource status message into its local first message queue, without waiting for a response from the second server or being constrained by the processing speed of the second server. This ensures the efficiency and stability of the core resource transfer transaction process. Furthermore, by sending messages to the second server sequentially and asynchronously, the timing correctness of resource status synchronization is strictly guaranteed, avoiding data inconsistency issues that may result from out-of-order delivery. The asynchronous mechanism also reduces the impact of network latency, ensuring consistency between devices throughout the entire resource transfer process.
[0170] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0171] Based on the same inventive concept, this application also provides a resource transfer consistency processing apparatus for implementing the resource transfer consistency processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more resource transfer consistency processing apparatus embodiments provided below can be found in the limitations of the resource transfer consistency processing method described above, and will not be repeated here.
[0172] In one embodiment, such as Figure 9 As shown, a resource transfer consistency processing apparatus is provided, comprising: a first receiving module 10, an execution module 11, a writing module 12, and a first sending module 13, wherein:
[0173] The first receiving module 10 is used to receive a resource service request sent by the second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction operation initiated by the target user on the user terminal.
[0174] The execution module 11 is used to perform resource transfer operations and obtain the first resource status message after the resource transfer operation.
[0175] The writing module 12 is used to write the first resource status message to the first message queue, which is used to store the resource status message after the resource transfer operation.
[0176] The first sending module 13 is used to asynchronously send each resource status message to the second server in the order of each resource status message in the first message queue.
[0177] In one embodiment, the execution module 11 includes: a first execution unit, a generation unit, and a packaging unit, wherein:
[0178] The first execution unit is used to perform resource transfer operations and obtain resource status information after the resource transfer operations.
[0179] A generation unit is a unique identifier used to generate status information based on resource service requests.
[0180] The encapsulation unit is used to encapsulate the unique identifier and the resource status information after the resource transfer operation to obtain the first resource status message.
[0181] In one embodiment, the writing module 12 includes: a determining unit and a writing unit, wherein:
[0182] The determining unit is used to determine the target message priority of the first resource status message based on at least one of resource service type, resource transfer quantity, and user level.
[0183] The writing unit is used to write the first resource status message into the target position in the first message queue corresponding to the target message priority, based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue.
[0184] In one embodiment, the writing unit is specifically used to determine the timeout time of the resource server request based on the timeout waiting duration and the receiving time of the resource service request; and to write the first resource status message into the target position in the first message queue corresponding to the target message priority based on the timeout time of the resource server request, the target message priority of the first resource status message, and the message priority of the existing messages in the first message queue.
[0185] In one embodiment, the execution module 11 includes: a verification unit and a second execution unit, wherein:
[0186] The verification unit is used to perform security verification on the resource server request based on the parameter information in the resource server request.
[0187] The second execution unit is used to perform resource transfer operations if the security check passes.
[0188] In one embodiment, such as Figure 10 As shown, a resource transfer consistency processing apparatus is provided, comprising: a second sending module 14, a second receiving module 15, and an update module 16, wherein:
[0189] The second sending module 14 is used to send a resource service request; the resource service request is used to request the execution of the corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal.
[0190] The second receiving module 15 is used to receive resource status messages sent asynchronously by the first server in the order of each resource status message in the first message queue, so as to obtain the first resource status message. The first resource status message is obtained after performing a resource transfer operation based on the resource service request. The first message queue is used to store the resource status messages after the resource transfer operation.
[0191] The update module 16 is used to update the local resource status corresponding to the resource service request based on the first resource status message.
[0192] Each module in the aforementioned resource transfer consistency processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0193] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores processing data related to resource transfer consistency. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource transfer consistency processing method.
[0194] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0195] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0196] Receive resource service requests sent by the second server; resource service requests are used to request the execution of corresponding resource transfer operations for transaction operations initiated by the target user on the user terminal;
[0197] Perform the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0198] Write the first resource status message to the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0199] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server in turn.
[0200] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0201] Perform resource transfer operations and obtain resource status information after the resource transfer operations;
[0202] A unique identifier that generates resource status information based on resource service requests;
[0203] The unique identifier and the resource status information after the resource transfer operation are encapsulated to obtain the first resource status message.
[0204] In one embodiment, when the processor executes a computer program, the priority of the first message queue is higher than the priority of the second message queue;
[0205] The second message queue is used to store messages generated by non-resource transfer operations.
[0206] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0207] The target message priority of the first resource status message is determined based on at least one of the resource service type, the number of resource transfers, and the user level.
[0208] Based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0209] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0210] The timeout period for the resource service request is determined based on the timeout waiting duration and the time it takes to receive the resource service request.
[0211] Based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0212] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0213] The resource service request is security verified based on the parameter information in the resource service request.
[0214] If the security check passes, perform the resource transfer operation.
[0215] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0216] Send a resource service request; the resource service request is used to request the execution of the corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0217] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message. The first resource status message is obtained after performing a resource transfer operation based on a resource service request. The first message queue is used to store resource status messages after the resource transfer operation.
[0218] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0219] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0220] Receive resource service requests sent by the second server; resource service requests are used to request the execution of corresponding resource transfer operations for transaction operations initiated by the target user on the user terminal;
[0221] Perform the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0222] Write the first resource status message to the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0223] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server in turn.
[0224] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0225] Perform resource transfer operations and obtain resource status information after the resource transfer operations;
[0226] A unique identifier that generates resource status information based on resource service requests;
[0227] The unique identifier and the resource status information after the resource transfer operation are encapsulated to obtain the first resource status message.
[0228] In one embodiment, when a computer program is executed by a processor, the priority of the first message queue is higher than the priority of the second message queue.
[0229] The second message queue is used to store messages generated by non-resource transfer operations.
[0230] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0231] The target message priority of the first resource status message is determined based on at least one of the resource service type, the number of resource transfers, and the user level.
[0232] Based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0233] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0234] The timeout period for the resource service request is determined based on the timeout waiting duration and the time it takes to receive the resource service request.
[0235] Based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0236] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0237] The resource service request is security verified based on the parameter information in the resource service request.
[0238] If the security check passes, perform the resource transfer operation.
[0239] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0240] Send a resource service request; the resource service request is used to request the execution of the corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0241] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message. The first resource status message is obtained after performing a resource transfer operation based on a resource service request. The first message queue is used to store resource status messages after the resource transfer operation.
[0242] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0243] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0244] Receive resource service requests sent by the second server; resource service requests are used to request the execution of corresponding resource transfer operations for transaction operations initiated by the target user on the user terminal;
[0245] Perform the resource transfer operation and obtain the first resource status message after the resource transfer operation;
[0246] Write the first resource status message to the first message queue; the first message queue is used to store resource status messages after the resource transfer operation.
[0247] In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server in turn.
[0248] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0249] Perform resource transfer operations and obtain resource status information after the resource transfer operations;
[0250] A unique identifier that generates resource status information based on resource service requests;
[0251] The unique identifier and the resource status information after the resource transfer operation are encapsulated to obtain the first resource status message.
[0252] In one embodiment, when a computer program is executed by a processor, the priority of the first message queue is higher than the priority of the second message queue.
[0253] The second message queue is used to store messages generated by non-resource transfer operations.
[0254] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0255] The target message priority of the first resource status message is determined based on at least one of the resource service type, the number of resource transfers, and the user level.
[0256] Based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0257] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0258] The timeout period for the resource service request is determined based on the timeout waiting duration and the time it takes to receive the resource service request.
[0259] Based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
[0260] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0261] The resource service request is security verified based on the parameter information in the resource service request.
[0262] If the security check passes, perform the resource transfer operation.
[0263] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0264] Send a resource service request; the resource service request is used to request the execution of the corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal;
[0265] The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message. The first resource status message is obtained after performing a resource transfer operation based on a resource service request. The first message queue is used to store resource status messages after the resource transfer operation.
[0266] Based on the first resource status message, update the local resource status corresponding to the resource service request.
[0267] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0268] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0269] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for handling resource transfer consistency, characterized in that, The method is applied to a first server, and the method includes: Receive a resource service request sent by a second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction initiated by the target user on the user terminal; Execute the resource transfer operation and obtain the first resource status message after the resource transfer operation; Write the first resource status message into the first message queue; the first message queue is used to store resource status messages after the resource transfer operation. In accordance with the order of the resource status messages in the first message queue, each resource status message is sent asynchronously to the second server.
2. The method according to claim 1, characterized in that, The step of performing the resource transfer operation and obtaining the first resource status message after the resource transfer operation includes: Execute the resource transfer operation and obtain the resource status information after the resource transfer operation; A unique identifier for generating the resource status information is generated based on the resource service request; The unique identifier and the resource status information after the resource transfer operation are encapsulated to obtain the first resource status message.
3. The method according to claim 2, characterized in that, The first message queue has a higher priority than the second message queue; The second message queue is used to store messages not generated by the resource transfer operation.
4. The method according to claim 1, characterized in that, The resource service request includes at least one of the following: resource service type, resource transfer quantity, and user level; writing the first resource status message into the first message queue includes: The target message priority of the first resource status message is determined based on at least one of the resource service type, the number of resource transfers, and the user level. Based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
5. The method according to claim 4, characterized in that, The resource service request also includes: a timeout waiting duration; the target message priority based on the first resource status message and the message priority of existing messages in the first message queue; writing the first resource status message into the target position in the first message queue corresponding to the target message priority, including: The timeout period of the resource service request is determined based on the timeout waiting duration and the time of receiving the resource service request. Based on the timeout of the resource service request, the target message priority of the first resource status message, and the message priority of existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
6. The method according to any one of claims 1 to 5, characterized in that, The execution of the resource transfer operation includes: The resource service request is security verified based on the parameter information in the resource service request. If the security check passes, the resource transfer operation is performed.
7. A method for handling resource transfer consistency, characterized in that, The method is applied to a second server, and the method includes: Send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for the transaction operation initiated by the target user on the user terminal; The system receives resource status messages asynchronously sent sequentially by the first server according to the order of each resource status message in the first message queue, thereby obtaining the first resource status message; the first resource status message is obtained after performing a resource transfer operation based on the resource service request, and the first message queue is used to store the resource status message after the resource transfer operation; Based on the first resource status message, update the local resource status corresponding to the resource service request.
8. A processing apparatus for resource transfer consistency, characterized in that, The device includes: The first receiving module is used to receive a resource service request sent by the second server; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction operation initiated by the target user on the user terminal; An execution module is used to execute the resource transfer operation and obtain a first resource status message after the resource transfer operation; The writing module is used to write the first resource status message into a first message queue, and the first message queue is used to store the resource status message after the resource transfer operation. The first sending module is used to asynchronously send each of the resource status messages to the second server in the order of the resource status messages in the first message queue.
9. The apparatus according to claim 8, characterized in that, The execution module includes: The first execution unit is used to execute the resource transfer operation and obtain the resource status information after the resource transfer operation; The generation unit is used to generate a unique identifier for the status information based on the resource service request; The encapsulation unit is used to encapsulate the unique identifier and the resource status information after the resource transfer operation to obtain the first resource status message.
10. The apparatus according to claim 8, characterized in that, The writing module includes: The determining unit is configured to determine the target message priority of the first resource status message based on at least one of resource service type, resource transfer quantity, and user level. The writing unit is used to write the first resource status message into the target position in the first message queue corresponding to the target message priority, based on the target message priority of the first resource status message and the message priority of the existing messages in the first message queue.
11. The apparatus according to claim 10, characterized in that, The writing unit is specifically used to determine the timeout period of the resource server request based on the timeout waiting period and the receiving time of the resource service request. Based on the timeout period of the resource server request, the target message priority of the first resource status message, and the message priority of existing messages in the first message queue, the first resource status message is written to the target position in the first message queue corresponding to the target message priority.
12. The method according to any one of claims 8-11, characterized in that, The execution module includes: The verification unit is used to perform security verification on the resource server request based on the parameter information in the resource server request; The second execution unit is used to execute the resource transfer operation if the security check passes.
13. A processing apparatus for resource transfer consistency, characterized in that, The device includes: The second sending module is used to send a resource service request; the resource service request is used to request the execution of a corresponding resource transfer operation for a transaction operation initiated by the target user on the user terminal; The second receiving module is used to receive resource status messages sent asynchronously by the first server in the order of each resource status message in the first message queue, so as to obtain the first resource status message. The first resource status message is obtained after performing a resource transfer operation based on the resource service request. The first message queue is used to store the resource status message after the resource transfer operation. The update module is used to update the local resource status corresponding to the resource service request based on the first resource status message.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.