A message processing method and apparatus
By delaying the processing of payment messages and prioritizing messages with later statuses, the problem of high server load in payment scenarios was solved, improving performance and throughput.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2022-12-26
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, the addition, modification, querying, and frequent updates of massive amounts of data in payment business scenarios put a lot of pressure on database servers and application servers, resulting in reduced performance and data throughput.
By delaying processing based on the business status of messages, messages with later business statuses are processed first, effectively filtering out more messages with earlier business statuses and reducing the number of database operations.
It reduces the pressure on database servers and application servers, and improves server performance and data throughput.
Smart Images

Figure CN116010122B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a message processing method and apparatus. Background Technology
[0002] In payment scenarios, to meet the data service needs of different users, heterogeneous storage of business data is often required. This typically involves receiving messages about the creation, modification, and completion status of business data, updating the heterogeneous data, and performing database operations to maintain the data. The number of times the database is operated is directly proportional to the number of states the business data has. The massive amounts of data being added, modified, and queried, as well as the frequent updates of different states for the same business data, place high performance demands on application servers and database servers.
[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:
[0004] The system requires processing messages related to all business statuses, resulting in numerous database operations. This puts a heavy burden on the database server and application server, reducing server performance and data throughput. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a message processing method and apparatus that can delay message processing based on the business status corresponding to the message, prioritize the processing of messages with later business statuses, efficiently filter out more messages with earlier business statuses, reduce the number of database operations, alleviate the pressure on the database server and application server, and improve server performance and data throughput.
[0006] To achieve the above objectives, according to one aspect of the present invention, a message processing method is provided.
[0007] A message processing method includes: responding to a message processing request, obtaining a service identifier and service status corresponding to a message to be processed, wherein each service includes multiple service statuses in a sequential order, the multiple service statuses including a termination status; if the service status corresponding to the message to be processed is the termination status, processing the message to be processed, and setting the current service status of the service corresponding to the service identifier according to the service status of the message to be processed; if the service status corresponding to the message to be processed is not the termination status, delaying the processing of the message to be processed.
[0008] Optionally, the step of delaying the processing of the message to be processed includes: delaying the processing of the message to be processed according to a set delay time, wherein the delay time is related to the business status corresponding to the message to be processed, and the delay time decreases from long to short according to the order of the multiple business statuses from first to last.
[0009] Optionally, the step of delaying the processing of the message to be processed includes: in response to reaching a set delay time, obtaining the service identifier and service status corresponding to the message to be processed; obtaining the current service status of the service corresponding to the service identifier based on the service identifier; and delaying the processing of the message to be processed based on the order of the multiple service statuses, the service status and the current service status.
[0010] Optionally, the step of delaying the processing of the pending message according to the order of the multiple service states, the service state, and the current service state includes: processing the pending message and updating the current service state according to the order of the multiple service states when the service state is after the current service state; and deleting the pending message when the service state is before the current service state.
[0011] Optionally, the step of delaying the processing of the message to be processed further includes: in response to the arrival of a set delay time, if the current business status of the business corresponding to the business identifier is not obtained, processing the message to be processed and setting the current business status of the business corresponding to the business identifier according to the business status of the message to be processed.
[0012] Optionally, after setting the current business status of the business corresponding to the business identifier, the method further includes: saving the set current business status to a cache; obtaining the current business status of the business corresponding to the business identifier based on the business identifier includes: obtaining the current business status of the business corresponding to the business identifier from the cache based on the business identifier; after updating the current business status based on the business status, the method further includes: saving the updated current business status to a cache.
[0013] Optionally, the step of delaying the processing of the message to be processed includes: writing the message to be processed into a delay queue corresponding to the business state according to the business state of the message to be processed, wherein the message to be processed in each delay queue has a delay time related to the corresponding business state.
[0014] According to another aspect of the present invention, a message processing apparatus is provided.
[0015] A message processing apparatus includes: a message processing request and response module, configured to respond to a message processing request and obtain a service identifier and service status corresponding to a message to be processed, wherein each service includes multiple service statuses in a sequential order, and the multiple service statuses include a termination status; a first message processing module, configured to process the message to be processed when the service status corresponding to the message to be processed is the termination status, and set the current service status of the service corresponding to the service identifier according to the service status of the message to be processed; and a second message processing module, configured to delay processing the message to be processed when the service status corresponding to the message to be processed is not the termination status.
[0016] Optionally, the second message processing module is further configured to: perform delayed processing on the message to be processed according to a set delay time, wherein the delay time is related to the business status corresponding to the message to be processed, and the delay time decreases from long to short according to the order of the multiple business statuses from first to last.
[0017] Optionally, the second message processing module is further configured to: in response to reaching a set delay time, obtain the service identifier and service status corresponding to the message to be processed; obtain the current service status of the service corresponding to the service identifier according to the service identifier; and perform delayed processing on the message to be processed according to the order of the multiple service statuses, the service status and the current service status.
[0018] Optionally, the second message processing module is further configured to: process the message to be processed according to the order of the plurality of business states, and update the current business state according to the business state; and delete the message to be processed if the business state is before the current business state.
[0019] Optionally, the second message processing module is further configured to: in response to reaching a set delay time, if the current service status of the service corresponding to the service identifier is not obtained, process the message to be processed, and set the current service status of the service corresponding to the service identifier according to the service status of the message to be processed.
[0020] Optionally, the second message processing module is further configured to: after setting the current business status of the business corresponding to the business identifier, save the set current business status to a cache; obtain the current business status of the business corresponding to the business identifier from the cache according to the business identifier; and after updating the current business status according to the business status, save the updated current business status to a cache.
[0021] Optionally, the second message processing module is further configured to: write the message to be processed into a delay queue corresponding to the business state according to the business state of the message to be processed, wherein the message to be processed in each delay queue has a delay time related to the corresponding business state.
[0022] According to another aspect of the present invention, an electronic device is provided.
[0023] An electronic device includes: one or more processors; and a memory for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the message processing method provided in the embodiments of the present invention.
[0024] According to another aspect of the present invention, a computer-readable medium is provided.
[0025] A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the message processing method provided in the embodiments of the present invention.
[0026] One embodiment of the above invention has the following advantages or beneficial effects: In response to a message processing request, the business identifier and business status corresponding to the message to be processed are obtained, wherein each business includes multiple business states in a sequential order, and the multiple business states include a termination state; when the business status corresponding to the message to be processed is a termination state, the message to be processed is processed, and the current business status of the business corresponding to the business identifier is set according to the business status of the message to be processed; when the business status corresponding to the message to be processed is not a termination state, the technical solution of delaying the processing of the message to be processed can, by delaying the processing of the message according to the business status corresponding to the message, prioritize the processing of messages with later business states, efficiently filter out more messages with earlier business states, reduce the number of database operations, alleviate the pressure on the database server and application server, and improve server performance and data throughput.
[0027] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0028] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0029] Figure 1 This is a schematic diagram of the main steps of a message processing method according to an embodiment of the present invention;
[0030] Figure 2 This is a flowchart illustrating a message processing method according to an embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of the main modules of a message processing apparatus according to an embodiment of the present invention;
[0032] Figure 4 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0033] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0034] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0035] Figure 1 This is a schematic diagram of the main steps of a message processing method according to an embodiment of the present invention.
[0036] like Figure 1 As shown, a message processing method according to an embodiment of the present invention mainly includes the following steps S101 to S103.
[0037] Step S101: In response to the message processing request, obtain the business identifier and business status corresponding to the message to be processed.
[0038] Each business process can include multiple business states in a sequential order, and these business states can include a termination state. For example, in a payment business scenario, the multiple business states in sequence can be: transaction creation state, transaction acceptance successful state, channel request completed state, waiting for payment result state, payment successful state, and transaction completed state, where the transaction completed state is the termination state.
[0039] In one embodiment, the delay time is related to the business status corresponding to the message to be processed, and the delay time decreases from the longest to the shortest according to the order of the multiple business statuses from first to last.
[0040] Specifically, a corresponding delay time is set for each business state except for the termination state, according to the order of the multiple business states. For example, in a payment business scenario, if the order of the multiple business states is transaction creation state, transaction acceptance successful state, channel request completed state, waiting for payment result state, payment successful state, and transaction completed state, then corresponding delay times are set for each of the following states: transaction creation state, transaction acceptance successful state, channel request completed state, waiting for payment result state, and payment successful state. Furthermore, the delay times for the transaction creation state, transaction acceptance successful state, channel request completed state, waiting for payment result state, and payment successful state are set from longest to shortest.
[0041] Step S102: If the business status corresponding to the message to be processed is terminated, process the message to be processed and set the current business status of the business corresponding to the business identifier according to the business status of the message to be processed.
[0042] Specifically, in a payment scenario, if the business status of the message to be processed is "transaction completed," then the message is processed, and the current business status of the business corresponding to the business identifier is set to "transaction completed." Processing the message to be processed can involve storing the business data corresponding to the message in the database.
[0043] In one embodiment, after setting the current business state of the business corresponding to the business identifier, the method may further include: saving the set current business state to a cache.
[0044] Specifically, in the payment business scenario, after setting the current business status of the business corresponding to the business identifier to the transaction completion status, the business corresponding to the business identifier and the transaction completion status can be associated and stored in the cache.
[0045] Step S103: If the business status corresponding to the message to be processed is not terminated, the message to be processed is delayed.
[0046] In one embodiment, delaying the processing of messages to be processed may include: writing the messages to be processed into a delay queue corresponding to the business state, wherein each message to be processed in the delay queue has a delay time related to the corresponding business state.
[0047] Specifically, a delay queue is created for each business state, and the delay time of the business state is used as the delay time of the delay queue. If the business state corresponding to the message to be processed is not a terminated state, the message to be processed can be written to the delay queue corresponding to the business state.
[0048] In one embodiment, the message to be processed is delayed based on a set delay time. Upon reaching the set delay time, if the current business status of the business corresponding to the business identifier cannot be obtained, the message to be processed is processed, and the current business status of the business corresponding to the business identifier is set according to the business status of the message to be processed, and the set current business status is saved to a cache. If the current business status of the business corresponding to the business identifier can be obtained, the current business status of the business corresponding to the business identifier is obtained according to the business identifier, and the message to be processed is delayed based on the order of multiple business statuses, the current business status, and the current business status.
[0049] In one embodiment, delaying the processing of a message to be processed based on the order of multiple business states, the current business state, and the current business state may include: processing the message to be processed when the current business state is after the current business state, updating the current business state according to the current business state, and saving the updated current business state to a cache; and deleting the message to be processed when the current business state is before the current business state.
[0050] Among these features, before delaying the processing of a message to be processed based on the order of multiple business states, the current business state, and the current business state, the message to be processed can be processed based on the current business state and the business state. In other words, if the current business state and the current business state are the same, the message to be processed can be deleted.
[0051] Figure 2 This is a flowchart illustrating a message processing method according to an embodiment of the present invention.
[0052] like Figure 2As shown, in one embodiment, the provider sends message processing requests for multiple states to the consumer. For each message processing request, the consumer determines the business state of the message to be processed corresponding to message processing request 5. If the business state is terminated, the message to be processed is processed, the current business state of the message to be processed is set to terminated and saved to the cache; if the business state is terminated, the message to be processed is saved to the delay queue corresponding to the business state. In response to the delay time of the delay queue, the consumer retrieves the current business state of the message to be processed from the cache. If the current business state cannot be retrieved, the message to be processed is processed directly, the current business state of the message to be processed is set to the business state and saved to the cache. If the current business state can be retrieved, if the current business state is after the current business state, the message to be processed is processed, the current business state of the message to be processed is updated to the business state and saved to the cache; otherwise, the message to be processed is deleted. The evolution order of the business states is first state, second state, ..., Nth state, terminated state, and the delay time T1 > T2 > ... > TN.
[0053] Figure 3 This is a schematic diagram of the main modules of a message processing device according to an embodiment of the present invention.
[0054] like Figure 3 As shown, a message processing device 300 according to an embodiment of the present invention mainly includes: a message processing request and response module 301, a first message processing module 302, and a second message processing module 303.
[0055] The message processing request and response module 301 is used to respond to a message processing request and obtain the business identifier and business status corresponding to the message to be processed. Each business may include multiple business statuses in a sequential order, and the multiple business statuses include a termination status.
[0056] 5. The first message processing module 302 is used to process the message to be processed when the business status corresponding to the message to be processed is terminated, and to set the current business status of the business corresponding to the business identifier according to the business status of the message to be processed.
[0057] The second message processing module 303 is used to delay the processing of the message to be processed when the business status corresponding to the message to be processed is not in the terminated state.
[0058] 0 In one embodiment, the second message processing module is specifically used to: perform delayed processing on the message to be processed according to a set delay time, wherein the delay time is related to the business status corresponding to the message to be processed, and the delay time is from long to short according to the order of multiple business statuses from first to last.
[0059] In one embodiment, the second message processing module is specifically used to: in response to the arrival of a set delay time, obtain the service identifier and service status corresponding to the message to be processed; obtain the current service status of the service corresponding to the service identifier based on the service identifier; and perform delayed processing on the message to be processed based on the order of multiple service statuses, the service status, and the current service status.
[0060] In one embodiment, the second message processing module is specifically used to: process the message to be processed according to the order of multiple business states, and update the current business state according to the business state when the business state is after the current business state; and delete the message to be processed when the business state is before the current business state.
[0061] In one embodiment, the second message processing module is specifically used to: in response to the arrival of a set delay time, if the current business status of the business corresponding to the business identifier is not obtained, process the message to be processed, and set the current business status of the business corresponding to the business identifier according to the business status of the message to be processed.
[0062] In one embodiment, the second message processing module is specifically used to: after setting the current business status of the business corresponding to the business identifier, save the set current business status to the cache; according to the business identifier, retrieve the current business status of the business corresponding to the business identifier from the cache; after updating the current business status according to the business status, save the updated current business status to the cache.
[0063] In one embodiment, the second message processing module is specifically used to: write the message to be processed into a delay queue corresponding to the business state, based on the business state of the message to be processed, wherein the message to be processed in each delay queue has a delay time related to the corresponding business state.
[0064] Furthermore, the specific implementation details of the message processing device in this embodiment of the invention have been described in detail in the message processing method above, so they will not be repeated here.
[0065] Figure 4 An exemplary system architecture 400 is shown that can be applied to the message processing method or message processing apparatus of the present invention.
[0066] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, and 403, a network 404, and a server 405. Network 404 serves as the medium for providing communication links between terminal devices 401, 402, and 403 and server 405. Network 404 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0067] Users can use terminal devices 401, 402, and 403 to interact with server 405 via network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, and 403, such as shopping applications, web browser applications, messaging applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0068] Terminal devices 401, 402, and 403 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0069] Server 405 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 401, 402, and 403 (for example only). The backend management server can respond to received message processing requests, obtain the business identifier and business status corresponding to the message to be processed, where each business includes multiple business states in a sequential order, including a termination state; if the business status corresponding to the message to be processed is termination, the message to be processed is processed, and the current business status of the business corresponding to the business identifier is set according to the business status of the message to be processed; if the business status corresponding to the message to be processed is not termination, the message to be processed is processed with delays, and the processing result (e.g., message processing result – for example only) is fed back to the terminal device.
[0070] It should be noted that the message processing method provided in the embodiments of the present invention is generally executed by server 405, and correspondingly, the message processing device is generally set in server 405.
[0071] It should be understood that Figure 4 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0072] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing terminal devices or servers of the present invention. Figure 5 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0073] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0074] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0075] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.
[0076] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0078] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may be described as including a message processing request and response module, a first message processing module, and a second message processing module. The names of these modules do not necessarily limit the module itself; for example, the message processing request and response module may also be described as "a module for responding to a message processing request and obtaining the service identifier and service status corresponding to the message to be processed."
[0079] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to: in response to a message processing request, obtain a service identifier and service status corresponding to a message to be processed, wherein each service includes multiple service states in a sequential order, and the multiple service states include a termination state; if the service status corresponding to the message to be processed is a termination state, process the message to be processed and set the current service status of the service corresponding to the service identifier according to the service status of the message to be processed; if the service status corresponding to the message to be processed is not a termination state, delay the processing of the message to be processed.
[0080] According to the technical solution of this embodiment of the invention, in response to a message processing request, the service identifier and service status corresponding to the message to be processed are obtained. Each service includes multiple service statuses in a sequential order, including a termination status. If the service status corresponding to the message to be processed is a termination status, the message to be processed is processed, and the current service status of the service corresponding to the service identifier is set according to the service status of the message to be processed. If the service status corresponding to the message to be processed is not a termination status, the message to be processed is delayed. By delaying message processing based on the service status of the message, messages with later service statuses are processed first, effectively filtering out more messages with earlier service statuses, reducing the number of database operations, alleviating the pressure on the database server and application server, and improving server performance and data throughput.
[0081] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A message processing method, characterized in that, include: In response to a message processing request, the service identifier and service status corresponding to the message to be processed are obtained, wherein each service includes multiple service statuses in a sequential order, and the multiple service statuses include a termination status. If the service status corresponding to the pending message is the terminated status, the pending message is processed, and the current service status of the service corresponding to the service identifier is set according to the service status of the pending message. If the business status corresponding to the message to be processed is not the termination status, the message to be processed is delayed according to the set delay time. The delay time is related to the business status corresponding to the message to be processed, and the delay time is from long to short according to the order of the multiple business statuses from first to last. In response to the arrival of the set delay time, the service identifier and service status corresponding to the message to be processed are obtained; Based on the service identifier, obtain the current service status of the service corresponding to the service identifier; Based on the order of the multiple business states, if a business state is located after the current business state, the message to be processed is processed, and the current business state is updated according to the business state. If the service status is prior to the current service status or the same as the current service status, delete the pending message.
2. The method according to claim 1, characterized in that, The method of delaying the processing of the message to be processed further includes: In response to the arrival of the set delay time, if the current business status of the business corresponding to the business identifier cannot be obtained, the pending message is processed, and the current business status of the business corresponding to the business identifier is set according to the business status of the pending message.
3. The method according to claim 2, characterized in that, After setting the current business status of the business corresponding to the business identifier, the method further includes: saving the set current business status to a cache; The step of obtaining the current business status of the business corresponding to the business identifier based on the business identifier includes: obtaining the current business status of the business corresponding to the business identifier from the cache based on the business identifier; After updating the current business status according to the business status, the method further includes: saving the updated current business status to a cache.
4. The method according to claim 1, characterized in that, The delayed processing of the message to be processed includes: Based on the service status of the message to be processed, the message to be processed is written into a delay queue corresponding to the service status, wherein the message to be processed in each delay queue has a delay time related to the corresponding service status.
5. A message processing device, characterized in that, include: The message processing request and response module is used to respond to a message processing request and obtain the business identifier and business status corresponding to the message to be processed. Each business includes multiple business statuses in a sequential order, and the multiple business statuses include a termination status. The first message processing module is used to process the message to be processed when the service status corresponding to the message to be processed is the terminated status, and to set the current service status of the service corresponding to the service identifier according to the service status of the message to be processed. The second message processing module is used to perform delayed processing on the message to be processed according to a set delay time when the business status corresponding to the message to be processed is not the termination status. The delay time is related to the business status corresponding to the message to be processed, and the delay time is from long to short according to the order of the multiple business statuses from first to last. The second message processing module is specifically configured to: in response to the arrival of a set delay time, obtain the service identifier and service status corresponding to the message to be processed; obtain the current service status of the service corresponding to the service identifier based on the service identifier; process the message to be processed according to the order of the multiple service statuses, if the service status is after the current service status, and update the current service status according to the service status; and delete the message to be processed if the service status is before the current service status or if the service status is the same as the current service status.
6. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4.
7. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Data processing method and device, equipment and storage medium
CN111796946A