Message processing methods, devices, servers, and storage media

By filtering and selectively verifying the changed field information in the distributed system, the problem of false alarms caused by data inconsistency in the distributed system is solved, and more accurate and efficient message verification is achieved.

CN114860476BActive Publication Date: 2025-10-28BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210459703.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2025-10-28
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

In distributed systems, data inconsistencies caused by faults such as network timeouts, system errors, and network latency can lead to false alarms and inaccurate verification results during real-time reconciliation.

Method used

By acquiring messages carrying target field information, we can filter out the change fields that need attention, and selectively verify messages under certain conditions to eliminate invalid messages, thus ensuring the accuracy and efficiency of the verification.

Benefits of technology

It reduced the false alarm rate of verification, improved the accuracy of verification results, reduced the workload of verification, and improved verification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860476B_ABST
    Figure CN114860476B_ABST
Patent Text Reader

Abstract

This disclosure relates to a message processing method, apparatus, server, and storage medium. The method includes: acquiring a first message, wherein the first message carries at least first target field information generated after a message update is triggered by the system containing the second message; if the first message meets a first preset filtering condition, detecting whether the first target field information belongs to a preset field, and obtaining a detection result; if the detection result indicates that the first target field information in the first message belongs to a preset field, and if the third message does not meet the message rejection condition, performing message verification between the first message and the third message. This disclosure only verifies change messages that require attention, which not only reduces the false alarm rate of verification but also improves the accuracy of the verification results. Furthermore, unlike traditional full-message verification, selective message verification reduces the workload of verification and improves message verification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computers, and in particular to message processing methods, apparatus, servers, and storage media. Background Technology

[0002] In distributed systems, data inconsistencies may occur between systems due to various faults such as network timeouts, system errors, and network latency. Real-time reconciliation is mainly used to detect data inconsistencies between systems, thereby avoiding the adverse effects of various faults.

[0003] In related technologies, whenever a data row in the accounting system to be verified changes, a binlog (a binary log maintained by the MySQL server layer) message will be triggered, causing the messages between the systems to be re-verified. This can lead to false alarms and inaccurate verification results. Summary of the Invention

[0004] This disclosure provides a message processing method, apparatus, server, and storage medium to at least solve the problem of false alarms in related technologies, leading to inaccurate verification results. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a message processing method is provided, comprising: acquiring a first message, wherein the first message carries at least first target field information generated after a message update is triggered by the system where the second message is located; when it is determined that the first message meets a first preset filtering condition, detecting whether the first target field information belongs to a preset field, and obtaining a detection result, wherein the preset field is a field used to indicate message verification; when the detection result indicates that the first target field information in the first message belongs to the preset field, and when the third message does not meet the message removal condition, performing message verification between the first message and the third message; wherein the first message and the second message come from the same system, the third message comes from another system, and the second message and the third message have been verified in a historical period.

[0006] Optionally, when the detection result indicates that the first target field information in the first message belongs to a preset field, and when the third message does not meet the message removal condition, message verification is performed between the first message and the third message, including: when the detection result indicates that the first target field information in the first message belongs to a preset field, obtaining the verification waiting time of the first message; obtaining the remaining time of the first effective cache of the third message; when the verification waiting time is less than the remaining time of the first effective cache, determining that the third message does not meet the message removal condition; counting down the verification waiting time, determining the first moment corresponding to the end of the countdown, and performing message verification between the first message and the third message at the first moment.

[0007] Optionally, the above method further includes: if the verification waiting time is greater than the remaining time of the first effective cache, then the third message is determined to meet the message removal condition, and the third message is removed from the target storage location, where the target storage location is used to point to the message verification operation.

[0008] Optionally, after removing the third message from the target storage location, the method further includes: determining the second valid cache remaining time of the first message; if a fourth message from another system is detected within the second valid cache remaining time, wherein the fourth message carries at least the second target field information generated after the other system triggers a message update, obtaining the verification waiting time of the fourth message; if it is determined that the verification waiting time of the fourth message is less than the second valid cache remaining time, determining that the first message and the fourth message are to be verified.

[0009] Optionally, obtaining the verification waiting time of the fourth message includes: if it is determined that the fourth message meets the second preset filtering conditions, detecting whether the second target field belongs to the preset field, and if the detection result indicates that the second target field belongs to the preset field, obtaining the verification waiting time of the fourth message.

[0010] Optionally, the above method further includes: deleting the first message from the target storage location if it is determined that the verification wait time of the fourth message is greater than the remaining time of the second valid cache.

[0011] Optionally, the above method further includes: deleting the first message from the target storage location if the detection result indicates that the first target field information in the first message does not belong to a preset field, wherein the target storage location is used to point to the message verification operation.

[0012] Optionally, before obtaining the first message, the method further includes: obtaining the second message and the third message from the first queue; if the second message meets the first preset filtering condition and the third message meets the second preset filtering condition, storing the second message and the third message in the target storage location, and adding the message identifier corresponding to the second message and the message identifier corresponding to the third message to the second queue; if the addition time of the message identifier in the second queue meets the first preset condition, performing message verification on the second message and the third message that meet the first preset condition; if the message verification result meets the preset verification condition, determining that the second message and the third message have passed the message verification.

[0013] Optionally, the above method further includes: deleting messages that meet the second preset condition from the target storage location when the remaining effective cache duration of messages in the target storage location is detected to meet the second preset condition.

[0014] Optionally, the above method further includes: deleting the first message and the third message when the detection result indicates that the first target field information in the first message does not belong to a preset field, and when the third message meets the message removal conditions.

[0015] According to a second aspect of the present disclosure, a message processing apparatus is also provided, comprising: a first acquisition module configured to acquire a first message, wherein the first message carries at least first target field information generated after a message update is triggered by the system where the second message is located; a detection module configured to, when determining that the first message meets a first preset filtering condition, detect whether the first target field information belongs to a preset field and obtain a detection result, wherein the preset field is a field used to indicate message verification; and a first verification module configured to, when the detection result indicates that the first target field information in the first message belongs to the preset field, and when the third message does not meet the message rejection condition, perform message verification between the first message and the third message; wherein the first message and the second message come from the same system, the third message comes from another system, and the second message and the third message have been verified in a historical period.

[0016] Optionally, the first verification module includes: a first acquisition unit configured to acquire the verification waiting time of the first message when the detection result indicates that the first target field information in the first message belongs to a preset field; a second acquisition unit configured to acquire the remaining effective cache time of the third message; a first determination unit configured to determine that the third message does not meet the message removal condition when the verification waiting time is less than the remaining effective cache time; and a second determination unit configured to count down the verification waiting time, determine the first moment corresponding to the end of the countdown, and perform message verification between the first message and the third message at the first moment.

[0017] Optionally, the above apparatus further includes: a first determining module, configured to determine that the third message meets the message removal condition and remove the third message from the target storage location if the verification waiting time is greater than the remaining time of the first effective cache, wherein the target storage location is used to point to the message verification operation.

[0018] Optionally, the above apparatus further includes: a second determining module configured to determine the second valid cache remaining time of the first message after removing the third message from the target storage location; a second obtaining module configured to obtain the verification waiting time of the fourth message if a fourth message from another system is detected within the second valid cache remaining time, wherein the fourth message carries at least the second target field information generated after the other system triggers a message update; and a third determining module configured to determine that the first message and the fourth message are to be verified if the verification waiting time of the fourth message is determined to be less than the second valid cache remaining time.

[0019] Optionally, the second acquisition module includes: a third determining unit, configured to, when determining that the fourth message meets the second preset filtering conditions, detect whether the second target field belongs to a preset field, and, when the detection result indicates that the second target field belongs to the preset field, acquire the verification waiting time of the fourth message.

[0020] Optionally, the above apparatus further includes: a first deletion module configured to delete the first message from the target storage location if it is determined that the verification wait time of the fourth message is greater than the remaining time of the second valid cache.

[0021] Optionally, the above device further includes: a second deletion module, configured to delete the first message from the target storage location when the detection result indicates that the first target field information in the first message does not belong to a preset field, the target storage location being used to point to the message verification operation.

[0022] Optionally, the above apparatus further includes: a third acquisition module, configured to acquire a second message and a third message from a first queue before acquiring the first message; a storage module, configured to store the second message and the third message in a target storage location and add the message identifier corresponding to the second message and the message identifier corresponding to the third message to the second queue when the second message meets the first preset filtering condition and the third message meets the second preset filtering condition; a second verification module, configured to perform message verification on the second message and the third message that meet the first preset condition when the addition time of the message identifier of the second queue is detected; and a third verification module, configured to determine that the second message and the third message have passed the message verification when the message verification result meets the preset verification condition.

[0023] Optionally, the above device further includes: a third deletion module, configured to delete messages that meet the second preset condition from the target storage location when the remaining effective cache time of messages in the target storage location is detected to meet the second preset condition.

[0024] Optionally, the above-mentioned device further includes: a fourth deletion module, configured to delete the first message and the third message when the detection result indicates that the first target field information in the first message does not belong to a preset field, and when the third message meets the message removal conditions.

[0025] According to a third aspect of the present disclosure, a server is also provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement any message processing method.

[0026] According to a fourth aspect of the present disclosure, a computer-readable storage medium is also provided, which, when the instructions in the computer-readable storage medium are executed by a processor of a server, enables the server to perform any message processing method.

[0027] According to a fifth aspect of the present disclosure, a computer program product is also provided, including a computer program / instructions, which, when executed by a processor, implement any message processing method.

[0028] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0029] The technical solution provided by the embodiments of this disclosure obtains a first message, and if it is determined that the first message meets a first preset filtering condition, it detects whether the first target field carried by the first message belongs to a preset change field that needs to be focused on. Only if the first target field belongs to a change field that needs to be focused on, and the third message from the other system does not meet the rejection condition, is the first message and the third message checked. By checking only the change messages that need to be focused on in this way, the false alarm rate of the check is reduced, and the accuracy of the check results is improved. Furthermore, unlike traditional full-message check, this disclosure reduces the workload of check and improves the efficiency of message check through selective message check.

[0030] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0032] Figure 1 This is a flowchart illustrating a message processing method according to an exemplary embodiment.

[0033] Figure 2This is a schematic diagram illustrating a message processing flow according to an exemplary embodiment.

[0034] Figure 3 This is a schematic diagram illustrating a process for verifying messages based on a filter script, according to an exemplary embodiment.

[0035] Figure 4 This is a message processing flowchart illustrated according to an exemplary embodiment.

[0036] Figure 5 This is a schematic diagram of the structure of a message processing apparatus according to an exemplary embodiment.

[0037] Figure 6 This is a schematic diagram of the structure of a server according to an exemplary embodiment. Detailed Implementation

[0038] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0039] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0040] To facilitate a better understanding of the embodiments of this application by those skilled in the art, the technical terms or some nouns that may be involved in the embodiments of this application are explained as follows:

[0041] binlog: is a binary log maintained by the MySQL server layer. It is mainly used to record SQL statements that update or potentially update MySQL data, and can be saved to disk in the form of transactions.

[0042] Figure 1 This is a flowchart illustrating a message processing method according to an exemplary embodiment, such as... Figure 1 As shown, this message processing method can be used in a reconciliation server, and the method includes the following steps:

[0043] In step S11, a first message is obtained, wherein the first message carries at least the first target field information generated after the system where the second message is located triggers a message update;

[0044] In step S12, if it is determined that the first message meets the first preset filtering condition, it is detected whether the first target field information belongs to the preset field to obtain the detection result. The preset field is a field used to indicate message verification.

[0045] In step S13, if the detection result indicates that the first target field information in the first message belongs to a preset field, and if the third message does not meet the message removal conditions, the first message and the third message are checked; wherein the first message and the second message come from the same system, the third message comes from another system, and the second message and the third message have been checked in a historical period.

[0046] It should be noted that the aforementioned preset fields are the change fields that need to be monitored. In this message processing method, by obtaining the first message and determining that the first message meets the first preset filtering conditions, it checks whether the first target field carried by the first message belongs to the preset change fields that need to be monitored. If the first target field belongs to the change fields that need to be monitored, and the third message from the other system does not meet the rejection conditions, the first message and the third message are checked. By checking only the change messages that need to be monitored in this way, not only is the false alarm rate of the check reduced, but the accuracy of the check results is also improved. In addition, unlike the traditional full message check, this disclosure reduces the workload of the check and improves the efficiency of message check by selectively checking messages.

[0047] For example, two systems, A and B, are reconciling accounts. Suppose that after 10 minutes, the reconciliation timeout for both systems A and B is reached (i.e., both systems have a 10-minute reconciliation timeout). Two binlog messages are retrieved and reconciled successfully. Therefore, these two messages will automatically expire in the cache after one hour, and the reconciliation process should end. However, system A may update the data field in this record for other reasons, generating a new binlog message. This new binlog message also passes the filtering rules and successfully participates in the reconciliation. Since system B's message has already been reconciled with system A and its reconciliation timeout has expired, the reconciliation will fail. Therefore, this binlog message can be further verified based on the changed field to determine whether to discard the binlog message sent by system A.

[0048] It should be noted that the aforementioned first preset filtering condition includes, but is not limited to, a filtering script. This filtering script is configured with preset message types and preset states. When filtering the first message based on the first preset filtering condition, it can check whether the first type and first state of the first message are the same as the preset type and preset state, respectively. For example, if the preset type (e.g., standard_type) configured in the filtering script is 'a', the preset state (e.g., standard_state) is '1', the first type (e.g., first_typ) of the first message is 'b', and the first state (e.g., first_state) is '1', then since the first type of the first message does not match the preset type in the filtering script, the first message is determined to fail verification.

[0049] It is worth noting that when verifying the second and third messages in the historical time period, it is also necessary to filter them through their respective filtering scripts. After the filtering scripts have passed the screening, further message verification can be carried out.

[0050] For example, suppose system A and system B are performing real-time verification, such as Figure 2 As shown, the left side represents system A, and the right side represents system B. Reconciliation can be performed based on the following steps:

[0051] 1. First, listen for binlog messages from system A and system B and send them to the MQ queue;

[0052] 2. After retrieving a message from the MQ, store the message in the cache and simultaneously send an index ID to the delayed queue;

[0053] 3. Listen for messages in the delayed queue and begin verification;

[0054] 4. Messages that have been successfully verified are automatically cleared from the cache after they expire. In step 2, the retrieved message is subject to simple filtering based on the filtering script. If it passes the filter, the verification process continues; if it fails, the message is discarded.

[0055] Figure 3 In this application embodiment, an optional flowchart of filtering based on a filtering script is shown, as follows: Figure 3 As shown, the process mainly includes: parsing the MQ queue to obtain the parsed messages, then filtering them based on a filtering script; messages that fail the filter are discarded, while those that pass are processed further (e.g., matching with changed fields). It should be noted that the first and second messages can be validated based on the same preset filtering rules, or they can be validated based on different preset filtering rules.

[0056] For example, the filtering rules for system A can be:

[0057] type_p='1'&&state_c='2';

[0058] The filtering rules for system B can be:

[0059] state_t = '2';

[0060] At this point, if a binlog message arrives from system A and system B respectively, it can be filtered according to the corresponding filtering rules of system A and system B. After passing the filter, the message is saved in the cache, and the cache expiration time can be set to 1 hour.

[0061] In some embodiments of this application, when the detection result indicates that the first target field information in the first message belongs to a preset field, and when the third message does not meet the message removal condition, message verification between the first message and the third message can be implemented in the following way: Specifically, when the detection result indicates that the first target field information in the first message belongs to a preset field, the verification waiting time of the first message is obtained; the remaining effective cache time of the third message is obtained; if the verification waiting time is less than the remaining effective cache time, it is determined that the third message does not meet the message removal condition; a countdown is performed on the verification waiting time, and the first moment corresponding to the end of the countdown is determined, at which moment the first message and the third message are verified. For example, if the first message participates in the verification at the 10th minute (i.e., the verification waiting time is 10 minutes), and if the remaining effective cache time of the third message is 12 minutes, then the third message will not expire after the verification waiting time ends, and the first message and the third message are verified.

[0062] By using the above methods, it can be ensured that the first message and the third message are checked within the valid verification period, and no valid first message or third message will be missed, thereby avoiding reconciliation errors. It can also ensure that all valid messages carrying fields that need attention participate in the verification, and at the same time, it can also avoid false alarms caused by invalid messages that are mistakenly triggered by the system participating in the message verification.

[0063] Understandably, if the verification wait time exceeds the remaining time of the first valid cache, the third message is determined to meet the message eviction criteria and is removed from the target storage location, which is used to point to the message verification operation. For example, if the first message needs to be verified in 10 minutes, but the third message only has 6 minutes of cache time left, then when the 10-minute mark arrives, the third message has expired and is therefore discarded. By ensuring the third message meets the eviction criteria, the real-time nature of the verification is guaranteed, and invalid third messages are prevented from participating in the message verification process.

[0064] In some embodiments of this application, after removing the third message from the target storage location, the remaining second valid cache duration of the first message can be determined. If a fourth message from another system is detected within the remaining second valid cache duration, wherein the fourth message carries at least the second target field information generated after the other system triggers a message update, the verification waiting time of the fourth message is obtained. If it is determined that the verification waiting time of the fourth message is less than the remaining second valid cache duration, the first message and the fourth message are verified. It should be noted that after the third message expires (is deleted), the first message may not have participated in the verification yet. Therefore, it is possible to wait for another system to trigger a new message (the fourth message) and determine whether the first message can be verified with the fourth message. If verification is possible, the first message and the fourth message are verified. The above method can ensure that the first message that originally needs attention will not be missed, avoid verification errors caused by missing valid messages, and prevent inaccurate verification results and high false alarm rates.

[0065] In some embodiments of this application, the verification waiting time for the fourth message can be obtained through the following steps: If the fourth message meets the second preset filtering conditions, it is detected whether the second target field belongs to a preset field. If the detection result indicates that the second target field belongs to a preset field, the verification waiting time for the fourth message is obtained. It should be noted that the aforementioned second preset filtering conditions include, but are not limited to, the filtering script corresponding to the fourth message. Similarly, the filtering script includes a preset type and a preset state. The aforementioned preset field is the change field that needs to be monitored.

[0066] Obtaining the fourth message in the above manner ensures that the obtained fourth message is a valid message that has been filtered by the second preset filtering conditions and the change fields that need to be monitored. This avoids messages that have not been filtered by the second preset filtering conditions, or messages that have been filtered by the second preset filtering conditions but whose updated fields do not belong to the change fields that need to be monitored, being used for message verification and causing message verification errors.

[0067] For example, the filtering rule for system A is: state_c == '2';

[0068] The filtering rule for system B is: state_t == '2';

[0069] The current verification field for System A is: field_m, which represents the consumption limit;

[0070] The current verification field for System B is: field_tm, which represents the interaction limit;

[0071] Assume that the verification time between system A and system B is 10 minutes, and the caching time is 1 hour.

[0072] At this point, a message is received from system A with id=5, state_c=2, field_m=10, and a message is received from system B with id=5, state_t=2, field_tm=10. Both messages pass the filter and are successfully verified. One hour later, system A updates its data for other reasons, triggering an update still. The updated message is for the field field_data, which represents the date.

[0073] Suppose the system obtains the following changed fields: field_cl, which represents the recipient, and field_m, which represents the consumed quota. Since field_data does not match either the changed fields field_cl or field_m, it means that the message updated this time is not a message that needs attention. Therefore, the updated message is discarded and will not be included in the next verification.

[0074] Understandably, if the verification wait time for the fourth message is determined to be greater than the remaining time of the second valid cache, the first message is deleted from the target storage location. For example, if the fourth message needs to be verified in 10 minutes, but the cache time for the first message is only 6 minutes, then the first message will have expired when the 10-minute mark arrives, and in this case, the first message can be discarded.

[0075] In some embodiments of this application, if the detection result indicates that the first target field information in the first message does not belong to a preset field, the first message is deleted from the target storage location, which is used to point to the message verification operation. That is, after the system triggers an update to generate a new first message, if the updated field in the first message is a change field that does not need to be concerned, the first message can be directly deleted.

[0076] In some embodiments of this application, before obtaining the first message, the method further includes: obtaining a second message and a third message from a first queue; if the second message meets a first preset filtering condition and the third message meets a second preset filtering condition, storing the second message and the third message in a target storage location, and adding the message identifier corresponding to the second message and the message identifier corresponding to the third message to a second queue; if the addition time of the message identifier in the second queue is detected to meet a first preset condition, performing message verification on the second message and the third message that meet the first preset condition; if the message verification result meets a preset verification condition, determining that the second message and the third message have passed the message verification.

[0077] For example, after retrieving the second and third messages from the message queue, if the second message meets the first preset filtering condition and the third message meets the second preset filtering condition, the second and third messages are stored in the cache area, and their identifiers are added to the delay queue. After the verification time expires, the second and third messages are verified.

[0078] Understandably, if the remaining valid cache time of a message in the target storage location meets the second preset condition, the message that meets the second preset condition will be deleted from the target storage location. That is, if the remaining valid cache time of a message is zero (the message expires), the message will be deleted from the cache.

[0079] In some embodiments of this application: when the detection result indicates that the first target field information in the first message does not belong to a preset field, and when the third message meets the message removal conditions, message deletion is performed on the first message and the third message.

[0080] In other words, if the field updated in the first message does not belong to the field that needs attention, the first message is deleted. And if the remaining effective cache duration of the third message is zero, the third message is deleted. This is to prevent invalid messages from being used for message verification, causing message verification errors and affecting the normal verification process.

[0081] Figure 4 This is a message processing flowchart according to an exemplary embodiment, such as Figure 4 As shown, the process includes:

[0082] Messages are retrieved from the message queue, parsed, and initially validated using a filtering script. Messages that fail the initial validation are discarded. If the initial validation passes, the changed fields are retrieved from the management end. The message that passed the initial validation is matched against the changed fields. If no changes have occurred (i.e., the fields updated in the message are not among the fields requiring special attention), the message is discarded. If changes have occurred (i.e., the fields updated in the message are among the fields requiring special attention), the verification process continues.

[0083] Figure 5 This is a message processing apparatus according to an exemplary embodiment, such as Figure 5 As shown, the message processing device includes:

[0084] The first acquisition module 50 is configured to acquire a first message, wherein the first message carries at least the first target field information generated after the system where the second message is located triggers a message update;

[0085] The detection module 52 is configured to detect whether the first target field information belongs to a preset field when it is determined that the first message meets the first preset filtering conditions, and obtain the detection result, wherein the preset field is a field used to indicate message verification;

[0086] The first verification module 54 is configured to perform message verification on the first message and the third message when the detection result indicates that the first target field information in the first message belongs to a preset field, and when the third message does not meet the message removal conditions; wherein the first message and the second message come from the same system, the third message comes from another system, and the second message and the third message have been verified in a historical period.

[0087] In this message processing device, a first acquisition module 50 is configured to acquire a first message, wherein the first message carries at least the first target field information generated after the system where the second message is located triggers a message update; a detection module 52 is configured to, when determining that the first message meets the first preset filtering conditions, detect whether the first target field information belongs to a preset field and obtain a detection result, wherein the preset field is a field used to indicate message verification; a first verification module 54 is configured to, when the detection result indicates that the first target field information in the first message belongs to the preset field, and when the third message does not meet the message rejection conditions, perform message verification between the first message and the third message; wherein the first message and the second message come from the same system, the third message comes from another system, and the second message and the third message have already been verified in a historical period, by verifying only the change messages that need attention in the above manner, not only is the false alarm rate of verification reduced, but the accuracy of the verification results is also improved. In addition, unlike the traditional full message verification, this disclosure reduces the verification workload and improves the efficiency of message verification by selective message verification.

[0088] In some embodiments of this application, the first verification module includes: a first acquisition unit configured to acquire the verification waiting time of the first message when the detection result indicates that the first target field information in the first message belongs to a preset field; a second acquisition unit configured to acquire the remaining effective cache time of the third message; a first determination unit configured to determine that the third message does not meet the message removal condition when the verification waiting time is less than the remaining effective cache time; and a second determination unit configured to count down the verification waiting time, determine the first moment corresponding to the end of the countdown, and perform message verification between the first message and the third message at the first moment.

[0089] In an exemplary embodiment of this application, the above-mentioned apparatus further includes: a first determining module, configured to determine that the third message meets the message removal condition and remove the third message from the target storage location when the verification waiting time is greater than the remaining time of the first effective cache, wherein the target storage location is used to point to the message verification operation.

[0090] In some optional embodiments of this application, the above-described apparatus further includes: a second determining module configured to determine the second valid cache remaining duration of the first message after removing the third message from the target storage location; a second obtaining module configured to obtain the verification waiting duration of the fourth message if a fourth message from another system is detected within the second valid cache remaining duration, wherein the fourth message carries at least the second target field information generated after the other system triggers a message update; and a third determining module configured to determine that the first message and the fourth message are to be verified if the verification waiting duration of the fourth message is determined to be less than the second valid cache remaining duration.

[0091] In some optional embodiments of this application, the second acquisition module includes: a third determining unit, configured to detect whether the second target field belongs to a preset field when it is determined that the fourth message meets the second preset filtering conditions, and to acquire the verification waiting time of the fourth message when the detection result indicates that the second target field belongs to the preset field.

[0092] In some embodiments of this application, the above-described apparatus further includes: a first deletion module, configured to delete the first message from the target storage location if it is determined that the verification wait time of the fourth message is greater than the remaining time of the second valid cache.

[0093] In an exemplary embodiment of this application, the above-mentioned apparatus further includes: a second deletion module, configured to delete the first message from a target storage location when the detection result indicates that the first target field information in the first message does not belong to a preset field, the target storage location being used to point to a message verification operation.

[0094] In some optional embodiments of this application, the above-mentioned apparatus further includes: a third acquisition module, configured to acquire a second message and a third message from a first queue before acquiring the first message; a storage module, configured to store the second message and the third message in a target storage location and add the message identifier corresponding to the second message and the message identifier corresponding to the third message to the second queue when the second message meets the first preset filtering condition and the third message meets the second preset filtering condition; a second verification module, configured to perform message verification on the second message and the third message that meet the first preset condition when the addition time of the message identifier of the second queue is detected; and a third verification module, configured to determine that the second message and the third message have passed the message verification when the message verification result meets the preset verification condition.

[0095] In some embodiments of this application, the above-described apparatus further includes: a third deletion module, configured to delete messages that meet the second preset condition from the target storage location when the remaining effective cache duration of messages in the target storage location is detected to meet the second preset condition.

[0096] In an exemplary embodiment of this application, the above-mentioned apparatus further includes: a fourth deletion module, configured to delete the first message and the third message when the detection result indicates that the first target field information in the first message does not belong to a preset field, and when the third message meets the message removal conditions.

[0097] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0098] Figure 6 This is a server illustrated according to an exemplary embodiment, such as Figure 6 As shown, the server includes: a processor 01; and a memory 02 for storing executable instructions of the processor 01; wherein the processor 01 is configured to execute instructions to implement any message processing method.

[0099] In an exemplary embodiment, a computer-readable storage medium is also provided, which, when the instructions in the computer-readable storage medium are executed by the processor of the server, enables the server to perform any message processing method.

[0100] In an exemplary embodiment, a computer program product is also provided, including a computer program / instructions that, when executed by a processor, implement any message processing method.

[0101] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0102] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A message processing method, characterized in that, include: Obtain a first message, wherein the first message carries at least the first target field information generated after the system where the second message is located triggers a message update; If the first message meets the first preset filtering conditions, the system detects whether the first target field information belongs to a preset field and obtains a detection result. The preset field is a field used to indicate message verification. When the detection result indicates that the first target field information in the first message belongs to the preset field, and when the third message does not meet the message removal condition, a message verification is performed between the first message and the third message, including: when the detection result indicates that the first target field information in the first message belongs to the preset field, obtaining the verification waiting time of the first message; obtaining the remaining effective cache time of the third message; when the verification waiting time is less than the remaining effective cache time, determining that the third message does not meet the message removal condition; counting down the verification waiting time, determining the first moment corresponding to the end of the countdown, and performing a message verification between the first message and the third message at the first moment; The first and second messages come from the same system, while the third message comes from another system, and the second and third messages have been verified in a historical time period.

2. The method according to claim 1, characterized in that, The method further includes: If the verification wait time is greater than the remaining time of the first valid cache, then the third message is determined to meet the message eviction condition, and the third message is removed from the target storage location, which is used to point to the message verification operation.

3. The method according to claim 2, characterized in that, After removing the third message from the target storage location, the method further includes: Determine the remaining duration of the second valid cache for the first message; If a fourth message from the other system is detected within the remaining time of the second valid cache, wherein the fourth message carries at least the second target field information generated after the other system triggers a message update, the verification waiting time of the fourth message is obtained; If the verification waiting time of the fourth message is determined to be less than the remaining time of the second effective cache, the first message and the fourth message are to be verified.

4. The method according to claim 3, characterized in that, The verification waiting time for obtaining the fourth message includes: If the fourth message meets the second preset filtering conditions, it is detected whether the second target field belongs to the preset field. If the detection result indicates that the second target field belongs to the preset field, the verification waiting time of the fourth message is obtained.

5. The method according to claim 3, characterized in that, The method further includes: If it is determined that the verification wait time of the fourth message is greater than the remaining time of the second valid cache, the first message is deleted from the target storage location.

6. The method according to claim 1, characterized in that, The method further includes: If the detection result indicates that the first target field information in the first message does not belong to the preset field, the first message is deleted from the target storage location, which is used to point to the message verification operation.

7. The method according to any one of claims 1 to 6, characterized in that, Before obtaining the first message, the method further includes: Retrieve the second and third messages from the first queue; If the second message satisfies the first preset filtering condition and the third message satisfies the second preset filtering condition, the second message and the third message are stored in the target storage location, and the message identifier corresponding to the second message and the message identifier corresponding to the third message are added to the second queue. If the addition time of the message identifier of the second queue meets the first preset condition, the second message and the third message that meet the first preset condition are checked. If the message verification results meet the preset verification conditions, it is determined that the second message and the third message have passed the message verification.

8. The method according to any one of claims 1 to 6, characterized in that, The method further includes: If the remaining effective cache duration of a message in the target storage location meets a second preset condition, the message that meets the second preset condition will be deleted from the target storage location.

9. The method according to any one of claims 1 to 6, characterized in that, The method further includes: If the detection result indicates that the first target field information in the first message does not belong to the preset field, and if the third message meets the message removal conditions, then the first message and the third message are deleted.

10. A message processing device, characterized in that, include: The first acquisition module is configured to acquire a first message, wherein the first message carries at least the first target field information generated after the system where the second message is located triggers a message update; The detection module is configured to detect whether the first target field information belongs to a preset field when it is determined that the first message meets the first preset filtering conditions, and obtain a detection result, wherein the preset field is a field used to indicate message verification; The first verification module is configured to perform message verification between the first message and the third message when the detection result indicates that the first target field information in the first message belongs to the preset field, and when the third message does not meet the message removal conditions; wherein the first message and the second message come from the same system, the third message comes from another system, and the second message and the third message have been verified in a historical period. The first verification module includes: a first acquisition unit configured to acquire the verification waiting time of the first message when the detection result indicates that the first target field information in the first message belongs to the preset field; a second acquisition unit configured to acquire the first valid cache remaining time of the third message; a first determination unit configured to determine that the third message does not meet the message removal condition when the verification waiting time is less than the first valid cache remaining time; and a second determination unit configured to count down the verification waiting time, determine the first moment corresponding to the end of the countdown, and perform message verification between the first message and the third message at the first moment.

11. The apparatus according to claim 10, characterized in that, The device further includes: The first determining module is configured to determine that the third message meets the message removal condition if the verification waiting time is greater than the remaining time of the first effective cache, and remove the third message from the target storage location, where the target storage location is used to point to the message verification operation.

12. The apparatus according to claim 11, characterized in that, The device further includes: The second determining module is configured to determine the second valid cache remaining duration of the first message after removing the third message from the target storage location; The second acquisition module is configured to acquire the verification waiting time of the fourth message if a fourth message from the other system is detected within the remaining time of the second valid cache, wherein the fourth message carries at least the second target field information generated after the other system triggers a message update; The third determining module is configured to determine that the first message and the fourth message should be checked if the verification waiting time of the fourth message is less than the remaining time of the second effective cache.

13. The apparatus according to claim 12, characterized in that, The second acquisition module includes: The third determining unit is configured to, when determining that the fourth message meets the second preset filtering conditions, detect whether the second target field belongs to the preset field, and if the detection result indicates that the second target field belongs to the preset field, obtain the verification waiting time of the fourth message.

14. The apparatus according to claim 12, characterized in that, The device further includes: The first deletion module is configured to delete the first message from the target storage location if it is determined that the verification wait time of the fourth message is greater than the remaining time of the second valid cache.

15. The apparatus according to claim 10, characterized in that, The device further includes: The second deletion module is configured to delete the first message from the target storage location when the detection result indicates that the first target field information in the first message does not belong to the preset field, and the target storage location is used to point to the message verification operation.

16. The apparatus according to any one of claims 10 to 15, characterized in that, The device further includes: The third acquisition module is configured to acquire the second and third messages from the first queue before acquiring the first message; The storage module is configured to, when it is detected that the second message satisfies the first preset filtering condition and the third message satisfies the second preset filtering condition, store the second message and the third message in the target storage location, and add the message identifier corresponding to the second message and the message identifier corresponding to the third message to the second queue; The second verification module is configured to verify the second message and the third message that meet the first preset condition when the message identifier of the second queue is added. The third verification module is configured to determine that the second message and the third message have passed the message verification if the message verification result meets the preset verification conditions.

17. The apparatus according to any one of claims 10 to 15, characterized in that, The device further includes: The third deletion module is configured to delete messages that meet the second preset condition from the target storage location when the remaining effective cache time of the message in the target storage location is detected to meet the second preset condition.

18. The apparatus according to any one of claims 10 to 15, characterized in that, The device further includes: The fourth deletion module is configured to delete the first message and the third message when the detection result indicates that the first target field information in the first message does not belong to the preset field, and when the third message meets the message removal conditions.

19. A server, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the message processing method as described in any one of claims 1 to 9.

20. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of a server, enable the server to perform the message processing method as described in any one of claims 1 to 9.

21. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the message processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data processing method and device, blockchain service system and storage medium

    CN111475309A

  • Interface and system for updating isolated repositories

    US20220075877A1