Message processing method and device, computer device and storage medium
By automating message queue management and calculating matching scores based on event type and message fields, the problem of low efficiency in traditional message matching is solved, and efficient and accurate resource interaction confirmation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- IND BANK CO
- Filing Date
- 2023-02-08
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional message matching methods rely on manual operation, which is inefficient and prone to errors, and cannot meet the requirements for accuracy and security in resource interaction.
By acquiring event messages sent by the client, determining the confirmation message based on resource interaction information and event type, and transferring it to the corresponding message queue, the matching score is calculated using preset message fields and field weights to achieve automatic matching and queue management.
Automatic message matching was achieved, reducing manual workload, improving matching efficiency and accuracy, avoiding matching errors caused by event changes, and enhancing the reliability of resource interaction.
Smart Images

Figure CN116248481B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a message processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the development of the resource interaction market, the amount of resource interaction is increasing day by day, and a large number of resource interaction confirmation messages are generated during the resource interaction process.
[0003] Typically, different products correspond to different types of confirmation messages. In traditional technologies, the accuracy and security of resource interactions are ensured by matching confirmation messages. Message matching requires manual matching by backend business personnel, which demands a high level of expertise, consumes a lot of manpower, is inefficient, and is prone to matching errors. Summary of the Invention
[0004] Therefore, it is necessary to provide a message processing method, apparatus, computer equipment, storage medium, and computer program product that improves matching efficiency and reduces manual workload in response to the above-mentioned technical problems.
[0005] In a first aspect, embodiments of this disclosure provide a message processing method, the method being applied to a server, comprising:
[0006] Obtain the event message sent by the client, wherein the event message includes resource interaction information and event type;
[0007] A confirmation message for the resource interaction corresponding to the event message is determined based on the resource interaction information. The confirmation message includes a first confirmation message and a second confirmation message. The first confirmation message includes the message generated by the client in the resource interaction, and the second confirmation message includes the message generated by the server in the resource interaction.
[0008] Determine the message processing method corresponding to the event type;
[0009] The acknowledgment message is transferred from the initial matching message queue to the message queue corresponding to the message processing method.
[0010] In one embodiment, the confirmation method for the matching message queue includes:
[0011] Obtain the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched;
[0012] Determine the preset message fields based on the message types corresponding to the first message queue and the second message queue;
[0013] Obtain the first field value of the first acknowledgment message to be matched and the second field value of the second acknowledgment message to be matched, which correspond to the preset message field;
[0014] The matching score between the first acknowledgment message to be matched and the second acknowledgment message to be matched is determined based on the first field value and the second field value.
[0015] The first acknowledgment message to be matched and the second acknowledgment message to be matched are stored in the matching message queue corresponding to the matching score.
[0016] In one embodiment, the event type of the event message includes revocation messages and modification messages, and determining the message processing method corresponding to the event type includes:
[0017] In the case where the event type is a cancellation message, the message processing method is determined to be to transfer the confirmation message to the cancellation message queue;
[0018] When the event type is a modified message, the message processing method is determined to be to transfer the confirmed message modified according to the event message to the first message queue and the second message queue, and to determine the matching message queue of the modified confirmed message.
[0019] In one embodiment, storing the first acknowledgment message to be matched and the second acknowledgment message to be matched into a matching message queue corresponding to the matching score includes:
[0020] If the matching score is greater than the first threshold, the first confirmation message to be matched and the second confirmation message to be matched are stored in the first matching message queue.
[0021] The acquisition of event messages sent by the client includes:
[0022] Obtain the matching confirmation message from the first matching message queue, wherein the matching confirmation message includes a first confirmation message and a second confirmation message;
[0023] Determine the resource interaction corresponding to the matching confirmation message;
[0024] Obtain the event message sent by the client corresponding to the resource interaction.
[0025] In one embodiment, determining the matching score between the first acknowledgment message to be matched and the second acknowledgment message to be matched based on the first field value and the second field value includes:
[0026] Determine the field weights corresponding to the preset message fields based on the message type;
[0027] The matching score between the first confirmation message to be matched and the second confirmation message to be matched is determined based on the first field value, the second field value, and the field weight.
[0028] In one embodiment, obtaining the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched includes:
[0029] Obtain the message identifier of the acknowledgment message to be matched, wherein the message identifier includes the message source and the message time;
[0030] The acknowledgment messages to be matched are divided according to the message source to obtain a first acknowledgment message to be matched and a second acknowledgment message to be matched.
[0031] The first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched are determined based on the message time.
[0032] Secondly, embodiments of this disclosure also provide a message processing apparatus, the apparatus being applied to a server, comprising:
[0033] The acquisition module is used to acquire event messages sent by the client, wherein the event messages include resource interaction information and event type;
[0034] The first determining module is used to determine a confirmation message for resource interaction corresponding to the event message based on the resource interaction information. The confirmation message includes a first confirmation message and a second confirmation message. The first confirmation message includes a message generated by the client in the resource interaction, and the second confirmation message includes a message generated by the server in the resource interaction.
[0035] The second determining module is used to determine the message processing method corresponding to the event type;
[0036] The processing module is used to transfer the acknowledgment message from the initial matching message queue to a message queue corresponding to the message processing method.
[0037] In one embodiment, the confirmation module for the matching message queue includes:
[0038] The first acquisition submodule is used to acquire the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched;
[0039] The first determining submodule is used to determine preset message fields based on the message types corresponding to the first message queue and the second message queue;
[0040] The second acquisition submodule is used to acquire the first field value of the first confirmation message to be matched and the second field value of the second confirmation message to be matched, which are corresponding to the preset message field.
[0041] The second determining submodule is used to determine the matching score between the first confirmation message to be matched and the second confirmation message to be matched based on the first field value and the second field value;
[0042] The matching module is used to store the first confirmation message to be matched and the second confirmation message to be matched into a matching message queue corresponding to the matching score.
[0043] In one embodiment, the event type of the event message includes revocation messages and modification messages, and the second determining module includes:
[0044] The third determining submodule is used to determine, when the event type is a cancellation message, the message processing method is to transfer the confirmation message to the cancellation message queue;
[0045] The fourth determining submodule is used to determine, when the event type is modified message, the message processing method is to transfer the confirmed message modified according to the event message to the first message queue and the second message queue, and to determine the matching message queue of the modified confirmed message.
[0046] In one embodiment, the matching module includes:
[0047] The first matching submodule is used to store the first confirmation message to be matched and the second confirmation message to be matched into the first matching message queue when the matching score is greater than the first threshold.
[0048] The acquisition module includes:
[0049] The third acquisition submodule is used to acquire the matching confirmation message in the first matching message queue, wherein the matching confirmation message includes a first confirmation message and a second confirmation message;
[0050] The fifth determining submodule is used to determine the resource interaction corresponding to the matching confirmation message;
[0051] The fourth acquisition submodule is used to acquire event messages sent by the client that correspond to the resource interaction.
[0052] In one embodiment, the second determining submodule includes:
[0053] The first determining unit is configured to determine the field weight corresponding to the preset message field based on the message type.
[0054] The second determining unit is used to determine the matching score between the first confirmation message to be matched and the second confirmation message to be matched based on the first field value, the second field value, and the field weight.
[0055] In one embodiment, the first acquisition submodule includes:
[0056] The first acquisition unit is used to acquire the message identifier of the acknowledgment message to be matched, wherein the message identifier includes the message source and the message time;
[0057] The segmentation module is used to segment the acknowledgment message to be matched according to the message source, so as to obtain a first acknowledgment message to be matched and a second acknowledgment message to be matched;
[0058] The third determining unit is used to determine, based on the message time, a first message queue corresponding to the first acknowledgment message to be matched and a second message queue corresponding to the second acknowledgment message to be matched.
[0059] Thirdly, embodiments of this disclosure also provide a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described in any one of the embodiments of this disclosure.
[0060] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the method described in any one of the embodiments of this disclosure.
[0061] Fifthly, embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the method described in any one of the embodiments of this disclosure.
[0062] In this embodiment of the disclosure, when processing messages, an event message sent by the client is received. Based on the resource interaction information and event type of the event message, a corresponding confirmation message for resource interaction and a message processing method are determined. The corresponding confirmation message for resource interaction is transferred from the initial message matching queue to a message queue corresponding to the message processing method. When matching confirmation messages for resource interaction, automatic matching of confirmation messages is achieved, reducing manual workload and improving matching efficiency. Furthermore, the confirmation messages can be processed according to specific event messages, transferring them to the corresponding message queue. Based on automatic matching, the accuracy of confirmation message matching is improved. Different processing methods are applied to confirmation messages according to different event message types. The queue status of confirmation messages can be updated in real time based on the actual situation of the client, avoiding matching errors caused by modification or cancellation events during resource interaction. This further reduces manual workload and balances matching efficiency and accuracy. Attached Figure Description
[0063] Figure 1 This is a flowchart illustrating a message processing method in one embodiment;
[0064] Figure 2 This is a flowchart illustrating the confirmation method for matching message queues in one embodiment;
[0065] Figure 3 This is a flowchart illustrating a message processing method in one embodiment;
[0066] Figure 4 This is a flowchart illustrating the confirmation method for matching message queues in one embodiment;
[0067] Figure 5 This is a flowchart illustrating the confirmation method for matching message queues in one embodiment;
[0068] Figure 6 This is a structural block diagram of a message processing apparatus in one embodiment;
[0069] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the embodiments of this disclosure will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this disclosure and are not intended to limit the embodiments of this disclosure.
[0071] In one embodiment, such as Figure 1As shown, a message processing method is provided, which is applied to a server and includes:
[0072] Step S110: Obtain the event message sent by the client, wherein the event message includes resource interaction information and event type;
[0073] This disclosure provides a message processing method applied to a server. Typically, during resource interaction, the server and client communicate via messages. The server sends a resource interaction confirmation message, and the client also sends a resource interaction confirmation message to confirm the resource interaction information, ensuring the accuracy and reliability of the resource interaction. There is a correlation between the resource interaction confirmation messages generated in a single resource interaction. In this embodiment, event messages sent by the client are obtained. These event messages are typically generated after changes occur during the resource interaction process. There is a correspondence between event messages and resource interactions. In one example, event messages may include, but are not limited to, modification messages and cancellation messages. A modification message indicates that the corresponding resource interaction has been modified, and a cancellation message indicates that the corresponding resource interaction has been cancelled. The event message includes resource interaction information and an event type. The resource interaction information may include a resource interaction identifier corresponding to the event message, used to determine the resource interaction corresponding to the event message. In one example, the event type can be determined in advance based on the actual application scenario. Events can be classified according to the characteristics of different events to obtain the event type. For example, they can be classified into modification type, cancellation type, confirmation type, etc. This disclosure does not limit this.
[0074] Step S120: Determine the confirmation message of the resource interaction corresponding to the event message based on the resource interaction information, wherein the confirmation message includes a first confirmation message and a second confirmation message, the first confirmation message includes the message generated by the client in the resource interaction, and the second confirmation message includes the message generated by the server in the resource interaction;
[0075] In this embodiment, after obtaining an event message, a confirmation message for the resource interaction corresponding to the event message is determined based on the resource interaction information in the event message. There is a correspondence between event messages and resource interactions; one event message can correspond to one or more resource interactions. The resource interaction corresponding to the event message can be determined based on the resource interaction information in the event message. In one example, the resource interaction information in the event message may include the identifier information of the corresponding resource interaction, and the corresponding resource interaction can be determined based on the identifier information. After obtaining the resource interaction corresponding to the event message, the corresponding confirmation message can be determined. Typically, during resource interaction, the server and client interact through messages, and both the server and client generate confirmation messages. In this embodiment, the confirmation messages include a first confirmation message and a second confirmation message. The first confirmation message includes the message generated by the client during the resource interaction process, and the second confirmation message includes the message generated by the server during the resource interaction process. Preferably, the message type of the first and second confirmation messages can be set to confirmation messages, that is, the first and second confirmation messages correspond to the confirmation messages generated by the client and server during the resource interaction process.
[0076] Step S130: Determine the message processing method corresponding to the event type;
[0077] In this embodiment, the corresponding message processing method is determined based on the event type of the event message. Specifically, in this embodiment, there is a correlation between the message processing method and the event type; different event types can correspond to different message processing methods. The message processing method includes transferring the corresponding resource interaction confirmation message to the corresponding message queue. In one example, the correspondence between the message processing method and the event type can be pre-set according to the actual application scenario. After determining the event type of the event message, the message processing method is searched from the pre-determined correspondence based on the event type.
[0078] Step S140: Transfer the acknowledgment message from the initial matching message queue to the message queue corresponding to the message processing method.
[0079] In this embodiment, after determining the acknowledgment message and message processing method corresponding to the event type, the message processing method includes transferring the acknowledgment message to the corresponding message queue. Therefore, there is an association between the message processing method and the message queue, and the corresponding message queue to be transferred can be determined based on the message processing method. The acknowledgment message is transferred from the initial matching message queue to the message queue to be transferred corresponding to the message processing method. In this embodiment, before processing the acknowledgment message according to the corresponding message processing method, the acknowledgment message is stored in the initial matching message queue. The initial matching message queue may include the unmatched original message queue, or it may include the message queue after initial matching among the event-generating messages. In one example, the acknowledgment message includes a first acknowledgment message and a second acknowledgment message. The first acknowledgment message and the second acknowledgment message are matched with each other. The matching relationship between the first acknowledgment message and the second acknowledgment message can be determined after initial matching.
[0080] In this embodiment of the disclosure, when processing messages, an event message sent by the client is received. Based on the resource interaction information and event type of the event message, a corresponding confirmation message for resource interaction and a message processing method are determined. The corresponding confirmation message for resource interaction is transferred from the initial message matching queue to a message queue corresponding to the message processing method. When matching confirmation messages for resource interaction, automatic matching of confirmation messages is achieved, reducing manual workload and improving matching efficiency. Furthermore, confirmation messages can be processed according to specific event messages, transferring them to the corresponding message queue. Based on automatic matching, the accuracy of confirmation message matching is improved. Different processing methods are applied to confirmation messages according to different event message types. The queue status of confirmation messages can be updated in real time based on the actual situation of the client, enabling the flow of confirmation messages between different message queues. This avoids confirmation message matching errors caused by modification or cancellation events during resource interaction, further reducing manual workload and balancing matching efficiency and accuracy.
[0081] In one embodiment, such as Figure 2 As shown, the acknowledgment method for the matching message queue includes:
[0082] Step S210: Obtain the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched;
[0083] Step S220: Determine preset message fields based on the message types corresponding to the first message queue and the second message queue;
[0084] Step S230: Obtain the first field value of the first confirmation message to be matched and the second field value of the second confirmation message to be matched, which correspond to the preset message field.
[0085] Step S240: Determine the matching score between the first acknowledgment message to be matched and the second acknowledgment message to be matched based on the first field value and the second field value;
[0086] Step S250: Store the first confirmation message to be matched and the second confirmation message to be matched into the matching message queue corresponding to the matching score.
[0087] In this embodiment of the disclosure, the initial matching message queue can be determined after preliminary matching. Specifically, a first message queue corresponding to a first confirmation message to be matched and a second message queue corresponding to a second confirmation message to be matched are obtained. The first confirmation message includes messages generated by the client during resource interaction, and the second confirmation message includes messages generated by the server during resource interaction. The first confirmation message and the second confirmation message generated in the same resource interaction process are matched with each other. At this time, the first confirmation message and the second confirmation message are in a pending matching state. Therefore, there is no message matching relationship between the messages in the first message queue and the second message queue. In one example, the first message queue and the second message queue can be obtained by dividing the confirmation messages according to the message identifier information of the confirmation messages to be matched. In this embodiment, message matching can be performed using the corresponding field values of the messages. Since the fields of messages corresponding to different message types will vary, the matching process will also differ. Typically, corresponding message matching rules can be determined based on the characteristic information of different message types. Different message matching rules correspond to preset message fields, and message matching is performed using the field values of these preset message fields. Preset message fields are determined based on the message types corresponding to the first and second message queues. These preset message fields can correspond to one or more message fields. In one example, the corresponding message matching rules can be determined based on the message type, and the corresponding preset message fields can be determined based on these matching rules. Message types can include, but are not limited to, SWIFT, ISO20022 new standard messages, foreign exchange trading center messages, and Shanghai Clearing House messages. The first field value of the first confirmation message to be matched and the second field value of the second confirmation message to be matched are determined based on the preset message fields. The corresponding matching score is then determined based on the determined first and second field values. The relationship between the matching score and the field values can be determined in advance based on the actual application scenario. In this embodiment, different matching scores correspond to different matching message queues. In one example, the matching message queues can be divided into a fully matching queue, a partially matching queue, and a matching failure queue based on the different matching scores. In one example, when there are multiple acknowledgment messages in the first message queue and the second message queue, the matching scores can be calculated sequentially, and the matching message queues can be divided according to the highest matching score among all the matching scores obtained by each acknowledgment message.
[0088] In one example, when determining the matching message queue based on the matching score, three matching results can be set: a successful match score of 100 points, a partially successful match score greater than a preset matching threshold but less than 100 points, and a failed match score less than or equal to the preset matching threshold. Based on the matching results, matched messages are stored in the successful match queue, the partially successful match queue, and the failed match queue, respectively. Confirmation messages for partially successful matches can be temporarily stored in a temporary database for a set waiting time, which can be pre-set according to the actual application scenario. In one example, for partially successful matches, based on the set waiting time, internal messages can continue to traverse external messages for matching, obtaining the message with the highest matching score to determine the final result. After determining the final result, the message with the final result can be stored in a specific database, and the message can be deleted from the temporary database table. In one example, for messages that are automatically confirmed and ultimately enter the partially successful match queue, a manual forced confirmation function can be provided for relevant personnel to manually confirm.
[0089] In this embodiment, a matching score is calculated using preset message fields corresponding to the message type, and the message queue is divided based on the matching score. This enables automatic message matching based on the message information of the confirmation message, completing the initial matching of the confirmation messages to be matched. As a result, in subsequent event processing, the corresponding confirmation message can be determined directly based on the resource interaction information of the event message, eliminating the need for manual initial message matching, reducing manual workload, and improving message matching efficiency.
[0090] In one embodiment, such as Figure 3 As shown, the event types of event messages include revocation messages and modification messages. Determining the message processing method corresponding to the event type includes:
[0091] Step S131: If the event type is a cancellation message, determine the message processing method as transferring the confirmation message to the cancellation message queue;
[0092] Step S132: If the event type is a modified message, determine the message processing method as follows: transfer the confirmed message modified according to the event message to the first message queue and the second message queue, and determine the matching message queue of the modified confirmed message.
[0093] In this embodiment of the disclosure, the event types of the event messages include cancellation messages and modification messages, and different event types correspond to different message processing methods. Specifically, when the event type is a cancellation message, it can be considered that the resource interaction corresponding to the event message has been cancelled, and there is no need to match and confirm the confirmation message of this resource interaction. The message processing method is set to transfer the confirmation message corresponding to this resource interaction to the cancellation message queue. The cancellation message queue can be a pre-set queue for storing confirmation messages corresponding to cancelled resource interactions. Under normal circumstances, since the resource interaction has been cancelled, the confirmation messages in the cancellation message queue do not need to undergo any other matching processing. When the event type is a modification message, it can be assumed that the resource interaction information corresponding to the event message has been modified and needs to be re-matched. The event message usually also corresponds to a message modification method. In this case, the confirmation message for the resource interaction is modified according to the event message, and the modified confirmation message is transferred to the first message queue and the second message queue. The first and second message queues are used to store confirmation messages to be matched. Therefore, the modified confirmation message needs to be re-matched, and the matching message queue for the modified confirmation message is re-determined according to a preset matching method. In one example, this is done through... Figure 2 The matching method shown redetermines the matching message queue for the modified acknowledgment message.
[0094] In this embodiment, the event message types include revocation messages and modification messages. Corresponding message processing methods are set according to the characteristics of revocation and modification messages. Confirmation messages for corresponding resource interactions are transferred to the corresponding message queues. This allows for different processing of messages based on different events and different processing methods for confirmation messages based on different event message types. The queue status of confirmation messages can be updated in real time based on the actual situation of the client, avoiding incorrect matching of confirmation messages caused by modification or revocation events during resource interaction. This further reduces manual workload and balances the matching efficiency and accuracy of confirmation messages.
[0095] In one embodiment, storing the first acknowledgment message to be matched and the second acknowledgment message to be matched into a matching message queue corresponding to the matching score includes:
[0096] If the matching score is greater than the first threshold, the first confirmation message to be matched and the second confirmation message to be matched are stored in the first matching message queue.
[0097] The acquisition of event messages sent by the client includes:
[0098] Obtain the matching confirmation message from the first matching message queue, wherein the matching confirmation message includes a first confirmation message and a second confirmation message;
[0099] Determine the resource interaction corresponding to the matching confirmation message;
[0100] Obtain the event message sent by the client corresponding to the resource interaction.
[0101] In this embodiment, during the initial matching of acknowledgment messages to be matched, after obtaining the matching score of the acknowledgment message, the first acknowledgment message and the second acknowledgment message to be matched are stored in the corresponding matching message queue according to the matching score. Specifically, if the matching score is greater than a first threshold, the corresponding first acknowledgment message and the second acknowledgment message to be matched are stored in the first matching message queue. Typically, the first threshold can be set according to the actual application scenario. In one example, the matching score of a complete match between the first and second messages to be matched is recorded as the first score, and the first threshold can be set to the first score. In this case, the first matching message queue corresponds to a complete matching message queue. Alternatively, the first threshold can be set to the difference between the first score and a preset score. In this case, the first matching message queue corresponds to the sum of the complete matching message queue and the partially matching message queue. In this embodiment, when obtaining an event message, the corresponding resource interaction can be determined first based on the matching confirmation message in the first matching message queue, and the event message matching the corresponding resource interaction can be obtained. That is, when obtaining an event message, the event message corresponding to the resource interaction of the confirmation message that has been initially matched can be obtained.
[0102] In this embodiment of the disclosure, when acquiring event messages, the event messages are acquired based on the resource interaction corresponding to the preliminarily matched confirmation messages. This enables the modification of the matching status based on the resource interaction status corresponding to the messages after the preliminary matching is completed. There is no need to monitor the event messages for unmatched confirmation messages. This improves the accuracy and efficiency of confirmation message matching while reducing the workload of data acquisition and matching, avoiding unnecessary resource waste, thereby ensuring the efficiency of data processing and improving the efficiency of confirmation message matching.
[0103] In one embodiment, such as Figure 4 As shown, determining the matching score between the first acknowledgment message to be matched and the second acknowledgment message to be matched based on the first field value and the second field value includes:
[0104] Step S241: Determine the field weight corresponding to the preset message field according to the message type;
[0105] Step S242: Determine the matching score between the first confirmation message to be matched and the second confirmation message to be matched based on the first field value, the second field value, and the field weight.
[0106] In this embodiment of the disclosure, when determining the matching score through field values, the degree of correlation between different fields and confirmation messages varies, and the influence of different fields on the matching result also varies. Therefore, different preset message fields correspond to different field weights. In one example, the field weights can be set according to the actual application scenario, and the field weights corresponding to different message types and different preset message fields may also be different. The corresponding preset message fields and their corresponding field weights are determined according to the message type, and the matching score is calculated based on the determined field weights and the obtained field values corresponding to the messages. In one example, the field matching score can be determined based on the degree of matching between the first field value and the second field value, and then combined with the field weights, the weighted sum of the field matching scores is used as the matching score between the first confirmation message and the second confirmation message to be matched. When determining the field matching score between the first field value and the second field value, the correlation between the first field value and the second field value can be determined based on the distance between the field values (e.g., Euclidean distance), and the corresponding field matching score can be obtained. Alternatively, the field matching score can be determined through other methods that can determine the correlation between field values, and this disclosure does not limit this.
[0107] In this embodiment, different field weights are set according to different preset message fields and different message types. When calculating the matching score between messages, the matching score is determined by combining the field value and the field weight, which can ensure the accuracy of the calculated matching score, thereby improving the accuracy of message matching. While realizing automatic matching of confirmation messages, the accuracy of message matching is also taken into account, reducing the subsequent risk problems caused by matching errors, improving the stability of automatic message matching, and reducing the workload of manual labor.
[0108] In one embodiment, such as Figure 5 As shown, obtaining the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched includes:
[0109] Step S211: Obtain the message identifier of the acknowledgment message to be matched, wherein the message identifier includes the message source and the message time;
[0110] Step S212: Divide the confirmation message to be matched according to the message source to obtain the first confirmation message to be matched and the second confirmation message to be matched.
[0111] Step S213: Determine the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched based on the message time.
[0112] In this embodiment, a first message queue and a second message queue are obtained by dividing the acknowledgment messages to be matched. Specifically, the acknowledgment messages to be matched are obtained, and the message identifier of the acknowledgment messages to be matched is determined. The message identifier may include the message source and the message time. In this embodiment, the message source may include messages generated by the server and messages generated by the client. Since this method is applied to the server, the message source can also be classified into internal messages and external messages. Internal messages include acknowledgment messages generated by the server, and external messages include acknowledgment messages generated by the client. In one example, the acknowledgment messages to be matched can be obtained based on the organizational entity. Based on the message source in the message identifier, the acknowledgment messages to be matched can be divided to obtain a first acknowledgment message to be matched and a second acknowledgment message to be matched. The first acknowledgment message to be matched includes messages generated by the client in resource interaction, and the second acknowledgment message to be matched includes messages generated by the server in resource interaction. After obtaining the first acknowledgment message to be matched and the second acknowledgment message to be matched, the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched can be determined according to the message time in the message identifier. For example, acknowledgment messages whose message generation time is within a preset time range can be divided into the same queue according to the message time. The specific settings can be determined according to the actual application scenario.
[0113] In this embodiment, a first message queue and a second message queue are obtained based on the message source and message time of the acknowledgment message to be matched. Dividing the first and second acknowledgment messages by message source is beneficial for subsequent message matching. Determining the first and second message queues by message time can effectively reduce the workload of subsequent message matching. Dividing the queues by message time can exclude some invalid acknowledgment messages, further improving the efficiency of message matching and reducing the workload of data calculation.
[0114] In one example, this method can be applied to the transaction settlement process in resource interaction. Transaction confirmation is a crucial process in the transaction lifecycle, requiring not only verification of the accuracy and authenticity of transaction elements but also ensuring the integrity of settlement information, thereby triggering relevant transaction settlement processes. Different products correspond to different types of confirmation messages, necessitating manual matching by back-end business personnel, which is not only labor-intensive and requires high levels of expertise but also prone to operational risks. This embodiment provides a message confirmation matching process. Specifically, based on the message identifier, internal and external messages are determined and enter a matching queue. The message identifier includes the message source, which distinguishes between internal and external messages. Internal messages awaiting confirmation are stored in the internal matching queue, and external messages awaiting confirmation are stored in the external matching queue. For messages in both internal and external queues, a preset message matching rule is queried based on the message type. The preset message matching rule is established according to the message type, with different message types designed based on different key fields. In one example, the key fields can correspond to preset message fields. In one example, the message type may include, but is not limited to, SWIFT, ISO20022 new standard messages, foreign exchange trading center messages, Shanghai Clearing House messages, etc.; the key fields may include, but are not limited to, transaction elements, clearing information, etc. Due to the complexity of transaction message content, it is not necessary to match all fields. Weight parameters are set according to the importance of the key fields. These weight parameters may include the field weights corresponding to different preset message fields, which can be pre-set according to actual conditions.
[0115] Based on the retrieved message matching rules, internal and external messages in the matching queue are parsed to obtain key field values. After obtaining the key field information, the matching value is determined according to the set weight parameters. Internal and external messages are matched against key field values and their corresponding weights based on their message type. The key field information is obtained by parsing internal and external messages, and the matching degree of the key field is multiplied by the weight parameters and then summed to determine the matching score. The matching score is calculated based on the weight parameters, and the matching result is determined according to the set threshold. A matching threshold can be preset according to the actual application scenario. Based on the matching score of the transaction confirmation, three matching results are set: a successful match score of 100 points, a partially successful match score greater than the preset matching threshold but less than 100 points, and a failed match score less than or equal to the preset matching threshold. Based on the matching results, the matched messages are stored in the successful match queue, the partially successful match queue, and the failed match queue, respectively. Partially successful matches are temporarily stored in a temporary database for a period determined by the set waiting time. For partially matched messages, according to the set waiting time, internal messages can continue to traverse external messages for matching, obtaining the message with the highest matching score to determine the final result; messages with the final result are stored in a specific database, and messages are deleted from the temporary database table; for messages that are automatically confirmed to enter the partial matching queue, a manual forced confirmation function is provided. For messages that have completed matching, they can be reprocessed based on received event messages, where event messages may include, but are not limited to, cancellation messages and modification messages. Reprocessing completed matching messages involves storing them in the cancellation message queue or returning internal and external messages to the waiting matching queue for matching. If the received event message is a cancellation message, the completed matching message will be moved to the cancellation queue; if the received event message is a modification message, the partially matched messages will be unpacked and re-matched to obtain a new matching result.
[0116] This embodiment of the disclosure displays message information and matching results based on the organization entity; sets different queues for matching based on message source and time; executes pre-set matching rules, sets thresholds and weights based on message type; extracts the field values to be matched from the transaction message according to the matching rules, matches the field values of internal and external messages, and determines the result score based on the weights. For messages that fail to match, an unmatching operation is provided, and internal and external messages are returned to the queue for matching. Based on the processing of message events, the flow and storage queues of new and old messages are confirmed. This achieves automatic matching and confirmation of transaction messages, reduces manual operations, saves labor costs, and reduces operational risks.
[0117] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown sequentially as indicated by 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 of the steps in the accompanying drawings may include multiple steps or stages, which are not necessarily completed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0118] Based on the same inventive concept, this disclosure also provides a message processing apparatus for implementing the message processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations of one or more message processing apparatus embodiments provided below can be found in the limitations of the message processing method described above, and will not be repeated here.
[0119] In one embodiment, such as Figure 6 As shown, a message processing apparatus 600 is provided, which is applied to a server and includes:
[0120] The acquisition module 610 is used to acquire event messages sent by the client, wherein the event messages include resource interaction information and event type;
[0121] The first determining module 620 is used to determine a confirmation message for resource interaction corresponding to the event message based on the resource interaction information. The confirmation message includes a first confirmation message and a second confirmation message. The first confirmation message includes a message generated by the client in the resource interaction, and the second confirmation message includes a message generated by the server in the resource interaction.
[0122] The second determining module 630 is used to determine the message processing method corresponding to the event type;
[0123] The processing module 640 is used to transfer the acknowledgment message from the initial matching message queue to a message queue corresponding to the message processing method.
[0124] In one embodiment, the confirmation module for the matching message queue includes:
[0125] The first acquisition submodule is used to acquire the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched;
[0126] The first determining submodule is used to determine preset message fields based on the message types corresponding to the first message queue and the second message queue;
[0127] The second acquisition submodule is used to acquire the first field value of the first confirmation message to be matched and the second field value of the second confirmation message to be matched, which are corresponding to the preset message field.
[0128] The second determining submodule is used to determine the matching score between the first confirmation message to be matched and the second confirmation message to be matched based on the first field value and the second field value;
[0129] The matching module is used to store the first confirmation message to be matched and the second confirmation message to be matched into a matching message queue corresponding to the matching score.
[0130] In one embodiment, the event type of the event message includes revocation messages and modification messages, and the second determining module includes:
[0131] The third determining submodule is used to determine, when the event type is a cancellation message, the message processing method is to transfer the confirmation message to the cancellation message queue;
[0132] The fourth determining submodule is used to determine, when the event type is modified message, the message processing method is to transfer the confirmed message modified according to the event message to the first message queue and the second message queue, and to determine the matching message queue of the modified confirmed message.
[0133] In one embodiment, the matching module includes:
[0134] The first matching submodule is used to store the first confirmation message to be matched and the second confirmation message to be matched into the first matching message queue when the matching score is greater than the first threshold.
[0135] The acquisition module includes:
[0136] The third acquisition submodule is used to acquire the matching confirmation message in the first matching message queue, wherein the matching confirmation message includes a first confirmation message and a second confirmation message;
[0137] The fifth determining submodule is used to determine the resource interaction corresponding to the matching confirmation message;
[0138] The fourth acquisition submodule is used to acquire event messages sent by the client that correspond to the resource interaction.
[0139] In one embodiment, the second determining submodule includes:
[0140] The first determining unit is configured to determine the field weight corresponding to the preset message field based on the message type.
[0141] The second determining unit is used to determine the matching score between the first confirmation message to be matched and the second confirmation message to be matched based on the first field value, the second field value, and the field weight.
[0142] In one embodiment, the first acquisition submodule includes:
[0143] The first acquisition unit is used to acquire the message identifier of the acknowledgment message to be matched, wherein the message identifier includes the message source and the message time;
[0144] The segmentation module is used to segment the acknowledgment message to be matched according to the message source, so as to obtain a first acknowledgment message to be matched and a second acknowledgment message to be matched;
[0145] The third determining unit is used to determine, based on the message time, a first message queue corresponding to the first acknowledgment message to be matched and a second message queue corresponding to the second acknowledgment message to be matched.
[0146] Each module in the aforementioned message processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware within or independently of the processor in a computer device, or stored in software within the memory of the computer device, so that the processor can invoke and execute the operations corresponding to each module.
[0147] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing 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 an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores event messages, acknowledgment messages, message queues, and other data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a message processing method.
[0148] Those skilled in the art will understand that Figure 7The structures shown are merely block diagrams of some structures related to the embodiments of this disclosure and do not constitute a limitation on the computer devices on which the embodiments of this disclosure are applied. Specific computer devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.
[0149] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0150] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0151] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0152] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0153] 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 disclosure can include at least one of non-volatile 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 disclosure 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 disclosure may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0154] 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 specification.
[0155] The above-described embodiments are merely illustrative of several implementation methods of the present disclosure, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the patent for the embodiments of the present disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of the present disclosure, and these all fall within the protection scope of the embodiments of the present disclosure. Therefore, the protection scope of the embodiments of the present disclosure should be determined by the appended claims.
Claims
1. A method of processing a packet, the method comprising: The method is applied to a server and includes: Obtain the event message sent by the client, wherein the event message includes resource interaction information and event type; A confirmation message for the resource interaction corresponding to the event message is determined based on the resource interaction information. The confirmation message includes a first confirmation message and a second confirmation message. The first confirmation message includes the message generated by the client in the resource interaction, and the second confirmation message includes the message generated by the server in the resource interaction. Determine the message processing method corresponding to the event type; The acknowledgment message is transferred from the initial matching message queue to a message queue corresponding to the message processing method. The acknowledgment method for the matching message queue includes: obtaining a first message queue corresponding to a first acknowledgment message to be matched and a second message queue corresponding to a second acknowledgment message to be matched; determining preset message fields based on the message types corresponding to the first and second message queues; obtaining a first field value of the first acknowledgment message to be matched and a second field value of the second acknowledgment message to be matched corresponding to the preset message fields; determining a matching score between the first and second acknowledgment messages to be matched based on the first and second field values; and storing the first and second acknowledgment messages to be matched into a matching message queue corresponding to the matching score.
2. The method of claim 1, wherein, The event types of event messages include revocation messages and modification messages. Determining the message processing method corresponding to the event type includes: In the case where the event type is a cancellation message, the message processing method is determined to be to transfer the confirmation message to the cancellation message queue; When the event type is a modified message, the message processing method is determined to be to transfer the confirmed message modified according to the event message to the first message queue and the second message queue, and to determine the matching message queue of the modified confirmed message.
3. The method of claim 1, wherein, The step of storing the first acknowledgment message to be matched and the second acknowledgment message to be matched into the matching message queue corresponding to the matching score includes: If the matching score is greater than the first threshold, the first confirmation message to be matched and the second confirmation message to be matched are stored in the first matching message queue. The acquisition of event messages sent by the client includes: Obtain the matching confirmation message from the first matching message queue, wherein the matching confirmation message includes a first confirmation message and a second confirmation message; Determine the resource interaction corresponding to the matching confirmation message; Obtain the event message sent by the client corresponding to the resource interaction.
4. The method of claim 1, wherein, Determining the matching score between the first acknowledgment message and the second acknowledgment message to be matched based on the first field value and the second field value includes: Determine the field weights corresponding to the preset message fields based on the message type; The matching score between the first confirmation message to be matched and the second confirmation message to be matched is determined based on the first field value, the second field value, and the field weight.
5. The method according to claim 1, characterized in that, The step of obtaining the first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched includes: Obtain the message identifier of the acknowledgment message to be matched, wherein the message identifier includes the message source and the message time; The acknowledgment messages to be matched are divided according to the message source to obtain a first acknowledgment message to be matched and a second acknowledgment message to be matched. The first message queue corresponding to the first acknowledgment message to be matched and the second message queue corresponding to the second acknowledgment message to be matched are determined based on the message time.
6. A message processing apparatus, characterized in that, The device is used in a server and includes: The acquisition module is used to acquire event messages sent by the client, wherein the event messages include resource interaction information and event type; The first determining module is used to determine a confirmation message for resource interaction corresponding to the event message based on the resource interaction information. The confirmation message includes a first confirmation message and a second confirmation message. The first confirmation message includes a message generated by the client in the resource interaction, and the second confirmation message includes a message generated by the server in the resource interaction. The second determining module is used to determine the message processing method corresponding to the event type; The processing module is used to transfer the acknowledgment message from the initial matching message queue to a message queue corresponding to the message processing method; wherein, the acknowledgment method of the matching message queue includes: obtaining a first message queue corresponding to a first acknowledgment message to be matched and a second message queue corresponding to a second acknowledgment message to be matched; determining a preset message field according to the message type corresponding to the first message queue and the second message queue; obtaining a first field value of the first acknowledgment message to be matched and a second field value of the second acknowledgment message to be matched corresponding to the preset message field; determining a matching score between the first acknowledgment message to be matched and the second acknowledgment message to be matched according to the first field value and the second field value; and storing the first acknowledgment message to be matched and the second acknowledgment message to be matched into a matching message queue corresponding to the matching score.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the message processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the message processing method according to any one of claims 1 to 5.
9. 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 message processing method according to any one of claims 1 to 5.