Message processing method and device
By obtaining multiple channel information of the second client, the first message is encapsulated and converted, and the message transmission problem of the instant messaging system when the server failure of the service provider is solved, and the duplicate display problem caused by channel compatibility is avoided, and the message data is realized Smooth analysis and presentation.
Patent Information
- Application Number
- CN202411644157.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-14
AI Technical Summary
The existing instant messaging system will be paralyzed when the service provider server fails, and the message channel compatibility issues of different clients will not be able to resolve the instant messages sent by the other party.
By obtaining multiple second channel information of the second client corresponding to the first message, encapsulate the first message and generate a second message, so that the second client can parse the message data and synchronize the encapsulation message during the encapsulation process. Encoding to deduplication.
It realizes that message transmission can still be carried out when the service provider server fails, and avoids the problem of repeated display under multiple message channels, ensuring that message data can be successfully parsed and displayed.
Smart Images

Figure CN119449750A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of instant messaging, and in particular to a message processing method and device. Background Art
[0002] In the use of existing instant messaging applications, message transmission between different clients is generally achieved through instant messaging service providers. When the service provider's server fails, the entire instant messaging system will be paralyzed. In this regard, the existing solution is to encapsulate the message channels in each instant messaging software development kit into the client's middleware, so that when the service provider fails, the client's own middleware can be used to complete channel selection and message transmission. However, this method can only be implemented based on multiple clients using the same message channel. When different clients have different versions or different system compatibilities, there may be a situation where the message channel corresponding to client A is not integrated in the middleware of client B, so that client B still cannot parse after receiving the instant message sent by client A.
[0003] Therefore, there is an urgent need to provide a message processing method and device that does not require pre-integration of multiple message channels but can still implement message communication between clients with different message channels. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a method and device for message processing, which can re-encapsulate the first message by obtaining multiple second channel information corresponding to the second client corresponding to the first message, and convert the first message obtained by encapsulation based on the first channel information into a second message obtained by encapsulation based on the second channel information, thereby ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously encapsulates the message code during the encapsulation process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a message processing method applied to a server is provided.
[0006] A message processing method according to an embodiment of the present invention includes: obtaining a first message and parsing it to obtain a message code and message data corresponding to the first message; wherein the first message is encapsulated by the first client based on first channel information; determining a second client corresponding to the first message, and obtaining multiple second channel information corresponding to the second client; encapsulating the message code and the message data according to each second channel information to obtain a second message corresponding to each second channel information; sending each second message to a second client, so that the second client deduplicates multiple second messages according to the message code, and displays the message data.
[0007] Optionally, encapsulating the message code and the message data according to each second channel information includes: performing data verification on a first message field in the message data; in response to a verification result of the data verification being a passed verification, converting the first message field according to the second channel information to obtain a second message field corresponding to the second channel information; and encapsulating the second message field and the message code together to obtain the second message.
[0008] Optionally, the method further includes: in response to a verification result of the data verification being a verification failure, generating a first message receipt corresponding to the verification result, and feeding back the first message receipt to the first client.
[0009] Optionally, the method further includes: storing the second client and the second channel information corresponding to the second client in a cache;
[0010] After sending each of the second messages to the second client, the method further includes: obtaining a second message receipt indicating whether the second message is sent successfully; and updating the second channel information in the cache according to the second message receipt.
[0011] Optionally, updating the second channel information in the cache according to the second message receipt includes: in response to the presence of a target message receipt indicating a message sending failure among multiple second message receipts, removing the target second channel information corresponding to the target message receipt from the cache to update the second channel information.
[0012] To achieve the above objective, according to another aspect of an embodiment of the present invention, a message processing method applied to a second client is provided.
[0013] A message processing method of an embodiment of the present invention includes: receiving multiple second messages sent by a server; wherein each second message is encapsulated by the server based on multiple second channel information corresponding to the second client; parsing the second messages to obtain message codes and message data corresponding to each second message; deduplicating multiple second messages according to the message codes and the message receiving time corresponding to each second message to obtain a target message; and displaying the target message data corresponding to the target message.
[0014] To achieve the above objective, according to another aspect of an embodiment of the present invention, a message processing server is provided.
[0015] A message processing server according to an embodiment of the present invention includes:
[0016] An acquisition module, configured to acquire and parse a first message to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by the first client based on the first channel information encapsulation;
[0017] A determination module, configured to determine a second client corresponding to the first message, and obtain a plurality of second channel information corresponding to the second client;
[0018] An encapsulation module, used for encapsulating the message code and the message data according to each of the second channel information, to obtain a second message corresponding to each of the second channel information;
[0019] A sending module is used to send each of the second messages to a second client, so that the second client deduplicates multiple second messages according to the message code and displays the message data.
[0020] To achieve the above objective, according to another aspect of an embodiment of the present invention, a second client for message processing is provided.
[0021] A second client for message processing according to an embodiment of the present invention includes:
[0022] A receiving module, configured to receive a plurality of second messages sent by a server, wherein each of the second messages is encapsulated by the server based on a plurality of second channel information corresponding to the second client;
[0023] A parsing module, used to parse the second message to obtain a message code and message data corresponding to each of the second messages;
[0024] a deduplication module, configured to deduplicate a plurality of the second messages according to the message codes and the message receiving time corresponding to each of the second messages, to obtain a target message;
[0025] The display module is used to display the target message data corresponding to the target message.
[0026] To achieve the above objective, according to another aspect of an embodiment of the present invention, a message processing system is provided.
[0027] A message processing system according to an embodiment of the present invention comprises: the above-mentioned server and a second client; wherein:
[0028] The server is used to obtain a first message and parse it to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by encapsulating the first client based on the first channel information; determine a second client corresponding to the first message, and obtain multiple second channel information corresponding to the second client; encapsulate the message code and the message data according to each second channel information to obtain a second message corresponding to each second channel information; and send each second message to the second client;
[0029] The second client is used to receive multiple second messages sent by the server; wherein each second message is encapsulated by the server based on multiple second channel information corresponding to the second client; the second messages are parsed to obtain the message code and message data corresponding to each second message; according to the message code and the message reception time corresponding to each second message, multiple second messages are deduplicated to obtain a target message; and the target message data corresponding to the target message is displayed.
[0030] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for message processing is provided.
[0031] An electronic device for message processing according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for message processing according to an embodiment of the present invention.
[0032] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.
[0033] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a message processing method according to an embodiment of the present invention is implemented.
[0034] An embodiment of the above invention has the following advantages or beneficial effects: by obtaining multiple second channel information corresponding to the second client corresponding to the first message, the first message can be repackaged, and the first message obtained by packaging based on the first channel information is converted into a second message obtained by packaging based on the second channel information, ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously packages the message code during the packaging process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0035] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0037] Figure 1 This is a schematic diagram of the main flow of a method for message processing applied to a server according to an embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of a data interaction process between a first client, a second client and a server according to an embodiment of the present invention;
[0039] Figure 3 is another schematic diagram of a data interaction process between a first client, a second client and a server according to an embodiment of the present invention;
[0040] Figure 4 is a main flow chart of another method for message processing applied to a server according to an embodiment of the present invention;
[0041] Figure 5 is a schematic diagram of a process of synchronizing second channel information from a second client to a server according to an embodiment of the present invention;
[0042] Figure 6 is a schematic diagram of the main process of updating the second channel information according to an embodiment of the present invention;
[0043] Figure 7 is a schematic diagram of a communication process in a distribution scenario according to an embodiment of the present invention;
[0044] Figure 8 is a main flow chart of a method for message processing applied to a second client according to an embodiment of the present invention;
[0045] Fig. 9is a schematic diagram of a specific process of synchronizing second channel information from a second client to a server according to an embodiment of the present invention;
[0046] Fig.10 This is a schematic diagram of a main process of feeding back a message reading status to a first client according to an embodiment of the present invention;
[0047] Fig.11 is a schematic diagram of main modules of a message processing server according to an embodiment of the present invention;
[0048] Fig.12 is a schematic diagram of main modules of a second client for message processing according to an embodiment of the present invention;
[0049] Fig.13 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0050] Fig.14 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0052] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0053] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0054] Figure 1 It is a schematic diagram of main steps of a message processing method applied to a server according to an embodiment of the present invention.
[0055] like Figure 1 As shown, the message processing method of the embodiment of the present invention mainly includes the following steps:
[0056] Step S101: Obtain and parse a first message to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by the first client based on first channel information encapsulation;
[0057] Step S102: determining a second client corresponding to the first message, and obtaining a plurality of second channel information corresponding to the second client;
[0058] Step S103: encapsulating the message code and the message data according to each second channel information to obtain a second message corresponding to each second channel information;
[0059] Step S104: Send each second message to the second client, so that the second client deduplicates the multiple second messages according to the message codes and displays the message data.
[0060] For the instant messaging field to which the present invention is applied, the first client and the second client can be understood as different clients that use the same APP for communication. Specifically, user A sends a first message to user B through the first client. Through the above process, the server will repackage the first message into a second message according to the channel that the second client can parse, and display the second message on the second client. Exemplarily, the communication APP can be various APPs with instant messaging functions, including but not limited to instant messaging tool APPs, distribution software APPs, social APPs, e-commerce platform APPs, etc. The first message refers to the message sent by the first client to the second client on the communication APP, the first channel information refers to the channel information equipped on the first client, and the second channel information refers to the channel information equipped on the second client.
[0061] Below Figure 2 The scenario in which the embodiment of the present invention is applied is specifically described by taking as an example to illustrate the data interaction process between the first client, the second client and the server. Figure 2As shown, before executing the embodiment of the present invention, it is necessary to ensure that the communication APP in the first client and the second client is in the startup state, and after startup, the first client initializes and obtains the first channel information, and the second client initializes and obtains the second channel information. When user A sends a message to user B through the first client, the specific content of the message needs to be encapsulated through the first message channel to obtain the first message actually sent. However, since the second channel information initialized by the second client is different from the first channel information, if the second client directly receives the first message, it cannot be parsed according to the encapsulation method of the first channel information. Therefore, the server needs to re-encapsulate the first message in a way that the second client can parse to obtain the second message, and finally send the second message to the second client, and display it smoothly after being parsed by the second client, thereby realizing the transmission of messages between user A and user B.
[0062] Usually, in order to manage communication messages, instant messaging APPs need to first pass through an instant messaging service provider (hereinafter referred to as an IM service provider) during the message sending and receiving process. Therefore, in an optional embodiment, the first message obtained by the server in the embodiment of the present invention is actually forwarded by the IM service provider, not directly sent by the first client, and the second message finally sent to the second client is also forwarded by the IM service provider. That is, a specific interaction process such as Figure 3 As shown, since the data interaction process through the IM service provider is a well-known interaction process in the art, it is not described as the focus of the embodiment of the present invention.
[0063] In an optional embodiment, for the first message encapsulated by the first client, it is necessary to include multiple first message fields necessary for the message, such as the message code (which can be understood as a unique ID for each message), the sender of the message, the receiver of the message, the message length, and the specific content of the message data. In the embodiment of the present invention, by parsing the first message in step S101, multiple first message fields related to the first message can be obtained, and the second client corresponding to the first message in step 102 can be determined through the receiver field of the message.
[0064] It should be noted that the present invention is particularly aimed at the situation where the second client includes multiple second channel information at the same time. When the second client has only one message channel (that is, it corresponds to only one second channel information), it only needs to re-encapsulate the message data according to the format that can be parsed by the second message channel, and there is no need to carry the message code during the carrying process. Only when multiple second channel information is included at the same time and a corresponding second message can be obtained according to each second channel information encapsulation, it is necessary to carry the message code, so that after the second client receives multiple second messages, it can perform deduplication processing according to the message code, thereby achieving the effect of not receiving duplicate information during multi-channel communication.
[0065] In an optional embodiment, the process of encapsulating the message data and obtaining the second message in step S103 may further include a data verification process, that is, the message processing method is as follows: Figure 4 As shown, including:
[0066] Step S401: Obtain a first message and parse it to obtain a message code and message data corresponding to the first message;
[0067] Step S402: determining a second client corresponding to the first message, and obtaining a plurality of second channel information corresponding to the second client;
[0068] Step S403: performing data verification on the first message field in the message data;
[0069] In response to the data verification result being a verification pass, executing steps S404 to S406; in response to the data verification being a verification failure, executing step S407;
[0070] Step S404: converting the first message field according to the second channel information to obtain a second message field corresponding to the second channel information;
[0071] Step S405: Encapsulate the second message field and the message code together to obtain a second message;
[0072] Step S406: Send each second message to the second client, so that the second client deduplicates the multiple second messages according to the message codes and displays the message data;
[0073] Step S407: Generate a first message receipt corresponding to the verification result, and feed back the first message receipt to the first client.
[0074] The data verification process may specifically include: checking whether the field contains sensitive words, checking whether the field format is correct, and other security checks. By performing data verification before the field conversion process, invalid data conversion processes can be avoided as much as possible, saving computing resources.
[0075] In addition, for the first message receipt, when the verification is passed, a corresponding first message receipt is usually generated to indicate the result of the data verification, but the first message receipt that has passed the verification does not need to be fed back to the first client, and feedback to the first client is only required when the verification fails. Exemplarily, when the verification fails, the first client can display a prompt message to the user based on the failed first message receipt to prompt that the current message does not meet the requirements and the sending fails. In an optional embodiment, regardless of whether the verification is passed or failed, the generated first message receipt will be stored accordingly, so that it can be queried based on the first message receipt in the subsequent exception management process.
[0076] In a further optional embodiment, after the second channel information corresponding to the second client is obtained in step S102, the method may further include: storing the second client and the second channel information corresponding to the second client in a cache. Generally, when the second client starts the APP, the second client actively synchronizes the information to the server through the interface. Figure 5 As shown. However, since the channel information corresponding to each client cannot be reported in real time, the embodiment of the present invention stores each second client and the corresponding second channel information, so that when other first clients send messages to the second clients, the second channel information corresponding to the second client can be directly obtained from the cache. For example, user A sends a message to user B. When user B starts the instant messaging APP, multiple second channel information corresponding to the second client is sent to the server, and the server stores the second client and the corresponding second channel information accordingly. Then user C also sends a message to user B, but user B does not frequently wake up the APP at this time, resulting in that even if the communication APP is offline, the message sent by user C can be directly encapsulated through the second channel information already stored in the cache, and the encapsulated second message can be sent to the second client.
[0077] In a further optional embodiment, after step S104, the method may further include: obtaining a second message receipt indicating whether the second message is sent successfully, and updating the second channel information in the cache according to the second message receipt. Figure 6 As shown, including:
[0078] Step S601: Obtaining a second message receipt indicating whether the second message is sent successfully;
[0079] In response to the second message being sent successfully, executing step S602: storing the second message receipt in correspondence with the second message;
[0080] In response to the second message not being sent successfully, step S603 is executed: in response to the presence of a target message receipt indicating message sending failure among the multiple second message receipts, the target second channel information corresponding to the target message receipt is removed from the cache to update the second channel information.
[0081] In an optional embodiment, the message processing method provided by the present invention can be applied to various application scenarios with communication between a first client and a second client. The instant delivery scenario is taken as an example to specifically illustrate the message processing method provided by the present invention. Figure 7 As shown in the figure, the first client is the mobile terminal used by the APP user who purchases the goods, and the second client is the mobile terminal used by the delivery personnel who deliver the goods to the APP user. Usually, when the user completes the order on the APP and the delivery personnel accepts the order, a dialogue window between the user and the delivery personnel will be displayed on the APP, so that the user can communicate with the delivery personnel in real time to learn about the delivery status of the purchased goods in a timely manner. Figure 7 As shown, when the user places an order and the delivery personnel accepts the order, the first mobile terminal used by the user and the second mobile terminal used by the delivery personnel will report the first channel information and the second channel information generated by themselves in the initialization to the server. When the user uses the first mobile terminal to send a real-time message asking about the delivery time of the goods, the first mobile terminal will encapsulate the real-time message according to the first channel information obtained by itself in the initialization to obtain the first message, and send the first message to the server. At this time, the server will repackage the first message based on the second channel information reported by the second mobile terminal, and send the repackaged second message to the second mobile terminal used by the delivery personnel. After the second mobile terminal receives the second message, it can parse it according to the second channel information, so as to obtain the message sent by the user as "How long will it take for the goods to be delivered", and display it on the interface of the second mobile terminal, thereby realizing instant messaging communication between the user and the delivery personnel.
[0082] According to the message processing method of the embodiment of the present invention, by obtaining multiple second channel information corresponding to the second client corresponding to the first message, the first message can be repackaged, and the first message obtained by packaging based on the first channel information is converted into a second message obtained by packaging based on the second channel information, ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously packages the message code during the packaging process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0083] Figure 8 It is a schematic diagram of main steps of a message processing method applied to a second client according to an embodiment of the present invention.
[0084] like Figure 8 As shown, the message processing method of the embodiment of the present invention mainly includes the following steps:
[0085] Step S801: receiving multiple second messages sent by the server; wherein each second message is encapsulated by the server based on multiple second channel information corresponding to the second client;
[0086] Step S802: parsing the second message to obtain the message code and message data corresponding to each second message;
[0087] Step S803: De-duplicate the multiple second messages according to the message codes and the message receiving time corresponding to each second message to obtain a target message;
[0088] Step S804: Display the target message data corresponding to the target message.
[0089] Among them, since the second message is repackaged by the server, even if the second channel information is different from the first channel information, it can be successfully parsed by the second client, solving the problem of being unable to distribute messages due to different channel information in different clients in the prior art.
[0090] As mentioned above, the second client needs to upload the second channel information corresponding to the second client when the APP is started. Therefore, in an optional embodiment, before step S801, Fig. 9 As shown, it also includes:
[0091] Step S901: In response to an initialization procedure of an application, determining a plurality of message channels in an application state;
[0092] Step S902: Generate second channel information corresponding to each message channel, and send the second channel information to the server.
[0093] It can be seen that through the above-mentioned interaction process between the second client and the server, the channel information corresponding to the second client can be successfully obtained before the server re-encapsulates the first message, thereby encapsulating the second message.
[0094] In a further optional embodiment, after step S804, a process of feeding back the message reading status to the first client may also be included, that is, in an optional embodiment, as Fig.10 As shown, including:
[0095] Step S1001: receiving multiple second messages sent by the server; wherein each second message is encapsulated by the server based on multiple second channel information corresponding to the second client;
[0096] Step S1002: parsing the second message to obtain the message code and message data corresponding to each second message;
[0097] Step S1003: De-duplicate multiple second messages according to the message codes and the message receiving time corresponding to each second message to obtain a target message;
[0098] Step S004: displaying target message data corresponding to the target message;
[0099] Step S1005: Obtain a read operation corresponding to the target message;
[0100] Step S1006: Generate a third message receipt according to the reading operation, and send the third message receipt to the first client.
[0101] Similarly, the third message receipt in step S1006 also needs to be forwarded by the IM service provider before it can be fed back to the first client. Exemplarily, the reading operation may include: a mouse click operation and a text input operation, and the generated third message receipt may indicate a variety of message reading states such as message read, message unread, and user input.
[0102] According to the message processing method of the embodiment of the present invention, by obtaining multiple second channel information corresponding to the second client corresponding to the first message, the first message can be repackaged, and the first message obtained by packaging based on the first channel information is converted into a second message obtained by packaging based on the second channel information, ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously packages the message code during the packaging process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0103] Fig.10 4 is a schematic diagram of main modules of a message processing server according to an embodiment of the present invention.
[0104] like Fig.11 As shown, the message processing server 1100 of the embodiment of the present invention includes:
[0105] The acquisition module 1101 is used to acquire and parse the first message to obtain the message code and message data corresponding to the first message; wherein the first message is obtained by the first client based on the first channel information encapsulation;
[0106] A determination module 1102 is used to determine a second client corresponding to the first message, and obtain a plurality of second channel information corresponding to the second client;
[0107] The encapsulation module 1103 is used to encapsulate the message code and the message data according to each of the second channel information to obtain a second message corresponding to each of the second channel information;
[0108] The sending module 1104 is used to send each of the second messages to the second client, so that the second client deduplicates multiple second messages according to the message code and displays the message data.
[0109] In an optional embodiment of the present invention, the encapsulation module 1103 is also used to perform data verification on the first message field in the message data; in response to a verification result of the data verification being a passed verification, converting the first message field according to the second channel information to obtain a second message field corresponding to the second channel information; and encapsulating the second message field together with the message code to obtain the second message.
[0110] In an optional embodiment of the present invention, the encapsulation module 1103 is further used to, in response to a verification result of the data verification being a verification failure, generate a first message receipt corresponding to the verification result, and feed back the first message receipt to the first client.
[0111] In an optional embodiment of the present invention, the server also includes a storage module, which is used to store the second client and the second channel information corresponding to the second client in a cache; the storage module is also used to, after sending each second message to the second client, obtain a second message receipt indicating whether the second message is sent successfully; and update the second channel information in the cache according to the second message receipt.
[0112] In an optional embodiment of the present invention, the storage module is also used to, in response to the presence of a target message receipt indicating a message sending failure among multiple second message receipts, remove the target second channel information corresponding to the target message receipt from the cache to update the second channel information.
[0113] It can be seen from the message processing server of the embodiment of the present invention that by obtaining multiple second channel information corresponding to the second client corresponding to the first message, the first message can be repackaged, and the first message obtained by encapsulation based on the first channel information is converted into a second message obtained by encapsulation based on the second channel information, ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously encapsulates the message code during the encapsulation process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0114] Fig.12 4 is a schematic diagram of main modules of a second client for message processing according to an embodiment of the present invention.
[0115] like Fig.12 As shown, the second client 1200 for message processing in this embodiment of the present invention includes:
[0116] The receiving module 1201 is used to receive multiple second messages sent by the server; wherein each of the second messages is encapsulated by the server based on multiple second channel information corresponding to the second client;
[0117] The parsing module 1202 is used to parse the second message to obtain a message code and message data corresponding to each of the second messages;
[0118] A deduplication module 1203 is used to deduplicate multiple second messages according to the message codes and the message receiving time corresponding to each second message, so as to obtain a target message;
[0119] The display module 1204 is used to display the target message data corresponding to the target message.
[0120] In an optional embodiment of the present invention, the second client 1200 also includes an initialization module, which is used to determine multiple message channels in the application state in response to the initialization procedure of the application before receiving multiple second messages sent by the server; generate second channel information corresponding to each of the message channels, and send the second channel information to the server.
[0121] In an optional embodiment of the present invention, the second client 1200 also includes a sending module, which is used to obtain a read operation corresponding to the target message after displaying the target message data corresponding to the target message; generate a third message receipt according to the read operation, and send the third message receipt to the first client.
[0122] According to the second client of the message processing of the embodiment of the present invention, it can be seen that by obtaining multiple second channel information corresponding to the second client corresponding to the first message, the first message can be repackaged, and the first message obtained by packaging based on the first channel information is converted into a second message obtained by packaging based on the second channel information, ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously packages the message code during the packaging process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0123] Fig.13 An exemplary system architecture 1300 is shown to which the message processing method or message processing apparatus according to the embodiment of the present invention can be applied.
[0124] like Fig.13 As shown, the system architecture 1300 may include first clients 1301, 1302, 1303, a network 1304, a server 1305, and second clients 1306, 1307, 1308. The network 1304 is used to provide a medium for communication links between the first clients 1301, 1302, 1303 and the server 1305, and between the server 1305 and the second clients 1306, 1307, 1308. The network 1304 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0125] The user can use the first client 1301, 1302, 1303 or the second client 1306, 1307, 1308 to interact with the server 1305 through the network 1304 to receive or send data, etc. Various communication client applications can be installed on the terminal devices 1301, 1302, 1303, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0126] The first clients 1301 , 1302 , 1303 and the second clients 1306 , 1307 , 1308 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0127] The server 1305 may be a server that provides various services, such as a background management server that provides support for the first message sent by the user using the first client 1301, 1302, 1303. The background management server may analyze and process the received first message and other data, and send the processing result (such as the second message) to the second client 1306, 1307, 1308.
[0128] It should be understood that Fig.13 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0129] Reference below Fig.14 , which shows a schematic diagram of the structure of a computer system 1400 of a terminal device suitable for implementing an embodiment of the present invention. Fig.14 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0130] like Fig.14 As shown, the computer system 1400 includes a central processing unit (CPU) 1401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1402 or a program loaded from a storage part 1408 into a random access memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the system 1400 are also stored. The CPU 1401, the ROM 1402, and the RAM 1403 are connected to each other through a bus 1404. An input / output (I / O) first interface 1405 is also connected to the bus 1404.
[0131] The following components are connected to the I / O first interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network first interface card such as a LAN card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O first interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed, so that a computer program read therefrom is installed into the storage section 1408 as needed.
[0132] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1409, and / or installed from the removable medium 1411. When the computer program is executed by the central processing unit (CPU) 1401, the above-mentioned functions defined in the system of the present invention are executed.
[0133] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0134] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0135] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor includes an acquisition module, a determination module, an encapsulation module, and a sending module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the acquisition module may also be described as a "module that acquires and parses a first message to obtain a message code and message data corresponding to the first message."
[0136] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: obtaining a first message and parsing it to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by the first client based on the first channel information encapsulation; determining a second client corresponding to the first message, and obtaining multiple second channel information corresponding to the second client; encapsulating the message code and the message data according to each second channel information, and obtaining a second message corresponding to each second channel information; sending each second message to the second client, so that the second client deduplicates multiple second messages according to the message code, and displays the message data.
[0137] According to the technical solution of the embodiment of the present invention, by obtaining multiple second channel information corresponding to the second client corresponding to the first message, the first message can be repackaged, and the first message obtained by packaging based on the first channel information is converted into a second message obtained by packaging based on the second channel information, ensuring that the second client can smoothly parse the second message to obtain the message data after receiving the second message. At the same time, the embodiment of the present invention synchronously packages the message code during the packaging process, so that the second client can deduplicate according to the message code, avoiding the problem of repeated display under multiple message channels.
[0138] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A message processing method, characterized in that: Applied to the server, including: Obtaining and parsing a first message to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by the first client based on the first channel information encapsulation; Determine a second client corresponding to the first message, and obtain a plurality of second channel information corresponding to the second client; According to each piece of the second channel information, encapsulate the message code and the message data to obtain a second message corresponding to each piece of the second channel information; Each of the second messages is sent to a second client, so that the second client deduplicates the plurality of second messages according to the message encoding and displays the message data.
2. The method according to claim 1, characterized in that: The step of encoding the message and encapsulating the message data according to each of the second channel information includes: Performing data verification on a first message field in the message data; In response to a verification result of the data verification being a verification pass, converting the first message field according to the second channel information to obtain a second message field corresponding to the second channel information; The second message field and the message code are encapsulated together to obtain the second message.
3. The method according to claim 2, characterized in that Also includes: In response to a verification result of the data verification being a verification failure, a first message receipt corresponding to the verification result is generated, and the first message receipt is fed back to the first client.
4. The method according to claim 1, characterized in that: Also includes: storing the second client and the second channel information corresponding to the second client in a cache; After sending each of the second messages to the second client, the method further includes: Obtaining a second message receipt indicating whether the second message was sent successfully; The second channel information in the cache is updated according to the second message receipt.
5. The method according to claim 4, characterized in that The updating the second channel information in the cache according to the second message receipt includes: In response to the presence of a target message receipt indicating a message sending failure among the plurality of second message receipts, the target second channel information corresponding to the target message receipt is removed from the cache to update the second channel information.
6. A message processing method, characterized in that: Applied to the second client, including: Receiving multiple second messages sent by the server; wherein each of the second messages is encapsulated by the server based on multiple second channel information corresponding to the second client; Parsing the second messages to obtain message codes and message data corresponding to each of the second messages; Deduplication of the plurality of second messages is performed according to the message code and the message receiving time corresponding to each second message to obtain a target message; Display the target message data corresponding to the target message.
7. The method according to claim 6, characterized in that Before receiving the plurality of second messages sent by the service end, the method further includes: In response to an initialization procedure of the application, determining a plurality of message channels in an application state; Generate second channel information corresponding to each of the message channels, and send the second channel information to the server.
8. The method according to claim 6, characterized in that After displaying the target message data corresponding to the target message, the method further includes: Obtaining a read operation corresponding to the target message; A third message receipt is generated according to the read operation, and the third message receipt is sent to the first client.
9. A message processing server, characterized in that: include: An acquisition module, configured to acquire and parse a first message to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by the first client based on the first channel information encapsulation; A determination module, configured to determine a second client corresponding to the first message, and obtain a plurality of second channel information corresponding to the second client; An encapsulation module, used for encapsulating the message code and the message data according to each of the second channel information, to obtain a second message corresponding to each of the second channel information; A sending module is used to send each of the second messages to a second client, so that the second client deduplicates multiple second messages according to the message code and displays the message data.
10. A second client for message processing, characterized in that: include: A receiving module, configured to receive a plurality of second messages sent by a server, wherein each of the second messages is encapsulated by the server based on a plurality of second channel information corresponding to the second client; A parsing module, used to parse the second message to obtain a message code and message data corresponding to each of the second messages; a deduplication module, configured to deduplicate a plurality of the second messages according to the message codes and the message receiving time corresponding to each of the second messages, to obtain a target message; The display module is used to display the target message data corresponding to the target message.
11. A message processing system, characterized in that: include: The server as claimed in claim 9 and the second client as claimed in claim 10; wherein, The server is used to obtain a first message and parse it to obtain a message code and message data corresponding to the first message; wherein the first message is obtained by encapsulating the first client based on the first channel information; determine a second client corresponding to the first message, and obtain multiple second channel information corresponding to the second client; encapsulate the message code and the message data according to each second channel information to obtain a second message corresponding to each second channel information; and send each second message to the second client; The second client is used to receive multiple second messages sent by the server; wherein each second message is encapsulated by the server based on multiple second channel information corresponding to the second client; the second messages are parsed to obtain the message code and message data corresponding to each second message; according to the message code and the message reception time corresponding to each second message, multiple second messages are deduplicated to obtain a target message; and the target message data corresponding to the target message is displayed.
12. An electronic device for business processing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
13. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
14. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 8.