Message time sequence control method and device
Through the cooperation between the client and the server, the message identification number is used to query the database, which solves the problem of low efficiency in processing out-of-sequence business messages, achieves efficient business message sequence control, reduces system overhead and redundant logic, and improves efficiency. processing power.
Patent Information
- Application Number
- CN202410771346.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-14
AI Technical Summary
When the existing technology processes out-of-sequence business packets, it results in an increase in the number of database accesses, high internal logic complexity, long transaction time, and redundant logic. It cannot effectively solve the problem of disordered business packet processing order.
Through the cooperation between the client and the server, the client simulates a message driver that is not sensitive to the business. The server focuses on querying whether the previous business messages are processed, avoiding redundant judgments and business logic corrections, and using the message identification number to query the database to ensure Business packets are processed in the correct order, reducing the number of database queries.
It improves the processing efficiency of out-of-order business packets, reduces the number of database queries and system overhead, avoids confusion in the processing order of business packets, and improves the system's processing capability and efficiency.
Smart Images

Figure CN118740920A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a message timing control method and device. Background Art
[0002] As a medium with multiple business elements, bills have complex internal processing processes and external interaction logic. Based on the same bill, multiple business messages may be generated, and the business messages generated by the same bill must be processed in the order of business logic. However, in actual production, the order of received business messages is often chaotic. The system will process the business messages received first first. This does not process the business messages in the order of business logic, which will cause the current bill status to be abnormal. The current way to deal with this situation is to combine the known out-of-order scenarios based on experience, and add a judgment on the out-of-order when processing business messages. When the subsequent business messages are processed in advance and meet the out-of-order processing results, special processing will be added to the logic of the previous business messages, such as rollback status or insert elements.
[0003] The above processing method is not a systematic solution, but a collection of experience. Due to the addition of additional judgment and logical processing of out-of-order business messages, the database is accessed more frequently and the internal logic is more complex, which increases transaction time and system overhead.
[0004] Therefore, there is an urgent need for a solution to improve the processing efficiency of out-of-order service messages. Summary of the invention
[0005] The message timing control method and device provided in the present application are used to improve the processing efficiency of out-of-order service messages.
[0006] In the first aspect, the present application provides a message timing control method, which is applied to a client, and the method includes: obtaining a business message; sending the business message to a server; receiving a query result based on the business message by the server; the query result indicates whether a preceding business message of the business message has been processed; if a preceding business message of the business message has been processed, modifying the state of the business message to a first state; otherwise, modifying the state of the business message to a second state; and performing corresponding business processing on the business message in the first state.
[0007] In the above technical solution, the client simulates a business-insensitive message driver and continuously sends the received business messages to the server. The server only focuses on querying whether the preceding business message of the business message has been processed. There is no need for redundant scenario judgment and business logic correction. The two interact and collaborate to avoid the problem of disordered business message processing order, and the processing efficiency of out-of-order business messages is higher.
[0008] In one possible design, the state of the newly acquired business message is the second state; sending the business message to the server includes: sending the business message in the second state to the server, and modifying the state of the business message to a third state; the third state represents that the business message is processed at the server.
[0009] In the above technical solution, the state of the business message sent to the server is modified to the third state to avoid the situation where one business message is sent to multiple servers for repeated processing under high concurrency.
[0010] In one possible design, after changing the state of the business message to the second state, it also includes: resending the business message to the server at a set interval until the state of the business message is changed to the first state or the retry limit is reached; the set interval is determined according to the number of retries; changing the state of the business message that reaches the retry limit to a fourth state; the fourth state indicates that the business message is abnormal.
[0011] In the above technical solution, the interval time of resending the service message in the second state to the server is affected by the number of retries. Since the more retransmissions, the less likely the state of the message is to change (the less likely its predecessor message is to change from unprocessed to processed), the more retransmissions, the longer the interval time of retransmissions, so as to avoid wasting computing resources.
[0012] In a possible design, before sending the business message to the server, it also includes: determining whether the business message has a preceding business message based on business processing logic according to the type of the business message and / or business scenario; sending the business message to the server includes: sending the business message with a preceding business message to the server.
[0013] In the above technical solution, before sending a business message to the server, it is determined whether the business message has a preceding message, and only the business message with a preceding message is sent to the server, which saves the number of times the server queries the database and improves the query efficiency of the database.
[0014] In the second aspect, the present application provides another message timing control method, which is applied to the server, and the method includes: receiving a business message sent by a client; determining whether a preceding business message of the business message has been processed; if processed, returning a first identifier to the client, and the first identifier indicates that the preceding business message of the business message has been processed; otherwise; returning a second identifier to the client, and the second identifier indicates that the preceding business message of the business message has not been processed.
[0015] In the above technical solution, the client simulates a business-insensitive message driver and continuously sends the received business messages to the server. The server only focuses on whether the previous business message of the base query business message has been processed in the query result of the business message, without redundant scene judgment and business logic correction. The server only queries the database once each time it queries, and can make correct judgment feedback. The code intrusion is minimal, the database query efficiency is high, there is no redundant logic, the problem of disordered business message processing order can be avoided, and the processing efficiency of disordered business messages is high.
[0016] In one possible design, the preceding message of the business message has the same message identification number as the business message, and determining whether the preceding business message of the business message has been processed includes: obtaining the message identification number recorded in the business message; querying the database whether there is a preceding message corresponding to the message identification number; if so, it indicates that the preceding business message of the business message has been processed; if not, it indicates that the preceding message of the business message has not been processed.
[0017] In the above technical solution, the server only needs to query the database once through the message identification number to determine whether there is a problem of out-of-order processing of messages, that is, to determine whether the preceding message of the business message has been processed. The code intrusion is extremely small, the database query efficiency is high, there is no redundant logic, and the problem of disorder in the processing order of business messages can be avoided.
[0018] In a third aspect, an embodiment of the present application provides a message timing control device, the device comprising:
[0019] The transceiver module is used to obtain business messages;
[0020] A transceiver module, used for sending the service message to the server;
[0021] The transceiver module is further used to receive a query result of the server based on the service message; the query result indicates whether the preceding service message of the service message has been processed;
[0022] A processing module, configured to modify the state of the service message to a first state if a preceding service message of the service message has been processed; otherwise, modify the state of the service message to a second state;
[0023] The processing module is also used to perform corresponding business processing on the business message in the first state.
[0024] In one possible design, the state of the newly acquired business message is the second state; when the transceiver module sends the business message to the server, it is specifically used to send the business message in the second state to the server and modify the state of the business message to the third state; the third state represents that the business message is processed at the server.
[0025] In one possible design, after the state of the business message is modified to the second state, the processing module is also used to resend the business message to the server at a set interval until the state of the business message is modified to the first state or the retry limit is reached; the set interval time is determined according to the number of retries; the state of the business message that reaches the retry limit is modified to a fourth state; the fourth state indicates that the business message is abnormal.
[0026] In one possible design, before sending the business message to the server, the processing module is also used to determine whether the business message has a preceding business message based on the business processing logic according to the type of the business message and / or the business scenario; when the transceiver module sends the business message to the server, it is specifically used to send the business message with a preceding business message to the server.
[0027] In a fourth aspect, an embodiment of the present application provides another message timing control device, the device comprising:
[0028] The transceiver module is used to receive the service message sent by the client;
[0029] A processing module is used to determine whether the preceding business message of the business message has been processed; if processed, a first identifier is returned to the client, and the first identifier indicates that the preceding business message of the business message has been processed; otherwise, a second identifier is returned to the client, and the second identifier indicates that the preceding business message of the business message has not been processed.
[0030] In one possible design, the preceding message of the business message has the same message identification number as the business message. When the processing module determines whether the preceding business message of the business message has been processed, it is specifically used to obtain the message identification number recorded in the business message; query whether there is a preceding message corresponding to the message identification number in the database; if so, it indicates that the preceding business message of the business message has been processed; if not, it indicates that the preceding message of the business message has not been processed.
[0031] In a fifth aspect, an embodiment of the present application further provides a computing device, including:
[0032] A memory for storing program instructions;
[0033] A processor is used to call the program instructions stored in the memory and execute the method described in any possible design of the first aspect according to the obtained program instructions.
[0034] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer-readable instructions are stored. When a computer reads and executes the computer-readable instructions, the method described in any possible design of the above-mentioned first aspect is implemented.
[0035] In a seventh aspect, an embodiment of the present application further provides a computer program product, comprising computer-readable instructions, which, when executed by a processor, implement the method described in any possible design of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 A schematic diagram of message forwarding for endorsement in a bill transaction provided in an embodiment of the present application;
[0038] Figure 2 A flowchart of a message timing control method provided in an embodiment of the present application;
[0039] Figure 3 A flowchart of another message timing control method provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of an interactive process of a message timing control method provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the structure of a message timing control device provided in an embodiment of the present application;
[0042] Figure 6 A schematic diagram of the structure of another message timing control device provided in an embodiment of the present application;
[0043] Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0045] In the embodiments of the present application, a plurality refers to two or more than two. The words "first", "second" and the like are only used for the purpose of distinguishing descriptions and cannot be understood as indicating or implying relative importance or order.
[0046] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0047] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0048] As a medium with multiple business elements, bills have complex internal processing and external interaction logic. Based on the same bill, multiple business messages may be generated, and the business messages generated by the same bill must be processed in the order of business logic. However, in actual production, the order of received business messages is often chaotic. The system will process the business messages received first first. In this way, the business messages are not processed in the order of business logic, which will cause the current bill status to be abnormal.
[0049] Take endorsement in bill transaction as an example. Figure 1 As shown in the figure, when the endorser and the endorsee belong to the same bank, after the endorser sends an endorsement application to the bill exchange (i.e., sends an endorsement transfer message to the bill exchange), the bill exchange will first send a general business confirmation message to the endorser, and then send a general business forwarding message to the endorsee. Since the endorser and the endorsee belong to the same bank, the bank system will receive the general business confirmation message and the general business forwarding message sent by the bill exchange. The normal receiving order is to receive the general business confirmation message first, and then receive the general business forwarding message. The business processing order is also to process the general business confirmation message first, and then process the general business forwarding message. However, in actual production, if the system receives the general business forwarding message first, it will first process the general business forwarding message, and when it receives the general business confirmation message later, the business processing of the general business confirmation message will be abnormal, resulting in an abnormal state of the current bill.
[0050] The current approach to this situation is to combine known out-of-order scenarios based on experience and add out-of-order judgment when processing business messages. When subsequent business messages are processed in advance and meet the out-of-order processing results, special processing will be added to the logic of the previous business messages, such as rollback status or insert elements.
[0051] For example, in the above example, if the business forwarding message has been processed in advance, when the general business confirmation message is received subsequently, the general business confirmation message will be processed as follows: the ticket status is modified according to the general confirmation message, the application business table status is updated to pre-processing success, and a new flow table and a general confirmation record table are added for confirmation association when the signatory signs for it later.
[0052] The above processing method is not a systematic solution, but a collection of experience. Due to the addition of additional judgment and logical processing of out-of-order business messages, the database is accessed more frequently and the internal logic is more complex, which increases transaction time and system overhead.
[0053] In addition, in order to prevent the results caused by disorder, the above method adds redundant backup codes, which causes serious code intrusion and greatly reduces the readability, maintainability and execution efficiency of the program.
[0054] Similarly, the problem of disordered processing order of business messages may also occur in situations such as multiple transactions of the same bill in a short period of time and network fluctuations. For example, customer A endorses customer B, and the customer's operation process is: 1. Send application; 2. Cancel; 3. Send application again. At this time, there will be an additional general cancellation message. The cancellation of the same bill must correspond to the first application, so the order of processing incoming messages is business confirmation message -> business forwarding message -> business cancellation message -> second business confirmation message -> second business forwarding message. In this case, it is very easy to have the problem of disordered processing order of messages.
[0055] Therefore, the embodiments of the present application provide a message timing control method and device, which can improve the processing efficiency of out-of-order service messages.
[0056] Figure 2 The flowchart of a message timing control method provided by an embodiment of the present application is exemplarily shown, and the method is applied to a client, such as Figure 2 As shown, the method comprises the following steps:
[0057] Step 201: Obtain a business message.
[0058] Step 202: Send the service message to the server.
[0059] In a possible implementation, before sending the business message to the server in step 202, it is also possible to determine whether there is a previous business message for the business message based on the business processing logic according to the type of the business message and / or the business scenario. Exemplarily, the current message type and / or business scenario can be identified in any of the following ways: 1. Through the transaction type code in the specified interval of the message header; 2. Through the xml tag of the message body. After identifying the type and / or business scenario of the business message, the transaction is concatenated in the following way: the MsgId field of the business message marks the current business message identification number and the previous message identification number; combined with the message type and / or business scenario and the message identification number sequence, it can be judged whether there is a previous business message for the business message. If there is a previous business message for the business message, the business message with the previous business message is sent to the server; if there is no previous business message for the business message, the business message can be directly processed.
[0060] In another possible implementation, after sending the business message to the server, the server may determine whether the business message has a preceding business message; if the business message has a preceding business message, the server may query the database to determine whether the preceding message of the business message has been processed; if the business message does not have a preceding business message, the server may return a message to the client indicating that the business message does not have a preceding business message, and the client may perform business processing on the business message after receiving the message.
[0061] In a possible implementation, the state of the newly acquired service message can be defaulted to the second state, and the second state indicates that the preceding service message of the service message has not been processed. Sending the service message to the server includes: sending the service message in the second state to the server, and modifying the state of the service message to a third state, and the third state indicates that the service message is processed by the server.
[0062] In the above technical solution, the state of the business message sent to the server is modified to the third state to avoid the situation where one business message is sent to multiple servers for repeated processing under high concurrency.
[0063] Step 203: Receive the query result based on the service message from the server.
[0064] The query result indicates whether the preceding service message of the service message has been processed.
[0065] Step 204: If the preceding service message of the service message has been processed, the state of the service message is changed to the first state; otherwise, the state of the service message is changed to the second state.
[0066] Step 205: Perform corresponding service processing on the service message in the first state.
[0067] The first state indicates that the preceding service message of the service message has been processed, and the corresponding service processing can be performed on the message. The second state indicates that the preceding service message of the service message has not been processed. If the service message is directly processed at this time, the service message processing order will be disordered. Therefore, the service message in the second state needs to wait until the preceding service message is processed before the corresponding service processing can be performed.
[0068] In the above technical solution, the client simulates a business-insensitive message driver and continuously sends the received business messages to the server. The server only focuses on querying whether the preceding business message of the business message has been processed. There is no need for redundant scenario judgment and business logic correction. The two interact and collaborate to avoid the problem of disordered business message processing order, and the processing efficiency of out-of-order business messages is higher.
[0069] In a possible implementation, after step 204 changes the state of the service message to the second state, it also includes: resending the service message to the server at a set interval until the state of the service message is changed to the first state or the retry limit is reached.
[0070] The interval time is set according to the number of retries. Specifically, the time interval can be equal to the number of retries multiplied by the set waiting time index. For example, if the waiting time index is set to 60s, the time interval = number of retries × 60s, that is, for a service message, after its state is changed to the second state, it is resent to the server after the first interval of 60s. If the state of the service message is still not the second state, it is resent to the server after the second interval of 120s, and resent to the server after the third interval of 180s, and so on.
[0071] In the above technical solution, the interval time of resending the service message in the second state to the server is affected by the number of retries. Since the more retransmissions, the less likely the state of the message is to change (the less likely its predecessor message is to change from unprocessed to processed), the more retransmissions, the longer the interval time of retransmissions, so as to avoid wasting computing resources.
[0072] In addition, an upper limit of the number of retries can be set, and the state of the service message that reaches the upper limit of retries can be changed to the fourth state, which indicates that the service message is abnormal. The message in the fourth state is sent to relevant service personnel, who conduct abnormality investigation.
[0073] Figure 3 The flowchart of another message timing control method provided by the embodiment of the present application is exemplarily shown, and the method is applied to the server, such as Figure 3 As shown, the method comprises the following steps:
[0074] Step 301: Receive a service message sent by a client.
[0075] Step 302: Determine whether the preceding service message of the service message has been processed.
[0076] If processed, execute step 303; otherwise, execute step 304.
[0077] In one possible implementation, the preceding message of a business message has the same message identification number as the business message, and whether the preceding business message of the business message has been processed can be determined in the following manner: obtaining the message identification number recorded in the business message; querying the database whether there is a preceding message corresponding to the message identification number; if so, it indicates that the preceding business message of the business message has been processed; if not, it indicates that the preceding business message of the business message has not been processed.
[0078] Step 303: Return the first identifier to the client.
[0079] Among them, the preceding service message of the service message represented by the first identifier is processed.
[0080] Step 304: Return the second identifier to the client.
[0081] The second identifier indicates that a preceding service message of the service message has not been processed.
[0082] In the above technical solution, after the server receives the business message sent by the client, it obtains the message identification number of the business message, and queries the database based on the message identification number whether there is a preceding message corresponding to the message identification number. If so, it indicates that the preceding business message of the business message has been processed and the first identification is returned to the client; if not, it indicates that the preceding message of the business message has not been processed and the second identification is returned to the client. Figure 4 The interactive flow diagram of the message timing control method provided in the embodiment of the present application is exemplarily shown, and the method is applied to the client and the server, such as Figure 3 As shown, the following steps are included:
[0083] Step 401: The client obtains a service message.
[0084] The state of the newly acquired service message is the second state.
[0085] Step 402: The client determines whether the service message has a preceding service message.
[0086] Specifically, the client determines whether a service message has a preceding service message based on the service processing logic according to the type of the service message and / or the service scenario.
[0087] If yes, execute step 403; otherwise, execute step 409.
[0088] Step 403: The client sends the service message with the preceding service message to the server.
[0089] Step 404: The server receives the service message sent by the client.
[0090] Step 405: The server determines whether the preceding service message of the service message has been processed.
[0091] Obtain the message identification number recorded in the business message; query the database whether there is a preceding message corresponding to the message identification number; if so, it indicates that the preceding business message of the business message has been processed; if not, it indicates that the preceding message of the business message has not been processed.
[0092] If processed, execute step 406; otherwise, execute step 407.
[0093] Step 406: Return the first identifier to the client.
[0094] Among them, the preceding service message of the service message represented by the first identifier is processed.
[0095] Step 407: Return the second identifier to the client.
[0096] The second identifier indicates that a preceding service message of the service message has not been processed.
[0097] Step 408: The client receives the query result based on the business message from the server.
[0098] The query result indicates whether the preceding service message of the service message has been processed.
[0099] If the preceding service message of the service message has been processed, execute step 409; otherwise, execute step 410.
[0100] Step 409: Change the state of the service message to the first state.
[0101] Step 410: Change the state of the service message to the second state.
[0102] After the state of the service message is changed to the second state, the service message is resent to the server at a set interval until the state of the service message is changed to the first state or the retry limit is reached.
[0103] Step 411: Perform corresponding service processing on the service message in the first state.
[0104] The message timing control method provided in the embodiment of the present application is a flexible, stable and efficient message timing control solution that meets the needs of horizontal equipment expansion and vertical business expansion; the client simulates a business-insensitive message driver and continuously sends the received business message method to the server, and the server only focuses on whether the previous business message of the base query business message has been processed in the query result of the business message, without redundant scene judgment and business logic correction. The server only queries the database once each time it queries, and can make correct judgment feedback. The code intrusion is extremely small, the database query efficiency is high, there is no redundant logic, the problem of disordered business message processing order can be avoided, and the processing efficiency of disordered business messages is high.
[0105] Based on the same technical concept, Figure 5 The schematic diagram of the structure of a message timing control device provided in an embodiment of the present application is exemplarily shown. The device may be a client, such as Figure 5 As shown, the device 500 includes:
[0106] The transceiver module 501 is used to obtain service messages;
[0107] The transceiver module 501 is used to send the service message to the server;
[0108] The transceiver module 501 is further used to receive a query result of the server based on the service message; the query result indicates whether the preceding service message of the service message has been processed;
[0109] The processing module 502 is used to modify the state of the service message to the first state if the preceding service message of the service message has been processed; otherwise, modify the state of the service message to the second state;
[0110] The processing module 502 is further configured to perform corresponding service processing on the service message in the first state.
[0111] In one possible design, the state of the newly acquired business message is the second state; when the transceiver module 501 sends the business message to the server, it is specifically used to send the business message in the second state to the server and modify the state of the business message to the third state; the third state represents that the business message is processed at the server.
[0112] In one possible design, after the state of the business message is modified to the second state, the processing module 502 is also used to resend the business message to the server at every set interval until the state of the business message is modified to the first state or the retry upper limit is reached; the set interval time is determined according to the number of retries; the state of the business message that reaches the retry upper limit is modified to a fourth state; the fourth state indicates that the business message is abnormal.
[0113] In one possible design, before sending the business message to the server, the processing module 502 is also used to determine whether the business message has a preceding business message based on the business processing logic according to the type of the business message and / or the business scenario; when the transceiver module 501 sends the business message to the server, it is specifically used to send the business message with a preceding business message to the server.
[0114] Based on the same technical concept, Figure 6 The schematic diagram of the structure of another message timing control device provided in an embodiment of the present application is exemplarily shown, and the device can enable the server, such as Figure 6 As shown, the device 600 includes:
[0115] The transceiver module 601 is used to receive the service message sent by the client;
[0116] Processing module 602 is used to determine whether the preceding business message of the business message has been processed; if processed, a first identifier is returned to the client, and the first identifier indicates that the preceding business message of the business message has been processed; otherwise, a second identifier is returned to the client, and the second identifier indicates that the preceding business message of the business message has not been processed.
[0117] In one possible design, the preceding message of the business message has the same message identification number as the business message. When determining whether the preceding business message of the business message has been processed, the processing module 602 is specifically used to obtain the message identification number recorded in the business message; query whether there is a preceding message corresponding to the message identification number in the database; if so, it indicates that the preceding business message of the business message has been processed; if not, it indicates that the preceding message of the business message has not been processed.
[0118] Based on the same technical concept, the present application embodiment provides a computing device, such as Figure 7 As shown, it includes at least one processor 701 and a memory 702 connected to the at least one processor. The specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application. Figure 7For example, the processor 701 and the memory 702 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0119] In the embodiment of the present application, the memory 702 stores instructions that can be executed by at least one processor 701, and the at least one processor 701 can execute the above-mentioned message timing control method by executing the instructions stored in the memory 702.
[0120] The processor 701 is the control center of the computing device, and can use various interfaces and lines to connect various parts of the computer device, and perform resource settings by running or executing instructions stored in the memory 702 and calling data stored in the memory 702.
[0121] Optionally, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0122] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
[0123] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0124] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer-executable program. The computer-executable program is used to enable a computer to execute the message timing control method listed in any of the above methods.
[0125] Based on the same technical concept, an embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed by a processor, any of the above-mentioned message timing control methods is implemented.
[0126] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0127] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 generate 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 comprising 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 application have been described, those skilled in the art may make additional 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 falling within the scope of the present application.
[0131] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A message timing control method, characterized in that: Applied to a client, the method comprises: Get business messages; Sending the service message to the server; receiving a query result of the service end based on the service message; the query result indicates whether a preceding service message of the service message has been processed; If the preceding service message of the service message has been processed, the state of the service message is changed to the first state; otherwise, the state of the service message is changed to the second state; Perform corresponding service processing on the service message in the first state.
2. The method according to claim 1, characterized in that The state of the newly acquired service message is the second state; and sending the service message to the server includes: The service message in the second state is sent to the server, and the state of the service message is changed to a third state; the third state indicates that the service message is processed at the server.
3. The method according to claim 1, characterized in that After the state of the service message is changed to the second state, the method further includes: At each set interval, the service message is resent to the server until the state of the service message is modified to the first state or the retry limit is reached; the set interval is determined according to the number of retries; The state of the service message that reaches the retry upper limit is changed to a fourth state; the fourth state indicates that the service message is abnormal.
4. The method according to claim 1, characterized in that: Before sending the service message to the server, the method further includes: Determine whether the service message has a preceding service message based on the service processing logic according to the type and / or service scenario of the service message; The sending of the service message to the server includes: Send the service message with the preceding service message to the server.
5. A message timing control method, characterized in that: Applied to the server, the method includes: Receive business messages sent by the client; Determining whether a preceding service message of the service message has been processed; If it is processed, a first identifier is returned to the client, where the first identifier indicates that the preceding service message of the service message is processed; Otherwise; a second identifier is returned to the client, where the second identifier indicates that a preceding service message of the service message has not been processed.
6. The method according to claim 5, characterized in that The preceding message of the service message has the same message identification number as the service message, and the determining whether the preceding service message of the service message is processed includes: Obtaining a message identification number recorded in the business message; Querying the database whether there is a preceding message corresponding to the message identification number; If it exists, it indicates that the preceding service message of the service message has been processed; if it does not exist, it indicates that the preceding service message of the service message has not been processed.
7. A message timing control device, characterized in that: include: The transceiver module is used to obtain business messages; A transceiver module, used for sending the service message to the server; The transceiver module is further used to receive the query result of the server based on the service message; The query result indicates whether the preceding service message of the service message has been processed; A processing module, configured to modify the state of the service message to a first state if a preceding service message of the service message has been processed; otherwise, modify the state of the service message to a second state; The processing module is also used to perform corresponding business processing on the business message in the first state.
8. A message timing control device, characterized in that: include: The transceiver module is used to receive the service message sent by the client; A processing module, used to determine whether a preceding service message of the service message has been processed; If it is processed, a first identifier is returned to the client, where the first identifier indicates that the preceding service message of the service message is processed; Otherwise; a second identifier is returned to the client, where the second identifier indicates that a preceding service message of the service message has not been processed.
9. 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 to 6 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The method comprises computer-readable instructions, and when a computer reads and executes the computer-readable instructions, the method according to any one of claims 1 to 6 is implemented.
11. A computer program product, characterized in that The method comprises computer readable instructions, which, when executed by a processor, enable the method according to any one of claims 1 to 6 to be implemented.
Citation Information
Patent Citations
Message order-preserving method and device adopting same
CN102546424A
Asynchronous message processing method and device
CN110221927A
Contract message processing method and device, electronic equipment and storage medium
CN110737537A
Message association methods, associated message query methods, devices, equipment and media
CN114936226A
Computer system, computer-implemented method and computer program product for sequencing incoming messages for processing at an application
US20140366039A1
Cited By
Packet processing method, apparatus, medium, product and electronic device
WO2026194225A1
