Message processing method, device and electronic equipment for internet medical treatment
By using business scenario values, message batch identifiers, and sequence numbers to generate time-sequential business messages in the instant messaging system of internet healthcare, the problem of unordered message display was solved, ensuring the orderly display of messages across multiple clients and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2026-04-14
AI Technical Summary
In instant messaging systems for internet healthcare, inconsistent clocks, multiple clients, service clustering, and uncertainties in network transmission can lead to unreliable message display timing, impacting user experience.
By transmitting raw business messages between the client and the message middleware, and using business scenario values, message batch identifiers, message batch sequence numbers, and message display status, time-series business messages are generated and displayed to ensure the orderliness of messages.
It ensures the orderly display of messages in an instant messaging system across multiple clients, thus improving the user experience.
Smart Images

Figure CN114429814B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information processing technology, and in particular to a message processing method, apparatus and electronic device for Internet healthcare. Background Technology
[0002] With the development of internet technology, the application of internet healthcare is becoming increasingly widespread. In internet healthcare consultation scenarios, multiple roles and their corresponding clients simultaneously complete the consultation process within an instant messaging system. The instant messaging system is designed with a distributed architecture. Under a distributed architecture, factors such as inconsistent clocks, multiple clients, service clustering, and the uncertainties of network transmission and multithreading can lead to a lack of guarantee regarding the timeliness of messages when displaying them in the instant messaging system.
[0003] Therefore, resolving the issue of message display disorder in instant messaging systems with multiple clients is crucial. Summary of the Invention
[0004] This disclosure provides a message processing method, apparatus, and electronic device for Internet healthcare, which addresses the deficiency in the prior art that the timeliness of messages in instant messaging systems cannot be guaranteed, and enables multiple client instant messaging system messages to have orderliness.
[0005] This disclosure provides a message processing method applied to a client, the method comprising:
[0006] Order retrieval event;
[0007] The original business message is generated based on the order event and sent to the message middle platform. The original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status.
[0008] The system receives a time-series business message returned by the message platform, wherein the time-series business message is generated by the message platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status.
[0009] The time-series business message is displayed based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the time-series business message.
[0010] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0011] The step of displaying the time-series business message based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the time-series business message includes:
[0012] The time-series business messages are sorted according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain the sorting result;
[0013] The time-series business messages whose display status is displayed are shown according to the sorting results.
[0014] According to a message processing method provided in this disclosure, before displaying the time-series business message whose display status is displayed according to the sorting result, the method further includes:
[0015] Receive the display status change event sent by the message platform;
[0016] Based on the displayed status change event, determine the time-series business message that needs to be changed;
[0017] Change the message display status of the time-series business message that needs to be changed to "display".
[0018] According to a message processing method provided in this disclosure, after the step of receiving the display status change event sent by the message platform, the method further includes:
[0019] If no display status change event is received within the first preset time, then the message display status of all the time-series business messages in the sorting result will be determined as displayed.
[0020] According to a message processing method provided in this disclosure, the original business message and the time-series business message further include a session identifier, and the method further includes:
[0021] Send a query request to the message platform, the query request including the session identifier to be queried;
[0022] Receive historical time-series service messages sent by the message platform, wherein the historical time-series service messages are multiple time-series service messages matched by the message platform according to the session identifier to be queried in the query request;
[0023] The historical time-series business messages are displayed based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages.
[0024] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed.
[0025] The step of displaying the time-series business message based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business message includes:
[0026] The historical time-series business messages are sorted according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain the historical sorting result;
[0027] The historical time-series business messages are displayed according to the historical sorting results.
[0028] This disclosure also provides a message processing method applied to a message middleware, the method comprising:
[0029] Receive raw business messages from multiple clients, wherein the raw business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status;
[0030] The original business message is processed based on the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message, which is then sent to the multiple clients.
[0031] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0032] The step of processing the original business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and sending it to the multiple clients includes:
[0033] If the message batch sequence number of the original business message is a preset value, then the message display status of the original business message is changed from empty to displayed, and the time-series business message is obtained.
[0034] The time-series business messages are stored in a distributed cache;
[0035] Send the time-series service messages to the multiple clients.
[0036] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0037] The step of processing the original business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and sending it to the multiple clients includes:
[0038] If the message batch sequence number of the original business message is not a preset value, then query the message display status of the preceding business message in the distributed cache. The preceding business message is the original business message or the time-series business message corresponding to the original business message after the message batch sequence number is reduced by one under the same business scenario value and the same message batch identifier.
[0039] When the message display status of the preceding business message is displayed, the message display status of the original business message is changed to displayed to obtain the time-series business message; the time-series business message is stored in a distributed cache; and the time-series business message is sent to the multiple clients.
[0040] When the message display status of the preceding service message is empty or not displayed, the message display status of the original service message is changed to not displayed, thus obtaining the time-series service message; the time-series service message is sent to the multiple clients.
[0041] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0042] After the step of processing the original business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and send it to the multiple clients, the method further includes:
[0043] Send the time-series business message to the message queue;
[0044] Store the time-series business messages in the message queue into the database;
[0045] When the message display status of the time-series business message is displayed, the message display status of the subsequent business message is obtained in the distributed cache. The subsequent business message is the original business message or the time-series business message corresponding to the message batch sequence number plus one under the same business scenario value and the same message batch identifier.
[0046] If the message display status of the subsequent service message is not displayed, then the message display status of the subsequent service message in the distributed cache and the database is changed to displayed, and a display status change event is sent to the multiple clients, and the step of obtaining the message display status of the subsequent service message in the distributed cache is re-executed;
[0047] If the message display status of the subsequent service message is empty or displayed, the process ends.
[0048] According to a message processing method provided in this disclosure, the method further includes:
[0049] Select the time-series business messages in the database whose message display status is still not displayed within a first preset time period, change the message display status of the selected time-series business messages to displayed, and generate an abnormal change log.
[0050] According to a message processing method provided in this disclosure, the original business message and the time-series business message further include a session identifier, and the method further includes:
[0051] Receive a query request sent by the client, the query request including the session identifier to be queried;
[0052] Match the time-series service message that matches the session identifier to be queried in the query request, and use it as a historical time-series service message;
[0053] The historical time-series business messages are sent to the client.
[0054] This disclosure also provides a message processing apparatus, configured on a client, the apparatus comprising:
[0055] The acquisition unit is used to acquire order events;
[0056] The generation unit is used to generate an original business message based on the order event and send the original business message to the message middle platform. The original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status.
[0057] The first receiving unit is configured to receive the time-series business message returned by the message platform, wherein the time-series business message is generated by the message platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status.
[0058] The display unit is used to display the time-series business message based on the business scenario value, the message batch identifier, the message batch sequence number, and the message display status of the time-series business message.
[0059] According to a message processing apparatus provided in this disclosure, the apparatus further includes:
[0060] A query request sending unit is used to send a query request to the message platform, wherein the query request includes the session identifier to be queried;
[0061] The historical receiving unit is used to receive historical time-series service messages sent by the message platform, wherein the historical time-series service messages are multiple time-series service messages matched by the message platform according to the session identifier to be queried in the query request;
[0062] The historical display unit is used to display the historical time-series business messages based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages.
[0063] This disclosure also provides a message processing apparatus, disposed in a message middleware, the apparatus comprising:
[0064] The second receiving unit is used to receive original business messages from multiple clients. The original business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status.
[0065] The processing unit is used to process the original business message according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status, generate a time-series business message and send it to the multiple clients.
[0066] According to a message processing apparatus provided in this disclosure, the apparatus further includes:
[0067] A query request receiving unit is configured to receive a query request sent by the client, wherein the query request includes a session identifier to be queried;
[0068] The historical matching unit is used to match the time-series business message that is consistent with the session identifier to be queried in the query request, and use it as a historical time-series business message.
[0069] The historical sending unit is used to send the historical time-series service messages to the client.
[0070] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the message processing methods described above.
[0071] This disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the message processing methods described above.
[0072] The message processing method, apparatus, and electronic device disclosed herein involve: acquiring an order event; generating an original business message based on the order event; sending the original business message to a message middleware platform, wherein the original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; receiving a time-series business message returned by the message middleware platform, wherein the time-series business message is generated by the message middleware platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status; and displaying the time-series business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status. This achieves ordered message display in an instant messaging system with multiple clients. Attached Figure Description
[0073] To more clearly illustrate the technical solutions in this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0074] Figure 1 This is one of the flowcharts of the message processing method provided in this disclosure;
[0075] Figure 2 This is a schematic diagram of the message processing flow provided in this public document;
[0076] Figure 3 This is the second flowchart of the message processing method provided in this publication;
[0077] Figure 4 This is the third flowchart of the message processing method provided in this public disclosure;
[0078] Figure 5 This is the fourth flowchart of the message processing method provided in this public disclosure;
[0079] Figure 6This is a schematic diagram of the publicly available message middleware architecture;
[0080] Figure 7 This is the fifth flowchart of the message processing method provided in this public disclosure;
[0081] Figure 8 This is the sixth flowchart of the message processing method provided in this publication;
[0082] Figure 9 This is the seventh flowchart of the message processing method provided in this public disclosure;
[0083] Figure 10 This is the eighth flowchart of the message processing method provided in this publication;
[0084] Figure 11 This is the ninth flowchart of the message processing method provided in this public disclosure;
[0085] Figure 12 This is the tenth flowchart of the message processing method provided in this public disclosure;
[0086] Figure 13 This is one of the structural schematic diagrams of the message processing apparatus provided in this disclosure;
[0087] Figure 14 This is the second schematic diagram of the message processing device provided in this disclosure;
[0088] Figure 15 This is the third schematic diagram of the message processing device provided in this disclosure;
[0089] Figure 16 This is the fourth schematic diagram of the message processing device provided in this disclosure;
[0090] Figure 17 This is a schematic diagram of the structure of the electronic device provided in this disclosure. Detailed Implementation
[0091] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the embodiments of this disclosure.
[0092] With the development of internet technology, the application of internet healthcare is becoming increasingly widespread. One of the most important functions in the online consultation and prescription process of internet hospitals is instant messaging. In the entire consultation scenario, multiple roles, including patients, doctors, medical assistants, and pharmacists, along with their corresponding clients, complete the entire consultation process simultaneously in a single instant messaging session. Therefore, instant messaging systems are characterized by high concurrency, strong real-time performance, strong timeliness, and high availability requirements, leading to a distributed architecture design. Under a distributed architecture, factors such as inconsistent clocks, multiple clients, service clustering, and the uncertainties of network transmission and multithreading can cause the timeliness of instant messaging messages to be compromised. Messages are the most crucial bridge in the doctor-patient consultation process, and system messages play an indispensable role in the consultation instant messaging session. Almost every event and change during the consultation process triggers a system message notification. Unlike user messages, system messages trigger multiple system messages from different business lines when an event occurs or changes. If system messages are displayed out of order, it will lead to a very poor experience for doctors, patients, and other users.
[0093] Therefore, resolving the issue of message display disorder in instant messaging systems with multiple clients is crucial.
[0094] This disclosure provides a message processing method applied to a client, such as... Figure 1 As shown, the method includes the following steps:
[0095] S11, Order Acquisition Event;
[0096] Specifically, the client can obtain order events. Order events can include events such as order placement, patient admission, cancellation, or completion.
[0097] S12. Generate an original business message based on the order event, and send the original business message to the message platform. The original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status.
[0098] Specifically, the client can generate original business messages based on order events and send the original business messages to the message middleware. The original business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status.
[0099] The original business message may also include information such as message identifier, session identifier, message sender, message sender user identifier, message receiver, message receiver user identifier, message content, and message creation time.
[0100] A complete original business message may include the contents shown in Table 1 below:
[0101] Table 1
[0102] Field Description
[0103] msgId is a message identifier that uniquely identifies a message.
[0104] sessionId is a session identifier that uniquely identifies a chat session.
[0105] msgFrom Message sender
[0106] msgFromUserId: The user identifier of the message sender.
[0107] msgTo Message receiver
[0108] msgToUserId is the identifier of the message recipient user.
[0109] msgContent message content
[0110] createTime: Message creation time
[0111] businessKey (Business Scenario Value)
[0112] msgBatchId is the message batch identifier.
[0113] msgBatchOrder message batch sequence number
[0114] msgShowStatus displays the message status.
[0115] S13. Receive the time-series business message returned by the message platform, wherein the time-series business message is generated by the message platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status.
[0116] Specifically, the client can receive time-series business messages returned by the message middleware. Time-series business messages are generated by the message middleware after receiving raw business messages from multiple clients and processing them based on business scenario values, message batch identifiers, message batch sequence numbers, and message display status.
[0117] S14. Display the time-series business message according to the business scenario value, message batch identifier, message batch sequence number and message display status of the time-series business message;
[0118] Specifically, the client can display time-series business messages based on the business scenario value, message batch identifier, message batch sequence number, and message display status.
[0119] In one example, such as Figure 2 As shown, multiple clients include patient clients, doctor clients, medical assistant clients, and pharmacist clients. After receiving an order event, each client generates its own original business message based on the order event and sends it to the message middle platform, and receives time-series business messages processed by the message middle platform.
[0120] In this embodiment, the client obtains an order event, generates an original business message based on the order event, and sends the original business message, including a message batch identifier, the message batch sequence number, and the message display status, to the message middle platform. The client then receives a sequential business message returned by the message middle platform and displays the sequential business message based on its message batch identifier, message batch sequence number, and message display status. This achieves ordered message display in an instant messaging system with multiple clients.
[0121] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. Step S14 specifically includes the following steps:
[0122] S141. Sort the time-series business messages according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain a sorting result;
[0123] Specifically, the message display status includes three states: empty, displayed, and not displayed. An empty message display status indicates that it has not been processed. After receiving a time-series business message, the client can determine the time-series business messages in the same business scenario based on the business scenario value, then determine the time-series business messages in the same batch based on the message batch identifier, and then sort the time-series business messages in the same batch in ascending order of message batch sequence number to obtain the sorting result.
[0124] S142. Display the time-series business messages whose display status is displayed according to the sorting result;
[0125] Specifically, the client can display time-series business messages that are in the display state according to the sorting results.
[0126] In this embodiment, the client sorts the time-series business messages according to the business scenario value, message batch identifier, and message batch sequence number, obtains the sorting result, and displays the time-series business messages whose display status is set to the sorting result. This achieves ordered message display in an instant messaging system with multiple clients.
[0127] A message processing method provided according to an embodiment of this disclosure, such as Figure 3As shown, the following steps are included before step S142:
[0128] S31. Receive the display status change event sent by the message platform;
[0129] Specifically, the client can receive message status change events sent by the message middleware.
[0130] S32. Based on the display status change event, determine the time-series business message that needs to be changed;
[0131] Specifically, the client can determine the time-series business messages that need to be changed based on the displayed state change events.
[0132] S33. Change the message display status of the time-series service message that needs to be changed to display;
[0133] Specifically, the client can change the message display status of the time-series business messages that need to be changed from empty or not displayed to displayed.
[0134] In this embodiment, the client can receive a display status change event, determine the time-series business messages that need to be changed based on the display status change event, change their display status to displayed, and then display them in subsequent steps. In special circumstances, the client can restore the display of time-series business messages that need to be displayed but are set to not be displayed based on the status change event, thus ensuring the orderly display of messages in the instant messaging system of multiple clients.
[0135] According to an embodiment of the present disclosure, a message processing method further includes the following step after S31:
[0136] S311. If the display status change event is not received within the first preset time, the message display status of all the time-series business messages in the sorting result is determined to be displayed.
[0137] Specifically, if the client does not receive a display status change event within the first preset time, there are two possible scenarios.
[0138] Scenario 1: All time-series business messages are displayed in the "display" state and require no change; that is, there will be no display status change event. In this case, if no display status change event is received within the first preset time, the client does not need to perform any operation, and all the time-series business messages are already in the "display" state.
[0139] Scenario 2: Due to network failures such as network latency or network outages, no display status change event is received within the first preset time. In this case, if no display status change event is received within the first preset time, the client will change the display status of the time-series business messages in the sorting results that are not currently displaying to displaying.
[0140] The first preset time can be set according to actual needs, and there is no limitation on it.
[0141] In this embodiment, if the client does not receive a display change event within a first preset time, it can determine the display status of all time-series service messages as displayed. Therefore, even in the event of a network failure, the time-series service messages can still be displayed according to the sorted queue, ensuring the orderly display of messages in a real-time communication system with multiple clients.
[0142] A message processing method provided according to an embodiment of this disclosure, such as Figure 4 As shown, the method further includes the following steps:
[0143] S41. Send a query request to the message middleware, the query request including the session identifier to be queried;
[0144] Specifically, the client can proactively send a query request to the message platform to view historical time-series business messages. The query request includes the session identifier to be queried.
[0145] S42. Receive historical time-series service messages sent by the message platform, wherein the historical time-series service messages are multiple time-series service messages matched by the message platform according to the session identifier to be queried in the query request;
[0146] Specifically, the client can receive historical time-series business messages sent by the message platform. These historical time-series business messages are multiple time-series business messages matched by the message platform based on the session identifier to be queried in the query request.
[0147] S43. Display the historical time-series business message based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business message;
[0148] Specifically, the client can display historical time-series business messages based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages.
[0149] In this embodiment, the client can proactively send a query request containing the session identifier to the message platform, and receive historical time-series business messages matched and sent by the message platform based on the session identifier. The client then displays the historical time-series business messages based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages. This ensures that the displayed historical time-series business messages are ordered even when proactively querying them, further enabling ordered message display across multiple clients in an instant messaging system.
[0150] According to a message processing method provided in an embodiment of this disclosure, the message display status includes three states: empty, displayed, and not displayed; step S43 may specifically include the following steps:
[0151] S431. Sort the historical time-series business messages according to the business scenario value, the message batch identifier and the message batch sequence number to obtain the historical sorting result;
[0152] Specifically, the client can determine the historical time-series business messages under the same scenario based on the business scenario value of the historical time-series business messages, then determine the historical time-series business messages in the same batch based on the message batch identifier, and then sort the historical time-series business messages in the same batch according to the message batch sequence number in ascending order to obtain the historical sorting result.
[0153] S432. Display the historical time-series business messages whose display status is displayed according to the historical sorting results;
[0154] Specifically, the client can display historical time-series business messages that are currently in the display state, based on the historical sorting results.
[0155] In this embodiment, the client can sort historical time-series business messages according to the message batch identifier and message batch sequence number, and display the historical time-series business messages that are in the display state according to the historical sorting results. This ensures that the displayed historical time-series business messages are ordered, further enabling the ordered display of messages in the instant messaging system of multiple clients.
[0156] This disclosure also provides a message processing method applied to a message middleware platform, such as... Figure 5 As shown, the method includes the following steps:
[0157] S51. Receive raw business messages from multiple clients, wherein the raw business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status;
[0158] Specifically, in one example, the architecture of the message middleware is as follows: Figure 6 As shown, the message middle platform has a gateway application programming interface (API), which includes message sending and a historical message list. The message middle platform also provides business service functions, including synchronous business services and asynchronous update services. Furthermore, the message middle platform includes basic components, which consist of a database, distributed cache, message queue, and push components.
[0159] The message middle platform can receive raw business messages from multiple clients. The raw business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status.
[0160] In one example, the raw business messages received from multiple clients can be stored in a distributed cache.
[0161] S52. Process the original business message according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status to generate a time-series business message and send it to the multiple clients;
[0162] Specifically, the message middle platform can process the original business messages based on the business scenario value, message batch identifier, message batch sequence number and message display status, generate time-series business messages and send them to multiple clients.
[0163] In this embodiment, the message middleware can receive raw business messages from multiple clients, process the raw business messages according to the business scenario value, message batch identifier, message batch sequence number, and message display status, generate time-series business messages, and send them to multiple clients. This ensures the generated time-series business messages are ordered, guaranteeing the orderliness of the time-series business messages during subsequent client reception and display, thereby achieving ordered message display in the instant messaging system for multiple clients.
[0164] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. Figure 7 As shown, step S52 specifically includes the following steps:
[0165] S71. If the message batch sequence number of the original business message is a preset value, then the message display status of the original business message is changed from empty to displayed, and the time-series business message is obtained.
[0166] Specifically, when the message batch sequence number of the original business message is a preset value, the message platform can change the message display status of the original business message from empty to displayed, thus obtaining a time-series business message.
[0167] An empty message display status indicates that the message has not been processed. Preset values can be set according to actual needs.
[0168] In a preferred example, the preset value can be 1. The message platform receives the original business message. If the message batch sequence number of the original business message is 1, it means that the original business message is the first message under the message batch represented by its message batch identifier. The message platform changes the display status of the original business message from empty to displayed, thus obtaining the time-series business message.
[0169] S72. Store the time-series service messages in a distributed cache;
[0170] Specifically, the message middle platform can store time-series business messages in a distributed cache to temporarily save them, thus enabling the persistence of these messages.
[0171] S73. Send the timing service message to the plurality of clients;
[0172] Specifically, a message middleware platform can send time-series business messages to multiple clients. In one example, the message middleware platform can determine the clients to which to send the messages based on the message recipient and the message recipient's identity in the time-series business message, and send the time-series business messages to multiple clients.
[0173] In this embodiment, the message middleware receives raw business messages from multiple clients, changes the display status of the raw business message with a preset batch sequence number from empty to displayed, and persistently stores it in a distributed cache. It then sends time-series business messages to multiple clients. This persistent storage and distribution of time-series business messages ensures the orderliness of these messages during subsequent client reception and display, thereby achieving ordered message display in the real-time communication system for multiple clients.
[0174] According to a message processing method provided in this disclosure, the message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. Figure 8 As shown, step S52 specifically includes the following steps:
[0175] S81. If the message batch sequence number of the original business message is not a preset value, then query the message display status of the preceding business message in the distributed cache. The preceding business message is the original business message or the time-series business message corresponding to the original business message after the message batch sequence number is reduced by one under the same business scenario value and the same message batch identifier.
[0176] Specifically, when the message batch sequence number of the original business message is not a preset value, the message platform can query the message display status of the preceding business message in the distributed cache. The preceding business message is the original business message or time-series business message corresponding to the original business message with the same business scenario value and the same message batch identifier minus one.
[0177] In a preferred example, the preset value can be 1. The message middle platform receives the original business message. If the message batch sequence number of the original business message is 2, which is not the preset value 1, the message middle platform queries the distributed cache for the message display status of the message with the same business scenario value and the same message batch identifier and message batch sequence number 1, which is the message display status of the preceding business message.
[0178] S82. When the message display status of the preceding service message is displayed, change the message display status of the original service message to displayed to obtain the time-series service message; store the time-series service message in a distributed cache; and send the time-series service message to the multiple clients.
[0179] Specifically, when the current business message is displayed, the message platform can change the display status of the original business message to displayed, thus obtaining a time-series business message. Then, the message platform can store the time-series business message in a distributed cache, achieving persistent storage of the time-series business message. Finally, the message platform can send the time-series business message to multiple clients.
[0180] In one example, the message middle platform can determine the client to send to based on the message recipient and message recipient identity in the time-series business message, and send time-series business messages to multiple clients.
[0181] S83. When the message display status of the preceding service message is empty or not displayed, change the message display status of the original service message to not displayed to obtain the time-series service message; send the time-series service message to the multiple clients.
[0182] Specifically, when the current business message is not displayed, the message platform can change the display status of the original business message to not displayed, thus obtaining a time-series business message. The message platform can then send the time-series business message to multiple clients.
[0183] In one example, the message middle platform can determine the clients to which to send the message based on the message recipient and the message recipient's identity in the time-series business message, and send time-series business messages to multiple clients. For example... Figure 6The synchronous service shown may include steps S81-S83 as described above.
[0184] In one example, such as Figure 9 As shown, the message middleware obtains the message details msgInfo of the original business messages to be sent to various clients, including the data recorded in Table 1.
[0185] The message middle platform checks if the message batch sequence number `msgInfo.msgBatchOrder` in the original business message is 1. If the result is yes, it indicates that this message is the first message in the corresponding message batch and can be displayed. The message middle platform sets the message display status `msgInfo.msgShowStatus` of the original business message to 1, at which point the original business message is transformed into a time-series business message. The message middle platform caches the business scenario value, message batch identifier, message batch sequence number, and message display status `msgInfo.msgShowStatus` from the `msgInfo` data corresponding to the time-series business message in a key-value pair format in a distributed cache Redis. The cache key is `{businessKey}:{msgBatchId}:{msgBatchOrder}`, and the value is 1. The cache validity period can be set according to actual needs, for example, 60 minutes. The message middle platform sends the time-series business message to the client and also sends the time-series business message to the message queue.
[0186] If the message platform determines whether to display a message message, the message batch sequence number `msgInfo.msgBatchOrder` in the original business message returns "no", it means that the message is not the first message in the corresponding message batch. Further confirmation is needed. The message platform retrieves the message display status of the preceding business message (`msgInfo-X`) from the distributed cache, which has the same business scenario value and the same message batch identifier, and whose message batch sequence number is one less than `msgInfo.msgBatchOrder` (-1).
[0187] When the message display status msgInfo-X.msgShowStatus of the current business message is 1 (meaning it is displayed), the message platform sets the message display status msgInfo.msgShowStatus of the original business message to 1 (meaning it is displayed), at which point the original business message is transformed into a time-series business message. The message platform caches the msgInfo data of this time-series business message, especially the business scenario value, message batch identifier, message batch sequence number, and message display status msgInfo.msgShowStatus, in a distributed cache Redis in key-value format. The cache key is {businessKey}:{msgBatchId}:{msgBatchOrder}, and the value is 1. The message platform then sends this time-series business message to the client and also sends it to the message queue.
[0188] If the message display status msgInfo-X.msgShowStatus of the current business message is not 1 (i.e., not displayed), is 0 (not displayed), or is empty (not processed), the message platform sets the message display status msgInfo.msgShowStatus of the original business message to 0, meaning it is not displayed. At this point, the original business message is transformed into a time-series business message. The message platform sends this time-series business message to the client and also sends it to the message queue.
[0189] In this embodiment, when the message batch sequence number of the original business message is not a preset value, the message middleware queries the message display status of the preceding business message in the distributed cache. If the message display status of the preceding business message is "displayed," the message display status of the original business message is changed to "displayed," resulting in a time-series business message, which is then stored in the distributed cache and simultaneously sent to the client. If the message display status of the preceding business message is "not displayed," the message display status of the original business message is changed to "not displayed," resulting in a time-series business message, which is then sent to the client. This synchronizes the message display status of the original business message with that of the preceding message, ensuring the orderliness of the time-series business messages during subsequent client reception and display, thereby achieving ordered message display in a real-time communication system for multiple clients.
[0190] According to a message processing method provided in an embodiment of this disclosure, after step S52, as follows: Figure 10 As shown, the method further includes the following steps:
[0191] S101. Send the time-series service message to the message queue;
[0192] Specifically, the message middle platform can send time-series business messages to the message queue.
[0193] S102. Store the time-series business messages in the message queue into the database;
[0194] Specifically, the message middle platform can store time-series business messages in the message queue into the database, thus persistently storing these messages in the database.
[0195] S103. When the message display status of the time-series business message is displayed, the message display status of the subsequent business message is obtained in the distributed cache, wherein the subsequent business message is the original business message or the time-series business message corresponding to the message batch sequence number plus one under the same business scenario value and the same message batch identifier.
[0196] Specifically, when the message display status of a time-series business message is "displayed," the message platform can obtain the message display status of subsequent messages from the distributed cache. The subsequent business message is the original business message or time-series business message corresponding to the message batch sequence number of the time-series business message under the same business scenario value and the same message batch identifier, plus one.
[0197] S104. If the message display status of the subsequent service message is not displayed, then change the message display status of the subsequent service message in the distributed cache and the database to displayed, and send a display status change event to the multiple clients, and re-execute the step of obtaining the message display status of the subsequent service message in the distributed cache.
[0198] Specifically, if the message display status of a subsequent business message is not displayed, the message platform can change the message display status of the subsequent business message in the distributed cache and database to displayed, and send display status change events to multiple clients. Afterwards, the message platform re-executes the step of retrieving the message display status of the subsequent business message from the distributed cache.
[0199] S105. If the message display status of the subsequent service message is empty or displayed, the process ends.
[0200] Specifically, if the message display status of the subsequent business message is empty or displayed, then the process ends.
[0201] In one example, a time-series business message in the message queue has a message batch sequence number of 2, and its message display status is "displayed". The message platform queries the distributed cache for the message display status of the original business message or time-series business message with the same business scenario value and the same message batch identifier, which has a message batch sequence number of 3, i.e., the message display status of the subsequent business message.
[0202] If the message display status of the subsequent business message is empty or displayed, then the process ends.
[0203] If the message display status of the subsequent business message is not displayed, the message platform will change the message display status of the subsequent business message in the distributed cache and database to displayed, and send the display status to multiple clients. Multiple clients can be identified based on the message recipient and message recipient user identifier of the subsequent message. The platform will then re-execute the process of retrieving the message display status of the subsequent business message from the distributed cache until the message display status of the subsequent business message is either empty or displayed, at which point the process ends. Alternatively, the process ends when the message platform does not retrieve the subsequent business message from the distributed cache. Figure 6 The asynchronous update service shown may include steps S101-S105 as described above.
[0204] In one example, such as Figure 11 As shown, the message middle platform retrieves the message information (i.e., message details) msgInfo corresponding to the time-series business messages from the message queue and persists it to the database.
[0205] The message middleware retrieves the msgInfo of time-series business messages from the database and checks if the msgInfo.msgShowStatus value is 1. If the result is no, it means that the time-series business message will not be displayed, and subsequent messages for this time-series business message do not need to be considered for the time being, and the process ends.
[0206] If the judgment result is yes, it means that the time-series business message will be displayed. At this time, it is necessary to consider whether its subsequent messages will also be displayed. If the current time-series business message is displayed, but the subsequent messages are not displayed, then the message display status of the subsequent messages needs to be changed to displayed. To this end, the message platform retrieves the message display status of the message details msgInfo of the subsequent business message under the same business scenario value and the same message batch, plus one (msgInfo.msgBatchOrder=msgInfo.msgBatchOrder+1), from the cache.
[0207] If the message display status value of a follow-up message is empty, it means there are no follow-up messages in this batch, and the process ends. If the message display status value of a follow-up message is 1, it means the follow-up message has been set to be displayed, and the process ends.
[0208] When the message display status of a subsequent message is not empty or is 1 (i.e., the message display status is 0, indicating no display), the message middleware updates the message display status in the cache and database for that time-series business message's msgInfo to 1, i.e., sets msgShowStatus=1. The message middleware sends a display status change event message to the client. The message middleware then re-executes the process of retrieving the message display status of the subsequent message's message details msgInfo from the cache. This time, it retrieves the subsequent message of the original subsequent message, and continues the above steps until the retrieved message display status is empty, i.e., there are no subsequent messages in that batch.
[0209] In this embodiment, the message middle platform sends sequential business messages to a message queue and stores these messages in a database. When the message display status of a sequential business message is "displayed," the platform retrieves the display status of subsequent business messages from a distributed cache. If the display status of a subsequent business message is "not displayed," the message middle platform changes the display status of the subsequent business message in both the distributed cache and the database to "displayed" and sends a display status change event to multiple clients. If the display status of the subsequent business message is either empty or displayed, the process ends. This implements the mechanism of changing the display status of subsequent business messages based on the current display status of the sequential business message and sending a status change event. This ensures that subsequent clients receive the status change event and update their sequential business messages accordingly, maintaining the orderliness of the sequential business messages during subsequent display processes. Consequently, the message display of the instant messaging system across multiple clients is ordered.
[0210] A message processing method according to an embodiment of this disclosure further includes the following steps:
[0211] S106. Select the time-series business messages in the database whose message display status is still not displayed within a first preset time period, change the message display status of the selected time-series business messages to displayed, and generate an abnormal change log.
[0212] Specifically, the message platform can select time-series business messages from the database whose message display status is still not displayed within a first preset time period, change the message display status of the selected time-series business messages to be displayed, and generate an exception change log.
[0213] In one example, the first preset time is set to 20 seconds. The database contains four time-series business messages with the same business scenario value and the same message batch identifier. The message batch sequence numbers for these four time-series business messages are 1, 2, 4, and 5, respectively. The message display status for time-series business messages with batch sequence numbers 1 and 2 is "displayed." Due to network failures or other reasons, the message platform did not receive the original business message with batch sequence number 3. Therefore, according to the above steps, the message display status for time-series business messages with batch sequence numbers 4 and 5 is "not displayed."
[0214] If, after 20 seconds, the message middle platform has not received the original business message with batch sequence number 3, the message display status of the time-series business messages with batch sequence numbers 4 and 5 remains "not displayed." At this point, the message middle platform selects the time-series business messages with batch sequence numbers 4 and 5, changes their message display status to "displayed," and generates an exception change log.
[0215] In this embodiment, the message middleware selects time-series business messages from the database whose display status is still not displayed within a first preset time period, changes the display status of the selected time-series business messages to displayed, and generates an exception change log. When the message middleware does not receive certain original business messages, it enables the time-series business messages in the database to change their display status. Developers can check the client and network based on the exception change log. This provides a basis for ordering when subsequently querying historical time-series messages from the database, ensuring the orderly display of messages in the instant messaging system across multiple clients.
[0216] According to a message processing method provided in an embodiment of this disclosure, the original business message and the time-series business message further include a session identifier, such as... Figure 12 As shown, the method further includes:
[0217] S121. Receive a query request sent by the client, the query request including the session identifier to be queried;
[0218] Specifically, both raw business messages and time-series business messages also include session identifiers. The message middleware can receive query requests sent by clients, which include the session identifier to be queried.
[0219] S122. Match the time-series service message that matches the session identifier to be queried in the query request, and use it as a historical time-series service message;
[0220] Specifically, the message middle platform can match time-series business messages in the database that match the session identifier that needs to be queried, and use them as historical time-series business messages.
[0221] In one example, historical time-series business messages can be stored in, for example... Figure 6 The historical message list of the gateway API is shown.
[0222] S123. Send the historical time-series service message to the client;
[0223] Specifically, the message middleware can send historical time-series business messages to the client.
[0224] In one example, such as Figure 6 The push component shown can execute step S123.
[0225] In this embodiment, the message middleware receives a query request sent by a client. The query request includes a session identifier to be queried. A time-series business message matching the session identifier in the query request is then sent to the client as a historical time-series business message. This ensures that the queried historical time-series messages are also ordered, thereby achieving ordered message display across multiple clients in the instant messaging system.
[0226] The message processing apparatus provided in the embodiments of this disclosure is described below. The message processing apparatus described below can be referred to in correspondence with the message processing method described above.
[0227] This disclosure also provides a message processing device, configured on a client, such as... Figure 13 As shown, the device includes:
[0228] Acquisition unit 131 is used to acquire order events;
[0229] The generation unit 132 is used to generate an original business message based on the order event and send the original business message to the message middle platform. The original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status.
[0230] The first receiving unit 133 is used to receive the time-series business message returned by the message platform, wherein the time-series business message is generated by the message platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status.
[0231] The display unit 134 is used to display the time-series business message according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status of the time-series business message.
[0232] In this embodiment, the client obtains an order event, generates an original business message based on the order event, and sends the original business message, including a message batch identifier, the message batch sequence number, and the message display status, to the message middle platform. The client then receives a sequential business message returned by the message middle platform and displays the sequential business message based on its message batch identifier, message batch sequence number, and message display status. This achieves ordered message display in an instant messaging system with multiple clients.
[0233] According to an embodiment of this disclosure, a message processing device is provided, wherein the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0234] Display unit 134 is specifically used for:
[0235] The time-series business messages are sorted according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain the sorting result;
[0236] The time-series business messages whose display status is displayed are shown according to the sorting results.
[0237] According to an embodiment of this disclosure, a message processing device is provided, wherein the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0238] Display unit 134 is also used for:
[0239] Receive the display status change event sent by the message platform;
[0240] Based on the displayed status change event, determine the time-series business message that needs to be changed;
[0241] Change the message display status of the time-series business message that needs to be changed to "display".
[0242] According to an embodiment of the present disclosure, a message processing apparatus, specifically displaying unit 134, is further configured to:
[0243] If no display status change event is received within the first preset time, then the message display status of all the time-series business messages in the sorting result will be determined as displayed.
[0244] According to an embodiment of this disclosure, a message processing apparatus further includes a session identifier in the original service message and the time-series service message, such as... Figure 14 As shown, the device further includes:
[0245] The query request sending unit 141 is used to send a query request to the message middleware, the query request including the session identifier to be queried;
[0246] The historical receiving unit 142 is used to receive historical time-series service messages sent by the message platform, wherein the historical time-series service messages are multiple time-series service messages matched by the message platform according to the session identifier to be queried in the query request.
[0247] The historical display unit 143 is used to display the historical time-series business messages based on the business scenario value, message batch identifier, message batch sequence number and message display status of the historical time-series business messages.
[0248] According to an embodiment of this disclosure, a message processing apparatus is provided, wherein the message display state includes three states: empty, displayed, and not displayed.
[0249] Historical display unit 143 is specifically used for:
[0250] The historical time-series business messages are sorted according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain the historical sorting result;
[0251] The historical time-series business messages are displayed according to the historical sorting results.
[0252] This disclosure also provides a message processing device, configured in a message middleware, such as... Figure 15 As shown, the device includes:
[0253] The second receiving unit 151 is used to receive original business messages from multiple clients, the original business messages including business scenario values, message batch identifiers, message batch sequence numbers, and message display status;
[0254] The processing unit 152 is used to process the original business message according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status, generate a time-series business message and send it to the multiple clients.
[0255] In this embodiment, the message middleware can receive raw business messages from multiple clients, process the raw business messages according to the business scenario value, message batch identifier, message batch sequence number, and message display status, generate time-series business messages, and send them to multiple clients. This ensures the generated time-series business messages are ordered, guaranteeing the orderliness of the time-series business messages during subsequent client reception and display, thereby achieving ordered message display in the instant messaging system for multiple clients.
[0256] According to an embodiment of this disclosure, a message processing device is provided, wherein the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0257] Processing unit 152 is specifically used for:
[0258] If the message batch sequence number of the original business message is a preset value, then the message display status of the original business message is changed from empty to displayed, and the time-series business message is obtained.
[0259] The time-series business messages are stored in a distributed cache;
[0260] Send the time-series service messages to the multiple clients.
[0261] According to an embodiment of this disclosure, a message processing device is provided, wherein the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0262] Processing unit 152 is specifically used for:
[0263] If the message batch sequence number of the original business message is not a preset value, then query the message display status of the preceding business message in the distributed cache. The preceding business message is the original business message or the time-series business message corresponding to the original business message after the message batch sequence number is reduced by one under the same business scenario value and the same message batch identifier.
[0264] When the message display status of the preceding business message is displayed, the message display status of the original business message is changed to displayed to obtain the time-series business message; the time-series business message is stored in a distributed cache; and the time-series business message is sent to the multiple clients.
[0265] When the message display status of the preceding service message is empty or not displayed, the message display status of the original service message is changed to not displayed, thus obtaining the time-series service message; the time-series service message is sent to the multiple clients.
[0266] According to an embodiment of this disclosure, a message processing device is provided, wherein the message display status includes three states: empty, displayed, and not displayed, and the message display status of the original business message is empty;
[0267] Processing unit 152 is also used for:
[0268] Send the time-series business message to the message queue;
[0269] Store the time-series business messages in the message queue into the database;
[0270] When the message display status of the time-series business message is displayed, the message display status of the subsequent business message is obtained in the distributed cache. The subsequent business message is the original business message or the time-series business message corresponding to the message batch sequence number plus one under the same business scenario value and the same message batch identifier.
[0271] If the message display status of the subsequent service message is not displayed, then the message display status of the subsequent service message in the distributed cache and the database is changed to displayed, and a display status change event is sent to the multiple clients, and the step of obtaining the message display status of the subsequent service message in the distributed cache is re-executed;
[0272] If the message display status of the subsequent service message is empty or displayed, the process ends.
[0273] According to an embodiment of this disclosure, a message processing apparatus, processing unit 152, is further configured to:
[0274] Select the time-series business messages in the database whose message display status is still not displayed within a first preset time period, change the message display status of the selected time-series business messages to displayed, and generate an abnormal change log.
[0275] A message processing apparatus provided according to an embodiment of this disclosure, such as Figure 16 As shown, the device further includes:
[0276] The query request receiving unit 161 is used to receive a query request sent by the client, the query request including the session identifier to be queried;
[0277] The historical matching unit 162 is used to match the time-series business message that is consistent with the session identifier to be queried in the query request, and use it as a historical time-series business message.
[0278] The historical sending unit 163 is used to send the historical time-series service messages to the client.
[0279] Figure 17 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 17As shown, the electronic device may include: a processor 1710, a communications interface 1720, a memory 1730, and a communications bus 1740, wherein the processor 1710, the communications interface 1720, and the memory 1730 communicate with each other through the communications bus 1740. Processor 1710 can call logical instructions in memory 1730 to execute a message processing method applied to a client. This method includes: acquiring an order event; generating an original business message based on the order event; sending the original business message to a message middleware platform, wherein the original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; receiving a time-series business message returned by the message middleware platform, wherein the time-series business message is generated by the message middleware platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status; and displaying the time-series business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status.
[0280] Alternatively, processor 1710 can call logic instructions in memory 1730 to execute a message processing method applied to a message middleware. This method includes: receiving raw business messages from multiple clients, the raw business messages including a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; processing the raw business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate time-series business messages and send them to the multiple clients.
[0281] Furthermore, the logical instructions in the aforementioned memory 1730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this disclosure, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0282] On the other hand, this disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the message processing methods provided by the above methods, applied to a client. The method includes: obtaining an order event; generating an original business message based on the order event; sending the original business message to a message middleware platform, wherein the original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; receiving a time-series business message returned by the message middleware platform, wherein the time-series business message is generated by the message middleware platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status; and displaying the time-series business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status of the time-series business message.
[0283] Alternatively, the computer can execute the message processing methods provided by the above methods and apply them to a message middleware platform. The method includes: receiving raw business messages from multiple clients, wherein the raw business messages include a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; processing the raw business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate time-series business messages and send them to the multiple clients.
[0284] In another aspect, this disclosure also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the aforementioned message processing methods, applied to a client. The method includes: acquiring an order event; generating an original business message based on the order event; sending the original business message to a message middleware platform, wherein the original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; receiving a time-series business message returned by the message middleware platform, wherein the time-series business message is generated by the message middleware platform receiving the original business messages from multiple clients and processing the original business messages based on the business scenario value, the message batch identifier, the message batch sequence number, and the message display status; and displaying the time-series business message based on the business scenario value, the message batch identifier, the message batch sequence number, and the message display status of the time-series business message.
[0285] Alternatively, when the computer program is executed by a processor, it is implemented to perform the message processing methods provided above, applied to a message middleware platform. The method includes: receiving raw business messages from multiple clients, the raw business messages including a business scenario value, a message batch identifier, a message batch sequence number, and a message display status; processing the raw business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate time-series business messages and send them to the multiple clients.
[0286] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0287] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0288] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure.
Claims
1. A message processing method for internet-based healthcare, characterized in that, Applied to a client, the method includes: Order retrieval event; Based on the order event, an original business message is generated and sent to the message middle platform. The original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status. The message middle platform has a gateway application programming interface, business service functions, and basic components. The system receives time-series business messages returned by the message platform. These time-series business messages are generated by the message platform receiving original business messages from multiple clients and processing them according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status. The multiple clients include patient clients, doctor clients, medical assistant clients, and pharmacist clients. The time-series business message is displayed based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the time-series business message.
2. The message processing method for internet healthcare according to claim 1, characterized in that, The message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. The step of displaying the time-series business message based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the time-series business message includes: The time-series business messages are sorted according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain the sorting result; The time-series business messages whose display status is displayed are shown according to the sorting results.
3. The message processing method for internet healthcare according to claim 2, characterized in that, Before displaying the time-series business messages whose display status is set according to the sorting result, the method further includes: Receive the display status change event sent by the message platform; Based on the displayed status change event, determine the time-series business messages that need to be changed; Change the message display status of the time-series business message that needs to be changed to "display".
4. The message processing method for internet healthcare according to claim 3, characterized in that, After the step of receiving the display status change event sent by the message platform, the method further includes: If no display status change event is received within the first preset time, then the message display status of all the time-series business messages in the sorting result will be determined as displayed.
5. The message processing method for internet healthcare according to claim 1, characterized in that, The original service message and the time-series service message also include a session identifier, and the method further includes: Send a query request to the message platform, the query request including the session identifier to be queried; Receive historical time-series service messages sent by the message platform, wherein the historical time-series service messages are multiple time-series service messages matched by the message platform according to the session identifier to be queried in the query request; The historical time-series business messages are displayed based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages.
6. The message processing method for internet healthcare according to claim 5, characterized in that, The message display status includes three states: empty, displayed, and not displayed. The step of displaying the historical time-series business messages based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages includes: The historical time-series business messages are sorted according to the business scenario value, the message batch identifier, and the message batch sequence number to obtain the historical sorting result; The historical time-series business messages are displayed according to the historical sorting results.
7. A message processing method for internet-based healthcare, characterized in that, Applied to a message middleware platform, the method includes: Receive raw business messages from multiple clients, wherein the raw business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status; The original business message is processed based on the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and send it to the multiple clients; The message platform has a gateway application programming interface, business service functions, and basic components; the multiple clients include patient clients, doctor clients, medical assistant clients, and pharmacist clients.
8. The message processing method for internet healthcare according to claim 7, characterized in that, The message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. The step of processing the original business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and sending it to the multiple clients includes: If the message batch sequence number of the original business message is a preset value, then the message display status of the original business message is changed from empty to displayed, and the time-series business message is obtained. The time-series business messages are stored in a distributed cache; Send the time-series service messages to the multiple clients.
9. The message processing method for internet healthcare according to claim 7, characterized in that, The message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. The step of processing the original business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and sending it to the multiple clients includes: If the message batch sequence number of the original business message is not a preset value, then query the message display status of the preceding business message in the distributed cache. The preceding business message is the original business message or the time-series business message corresponding to the original business message after the message batch sequence number is reduced by one under the same business scenario value and the same message batch identifier. When the message display status of the preceding business message is displayed, the message display status of the original business message is changed to displayed to obtain the time-series business message; the time-series business message is stored in a distributed cache; and the time-series business message is sent to the multiple clients. When the message display status of the preceding service message is empty or not displayed, the message display status of the original service message is changed to not displayed, thus obtaining the time-series service message; the time-series service message is sent to the multiple clients.
10. The message processing method for internet healthcare according to claim 7, characterized in that, The message display status includes three states: empty, displayed, and not displayed. The message display status of the original business message is empty. After the step of processing the original business message according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status to generate a time-series business message and send it to the multiple clients, the method further includes: Send the time-series business message to the message queue; Store the time-series business messages in the message queue into the database; When the message display status of the time-series business message is displayed, the message display status of the subsequent business message is obtained in the distributed cache. The subsequent business message is the original business message or the time-series business message corresponding to the message batch sequence number of the time-series business message under the same business scenario value and the same message batch identifier plus one. If the message display status of the subsequent service message is not displayed, then the message display status of the subsequent service message in the distributed cache and the database is changed to displayed, and a display status change event is sent to the multiple clients, and the step of obtaining the message display status of the subsequent service message in the distributed cache is re-executed; If the message display status of the subsequent service message is empty or displayed, the process ends.
11. The message processing method for internet healthcare according to claim 10, characterized in that, The method further includes: Select the time-series business messages in the database whose message display status is still not displayed within a first preset time period, change the message display status of the selected time-series business messages to displayed, and generate an abnormal change log.
12. The message processing method for internet healthcare according to claim 7, characterized in that, The original service message and the time-series service message also include a session identifier, and the method further includes: Receive a query request sent by the client, the query request including the session identifier to be queried; Match the time-series service message that matches the session identifier to be queried in the query request, and use it as a historical time-series service message; The historical time-series business messages are sent to the client.
13. A message processing device for internet-based medical services, characterized in that, The device, configured on the client side, includes: The acquisition unit is used to acquire order events; The generation unit is used to generate an original business message based on the order event and send the original business message to the message middle platform. The original business message includes a business scenario value, a message batch identifier, a message batch sequence number, and a message display status. The message middle platform has a gateway application programming interface, business service functions, and basic components. The first receiving unit is configured to receive the time-series business messages returned by the message platform, wherein the time-series business messages are generated by the message platform receiving the original business messages from multiple clients and processing the original business messages according to the business scenario value, the message batch identifier, the message batch sequence number, and the message display status; wherein the multiple clients include patient clients, doctor clients, medical assistant clients, and pharmacist clients. The display unit is used to display the time-series business message based on the business scenario value, the message batch identifier, the message batch sequence number, and the message display status of the time-series business message.
14. The message processing device for internet-based medical care according to claim 13, characterized in that, The device further includes: A query request sending unit is used to send a query request to the message platform, wherein the query request includes the session identifier to be queried; The historical receiving unit is used to receive historical time-series service messages sent by the message platform, wherein the historical time-series service messages are multiple time-series service messages matched by the message platform according to the session identifier to be queried in the query request; The historical display unit is used to display the historical time-series business messages based on the business scenario value, message batch identifier, message batch sequence number, and message display status of the historical time-series business messages.
15. A message processing device for internet-based medical services, characterized in that, The device, located in the message middleware, includes: The second receiving unit is used to receive original business messages from multiple clients. The original business messages include business scenario values, message batch identifiers, message batch sequence numbers, and message display status. The processing unit is used to process the original business message according to the business scenario value, the message batch identifier, the message batch sequence number and the message display status, generate a time-series business message and send it to the multiple clients; The message platform has a gateway application programming interface, business service functions, and basic components; the multiple clients include patient clients, doctor clients, medical assistant clients, and pharmacist clients.
16. The message processing device for internet-based medical care according to claim 15, characterized in that, The device further includes: A query request receiving unit is configured to receive a query request sent by the client, wherein the query request includes a session identifier to be queried; The historical matching unit is used to match the time-series business message that is consistent with the session identifier to be queried in the query request, and use it as a historical time-series business message. The historical sending unit is used to send the historical time-series service messages to the client.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the message processing method for Internet healthcare as described in any one of claims 1 to 12.
18. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the message processing method for Internet healthcare as described in any one of claims 1 to 12.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the message processing method for Internet healthcare as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Service scene element serial number generation method and device, medium and computer equipment
CN109597853A
Asynchronous message processing method and device
CN110221927A
Instant message processing method, device and equipment, server and storage medium
CN111669316A
Instant messaging session message processing method and device and electronic equipment
CN111782829A
Webpage display method and device, terminal equipment and medium
CN112818271A