A message query method and message receiving terminal

By maintaining real-time recording and statistical time period records on the message receiving end and determining the pending messages, the problem of high maintenance costs on the message receiving end in the prior art is solved, and the final consistency and cost reduction of data are achieved.

CN111786750BActive Publication Date: 2025-04-29WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010622026.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2025-04-29
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

The prior art has high maintenance costs when ensuring the final consistency of data at the message receiving end, especially in scenarios where timeliness is not high.

Method used

Maintenance costs are reduced by maintaining records of two natures: real-time recording and statistical time period state change recordings, using these records to determine the pending messages.

Benefits of technology

It ensures the final consistency of data under the conditions of low timeliness requirements, and reduces the maintenance cost of the message receiver.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111786750B_ABST
    Figure CN111786750B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to the field of financial technology (Fintech), and discloses a message query method and a message receiving end, wherein the message receiving end receives a query request sent by a message processing end; the query request is used to obtain a pending message from the message receiving end; the message receiving end determines the pending message from a first record and a second record; the first record is used to record in real time the message received by the message receiving end from the message sending end; the second record is used to record the message sent by the message sending end whose state changes within a statistical period; the message receiving end sends the pending message to the message processing end. The scheme makes the message sent by the message sending end into a record of two properties, namely the first record and the second record, so that for the pending message required by the query request, according to the state of the pending message in the records of the two properties, the determined pending message is fed back to the message processing end, thereby ensuring the final consistency of the data when the timeliness requirement is not high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a message query method and a message receiving end. Background Art

[0002] With the development of computer technology, more and more technologies (such as big data, cloud computing or blockchain) are being applied in the financial field. Traditional finance is gradually transforming into financial technology, and big data technology is no exception. However, due to the security and real-time requirements of the financial and payment industries, higher requirements are also placed on big data technology.

[0003] At present, in the process of sending and receiving messages, the ACK mechanism is mainly used to ensure that the message can be accurately transmitted from the message sender to the message receiver and successfully consumed by the message receiver. The ACK mechanism is a receipt mechanism. The message receiver sends an ACK packet to the message sender. The message sender uses the correct ACK packet to ensure that the message receiver successfully consumes the message it sent.

[0004] However, the above ACK mechanism has a certain implementation cost for the message receiver in some scenarios that only require the final consistency of data but do not require high timeliness. Summary of the invention

[0005] The embodiment of the present invention provides a message query method and a message receiving end, so as to achieve the goal of ensuring the final consistency of data at a lower cost of maintaining the message receiving end.

[0006] In the first aspect, an embodiment of the present invention provides a message query method, the method comprising: a message receiving end receives a query request sent by a message processing end; the query request is used to obtain a message to be processed from the message receiving end; the message receiving end determines the message to be processed from a first record and a second record; the first record is used to record in real time the message received by the message receiving end from the message sending end; the second record is used to record the message sent by the message sending end whose status changes within a statistical period; the message receiving end sends the message to be processed to the message processing end.

[0007] Based on this solution, after the message receiving end receives the query request, it determines the pending message corresponding to the query request from the local first record and the second record, and sends it to the message processing end. In this solution, the message sent by the message sending end is made into two types of records, one is stored by the message receiving end after receiving the message in real time, and the other is to store the messages from the message sending end in batches, so that the pending message required by the query request is fed back to the message processing end according to the status of the pending message in the two types of records, thereby ensuring the final consistency of the data when the timeliness requirement is not high.

[0008] In a possible implementation method, the message receiving end determines the message to be processed from the first record and the second record, including: if the first record and the second record both include messages with the same identifier, then the message with the identifier with the latest update time is determined as the message to be processed; and / or the message included only in the second record is determined as the message to be processed.

[0009] Based on this solution, since the first record is formed by the message receiving end storing the message after receiving it in real time, and the second record is the statistics of the messages sent by the message sending end within a certain statistical period, when querying the pending messages, for the message with the same identifier, if the message exists in both records of two natures, the message in the record with the latest update time will be used as the pending message; if the message is not stored by the message receiving end in time, the message in the second record will prevail. In this way, it is guaranteed that the pending messages queried are accurate.

[0010] In a possible implementation method, the second record is determined in the following manner: a first sending record and a second sending record are obtained from the message sending end; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; for messages with the same identifier, the messages whose status has changed are determined from the first sending record and the second sending record.

[0011] Based on this scheme, for the generation of the second record, by comparing the messages sent by the message sender before the first moment and the messages sent before the second moment, the messages actually generated by the message sender in the time interval from the first moment to the second moment can be determined, that is, when there are no abnormalities, the message receiving end will receive these messages in real time and record them in the local first record.

[0012] In a possible implementation method, the sending record of the message sending end is recorded in a hard deletion manner; the message whose status has changed is determined from the first sending record and the second sending record, including: determining the message deleted in the second sending record based on the first sending record and the second sending record; setting the deleted message to an invalid state in the second record; the invalid state is used to indicate a message that does not need to be processed.

[0013] Based on this scheme, if the sending record of the message sender is recorded using a hard deletion method, the first sending record and the second sending record are compared to find out the record that exists in the first sending record but not in the second sending record, and record this record in the second record. During the recording process, the record will be set to an invalid state.

[0014] In one possible implementation method, the sending record of the message sending end is recorded in a soft deletion manner; the message whose status has changed is determined from the first sending record and the second sending record, including: determining the message deleted in the second sending record based on the first sending record and the second sending record; setting the deleted message to a valid state in the second record; the valid state is used to indicate a message that needs to be processed.

[0015] Based on this scheme, if the sending record of the message sender is recorded in a soft deletion manner, by comparing the first sending record and the second sending record, the record that exists in the first sending record but not in the second sending record is found, and this record is recorded in the second record. During the recording process, the record will be set to a valid state.

[0016] In the second aspect, an embodiment of the present invention provides a message query method, the method comprising: a message sending end sends a message to a message receiving end, and records the message in a sending record; the sending record includes a message identifier and a message status; after receiving the message, the message receiving end records the message in a first record in real time; the message receiving end receives a query request sent by a message processing end; the query request is used to obtain a pending message from the message receiving end; the message receiving end determines the pending message from the first record and the second record, and sends the pending message to the message processing end; the second record records a message that the status of the message sending end has changed within a statistical period, as determined according to the sending record.

[0017] Based on this scheme, on the one hand, the message receiving end can record in real time the messages it receives from the message sending end, that is, the first record; on the other hand, the message receiving end can also form messages in which the status of the message sending end changes during the statistical period, that is, the second record. Therefore, when the message query end sends a query request to the message receiving end, the message receiving end can determine the message to be processed from the first record and the second record, thereby achieving the goal of final consistency of data under the condition that timeliness requirements are not high.

[0018] In one possible implementation method, the second record is generated in the following manner: the message sending end receives an acquisition request sent by the statistics end, and the acquisition request is used to periodically acquire the sending record; the message sending end records the sending record in a hard deletion manner or a soft deletion manner; the statistics end determines, for messages with the same identifier, messages whose status has changed from the first sending record and the second sending record, thereby generating the second record; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; the message receiving end determines the to-be-processed message from the first record and the second record, including: for a message with any identifier, if the message receiving end determines that both the first record and the second record contain the identifier, the message with the identifier with the latest update time is determined as the to-be-processed message; and / or the message included only in the second record is determined as the to-be-processed message.

[0019] Based on this scheme, the statistics end periodically obtains the sending record from the message sending end, wherein the message sending end records the sending record by hard deletion or soft deletion, so that the statistics end can determine the message whose status has changed from the first sending record and the second sending record and generate the second record; and, since the first record is formed by the message receiving end storing the message after receiving the message in real time, and the second record is a statistic of the messages sent by the message sending end within a certain statistical period, when querying the pending messages, for any identified message, if the message exists in both records, the message in the record with the latest update time will be used as the pending message; if the message is not stored by the message receiving end in time, the message in the second record will be used as the standard. In this way, the pending messages queried are guaranteed to be accurate.

[0020] In the third aspect, an embodiment of the present invention provides a message receiving end, which includes: a receiving unit, used to receive a query request sent by a message processing end; the query request is used to obtain a message to be processed from the message receiving end; a determination unit, used to determine the message to be processed from a first record and a second record; the first record is used to record in real time the message received by the message receiving end from the message sending end; the second record is used to record the message sent by the message sending end whose status changes within a statistical period; a sending unit, used to send the message to be processed to the message processing end.

[0021] Based on this solution, after the message receiving end receives the query request, it determines the pending message corresponding to the query request from the local first record and the second record, and sends it to the message processing end. In this solution, the message sent by the message sending end is made into two types of records, one is stored by the message receiving end after receiving the message in real time, and the other is to store the messages from the message sending end in batches, so that the pending message required by the query request is fed back to the message processing end according to the status of the pending message in the two types of records, thereby ensuring the final consistency of the data when the timeliness requirement is not high.

[0022] In one possible implementation method, the determination unit is specifically used to: if the first record and the second record both include messages with the same identifier, then determine the message with the identifier with the latest update time as the message to be processed; and / or determine the message included only in the second record as the message to be processed.

[0023] Based on this solution, since the first record is formed by the message receiving end storing the message after receiving it in real time, and the second record is the statistics of the messages sent by the message sending end within a certain statistical period, when querying the pending messages, for the message with the same identifier, if the message exists in both records of two natures, the message in the record with the latest update time will be used as the pending message; if the message is not stored by the message receiving end in time, the message in the second record will prevail. In this way, it is guaranteed that the pending messages queried are accurate.

[0024] In one possible implementation method, the determination unit is also used to: obtain a first sending record and a second sending record from the message sending end; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; for messages with the same identifier, determine the message whose status has changed from the first sending record and the second sending record.

[0025] Based on this scheme, for the generation of the second record, by comparing the messages sent by the message sender before the first moment and the messages sent before the second moment, the messages actually generated by the message sender in the time interval from the first moment to the second moment can be determined, that is, when there are no abnormalities, the message receiving end will receive these messages in real time and record them in the local first record.

[0026] In one possible implementation method, the sending record of the message sending end is recorded in a hard deletion manner; the determination unit is specifically used to: determine the message deleted in the second sending record based on the first sending record and the second sending record; set the deleted message to an invalid state in the second record; the invalid state is used to indicate a message that does not need to be processed.

[0027] Based on this scheme, if the sending record of the message sender is recorded using a hard deletion method, the first sending record and the second sending record are compared to find out the record that exists in the first sending record but not in the second sending record, and record this record in the second record. During the recording process, the record will be set to an invalid state.

[0028] In one possible implementation method, the sending record of the message sending end is recorded in a soft deletion manner; the determination unit is specifically used to: determine the message deleted in the second sending record based on the first sending record and the second sending record; set the deleted message to a valid state in the second record; the valid state is used to indicate a message that needs to be processed.

[0029] Based on this scheme, if the sending record of the message sender is recorded in a soft deletion manner, by comparing the first sending record and the second sending record, the record that exists in the first sending record but not in the second sending record is found, and this record is recorded in the second record. During the recording process, the record will be set to a valid state.

[0030] In a fourth aspect, an embodiment of the present invention provides a message query system, which includes a message sending end, a message receiving end and a message processing end; the message sending end is used to send a message to the message receiving end, and record the message in a sending record; the sending record includes a message identifier and a message status; after receiving the message, the message receiving end is used to record the message in a first record in real time; the message receiving end is also used to receive a query request sent by the message processing end; the query request is used to obtain a pending message from the message receiving end; the message receiving end is also used to determine the pending message from the first record and the second record, and send the pending message to the message processing end; the second record records a message that the status of the message sending end has changed during a statistical period, as determined according to the sending record.

[0031] Based on this scheme, on the one hand, the message receiving end can record in real time the messages it receives from the message sending end, that is, the first record; on the other hand, the message receiving end can also form messages in which the status of the message sending end changes during the statistical period, that is, the second record. Therefore, when the message query end sends a query request to the message receiving end, the message receiving end can determine the message to be processed from the first record and the second record, thereby achieving the goal of final consistency of data under the condition that timeliness requirements are not high.

[0032] In a possible implementation method, the system also includes a statistical end, and the message sending end is also used to receive an acquisition request sent by the statistical end, and the acquisition request is used to periodically acquire the sending record; the message sending end records the sending record in a hard deletion manner or a soft deletion manner; the statistical end is used to determine, for messages with the same identifier, messages whose status has changed from the first sending record and the second sending record, thereby generating the second record; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; the message receiving end is specifically used for messages with any identifier. If the message receiving end determines that the first record and the second record both contain the identifier, the message with the identifier with the latest update time is determined as the message to be processed; and / or the message included only in the second record is determined as the message to be processed.

[0033] Based on this scheme, the statistics end periodically obtains the sending record from the message sending end, wherein the message sending end records the sending record by hard deletion or soft deletion, so that the statistics end can determine the message whose status has changed from the first sending record and the second sending record and generate the second record; and, since the first record is formed by the message receiving end storing the message after receiving the message in real time, and the second record is a statistic of the messages sent by the message sending end within a certain statistical period, when querying the pending messages, for any identified message, if the message exists in both records, the message in the record with the latest update time will be used as the pending message; if the message is not stored by the message receiving end in time, the message in the second record will be used as the standard. In this way, the pending messages queried are guaranteed to be accurate.

[0034] In a fifth aspect, an embodiment of the present invention provides a computing device, including:

[0035] A memory for storing program instructions;

[0036] The processor is used to call the program instructions stored in the memory and execute the method described in any one of the first aspect and the second aspect according to the obtained program.

[0037] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method described in any one of the first aspect and the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0039] Figure 1 A possible system architecture diagram provided for an embodiment of the present invention;

[0040] Figure 2 Provide a message query method for an embodiment of the present invention;

[0041] Figure 3 A flow chart of a message query method provided by an embodiment of the present invention;

[0042] Figure 4 A message receiving terminal provided by an embodiment of the present invention;

[0043] Figure 5A message query system is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] like Figure 1 , which is a schematic diagram of a possible system architecture provided by an embodiment of the present invention, the system architecture includes a message sending end 110, a message receiving end 120 and a message processing end 130. Optionally, the system architecture also includes a statistics end 140, which can be an independent device or can be subordinate to the message sending end 110 (refer to Figure 1 ) is a statistical function deployed on the message sending end 110.

[0046] The message sending end 110 may be one device or multiple separate devices, and is used to generate a message and send the generated message to the message receiving end 120 .

[0047] The message receiving end 120 is a service cluster formed by one device or multiple devices, and is used to receive messages from the message sending end 110 and provide the message processing end 130 with the processing of the received messages.

[0048] The message processing end 130 is used to process the messages stored in the message receiving end 120 and feed back the processing results to the message sending end 110, so that the message sending end 110 can update the status of the messages with the same identifier.

[0049] based on Figure 1 The system architecture shown in the figure, the embodiment of the present invention provides a message query method. Figure 2 As shown, the method comprises the following steps:

[0050] Step 201: The message sending end sends a message to the message receiving end, and records the message in a sending record; the sending record includes a message identifier and a message status.

[0051] Step 202: After receiving the message, the message receiving end records the message in a first record in real time.

[0052] Step 203: the message processing end sends a query request to the message receiving end, wherein the query request is used to obtain the to-be-processed message from the message receiving end; correspondingly, the message receiving end receives the query request.

[0053] Step 204, the message receiving end determines the to-be-processed message from the first record and the second record; the second record records the message whose state changes during the statistical period determined by the message sending end according to the sending record.

[0054] Step 205: the message receiving end sends the message to be processed to the message processing end; correspondingly, the message processing end receives the message to be processed.

[0055] Based on this solution, for any message generated, the message sender only needs to send the message to the message receiver, without paying attention to whether the message is sent successfully. However, in this process, the message sender needs to record the sent message in the local database, that is, record the sent message in the sending record; ideally, the message receiver will receive and record any message sent from the message sender, that is, use the first record method to record the received message. However, due to various possible exceptions, the message receiver may not receive all the messages sent by the message sender, so that some messages may be missing in the record of the message receiver. By using the second The recording method can avoid the possibility of missing messages, wherein the second record is used to record the messages sent by the message sending end whose status has changed within the statistical period; when the message processing end needs to process the messages in the message receiving end, it will send a query request to the message receiving end. When the message receiving end receives the query request, for the pending message in the query request, the message receiving end will determine the pending message from the first record and the second record, and then send the pending message to the message processing end. In this scheme, the work efficiency of the message sending end is improved, the response of the message receiving end to the message processing end is guaranteed, and the final consistency of the data is guaranteed under the condition that the timeliness requirement is not high.

[0056] For example, if Bank A launches a car loan product, and customer B applies for a car loan at Bank A (offline) or Bank A's client (online), the bank's message sending end will generate an identifier for the event of customer B applying for a car loan, such as an order number, which corresponds to the car loan behavior that customer B applied for at the bank. By establishing an identifier, Bank A can manage the corresponding customers based on the identifier in the future.

[0057] In the above step 201, the message sending end sends a message to the message receiving end, and records the message in a sending record; the sending record includes the message identifier and the message status.

[0058] When the message sender of Bank A generates an order number corresponding to the car loan behavior of customer B, on the one hand, the message sender will record the order number in the local database, that is, record the order number in the sending record. In addition, because car loan products are usually complicated, the event of a customer applying for a car loan is only one of the intermediate processes. In the future, there will be other intermediate processes around customer B's car loan behavior, such as order review, first-term repayment, second-term repayment, etc. For these intermediate processes, the order number generated by customer B can be marked accordingly, so that A can track and manage customer B. Since customer B has only applied for a car loan to Bank A, it is also necessary to mark the status of customer B's order number in the sending record as "application"; on the other hand, the message sender will send the order number to the message receiver. In this process, the message sender does not need to care whether the message is successfully sent to the message receiver and continues to handle other things. This simplifies the ACK mechanism of the prior art, which requires setting a monitoring behavior at the message sending end to ensure that the message sending end must send the generated message to the message receiving end, and when the message fails to be successfully sent to the message receiving end, it will prompt another service to continuously scan out and resend these unsuccessfully sent messages. The embodiment of the present invention improves the efficiency of the message sending end in sending messages with respect to the mechanism of the message sending end.

[0059] In the above step 202, after receiving the message, the message receiving end records the message in the first record in real time.

[0060] In the specific implementation process, the following two situations may occur in the process of the message sender sending a message to the message receiver:

[0061] One possible situation is that the message receiving end can receive the message sent by the message sending end as expected, so the message receiving end will record the received message in the first record. As a specific implementation method, the first record may be an online table, that is, the message receiving end will maintain the received message in the online table;

[0062] One possible situation is that the message receiving end cannot receive the message sent by the message sending end as expected, which results in the message receiving end being unable to record all the sending records of the local database of the message sending end in the online table one by one, that is, some messages will be missing in the online table of the message receiving end. For example, in one day, the local sending records of the message sending end record 200 records in total, that is, the message sending end generates 200 messages, and the message sending end sends messages to the message receiving end. However, due to some anomalies, only 196 messages are recorded in the online table of the message receiving end, which means that in this day, for all the messages sent by the message sending end, the message receiving end did not receive 4 of them. The above reasons that cause the message receiving end to be unable to normally receive the messages sent by the message sending end may be:

[0063] 1. An exception occurs on the message sending end, resulting in the message not being sent as expected;

[0064] 2. An exception occurs on the message receiving end, which causes it to be unable to receive the message sent by the message sending end;

[0065] 3. Although the message receiving end can normally receive the message sent by the message sending end, the message receiving end cannot normally maintain the message in the online table, etc.

[0066] With regard to the possible inconsistency between the data in the online table in the message receiving end and the data in the sending record in the message sending end, when the timeliness requirement for data synchronization is not very high, an embodiment of the present invention proposes a batch compensation mechanism, that is, the newly added / updated / deleted records in a certain statistical period at the message sending end are sent in batches to the message receiving end, and logical processing is performed at the message receiving end to ensure the final consistency of the data.

[0067] In the above step 203, the message processing end sends a query request to the message receiving end, wherein the query request is used to obtain the to-be-processed message from the message receiving end; correspondingly, the message receiving end receives the query request.

[0068] When the message receiving end receives the query request, if there is a message to be processed in the local online table of the message receiving end, the message receiving end can directly feedback to the message processing end. However, it is also possible that there is no message to be processed in the online table, which generates a solution for step 204 of the embodiment of the present invention:

[0069] Step 204, the message receiving end determines the to-be-processed message from the first record and the second record; the second record records the message whose state changes during the statistical period determined by the message sending end according to the sending record.

[0070] Optionally, the second record is determined in the following manner: the message sending end receives an acquisition request sent by the statistical end, and the acquisition request is used to periodically obtain the sending record; the statistical end obtains a first sending record and a second sending record from the message sending end; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; for messages with the same identifier, the statistical end determines the message whose status has changed from the first sending record and the second sending record, thereby generating a second record.

[0071] As in the previous example, the statistical period is set to one day (24 hours) in the embodiment of the present invention. Of course, within the allowable timeliness range, the statistical period can also be set to other time lengths, and the embodiment of the present invention does not specifically limit this. The message sending end will send all messages generated on that day to the message receiving end, wherein each message carries the time information of the message generation, and the message sending end will also record all messages sent by itself in the local sending record; the message receiving end will actually record the messages received by itself on that day in the local online table; due to various possible exceptions, for the same day, the number of message records in the online table of the message receiving end is not greater than the number of message records in the sending record of the message sending end. For the message records that may be missing in the online table of the message receiving end, they can be revised by batch compensation:

[0072] For example, at the end of the day, around 23:59:59 every day, the statistics end will obtain the data of the message generation time of the day from the sending record of the message sender, and store the obtained data in a big data platform, such as Hive.

[0073] Specifically, the local sending record of the message sending end will always maintain all messages, including messages generated by newly generated order numbers and messages generated by some existing order numbers due to status changes. Therefore, the statistical end analyzes the sending records of the message sending end in every two consecutive days, and then obtains the change data of the message sending end in the latest day (in fact, the change data here is equivalent to all messages sent by the message sending end to the message receiving end in the latest day). These change data are the second records. As a specific implementation method, the second record can be a batch table, that is, the statistical end will maintain the change data of the message sending end on each day in the batch table. The process of generating a batch table can be implemented through the big data platform Hive. The generated batch table is stored in the message receiving end, so that the batch table will be used together with the online table of the message receiving end for the message query end to obtain the pending messages. For example, suppose Hive records the sending records of the message sender yesterday and today. By analyzing the sending records of the message sender in these two days, the statistics end can obtain the change data of the message sender on the latest day (here today), where the changed data includes newly added data, updated data, and deleted data. The sending record of yesterday is the first sending record, and the sending record of today is the second sending record.

[0074] For the message sending records of yesterday and today, the statistics end can determine the change data of today compared with yesterday by performing the following analysis:

[0075] For the same order number, if one or some order numbers are only in today's delivery records, and the order number(s) are not in yesterday's delivery records, then the order number(s) are newly added data today;

[0076] For the same order number, if one or some order numbers are in today's delivery record and yesterday's delivery record, and the status of the order number is updated in today's delivery record, then the order number is updated today;

[0077] The same order number is associated. If one or some order numbers are only in yesterday's delivery record, but the order number(s) are not in today's delivery record, the order number(s) will be deleted today.

[0078] Optionally, the sending record of the message sending end is recorded in a hard deletion manner; the message whose status has changed is determined from the first sending record and the second sending record, including: determining the message deleted in the second sending record based on the first sending record and the second sending record; setting the deleted message to an invalid state in the second record; the invalid state is used to indicate a message that does not need to be processed.

[0079] For example, the sending records for yesterday stored in Hive are shown in Table 1:

[0080] Table 1

[0081] Order Number Other fields 001 xxxx 002 xxxx

[0082] For another example, the sending records for today stored in Hive are shown in Table 2:

[0083] Table 2

[0084] Order Number Other fields 001 xxxx 003 xxxx

[0085] According to the data in Table 1 and Table 2, we can determine that today is different from yesterday: for order number "001", it is new data added today, for example, a new customer came to Bank A to apply for a car loan today; for order number "002", it is deleted data today, for example, a customer of Bank A has completely paid off his car loan at Bank A today; for order number "003", it is updated data today, for example, a customer of Bank A has paid off the first installment of his car loan at Bank A today.

[0086] When the sending record of the message sender is recorded in hard deletion mode, when the statistical end indicates that the data has changed today compared with yesterday, for the newly added data today, "IS_VALID (valid)" will be set to "YES"; for the deleted data today, "IS_VALID" will be set to "NO"; for the updated data today, "IS_VALID" will be set to "YES".

[0087] For example, for the data in Table 1 and Table 2 above, after being processed by the statistical end, the processing results can be shown in Table 3:

[0088] Table 3

[0089]

[0090]

[0091] According to the data in Table 3 above, it is possible to determine all the messages that the message receiving end should have received today. Since these messages all come from the sending records of the message sending end, the sending records are accurate and reliable data. Therefore, when the message receiving end receives the query request sent by the message processing end, it can at least respond based on the data in Table 3, thus ensuring the accuracy of the data.

[0092] Optionally, the sending record of the message sending end is recorded in a soft deletion manner; the message whose status has changed is determined from the first sending record and the second sending record, including: determining the message deleted in the second sending record based on the first sending record and the second sending record; setting the deleted message to a valid state in the second record; the valid state is used to indicate a message that needs to be processed.

[0093] For the data in Table 1 and Table 2, when the sending records of the message sender are recorded in soft deletion mode, when the statistical end indicates that the data has changed today compared with yesterday, for the newly added data today, "IS_VALID (valid)" will be set to "YES"; for the deleted data today, "IS_VALID" will be set to "YES"; for the updated data today, "IS_VALID" will be set to "YES".

[0094] For example, for the data in Table 1 and Table 2 above, after being processed by the statistical end, the processing results can be shown in Table 4:

[0095] Table 4

[0096] Order Number Other fields Delete label 001 xxxx YES 002 xxxx YES 003 xxxx YES

[0097] According to the data in Table 4 above, it is possible to determine all the messages that the message receiving end should have received today. Since these messages all come from the sending records of the message sending end, the sending records are accurate and reliable data. Therefore, when the message receiving end receives the query request sent by the message processing end, it can at least respond based on the data in Table 4, thereby ensuring the accuracy of the data.

[0098] In the above step 204, optionally, the message receiving end determines the message to be processed from the first record and the second record, including: if the first record and the second record both include messages with the same identifier, then the message with the identifier with the latest update time is determined as the message to be processed; and / or the message included only in the second record is determined as the message to be processed.

[0099] When the message receiving end receives the query request sent by the message processing end, the message receiving end will determine the message to be processed according to the following process, such as Figure 3As shown, it is a flow chart of a message query method provided by an embodiment of the present invention:

[0100] Step 301, query the online table and the batch table; for a message with a certain identifier (in the embodiment of the present invention, the identifier specifically refers to the order number), if it is determined that the message with the identifier exists in the online table but not in the batch table, then execute step 302; if it is determined that the message with the identifier exists in the batch table but not in the online table, then execute step 303; if it is determined that the message with the identifier exists in both the online table and the batch table, then execute step 304; if it is determined that the message with the identifier does not exist in both the online table and the batch table, then execute step 305;

[0101] Step 302, taking the message with the identifier in the online table as a message to be processed, and sending the message to be processed to the message processing end;

[0102] Step 303: Use the message with the identifier in the batch table as a message to be processed, and send the message to be processed to the message processing end;

[0103] Step 304, for the message with the identifier, compare its update time in the online table and the batch table. If its update time in the online table is the latest, determine the message with the identifier in the online table as a message to be processed, and send the message to be processed to the message processing end; if its update time in the online batch table is the latest, determine the message with the identifier in the batch table as a message to be processed, and send the message to be processed to the message processing end; if its update time in the online table and the batch table is the same, determine the message with the identifier in the batch table as a message to be processed, and send the message to be processed to the message processing end;

[0104] Step 305: the message receiving end feeds back "query failed" as the query result to the message processing end.

[0105] In the above step 205, the message receiving end sends the message to be processed to the message processing end; correspondingly, the message processing end receives the message to be processed.

[0106] Based on the same concept, the embodiment of the present invention also provides a message receiving terminal. Figure 4 As shown, the message receiving end includes:

[0107] The receiving unit 401 is used to receive a query request sent by the message processing end; the query request is used to obtain a message to be processed from the message receiving end;

[0108] The determination unit 402 is used to determine the to-be-processed message from a first record and a second record; the first record is used to record in real time the message received by the message receiving end from the message sending end; the second record is used to record the message sent by the message sending end whose state changes within the statistical period;

[0109] The sending unit 403 is used to send the message to be processed to the message processing end.

[0110] Further, for the device, the determination unit 402 is specifically used to: if the first record and the second record both include messages with the same identifier, then determine the message with the identifier with the latest update time as the message to be processed; and / or determine the message included only in the second record as the message to be processed.

[0111] Further, for the device, the determination unit 402 is also used to: obtain a first sending record and a second sending record from the message sending end; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; for messages with the same identifier, determine the message whose status has changed from the first sending record and the second sending record.

[0112] Furthermore, for the device, the sending record of the message sending end is recorded in a hard deletion manner; the determination unit 402 is specifically used to: determine the message deleted in the second sending record based on the first sending record and the second sending record; set the deleted message to an invalid state in the second record; the invalid state is used to indicate a message that does not need to be processed.

[0113] Furthermore, for the device, the sending record of the message sending end is recorded in a soft deletion manner; the determination unit 402 is specifically used to: determine the message deleted in the second sending record based on the first sending record and the second sending record; set the deleted message to a valid state in the second record; the valid state is used to indicate a message that needs to be processed.

[0114] Based on the same concept, the embodiment of the present invention also provides a message query system, such as Figure 5 As shown, the system includes a message sending end 501, a message receiving end 502 and a message processing end 503;

[0115] The message sending end 501 is used to send a message to the message receiving end 502 and record the message in a sending record; the sending record includes a message identifier and a message status;

[0116] After receiving the message, the message receiving end 502 is used to record the message in a first record in real time;

[0117] The message receiving end 502 is also used to receive a query request sent by the message processing end 503; the query request is used to obtain a message to be processed from the message receiving end 502;

[0118] The message receiving end 502 is also used to determine the pending message from the first record and the second record, and send the pending message to the message processing end 503; the second record records the message that the state of the message sending end 501 determined according to the sending record changes during the statistical period.

[0119] Furthermore, the system further includes a statistics terminal 504;

[0120] The message sending end 501 is also used to receive an acquisition request sent by the statistics end 504, and the acquisition request is used to periodically acquire the sending record; the message sending end 501 records the sending record in a hard deletion mode or a soft deletion mode;

[0121] The statistical terminal 504 is used to determine the message with the same identifier from the first sending record and the second sending record, thereby generating the second record; the first sending record records the message sent before the first moment; the second sending record records the message sent before the second moment; the second moment is later than the first moment;

[0122] The message receiving end 502 is specifically used for a message with any identifier. If the message receiving end 502 determines that both the first record and the second record contain the identifier, the message with the identifier with the latest update time is determined as the message to be processed; and / or the message included only in the second record is determined as the message to be processed. The embodiment of the present invention also provides a computing device, which can be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. The computing device may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0123] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present invention, the memory may be used to store program instructions of the message query method;

[0124] The processor is used to call the program instructions stored in the memory and execute the message query method according to the obtained program.

[0125] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the message query method.

[0126] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0127] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0128] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0129] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0130] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0131] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A message query method, characterized in that: include: The message receiving end receives the query request sent by the message processing end; The query request is used to obtain the message to be processed from the message receiving end; The identifier of the message to be processed is the order number; The message receiving end determines the message to be processed from the first record and the second record; The first record is used to record in real time the message received by the message receiving end from the message sending end; The second record is used to record the messages sent by the message sending end and whose status has changed within the statistical period; the number of message records in the first record is not greater than the number of message records in the sending record of the message sending end; the messages whose status has changed within the statistical period include messages that are only in the sending record of the statistical period and are not in the sending record of the previous period adjacent to the statistical period; Messages that are in the sending records of the statistical period and in the sending records of the previous period adjacent to the statistical period, and the status of the message is updated during the statistical period; and messages that are only in the sending records of the previous period adjacent to the statistical period and not in the sending records of the statistical period; The message receiving end sends the message to be processed to the message processing end.

2. The method according to claim 1, characterized in that The message receiving end determines the message to be processed from the first record and the second record, including: If both the first record and the second record include messages with the same identifier, the message with the identifier whose update time is latest is determined as the message to be processed; and / or Messages included only in the second record are determined as the messages to be processed.

3. The method according to claim 1, characterized in that The second record is determined by: Acquire a first sending record and a second sending record from the message sending end; the first sending record records messages sent before a first moment; the second sending record records messages sent before a second moment; the second moment is later than the first moment; For messages with the same identifier, messages with changed status are determined from the first sending record and the second sending record.

4. The method according to claim 3, characterized in that The sending record of the message sending end is recorded in a hard deletion mode; Determining a message whose status has changed from the first sending record and the second sending record includes: determining, according to the first sending record and the second sending record, a message deleted in the second sending record; In the second record, the deleted message is set to an invalid state; the invalid state is used to indicate a message that does not need to be processed.

5. The method according to claim 3, characterized in that The sending record of the message sending end is recorded in a soft deletion mode; Determining a message whose status has changed from the first sending record and the second sending record includes: determining, according to the first sending record and the second sending record, a message deleted in the second sending record; In the second record, the deleted message is set to a valid state; the valid state is used to indicate a message to be processed.

6. A message query method, characterized in that: include: The message sending end sends a message to the message receiving end, and records the message in a sending record; the sending record includes a message identifier and a message status; the message identifier is an order number; After receiving the message, the message receiving end records the message in a first record in real time; wherein the number of message records in the first record is not greater than the number of message records in the sending record of the message sending end; The message receiving end receives a query request sent by the message processing end; the query request is used to obtain a message to be processed from the message receiving end; The message receiving end determines the message to be processed from the first record and the second record, and sends the message to be processed to the message processing end; the second record records the message that the state of the message sending end has changed within the statistical period determined according to the sending record; the message whose state has changed within the statistical period includes the message that is only in the sending record of the statistical period and not in the sending record of the previous period adjacent to the statistical period; the message that is both in the sending record of the statistical period and in the sending record of the previous period adjacent to the statistical period, and the state of the message is updated within the statistical period; and the message that is only in the sending record of the previous period adjacent to the statistical period and not in the sending record of the statistical period.

7. The method according to claim 6, characterized in that The second record is generated by: The message sending end receives an acquisition request sent by the statistics end, where the acquisition request is used to periodically acquire the sending record; the message sending end records the sending record in a hard deletion mode or a soft deletion mode; The statistical end determines, for messages with the same identifier, messages whose status has changed from the first sending record and the second sending record, thereby generating the second record; the first sending record records messages sent before the first moment; the second sending record records messages sent before the second moment; The second moment is later than the first moment; The message receiving end determines the message to be processed from the first record and the second record, including: For a message with any identifier, if the message receiving end determines that both the first record and the second record contain the identifier, the message with the identifier with the latest update time is determined as the message to be processed; and / or Messages included only in the second record are determined as the messages to be processed.

8. A message receiving end, characterized in that: include: A receiving unit, used for receiving a query request sent by a message processing terminal; The query request is used to obtain the message to be processed from the message receiving end; The identifier of the message to be processed is the order number; A determination unit, configured to determine the message to be processed from the first record and the second record; The first record is used to record in real time the message received by the message receiving end from the message sending end; The second record is used to record the messages sent by the message sending end and whose status has changed within the statistical period; the number of message records in the first record is not greater than the number of message records in the sending record of the message sending end; the messages whose status has changed within the statistical period include messages that are only in the sending record of the statistical period and are not in the sending record of the previous period adjacent to the statistical period; Messages that are in the sending records of the statistical period and in the sending records of the previous period adjacent to the statistical period, and the status of the message is updated during the statistical period; and messages that are only in the sending records of the previous period adjacent to the statistical period and not in the sending records of the statistical period; A sending unit is used to send the message to be processed to the message processing end.

9. A message query system, characterized in that: The system includes a message sending end, a message receiving end and a message processing end; The message sending end is used to send a message to the message receiving end and record the message in a sending record; the sending record includes a message identifier and a message status; the message identifier is an order number; After receiving the message, the message receiving end is used to record the message in a first record in real time; the number of message records in the first record is not greater than the number of message records in the sending record of the message sending end; The message receiving end is further used to receive a query request sent by the message processing end; the query request is used to obtain a message to be processed from the message receiving end; The message receiving end is further used to determine the to-be-processed message from the first record and the second record, and send the to-be-processed message to the message processing end; the second record records the message that the state of the message sending end has changed within the statistical period determined according to the sending record; the message whose state has changed within the statistical period includes the message that is only in the sending record of the statistical period and is not in the sending record of the previous period adjacent to the statistical period; Messages that are in the sending records of the statistical period and in the sending records of the previous period adjacent to the statistical period, and the status of the message is updated during the statistical period; And messages that are only in the sending records of the previous period adjacent to the statistical period and not in the sending records within the statistical period.

10. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory and execute the method according to any one of claims 1-5, 6-7 according to the obtained program.

11. A computer-readable storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1-5, 6-7.

Citation Information

Patent Citations

  • Method and system for dynamically controlling the content of a local receiver data base from a transmitted data base in an information retrieval communication network

    US4745559A