Message processing method, device, electronic device and storage medium
By determining the target text template identification of exception text information, and performing message filtering and withdrawal processing, the problem of mass error messages on the server is solved, and the accuracy and user experience of message delivery are improved.
Patent Information
- Application Number
- CN202310020522.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2043-01-06
AI Technical Summary
In the scenario of official account operation, the server sends a mass error message that will cause users to be unable to receive the correct content, resulting in resource losses and user experience losses.
By determining the target text template identifier corresponding to the exception text information, message filtering is performed, pending messages are obtained, and message withdrawal is performed according to the transmission status to ensure that the user does not receive the error message.
It effectively reduces server resource usage, prevents users from receiving error messages, and improves the accuracy of server mass messages.
Smart Images

Figure CN116132392B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a message processing method, device, electronic device and storage medium. Background Art
[0002] In the scenario of official account operation, it is often necessary to frequently send group messages to users. The group messages are usually the same batch of messages with the same text. In the related technology, if there are messages with abnormal text such as incorrect message content in the same batch of messages, the server continues to broadcast the wrong message and cannot deliver the correct content to the user, thereby causing loss of server resources and loss of user experience. Summary of the invention
[0003] The present disclosure provides a message processing method, device, electronic device and storage medium to at least solve the problem of loss caused by broadcasting error messages in the related art. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a message processing method is provided, the method comprising:
[0005] Determine a target text template identifier corresponding to the abnormal text information; the target text template identifier is an identifier of a text template that generates the abnormal text information;
[0006] Based on the target text template identifier, filtering the transmission messages in at least one transmission state to obtain at least one to-be-processed message associated with the abnormal text information; the at least one to-be-processed message is a message generated based on the text template corresponding to the target text template identifier;
[0007] Based on the transmission status corresponding to each of the at least one to-be-processed messages, message withdrawal processing is performed on the at least one to-be-processed message.
[0008] As an optional embodiment, the performing message withdrawal processing on the at least one to-be-processed message based on the transmission status corresponding to each of the at least one to-be-processed messages includes:
[0009] In the case where the transmission status indication message corresponding to any pending message has been sent, obtaining a client identifier corresponding to the first pending message from the sending log data corresponding to the first pending message; the first pending message is a pending message to which the corresponding transmission status indication message has been sent;
[0010] A message withdrawal instruction is sent to a first client corresponding to the client identifier, where the message withdrawal instruction is used to instruct the first client to perform message withdrawal processing on the first to-be-processed message.
[0011] As an optional embodiment, the sending a message withdrawal instruction to the first client corresponding to the client identifier includes:
[0012] The message withdrawal instruction is sent to the first client corresponding to the client identifier, and the message withdrawal instruction carries the message sequence identifier of the first pending message in the target message session; the target message session is a message session between the first client and the target application account corresponding to the first pending message; the message withdrawal instruction is used to instruct the first client to update the first pending message in the target message session to a hidden display message based on the message sequence identifier.
[0013] As an optional embodiment, the performing message withdrawal processing on the at least one to-be-processed message based on the transmission status corresponding to each of the at least one to-be-processed messages includes:
[0014] When the transmission status indication message corresponding to any pending message is not sent, stop executing the sending operation corresponding to the second pending message, where the second pending message is the pending message whose corresponding transmission status indication message is not sent.
[0015] As an optional embodiment, the performing message withdrawal processing on the at least one to-be-processed message based on the transmission status corresponding to each of the at least one to-be-processed messages includes:
[0016] When the transmission status indication message corresponding to any pending message is being sent, the sending interface corresponding to the third pending message is closed, and the third pending message is the pending message corresponding to the transmission status indication message being sent.
[0017] As an optional embodiment, the at least one transmission state includes at least one transmission state indicating that the message has not been sent, a transmission state indicating that the message is being sent, and a transmission state indicating that the message has been sent. In the case where the at least one transmission state includes all transmission states, the transmission message in at least one transmission state is filtered based on the target text template identifier, and the at least one to-be-processed message associated with the abnormal text information includes:
[0018] Acquire a message structure of a transmission message in a first transmission state, wherein the first transmission state includes a transmission state indicating that the message has not been sent and a transmission state indicating that the message is being sent;
[0019] Acquire a text template identifier corresponding to the transmission message in the first transmission state from the message structure;
[0020] Comparing the text template identifier with the target text template identifier;
[0021] Determine the transmission message whose text template identifier matches the target text template identifier as the message to be processed;
[0022] Acquire sending log data of a transmission message in a second transmission state, wherein the second transmission state includes a transmission state indicating that the message has been sent;
[0023] The target sending log data corresponding to the target text template identifier is obtained from the sending log data, and the transmission message corresponding to the target sending log data is determined as the message to be processed.
[0024] As an optional embodiment, the method of obtaining a message structure of a transmission message in the first transmission state includes:
[0025] Acquire a message structure of a transmission message in a message pull link, wherein a transmission status indication message corresponding to the transmission message in the message pull link is not sent;
[0026] A message structure of a transmission message in a message sending link is acquired, wherein a transmission status corresponding to the transmission message in the message sending link indicates that the message is being sent.
[0027] According to a second aspect of an embodiment of the present disclosure, a message processing device is provided, the device comprising:
[0028] A target identifier determination module is configured to determine a target text template identifier corresponding to the abnormal text information; the target text template identifier is an identifier of a text template that generates the abnormal text information;
[0029] A message filtering module is configured to perform message filtering on transmission messages in at least one transmission state based on the target text template identifier to obtain at least one to-be-processed message associated with the abnormal text information; the at least one to-be-processed message is a message generated based on a text template corresponding to the target text template identifier;
[0030] The message withdrawal module is configured to execute message withdrawal processing on the at least one to-be-processed message based on the transmission status corresponding to each of the at least one to-be-processed messages.
[0031] As an optional embodiment, the message withdrawal module includes:
[0032] The client identification acquisition unit is configured to execute, when the transmission status indication message corresponding to any pending message has been sent, to acquire the client identification corresponding to the first pending message from the sending log data corresponding to the first pending message; the first pending message is a pending message to which the corresponding transmission status indication message has been sent;
[0033] The message withdrawal instruction sending unit is configured to execute sending a message withdrawal instruction to the first client corresponding to the client identifier, wherein the message withdrawal instruction is used to instruct the first client to perform message withdrawal processing on the first to-be-processed message.
[0034] As an optional embodiment, the message withdrawal instruction sending unit includes:
[0035] A message withdrawal unit is configured to execute the message withdrawal instruction to send the message withdrawal instruction to the first client corresponding to the client identifier, wherein the message withdrawal instruction carries the message sequence identifier of the first to-be-processed message in the target message session; the target message session is a message session between the first client and the target application account corresponding to the first to-be-processed message; the message withdrawal instruction is used to instruct the first client to update the first to-be-processed message in the target message session to a hidden display message based on the message sequence identifier.
[0036] As an optional embodiment, the message withdrawal module includes:
[0037] The stop sending unit is configured to stop executing the sending operation corresponding to the second pending message when the transmission status indication message corresponding to any pending message is not sent. The second pending message is a pending message whose corresponding transmission status indication message is not sent.
[0038] As an optional embodiment, the message withdrawal module includes:
[0039] The sending suspension unit is configured to execute, when the transmission status indication message corresponding to any pending message is being sent, closing the sending interface corresponding to the third pending message, wherein the third pending message is a pending message being sent corresponding to the transmission status indication message.
[0040] As an optional embodiment, the at least one transmission state includes at least one transmission state of a transmission state indicating that a message has not been sent, a transmission state indicating that a message is being sent, and a transmission state indicating that a message has been sent. In the case where the at least one transmission state includes all transmission states, the message filtering module includes:
[0041] A message structure acquisition unit, configured to execute acquisition of a message structure of a transmission message in a first transmission state, wherein the first transmission state includes a transmission state indicating that the message has not been sent and a transmission state indicating that the message is being sent;
[0042] A template identifier obtaining unit, configured to obtain a text template identifier corresponding to the transmission message in the first transmission state from the message structure;
[0043] An identification comparison unit, configured to compare the text template identification with the target text template identification;
[0044] A first to-be-processed message determining unit is configured to determine a transmission message whose text template identifier matches the target text template identifier as the to-be-processed message;
[0045] a sending log data acquiring unit, configured to acquire sending log data of a transmission message in a second transmission state, wherein the second transmission state includes a transmission state indicating that the message has been sent;
[0046] The second to-be-processed message determining unit is configured to obtain target sending log data corresponding to the target text template identifier from the sending log data, and determine the transmission message corresponding to the target sending log data as the to-be-processed message.
[0047] As an optional embodiment, the message structure acquisition unit includes:
[0048] A first message acquisition unit is configured to execute acquisition of a message structure of a transmission message in a message pull link, wherein a transmission status indication message corresponding to the transmission message in the message pull link is not sent;
[0049] The second message acquisition unit is configured to execute acquisition of a message structure of a transmission message in a message sending link, wherein a transmission status indication message corresponding to the transmission message in the message sending link is being sent.
[0050] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, the electronic device comprising:
[0051] processor;
[0052] a memory for storing instructions executable by the processor;
[0053] The processor is configured to execute the instructions to implement the message processing method as described above.
[0054] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the message processing method as described above.
[0055] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the message processing method described above is implemented.
[0056] The technical solution provided by the embodiment of the present disclosure brings at least the following beneficial effects: based on the target text template identifier corresponding to the abnormal text information, the to-be-processed message is determined, and based on the transmission status corresponding to each of the to-be-processed messages, the to-be-processed message is withdrawn. The method can withdraw the messages sent by the server group, reduce the resource usage of the server and avoid users receiving error messages, thereby improving the accuracy of the server group messages.
[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0059] Figure 1 The diagram is a schematic diagram of an application scenario of a message processing method according to an exemplary embodiment.
[0060] Figure 2 The figure is a flowchart of a message processing method according to an exemplary embodiment.
[0061] Figure 3 The present invention is a flowchart of performing message filtering in a message processing method according to an exemplary embodiment.
[0062] Figure 4 The present invention is a flowchart of determining a transmission status of a transmission message in a message processing method according to an exemplary embodiment.
[0063] Figure 5 The present invention is a flowchart of retracting a sent message in a message processing method according to an exemplary embodiment.
[0064] Figure 6 The present invention is an interactive flow chart of message withdrawal processing performed by a server and a client in a message processing method according to an exemplary embodiment.
[0065] Figure 7 The diagram is a schematic diagram showing a method for processing a message according to an exemplary embodiment, in which a server performs message withdrawal processing based on a transmission status.
[0066] Figure 8 The invention is a block diagram of a message processing device according to an exemplary embodiment.
[0067] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0070] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0071] Figure 1 is a schematic diagram of an application scenario of a message processing method according to an exemplary embodiment. Figure 1 As shown, the method includes a server 110 and a client 120. In the process of the server 110 sending a transmission message to the client 120, the server 110 determines the target text template identifier corresponding to the abnormal text information, and based on the target text template identifier, performs message filtering on the transmission message in at least one transmission state to obtain at least one to-be-processed message associated with the abnormal text information. The server 110 performs message withdrawal processing on at least one to-be-processed message based on the transmission state corresponding to each of the at least one to-be-processed messages.
[0072] In the embodiment of the present disclosure, the server 110 may include an independently operated server, or a distributed server, or a server cluster composed of multiple servers. The server 110 may include a network communication unit, a processor, a memory, and the like.
[0073] In the disclosed embodiment, the client 120 includes physical devices such as smart phones, desktop computers, tablet computers, laptops, digital assistants, smart wearable devices, etc., and may also include software running in the physical devices, such as applications.
[0074] Figure 2 is a flowchart of a message processing method according to an exemplary embodiment. Figure 2As shown, the method is used in a server and includes the following steps.
[0075] S210. Determine the target text template identifier corresponding to the abnormal text information; the target text template identifier is the identifier of the text template that generates the abnormal text information;
[0076] As an optional embodiment, when a message text is detected to be abnormal, the message with abnormal text is used as abnormal text information, and a target text template identifier corresponding to the abnormal text information is determined. The text template of the abnormal text information can be applied to the same batch of transmission messages, so the transmission messages in the same batch as the abnormal text information may all have text abnormalities.
[0077] S220. Based on the target text template identifier, filter the transmission messages in at least one transmission state to obtain at least one to-be-processed message associated with the abnormal text information; at least one to-be-processed message is a message generated based on the text template corresponding to the target text template identifier;
[0078] As an optional embodiment, the transmission messages in the same batch as the abnormal text information may be in one or more of the three transmission states of unsent, being sent or sent. Based on the target text template identifier, the transmission messages in at least one transmission state are filtered to obtain the transmission messages in the same batch as the abnormal text information, that is, at least one to-be-processed message associated with the abnormal text information.
[0079] As an alternative embodiment, see Figure 3 , at least one transmission state includes at least one of a transmission state indicating that a message has not been sent, a transmission state indicating that a message is being sent, and a transmission state indicating that a message has been sent. In the case where at least one transmission state includes all transmission states, based on the target text template identifier, transmission messages in at least one transmission state are filtered, and at least one to-be-processed message associated with the abnormal text information includes:
[0080] S310. Obtaining a message structure of a transmission message in a first transmission state, the first transmission state including a transmission state indicating that the message has not been sent and a transmission state indicating that the message is being sent;
[0081] S320. Obtaining a text template identifier corresponding to the transmission message in the first transmission state from the message structure;
[0082] S330. Compare the text template identifier and the target text template identifier;
[0083] S340. Determine the transmission message whose text template identifier matches the target text template identifier as a message to be processed;
[0084] S350. Obtaining the sending log data of the transmission message in the second transmission state, the second transmission state includes a transmission state indicating that the message has been sent;
[0085] S360. Obtain target sending log data corresponding to the target text template identifier from the sending log data, and determine the transmission message corresponding to the target sending log data as a message to be processed.
[0086] As an optional embodiment, the transmission message in at least one transmission state may include the transmission message in all transmission states, the transmission message in two transmission states and the transmission message in one transmission state. Based on the abnormal text information to determine the time, the data range corresponding to the transmission message in at least one transmission state can be determined. If the abnormal text information is determined when part of the message has been sent, then the transmission message in at least one transmission state is the transmission message in all transmission states. If the abnormal text information is determined when the message has not been sent, then the transmission message in at least one transmission state is the transmission message in the transmission state where the message has not been sent and the transmission message in the transmission state where the message is being sent. If the abnormal text information is determined when the message has been sent, then the transmission message in at least one transmission state is the transmission message in the transmission state where the message has been sent.
[0087] The message structure of the unsent transmission message and the transmission message being sent can be obtained, and the message structure may include a sender identifier, a receiver identifier, an information type, an information content, and a text template identifier. By comparing the text template identifier with the target text template identifier, if the text template identifier matches the target text template identifier, it can be determined that the transmission message corresponding to the matching text template identifier and the abnormal text information are transmission messages generated in the same batch, so the transmission message whose text template identifier matches the target text template identifier can be determined as a message to be processed.
[0088] Based on the preset interface filtering logic, the target text template identifier is searched in the message list of the unsent transmission messages, so that the transmission messages whose text template identifier matches the target text template identifier and have not been sent are regarded as pending messages. If, during the search process, any transmission message whose text template identifier matches the target text template identifier is found to be in the process of being sent and has not been completely sent, the transmission message can also be determined as a pending message.
[0089] Since the sent transmission message has been received by the receiving end, the sent message to be processed can be determined through the transmission log data of the transmission message. Based on the target text template identifier, the target transmission log data in the transmission log data is determined, and based on the information such as the transmission time, the transmission quantity and the receiving end identifier in the target transmission log data, the transmission message corresponding to the target transmission log data can be determined as the message to be processed.
[0090] Acquiring pending messages in different transmission states can ensure that all pending messages are withdrawn, thereby improving the comprehensiveness of message withdrawal processing and thus improving the accuracy of server group messaging.
[0091] As an alternative embodiment, see Figure 4 , obtaining the message structure of the transmission message in the first transmission state includes:
[0092] S410. Obtain the message structure of the transmission message in the message pull link, and the transmission status corresponding to the transmission message in the message pull link indicates that the message has not been sent;
[0093] S420. Acquire the message structure of the transmission message in the message sending link, and the transmission status corresponding to the transmission message in the message sending link indicates that the message is being sent.
[0094] As an optional embodiment, the message transmission link includes a message pull link and a message send link, the message pull link is used to obtain the transmission message from the sending end, and the message send link is used to send the transmission message to the receiving end.
[0095] The transmission status indication message of the transmission message obtained in the message pull link has not been sent. Based on the target text template identifier, the pending message obtained from the message pull link is the pending message whose transmission status indication message has not been sent. The preset filtering logic can be added to the message pull interface of the message pull link. Based on the preset filtering logic, the target text template identifier is queried in the message list returned by the message pull interface to determine the pending message that has not been sent.
[0096] In the transmission status indication message sending of the transmission message obtained in the message sending link, based on the target text template identifier, the pending message obtained from the message sending link is the pending message in the transmission status indication message sending. The pending message in the message sending link has a sending interface that is in the process of being sent and has not been sent completely.
[0097] Messages in the message pull link and messages in the message sending link can directly obtain the corresponding transmission status, and based on the transmission status corresponding to the message pull link or the message sending link, the pending messages are marked, thereby facilitating the subsequent withdrawal processing of the pending messages and improving the efficiency of message withdrawal processing.
[0098] S230. Based on the transmission status corresponding to each of the at least one to-be-processed messages, perform message withdrawal processing on at least one to-be-processed message.
[0099] As an optional embodiment, when the pending messages are in different transmission states, different message withdrawal processing methods may be executed to correspondingly withdraw the pending messages in different transmission states.
[0100] As an alternative embodiment, see Figure 5 Based on the transmission status corresponding to each of the at least one to-be-processed messages, performing message withdrawal processing on at least one to-be-processed message includes:
[0101] S510. In the case where the transmission status indication message corresponding to any pending message has been sent, the client identifier corresponding to the first pending message is obtained from the sending log data corresponding to the first pending message; the first pending message is a pending message for which the corresponding transmission status indication message has been sent;
[0102] S520. Send a message withdrawal instruction to the first client corresponding to the client identifier, where the message withdrawal instruction is used to instruct the first client to withdraw the first to-be-processed message.
[0103] As an optional embodiment, when the transmission status indication message corresponding to any pending message has been sent, the pending message for which the transmission status indication message has been sent is taken as the first pending message. Since the sent pending message can be determined based on the target log sending data, the transmission message corresponding to the target sending log data is the first pending message, and the target sending log data is the sending log data corresponding to the first pending message.
[0104] At this time, the receiving end has received the first message to be processed. Therefore, the client identifier corresponding to the first message to be processed can be obtained from the sending log data corresponding to the first message to be processed. The client identifier is the receiving end identifier. The first client to which the first message to be processed is sent can be determined through the receiving end identifier. The first client is the receiving end.
[0105] The server may create a message withdrawal link, and send a message withdrawal instruction to the first client corresponding to the client identifier based on the message withdrawal link. After receiving the message withdrawal instruction, the first client responds to the message withdrawal instruction and performs message withdrawal processing on the first pending message, so that the first pending message is no longer displayed in the first client. The first client sends the result of the message withdrawal to the server through the message withdrawal link.
[0106] Sending a message withdrawal instruction to the client to withdraw the sent pending messages can avoid users from seeing messages with text errors when viewing the client, thereby improving the accuracy of message display and enhancing the user experience.
[0107] As an alternative embodiment, see Figure 6, sending a message withdrawal instruction to the first client corresponding to the client identifier includes:
[0108] S610. The server sends a message withdrawal instruction to the first client corresponding to the client identifier, where the message withdrawal instruction carries a message sequence identifier of the first message to be processed in the target message session; the target message session is a message session between the first client and the target application account corresponding to the first message to be processed;
[0109] S620. The first client updates the first to-be-processed message in the target message session to a hidden display message based on the message sequence identifier.
[0110] As an optional embodiment, the message withdrawal instruction sent by the server to the first client carries the message sequence identifier of the first pending message in the target message session. The target message session is a message session between the first client and the target application account corresponding to the first pending message. The target message session can be displayed in the target application in the first client in the order of reception, and the corresponding message sequence identifier can be represented as the reception sequence of the first pending message. The first client performs a withdrawal process on the message corresponding to the message sequence identifier in the target message session.
[0111] Based on the message sequence identifier, the first message to be processed can be withdrawn even when it is not the latest received message. For example, in the target message session, there are three messages, message A, message B and message C, in the order of reception. At this time, if message B needs to be withdrawn, the message withdrawal instruction sent by the server to the first client carries the message sequence identifier 2 of message B. After the first client receives the message withdrawal instruction, it withdraws the message corresponding to the message sequence identifier 2 in the target message session, and message B can be withdrawn.
[0112] The first client can perform message update processing through an instant messaging software toolkit (imsdk). Through the instant messaging software toolkit, the first pending message in the target message session can be updated to a hidden display message based on the message sequence identifier, and the hidden display information can be an empty message. Therefore, when the user views the message list in the first client, the first pending message may not be displayed, and the first pending message may be automatically overwritten by the newly received message.
[0113] The pending message is determined by the message sequence identifier and is hidden and displayed, so that when the user cannot see the pending message, the pending message can be automatically overwritten by the newly received message, thereby simplifying the message withdrawal step and improving the efficiency of message withdrawal.
[0114] As an optional embodiment, based on the transmission status corresponding to each of the at least one to-be-processed messages, performing message withdrawal processing on the at least one to-be-processed message includes:
[0115] When the transmission status indication message corresponding to any pending message is not sent, the sending operation corresponding to the second pending message is stopped, and the second pending message is the pending message whose corresponding transmission status indication message is not sent.
[0116] As an optional embodiment, when the transmission status indication message corresponding to any pending message is not sent, the pending message for which the transmission status indication message is not sent is used as the second pending message. At this time, the second pending message is in the message pull link and has not been sent. Therefore, the message sending interface corresponding to the second pending message can be stopped from being generated, thereby stopping the sending operation corresponding to the second pending message. For example, if the transmission status indication message corresponding to pending message X is not sent, the pending message X can be used as the second pending message, and the sending operation corresponding to the pending message X is no longer executed.
[0117] Stopping the sending of the second pending message and no longer executing the sending operation of the unsent pending message can avoid the pending message with text errors from occupying server resources, thereby reducing the resource occupation of the server and improving the message processing efficiency and immediacy of the server.
[0118] As an optional embodiment, based on the transmission status corresponding to each of the at least one to-be-processed messages, performing message withdrawal processing on the at least one to-be-processed message includes:
[0119] When the transmission status indication message corresponding to any pending message is being sent, the sending interface corresponding to the third pending message is closed, and the third pending message is the pending message in which the corresponding transmission status indication message is being sent.
[0120] As an optional embodiment, when the transmission status indication message corresponding to any pending message is being sent, the pending message being sent with the transmission status indication message is treated as the third pending message, the sending interface corresponding to the third pending message is closed, and the sending operation corresponding to the third pending message is interrupted, so that the third pending message cannot be sent to the corresponding client. For example, if the transmission status indication message corresponding to pending message Y is being sent, the pending message Y can be treated as the third pending message, the sending interface corresponding to the pending message Y is closed, and the sending of the pending message Y is terminated.
[0121] Closing the sending interface of the third pending message and interrupting the sending operation of the pending message in progress can avoid the pending messages with text errors occupying server resources, thereby reducing the resource occupation of the server and improving the message processing efficiency and immediacy of the server.
[0122] As an optional embodiment, the message processing method can be used in the application scenario of the server sending batch messages, for example, launching an activity in an application and sending the information related to the activity to 1 million clients to remind users to participate, or a message will be notified to all residents in the city through an application, etc. Figure 7 ,like Figure 7 The figure shows a schematic diagram of the server performing message withdrawal processing based on the transmission status. After the server sends the message to N users in a group, it obtains abnormal text information, and based on the target text template identifier corresponding to the abnormal text information, the transmission message in at least one transmission state is filtered to obtain the pending message. Since after the server sends the message to N users in a group, the transmission message includes transmission messages in three transmission states, in the process of message filtering, the transmission message in the message pull link can be filtered based on the target text template identifier to obtain the pending message that matches the target text template identifier and has not been sent. Based on the target text template identifier, the transmission message in the message sending link is filtered to obtain the pending message that matches the target text template identifier and is being sent, and based on the target text template identifier, the sending log data is filtered to determine the target sending log data corresponding to the target text template identifier, and the pending message corresponding to the target sending log data is the pending message that has been sent.
[0123] In the case where the pending message is an unsent pending message, the sending operation can be stopped directly so that the unsent pending message will not be sent to the client. In the case where the pending message is a pending message being sent, the sending interface corresponding to the pending message being sent can be closed, and the sending of the pending message can be interrupted so that the client cannot receive the pending message. In the case where the pending message is a sent pending message, the first client that received the pending message can be determined based on the client identifier in the target sending log data, and a message withdrawal instruction can be sent to the first client. The message withdrawal instruction carries the message sequence identifier of the sent pending message in the target message session. The first client can determine the position of the pending message in the target message session based on the message sequence identifier, hide the pending message, and update the pending message to a hidden display message.
[0124] The disclosed embodiment provides a message processing method, which includes: determining a target text template identifier corresponding to abnormal text information, where the target text template identifier is an identifier of a text template that generates the abnormal text information. Based on the target text template identifier, message filtering is performed on transmission messages in at least one transmission state to obtain at least one pending message associated with the abnormal text information. At least one pending message is a message generated based on a text template corresponding to the target text template identifier. Based on the transmission state corresponding to each of the at least one pending message, message withdrawal is performed on at least one pending message. This method can withdraw messages sent by a server group, reduce the resource usage of the server, avoid users from receiving error messages, and improve the accuracy of messages sent by the server group.
[0125] Figure 8 FIG. 1 is a block diagram of a message processing device according to an exemplary embodiment. Figure 8 , the device comprises:
[0126] The target identifier determination module 810 is configured to determine the target text template identifier corresponding to the abnormal text information; the target text template identifier is the identifier of the text template that generates the abnormal text information;
[0127] The message filtering module 820 is configured to perform message filtering on the transmission messages in at least one transmission state based on the target text template identifier to obtain at least one to-be-processed message associated with the abnormal text information; the at least one to-be-processed message is a message generated based on the text template corresponding to the target text template identifier;
[0128] The message withdrawal module 830 is configured to execute message withdrawal processing on at least one to-be-processed message based on the transmission status corresponding to each of the at least one to-be-processed messages.
[0129] As an optional embodiment, the message withdrawal module includes:
[0130] The client identification acquisition unit is configured to acquire the client identification corresponding to the first message to be processed from the sending log data corresponding to the first message to be processed when the transmission status indication message corresponding to any message to be processed has been sent; the first message to be processed is a message to be processed for which the corresponding transmission status indication message has been sent;
[0131] The message withdrawal instruction sending unit is configured to execute sending a message withdrawal instruction to a first client corresponding to the client identifier, where the message withdrawal instruction is used to instruct the first client to perform message withdrawal processing on the first to-be-processed message.
[0132] As an optional embodiment, the message withdrawal instruction sending unit includes:
[0133] A message withdrawal unit is configured to execute a message withdrawal instruction to a first client corresponding to a client identifier, wherein the message withdrawal instruction carries a message sequence identifier of a first pending message in a target message session; the target message session is a message session between the first client and a target application account corresponding to the first pending message; the message withdrawal instruction is used to instruct the first client to update the first pending message in the target message session to a hidden display message based on the message sequence identifier.
[0134] As an optional embodiment, the message withdrawal module includes:
[0135] The sending stop unit is configured to stop executing the sending operation corresponding to the second pending message when the transmission status indication message corresponding to any pending message is not sent. The second pending message is a pending message whose corresponding transmission status indication message is not sent.
[0136] As an optional embodiment, the message withdrawal module includes:
[0137] The sending suspension unit is configured to execute, when a transmission status indication message corresponding to any pending message is being sent, closing the sending interface corresponding to the third pending message, where the third pending message is a pending message being sent by the corresponding transmission status indication message.
[0138] As an optional embodiment, the at least one transmission state includes at least one transmission state of a transmission state indicating that the message has not been sent, a transmission state indicating that the message is being sent, and a transmission state indicating that the message has been sent. In the case where the at least one transmission state includes all transmission states, the message filtering module includes:
[0139] A message structure acquisition unit, configured to execute acquisition of a message structure of a transmission message in a first transmission state, wherein the first transmission state includes a transmission state indicating that the message has not been sent and a transmission state indicating that the message is being sent;
[0140] A template identifier acquisition unit, configured to acquire a text template identifier corresponding to a transmission message in a first transmission state from a message structure;
[0141] The identification comparison unit is configured to compare the text template identification and the target text template identification;
[0142] A first to-be-processed message determining unit is configured to determine a transmission message whose text template identifier matches a target text template identifier as a to-be-processed message;
[0143] a sending log data acquiring unit, configured to acquire sending log data of a transmission message in a second transmission state, wherein the second transmission state includes a transmission state indicating that the message has been sent;
[0144] The second to-be-processed message determining unit is configured to obtain target sending log data corresponding to the target text template identifier from the sending log data, and determine the transmission message corresponding to the target sending log data as the to-be-processed message.
[0145] As an optional embodiment, the message structure obtaining unit includes:
[0146] A first message acquisition unit is configured to execute acquisition of a message structure of a transmission message in a message pull link, wherein a transmission status indication message corresponding to the transmission message in the message pull link is not sent;
[0147] The second message acquisition unit is configured to execute acquisition of a message structure of a transmission message in a message sending link, wherein a transmission status corresponding to the transmission message in the message sending link indicates that the message is being sent.
[0148] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0149] Fig. 9 is a block diagram of an electronic device for message processing according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message processing method is implemented.
[0150] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0151] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to perform the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0152] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute the message processing method in the embodiment of the present disclosure.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0154] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0155] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A message processing method, characterized in that: The method comprises: Determine a target text template identifier corresponding to the abnormal text information; the target text template identifier is an identifier of a text template that generates the abnormal text information; Obtain a message structure of a transmission message in a first transmission state, wherein the first transmission state includes a transmission state indicating that a message has not been sent and a transmission state indicating that a message is being sent; obtain a text template identifier corresponding to the transmission message in the first transmission state from the message structure; compare the text template identifier with the target text template identifier, and determine the transmission message whose text template identifier matches the target text template identifier as a pending message corresponding to the first transmission state; obtain sending log data of the transmission message in a second transmission state, wherein the second transmission state includes a transmission state indicating that a message has been sent; obtain target sending log data corresponding to the target text template identifier from the sending log data, and determine the transmission message corresponding to the target sending log data as a pending message corresponding to the second transmission state; Based on the transmission status corresponding to each of the to-be-processed messages, message withdrawal processing is performed on the to-be-processed messages.
2. The message processing method according to claim 1, characterized in that: The withdrawing the messages to be processed based on the transmission statuses corresponding to the messages to be processed includes: In the case where the transmission status indication message corresponding to any pending message has been sent, obtaining a client identifier corresponding to the first pending message from the sending log data corresponding to the first pending message; the first pending message is a pending message to which the corresponding transmission status indication message has been sent; A message withdrawal instruction is sent to a first client corresponding to the client identifier, where the message withdrawal instruction is used to instruct the first client to perform message withdrawal processing on the first to-be-processed message.
3. The message processing method according to claim 2, characterized in that: The sending of a message withdrawal instruction to the first client corresponding to the client identifier includes: The message withdrawal instruction is sent to the first client corresponding to the client identifier, and the message withdrawal instruction carries the message sequence identifier of the first pending message in the target message session; the target message session is a message session between the first client and the target application account corresponding to the first pending message; the message withdrawal instruction is used to instruct the first client to update the first pending message in the target message session to a hidden display message based on the message sequence identifier.
4. The message processing method according to claim 1, characterized in that: The withdrawing the messages to be processed based on the transmission statuses corresponding to the messages to be processed includes: When the transmission status indication message corresponding to any pending message is not sent, stop executing the sending operation corresponding to the second pending message, where the second pending message is the pending message whose corresponding transmission status indication message is not sent.
5. The message processing method according to claim 1, characterized in that: The withdrawing the messages to be processed based on the transmission statuses corresponding to the messages to be processed includes: When the transmission status indication message corresponding to any pending message is being sent, the sending interface corresponding to the third pending message is closed, and the third pending message is the pending message corresponding to the transmission status indication message being sent.
6. The message processing method according to claim 1, characterized in that: The message structure of acquiring the transmission message in the first transmission state includes: Acquire a message structure of a transmission message in a message pull link, wherein a transmission status indication message corresponding to the transmission message in the message pull link is not sent; A message structure of a transmission message in a message sending link is acquired, wherein a transmission status corresponding to the transmission message in the message sending link indicates that the message is being sent.
7. A message processing device, characterized in that: The device comprises: A target identifier determination module is configured to determine a target text template identifier corresponding to the abnormal text information; the target text template identifier is an identifier of a text template that generates the abnormal text information; A message filtering module is configured to execute the acquisition of a message structure of a transmission message in a first transmission state, wherein the first transmission state includes a transmission state indicating that a message has not been sent and a transmission state indicating that a message is being sent; acquiring a text template identifier corresponding to the transmission message in the first transmission state from the message structure; comparing the text template identifier with the target text template identifier, and determining a transmission message whose text template identifier matches the target text template identifier as a pending message corresponding to the first transmission state; acquiring sending log data of a transmission message in a second transmission state, wherein the second transmission state includes a transmission state indicating that a message has been sent; acquiring target sending log data corresponding to the target text template identifier from the sending log data, and determining the transmission message corresponding to the target sending log data as a pending message corresponding to the second transmission state; The message withdrawal module is configured to execute message withdrawal processing on the messages to be processed based on the transmission status corresponding to each of the messages to be processed.
8. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the message processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the message processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Message withdrawing method for 5G communication, computer device and computer readable storage medium
CN112187629A