Data processing method and device of communication tool, equipment and storage medium
By using a batch-stream processing method that combines streaming and batch processing, the problem of single message processing function on the instant messaging tool server side is solved, and efficient updating of the number of unread messages and improvement of data processing efficiency are achieved.
Patent Information
- Application Number
- CN202510931643.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-09-12
AI Technical Summary
The existing instant messaging tool server-side message processing functions are single and difficult to adapt to service scenarios with fast online iteration pace and complex business logic.
A batch stream processing method is used, combining streaming processing and batch processing, to process real-time data streams, store them in a preset storage system, and compare messages based on user lists to determine the number of unread messages. The client updates the number of unread messages based on real-time message events and user operations.
It realizes the sending and receiving of messages between user superiors and users and the updating of the number of unread messages, reduces the overhead of the interface in real-time statistics of unread messages, and improves data processing efficiency and adaptability.
Smart Images

Figure CN120639733A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data processing method, device, equipment and storage medium for a communication tool. Background Art
[0002] As a real-time online communication software, instant messaging tools have functions such as text, voice, video, and file transfer. They are widely used in scenarios such as personal communication, team collaboration, remote work, online education, customer service, and game communication. They promote the rapid transmission of information and also promote the development of remote collaboration and social networks, becoming an indispensable communication method in modern society.
[0003] The mainstream instant messaging tools for B-side application scenarios on the market are mainly developed and implemented using the C / S architecture, but their iteration cycle is long and they need to be adapted to different systems. The message processing function on the server side is single and it is difficult to adapt to the service scenarios with fast online iteration pace and complex business logic of customers. Summary of the Invention
[0004] The main purpose of this application is to provide a data processing method, device, equipment and storage medium for a communication tool, aiming to solve the technical problem that current instant messaging tools have a single message processing function on the server side and are difficult to adapt to service scenarios with fast online iteration pace and complex business logic of customers.
[0005] To achieve the above objectives, the present application proposes a data processing method for a communication tool, the method comprising:
[0006] Receive real-time data streams consumed by users in communication tools;
[0007] Performing batch stream processing on the real-time data stream to obtain batch stream target data, and storing the batch stream target data in a preset storage system, wherein the batch stream processing includes stream processing and batch processing;
[0008] Pulling batch stream target data from the preset storage system based on a preset user list to perform message comparison and determine the number of unread messages;
[0009] The number of unread messages is sent to the client, and the client updates the number of unread messages according to real-time message events and user superior operations.
[0010] In one embodiment, when the batch stream processing is streaming processing, the step of performing batch stream processing on the real-time data stream to obtain batch stream target data and storing the batch stream target data in a preset storage system includes:
[0011] Use the Flink framework to perform streaming processing on the real-time data stream to obtain the group chat user list, user notification events, and message records;
[0012] Performing information association based on the group chat user list, the user notification event, and the message record to obtain group chat user result data;
[0013] Performing uplink data filtering on the message record to obtain user uplink message result data;
[0014] The group chat user result data and the user uplink message result data are stored in a first storage system.
[0015] In one embodiment, the step of correlating information based on the group chat user list, the user notification event, and the message record to obtain group chat user result data includes:
[0016] Extracting a temporary group chat user list and a formal group chat user list from the group chat user list;
[0017] Performing ID conversion on the temporary group chat user list to obtain an intermediate result of the temporary group chat user list;
[0018] Associating the temporary group chat user list intermediate result and the formal group chat user list with the user basic information to obtain initial result data;
[0019] The user notification event and the message record are added to the initial result data to generate group chat user result data.
[0020] In one embodiment, when the batch stream processing is batch processing, the step of performing batch stream processing on the real-time data stream to obtain batch stream target data and storing the batch stream target data in a preset storage system further includes:
[0021] Perform offline processing on the real-time data stream at a preset time point to obtain end-of-day user uplink message results and end-of-day group chat user results;
[0022] Perform unread message preprocessing based on the end-of-day user uplink message result and the end-of-day group chat user result to determine the number of unread messages from the previous day;
[0023] Batch update the end-of-day group chat user results and user basic information, and add the updated results to the number of unread messages of the previous day to determine the second group chat user result data;
[0024] The second group chat user result data is stored in a second storage system.
[0025] In one embodiment, the step of pulling batch stream target data from the preset storage system based on the preset user list to perform message comparison and determine the number of unread messages includes:
[0026] Pulling batch flow target data from the preset storage system, and determining whether the user has sent a message based on the batch flow target data;
[0027] When the user has sent a message, determining whether the message sending time of the user is later than the message reading time of the user's superior;
[0028] When the message sending time is later than the message reading time, the number of unread messages is determined based on the user's superior's reading time on that day and the user's sending time on that day; wherein, when the reading time on that day is greater than the reading time on the previous day, the number of unread messages is the number of messages sent by the user on that day; when the sending time on that day is greater than the sending time on the previous day, the number of unread messages is the sum of the number of unread messages on that day and the number of unread messages on the previous day.
[0029] In one embodiment, the step of updating the number of unread messages by the client according to the real-time message event and the user's superior operation includes:
[0030] The client is used to obtain real-time message events and user superior operations;
[0031] The client is configured to update the number of unread messages to zero when there is a parent read notification in the real-time message event or a selected user operation in the user parent operation;
[0032] The client is configured to update the number of unread messages when there is a new message sent by a user in the real-time message event and there is no selected user operation in the user superior operation.
[0033] In one embodiment, before the step of receiving the real-time data stream consumed by the user in the communication tool, the method further includes:
[0034] Save the micro-application information to the configuration table, wherein the micro-application information includes the registration logic and loading and unloading logic of the micro-application;
[0035] According to the loading and unloading logic, the micro application is loaded based on the micro front-end framework;
[0036] The micro-application is connected to the communication tool for data communication according to the registration logic, and the micro-application receives status data of the communication tool by splitting into fine granularity.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a data processing device for a communication tool, the device comprising:
[0038] A data stream receiving module is used to receive real-time data streams consumed by users in communication tools;
[0039] A batch stream processing module is used to perform batch stream processing on the real-time data stream to obtain batch stream target data and store the batch stream target data in a preset storage system, wherein the batch stream processing includes stream processing and batch processing;
[0040] A message comparison module is used to pull batch stream target data from the preset storage system based on a preset user list to perform message comparison and determine the number of unread messages;
[0041] The message updating module is used to send the number of unread messages to the client, and the client updates the number of unread messages according to real-time message events and user superior operations.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a data processing device for a communication tool, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data processing method for the communication tool as described above.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium, and when the computer program is executed by the processor, the steps of the data processing method of the communication tool as described above are implemented.
[0044] One or more technical solutions proposed in this application have at least the following technical effects: the data processing method of the communication tool of this application includes: receiving the real-time data stream consumed by the user in the communication tool; performing batch stream processing on the real-time data stream to obtain batch stream target data, and storing the batch stream target data in a preset storage system, wherein the batch stream processing includes streaming processing and batch processing; pulling the batch stream target data from the preset storage system based on a preset user list to perform message comparison and determine the number of unread messages; sending the number of unread messages to the client, and the client updating the number of unread messages according to real-time message events and user superior operations.
[0045] Since this application adopts a batch stream processing method for the real-time data stream consumed by users in communication tools, and combines it with the client to update the number of unread messages, it can realize the functions of sending and receiving messages between user superiors and users and updating the number of unread messages, reducing the overhead of the interface for real-time statistics of unread messages. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 A flowchart of the first embodiment of the data processing method for the communication tool of the present application is provided;
[0049] Figure 2 This is a flow chart of the stream processing provided in Example 1 of the present application;
[0050] Figure 3 Flowchart of batch processing provided in Example 1 of this application;
[0051] Figure 4 This is a flowchart of processing the number of unread messages provided in Example 1 of this application;
[0052] Figure 5 A flowchart for updating the number of unread messages on a client provided in Example 1 of the present application;
[0053] Figure 6 A flowchart of the second embodiment of the data processing method for the communication tool of the present application is provided;
[0054] Figure 7 A schematic diagram of the micro-application access process provided in Example 2 of this application;
[0055] Figure 8 This is a schematic diagram of the module structure of the data processing device of the communication tool according to the embodiment of the present application;
[0056] Figure 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the data processing method of the communication tool in the embodiment of the present application.
[0057] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0058] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0059] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0060] It should be noted that the execution subject of this embodiment can be a computing service device with data reception, batch stream processing, and unread message count update functions, such as a personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions, a data processing device of a communication tool that executes the data processing method of the communication tool of the present application (hereinafter referred to as a data processing device), etc., and this embodiment does not limit this. The following uses a data processing device as an example to illustrate this embodiment and the following embodiments.
[0061] Based on this, the first embodiment of the present application is proposed. The embodiment of the present application provides a data processing method for a communication tool, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the data processing method of the communication tool of this application.
[0062] In this embodiment, the data processing method of the communication tool includes steps S10 to S40:
[0063] Step S10: receiving the real-time data stream consumed by the user in the communication tool.
[0064] It should be noted that communication tools are software used to enable information exchange between people or between people and machines. Common communication tools may include instant messaging software, email, video conferencing software, etc.
[0065] Among them, instant messaging tool software can be divided into two architectural modes: C / S (client / server) and B / S (browser / server). The B / S architecture does not require the installation of a client and adaptation to different systems, and has the advantages of low development cost, flexible adaptation, and rapid iteration of business scenarios. This embodiment is based on the data of the industry's basic communication platform and the Web SDK (Web Software Development Kit) to build a lightweight communication tool with a B / S architecture. Through the solution of this embodiment, it can be decoupled from the basic communication platform to achieve real-time messaging between user superiors and users, as well as statistics and updates on the number of unread messages.
[0066] Understandably, real-time data streams are the messages that are converted and transmitted when users send messages in the context of communication tools. Both user information and messages are stored on the server, ensuring data timeliness, accuracy, and query performance.
[0067] Step S20: performing batch stream processing on the real-time data stream to obtain batch stream target data, and storing the batch stream target data in a preset storage system. The batch stream processing includes streaming processing and batch processing.
[0068] It's important to note that batch stream processing combines stream processing and batch processing. Stream processing focuses on immediate, element-by-element processing of continuously generated data streams within real-time data flows, emphasizing real-time and low-latency data. Batch processing, on the other hand, accumulates large amounts of data and processes them all at once, enabling large-scale analysis of periodic data.
[0069] It is understandable that the batch stream target data is the data result obtained after a combination of streaming processing and batch processing (such as cleaning, aggregation, etc.).
[0070] It should be understood that the preset storage system is a pre-set system for storing batch stream target data obtained through batch stream processing, such as a database management system (such as relational database MySQL, Oracle, etc.), a distributed file system, etc., for subsequent query calls.
[0071] In its implementation, the data processing device first receives the real-time data stream consumed by users through communication tools. It then uses stream processing to perform preliminary filtering and classification on data with high real-time requirements within the real-time data stream. Simultaneously, after accumulating a certain amount of data, it initiates batch processing and integrates the results of both processes to generate the target batch stream data. Finally, the target batch stream data is stored in a pre-set storage system.
[0072] By combining streaming and batch processing, we can not only process data with high real-time requirements in a timely manner, but also perform batch operations on large amounts of accumulated data, making full use of computing resources for large-scale complex analysis, thereby improving overall data processing efficiency.
[0073] In a feasible implementation, when the batch stream processing is streaming processing, step S20 of this embodiment may include the steps of: performing streaming processing on the real-time data stream using the Flink framework to obtain a group chat user list, user notification events, and message records; performing information association based on the group chat user list, the user notification events, and the message records to obtain group chat user result data; performing uplink data filtering on the message records to obtain user uplink message result data; and storing the group chat user result data and the user uplink message result data in a first storage system.
[0074] It's important to note that Flink is an open-source stream processing framework that efficiently handles both unbounded and bounded data streams. When processing these real-time data streams, Flink can process the incoming data in real time, performing operations such as transformation, filtering, and aggregation, and automatically adjusting processing resources based on the flow of data.
[0075] It's understood that a group chat user list refers to the collection of identification information for all users participating in a group chat within a communication tool. User notification events are user-related notifications that occur within the communication tool, such as notifications of new members joining the group chat or notifications that messages have been read. Message logs are a collection of messages sent and received between users within a group chat, including various message types and metadata associated with each message.
[0076] It is understandable that the group chat user result data is obtained by associating information among the group chat user list, user notification events, and message records (for example, matching the user who sent the notification event with the members in the group chat user list by user ID).
[0077] In a feasible implementation manner, the step of obtaining group chat user result data by associating information according to the group chat user list, the user notification event, and the message record in this embodiment includes: extracting a temporary group chat user list and a formal group chat user list from the group chat user list; performing ID conversion on the temporary group chat user list to obtain an intermediate result of the temporary group chat user list; associating the intermediate result of the temporary group chat user list and the formal group chat user list with user basic information to obtain initial result data; and adding the user notification event and the message record to the initial result data to generate group chat user result data.
[0078] It should be noted that a temporary group chat user list is a list of users who join a group chat for a temporary purpose. A formal group chat user list is a collection of user IDs that are permanently and stably part of a group chat within a communication tool. The intermediate result of a temporary group chat user list is the data that retains the attribute identification information of the temporary group chat users after ID conversion. For example, in some event-related group chats, the participation of temporary guests who join the group chat is limited to a certain time limit, which is different from the long-term and stable participation of formal members in the group chat.
[0079] It should be understood that user basic information is basic attribute data about the user, such as the user's age, gender, region, registration time and other information.
[0080] In the specific implementation, the temporary group chat user list can be converted into an ID, and then the intermediate result of the converted temporary group chat user list and the official group chat user list can be uniformly associated with the user basic information, retaining the identification information of the temporary group chat users, making the data more comprehensive.
[0081] It should be noted that the user's uplink message result data is obtained after uplink data filtering of the message records. It contains data related to messages actively sent by users, such as message content, sending time, sender, and other information, reflecting the user's active interactive behavior in the group chat.
[0082] It is understandable that the first storage system is a predetermined system for storing group chat user result data and user uplink message result data.
[0083] For example, to facilitate understanding of the above-mentioned streaming process, refer to Figure 2 , Figure 2 A flowchart of the streaming processing provided for Example 1 of the present application. After using the Flink framework for streaming processing to obtain the group chat user list (including the temporary group chat user list and the formal group chat user list), user notification events (such as user read notifications and user superior read notifications) and message records, you can first obtain data from the temporary group chat user list, convert the client ID, and obtain the temporary group chat user list intermediate result. Then obtain data from the formal group chat user list, uniformly associate the user basic information with the above-mentioned temporary group chat user list intermediate result, and process it as part of the group chat user result data. Then obtain data from the user read notification, the user superior read notification and the message record, update the latest message read record of the user and the user superior (such as the latest message and the time of reading the message), and process it as another part of the group chat user result data. Then obtain data from the message record, filter the user's upstream data, and obtain the user's upstream message result data. Finally, the group chat user result data and user upstream message result data obtained by the above processing for use by the server are stored in the first storage system to support complex query and search scenarios;
[0084] In this embodiment, data from different sources can be integrated through information association to obtain more comprehensive group chat user result data. At the same time, uplink data filtering can focus on the user's active message sending behavior and obtain user uplink message result data.
[0085] In another feasible implementation, when the batch stream processing is batch processing, step S20 of this embodiment may include the steps of: performing offline processing on the real-time data stream at a preset time point to obtain end-of-day user uplink message results and end-of-day group chat user results; performing unread pre-processing based on the end-of-day user uplink message results and the end-of-day group chat user results to determine the number of unread messages of the previous day; batch updating the end-of-day group chat user results and user basic information, and adding the updated results to the number of unread messages of the previous day to determine second group chat user result data; and storing the second group chat user result data in a second storage system.
[0086] It should be noted that the preset time point is a pre-set time point for offline processing of real-time data streams. For example, at 2:00 a.m. every day, there is no need to respond to the incoming data immediately. This can avoid business peaks and ensure that data processing does not interfere with normal real-time business.
[0087] It is understood that the end-of-day user uplink message results are the results of processing user uplink messages (messages sent by users proactively) within a day, obtained by offline processing of real-time data streams at preset time points. The end-of-day user uplink message results may include the number of user uplink messages sent that day, the distribution of senders, and statistical information on message content.
[0088] End-of-day group chat user results are generated by offline processing of real-time data streams at preset time points, analyzing group chat users for the entire day. These results may include information such as user activity within the group chat that day (e.g., the number of active users, distribution of users by activity level), and user entry and exit information.
[0089] It should be understood that the number of unread messages from the previous day is the number of messages that were not read by users in the group chat on the previous day, reflecting the degree of attention paid by users to the messages.
[0090] The second group chat user result data combines the group chat user's daily situation, basic information updates, and unread messages, providing a more comprehensive picture of group chat user information. The second group chat user result data is distinguished from the above group chat user result data only and does not represent a sequential order.
[0091] The second storage system is a predetermined system for storing the second group chat user result data obtained after batch processing. The second storage system is only distinguished from the first storage system and does not represent a priority relationship.
[0092] For example, to facilitate understanding of the above batch processing process, refer to Figure 3 , Figure 3 This is a flow chart of batch processing provided in Example 1 of the present application. At the end of each day, the user list and user uplink messages can be extracted from the real-time data stream to the data warehouse, and then processed in batches using an offline job to obtain the end-of-day user uplink message results and the end-of-day group chat user results. The previous day's unread user message count is then calculated based on the end-of-day user uplink message results and the end-of-day group chat user results, reducing the overhead of the interface's real-time statistics of unread messages. The end-of-day group chat user results are then updated together with the user's basic information, and the results are used together with the above-mentioned previous day's unread user message count as the second group chat user result data and stored in the second storage system.
[0093] In this embodiment, offline processing can reduce the overhead of the interface in real-time statistics of unread messages, and avoid the problem of too many offline messages accumulating and causing data loading to be stuck when the user logs into the client next time.
[0094] Step S30: Pulling batch stream target data from the preset storage system based on the preset user list to perform message comparison and determine the number of unread messages.
[0095] It should be noted that the user list is a collection of pre-determined user identifiers (such as user names, user IDs, etc.). The number of unread messages indicates the number of unread messages for each user in the user list, reflecting the user's attention to messages and the effectiveness of message delivery.
[0096] In a feasible implementation, step S30 of this embodiment may include the steps of: pulling batch stream target data from the preset storage system, and judging whether the user has sent a message based on the batch stream target data; when the user has sent a message, judging whether the user's message sending time is later than the user's superior's message reading time; when the message sending time is later than the message reading time, determining the number of unread messages based on the user's superior's reading time on the same day and the user's sending time on the same day; wherein, when the reading time on the same day is greater than the reading time on the previous day, the number of unread messages is the number of messages sent by the user on the same day; when the sending time on the same day is greater than the sending time on the previous day, the number of unread messages is the sum of the number of unread messages on the same day and the number of unread messages on the previous day.
[0097] For example, to facilitate understanding of the above-mentioned processing of the number of unread messages, refer to Figure 4 , Figure 4This is a flowchart for processing the number of unread messages provided in Example 1 of the present application. At the beginning of the processing, first determine whether the user has sent a message. If no message has been sent, the number of unread messages = 0. If the user has sent a message, compare the user's latest message sending time uT and the user's superior's latest message reading time mT to determine whether uT is greater than or equal to mT. If uT is less than mT, the number of unread messages = 0. If uT is greater than or equal to mT, then determine again whether the user's superior has a reading record on that day (that is, based on the previous day's reading time mT-1 and the latest message reading time mT, determine whether mT is equal to mT-1. If mT is inconsistent with mT-1, it means there is a reading record). If there is a reading record, the number of unread messages = the number of messages sent by the user after mT. If there is no reading record, it is determined again whether the user has sent any messages that day (i.e., based on the previous day's sending time uT-1 and the latest message sending time uT, it is determined whether uT is greater than uT-1. If uT is less than or equal to uT-1, it means that the user has not sent any messages that day). If the user has not sent any messages that day, the number of unread messages is equal to the number of unread messages from the previous day. If the user has sent any messages that day, the number of unread messages is equal to the sum of the number of unread messages from the current day and the number of unread messages from the previous day. Finally, the unread message count processing process ends.
[0098] In this implementation, by combining the user's message sending time and the user's superior's latest message reading time, it is possible to quickly determine whether the number of unread messages can be directly calculated based on the group chat user data of the previous day. If it is necessary to rely on the user's upstream message, the data is pulled from the above-mentioned storage system to finally calculate the user's actual number of unread messages. There is no need for the server to calculate and update the unread message count of all users in real time.
[0099] Step S40: sending the unread message count to the client, and the client updates the unread message count according to the real-time message event and the user's superior operation.
[0100] It should be noted that real-time message events are message-related situations that occur in real time in communication tools, such as whether a user sends a message, whether the user's superior has read the notification, etc.
[0101] It is understood that the user superior operation is an operation related to the message performed by the user's superior in the communication tool. For example, the user superior selects the user to forward or reply to the message.
[0102] In a specific implementation, after determining the unread message count, the client sends it to the client. Upon receiving this count, the client begins acquiring real-time message events and also monitors actions taken by the user's supervisor. For supervisor actions, if a supervisor forwards a new message to the user, the client increments the unread message count; if a supervisor withdraws an unread message, the client decrements the unread message count, continuously updating the unread message count based on real-time conditions.
[0103] In another feasible implementation, step S40 of this embodiment may include the following steps: the client is used to obtain real-time message events and user superior operations; the client is used to update the number of unread messages to zero when there is a superior read notification in the real-time message event or a selected user operation in the user superior operation; the client is used to update the number of unread messages when there is a new user message in the real-time message event and there is no selected user operation in the user superior operation.
[0104] For example, to understand the client's processing, refer to Figure 5 , Figure 5 A flowchart for updating the number of unread messages of a client provided in Example 1 of the present application. The client updates the number of unread messages based on the acquired real-time message events (such as whether the user sends a message, the user's superior's read notification, etc.) and the user's superior's operation (such as whether the user is selected for operation, whether the client is triggered to obtain focus, etc.). If there is a superior read notification in the real-time message event, a user operation is selected in the user's superior operation, or one of the client's focus is triggered, the number of unread messages is updated to 0. If there is a new message sent by the user in the real-time message event, it is determined whether the client obtains the focus. If the client obtains the focus and the user is selected, the number of unread messages = 0. If the client does not obtain the focus, the number of unread messages + 1, and finally the client ends the process of updating the number of unread messages.
[0105] In this implementation, unread message counts are tracked through a combination of server-side initialization and client-side updates. When a user's list is first loaded into the client list, the server calculates the unread message count. Updates to unread messages during use are handled centrally by the client. This hierarchical approach reduces delays caused by unclear message status.
[0106] In the technical solution provided in this embodiment, a data processing device first receives a real-time data stream consumed by a user from a communication tool. It then uses streaming processing to perform preliminary filtering and classification on data with high real-time requirements within the real-time data stream. Simultaneously, after accumulating a certain amount of data, it initiates batch processing and integrates the results of both processes to generate batch stream target data. Finally, the batch stream target data is stored in a preset storage system. Next, based on a preset user list, the batch stream target data is pulled from the preset storage system for message comparison, determining the user's unread message count and sending this unread message count to the client. After receiving this unread message count, the client begins acquiring real-time message events while also monitoring actions taken by the user's superiors. For actions taken by the user's superiors, if the superior forwards a new message to the user, the client increments the unread message count; if the superior withdraws an unread message, the unread message count decrements, thereby continuously updating the unread message count based on real-time conditions. Since this embodiment adopts a batch stream processing method for the real-time data stream consumed by users in communication tools, and combines it with the client to update the number of unread messages, it can realize the functions of sending and receiving messages between user superiors and users and updating the number of unread messages, reducing the overhead of the interface for real-time statistics of unread messages.
[0107] Based on the above embodiment 1 of this application, the second embodiment of this application is proposed. In the second embodiment of this application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be repeated hereafter. Figure 6 , Figure 6 This is a flow chart of the second embodiment of the data processing method of the communication tool of this application.
[0108] Before step S10 of this example, the data processing method of the communication tool further includes steps S01 to S03:
[0109] Step S01: Save the micro-application information to the configuration table, wherein the micro-application information includes the registration logic and loading and unloading logic of the micro-application.
[0110] It should be noted that micro-application information is a collection of various setting information about the micro-application, and is the key basis for the micro-application to interact with other system components.
[0111] The loading and unloading logic is divided into loading logic and unloading logic. The loading logic defines the steps and rules for how a microapp is introduced into the runtime environment based on a specific micro-frontend framework, such as determining the loading order and dependencies. The unloading logic specifies the circumstances and procedures for removing a microapp from the runtime environment. The registration logic specifies the rules and procedures for registering a microapp with a communication tool.
[0112] It is understandable that the configuration table is a data storage structure for storing micro-application information, which can store important information such as the registration logic, loading and unloading logic of the micro-application in an orderly manner so as to facilitate subsequent corresponding operations on the micro-application.
[0113] Step S02: According to the loading and unloading logic, the micro application is loaded based on the micro front-end framework.
[0114] It should be noted that the micro-frontend framework is used to build large front-end applications composed of multiple small, independent and collaborative front-end applications (i.e. micro-applications).
[0115] Step S03: according to the registration logic, the micro-application is connected to the communication tool for data communication, and the micro-application receives the status data of the communication tool by splitting into fine granularity.
[0116] It should be noted that status data refers to data related to the status of the communication tool during its operation, such as the communication tool's connection status, user login status, user message activity status, etc.
[0117] Exemplary, reference Figure 7 , Figure 7 A flow chart of micro-application access provided in Example 2 of the present application. Micro-application information and user behavior events are respectively configured and input into the main application of the communication tool, wherein the main application logic receives the user behavior event through the user behavior event management. The sub-application management is responsible for calling the sub-application loader and unloader. Multiple micro-applications (such as smart telephone interviews, business assistants, AI assistants, etc.) can be loaded at the same time through the sub-application loader and unloader. Then, the application communication management is responsible for the communication between the micro-applications, and the status data is obtained by splitting the fine-grainedness: customer information, user information, call status information, etc. are selected, which can be applied to scenarios with frequent communication between applications.
[0118] In addition to communicating via state data, the communication management module also supports each application's proactive definition and registration of basic functional methods. Other applications can then access these registered methods through the communication management module, enabling functional reuse and direct data communication between applications. The main application registers micro-applications, implements their loading and unloading logic, and manages common data, methods, and event communications. The cost of integrating and modifying sub-applications is minimal, and once integrated, subsequent focus is on continuous business iteration and upgrades.
[0119] The technical solution provided in this embodiment allows for rapid integration with third-party tool micro-applications, such as AI assistants, business assistants, and smart phone interviews, to adapt to rapidly changing business scenarios. This eliminates the need to consider compatibility with different terminal devices and operating systems, and allows for the decoupling of most scenarios from the underlying communication platform, enabling rapid iteration of customer business scenario functions.
[0120] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data processing method of the communication tool of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0121] This application also provides a data processing device for communication tools, please refer to Figure 8 , Figure 8 This is a schematic diagram of the module structure of the data processing device of the communication tool according to an embodiment of the present application; the data processing device of the communication tool includes:
[0122] The data stream receiving module 801 is used to receive the real-time data stream consumed by the user in the communication tool;
[0123] The batch stream processing module 802 is used to perform batch stream processing on the real-time data stream to obtain batch stream target data and store the batch stream target data into a preset storage system. The batch stream processing includes stream processing and batch processing.
[0124] The message comparison module 803 is used to pull the batch stream target data from the preset storage system based on the preset user list to perform message comparison and determine the number of unread messages;
[0125] The message updating module 804 is configured to send the number of unread messages to the client, and the client updates the number of unread messages according to real-time message events and user superior operations.
[0126] As an implementation mode, when the batch stream processing is streaming processing, the batch stream processing module 802 is also used to perform streaming processing on the real-time data stream using the Flink framework to obtain a group chat user list, user notification events and message records; perform information association based on the group chat user list, the user notification events and the message records to obtain group chat user result data; perform uplink data filtering on the message records to obtain user uplink message result data; and store the group chat user result data and the user uplink message result data in a first storage system.
[0127] As an implementation method, the batch stream processing module 802 is further used to extract a temporary group chat user list and a formal group chat user list from the group chat user list; perform ID conversion on the temporary group chat user list to obtain an intermediate result of the temporary group chat user list; associate the intermediate result of the temporary group chat user list and the formal group chat user list with user basic information to obtain initial result data; and add the user notification event and the message record to the initial result data to generate group chat user result data.
[0128] As an implementation mode, when the batch stream processing is batch processing, the batch stream processing module 802 is further used to perform offline processing on the real-time data stream at a preset time point to obtain the end-of-day user uplink message results and the end-of-day group chat user results; perform unread pre-processing based on the end-of-day user uplink message results and the end-of-day group chat user results to determine the number of unread messages of the previous day; batch update the end-of-day group chat user results and user basic information, and add the updated results to the number of unread messages of the previous day to determine the second group chat user result data; and store the second group chat user result data in a second storage system.
[0129] As an embodiment, the message comparison module 803 is also used to pull batch stream target data from the preset storage system, and determine whether the user has sent a message based on the batch stream target data; when the user has sent a message, determine whether the user's message sending time is later than the user's superior's message reading time; when the message sending time is later than the message reading time, determine the number of unread messages based on the user's superior's reading time on the same day and the user's sending time on the same day; wherein, when the reading time on the same day is greater than the reading time of the previous day, the number of unread messages is the number of messages sent by the user on the same day; when the sending time on the same day is greater than the sending time of the previous day, the number of unread messages is the sum of the number of unread messages on the same day and the number of unread messages on the previous day.
[0130] As an embodiment, in the message update module 804, the client is used to obtain real-time message events and user superior operations; the client is used to update the number of unread messages to zero when there is a superior read notification in the real-time message event or a selected user operation in the user superior operation; the client is used to update the number of unread messages when there is a new message sent by the user in the real-time message event and there is no selected user operation in the user superior operation.
[0131] As an embodiment, the data processing device of the communication tool is also used to save micro-application information to a configuration table, wherein the micro-application information includes the registration logic and loading and unloading logic of the micro-application; according to the loading and unloading logic, the micro-application is loaded based on the micro-front-end framework; according to the registration logic, the micro-application is connected to the communication tool for data communication, and the micro-application receives the status data of the communication tool by splitting it into fine granularity.
[0132] Other embodiments or specific implementations of the data processing device of the communication tool of the present application can refer to the above-mentioned method embodiments and will not be repeated here.
[0133] The communication tool data processing device provided in this application, which utilizes the communication tool data processing method described in the aforementioned embodiments, can address the technical issues faced by current instant messaging tools, such as the limited message processing functionality of the server side, which makes it difficult to adapt to service scenarios characterized by rapid online customer iterations and complex business logic. Compared to the prior art, the communication tool data processing device provided in this application offers the same beneficial effects as the communication tool data processing method described in the aforementioned embodiments. Other technical features of the communication tool data processing device are the same as those disclosed in the aforementioned embodiments and are not further elaborated upon here.
[0134] The present application provides a data processing device for a communication tool, the data processing device for the communication tool comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data processing method for the communication tool in the above-mentioned embodiment 1.
[0135] Reference below Figure 9 , Figure 9 The present invention provides a schematic diagram of the hardware operating environment of the data processing method for a communication tool according to an embodiment of the present invention, illustrating a schematic diagram of the structure of a data processing device for a communication tool suitable for implementing the present invention. The data processing device for a communication tool according to the present invention may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The data processing device of the communication tool shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0136] like Figure 9 As shown, the data processing device of the communication tool may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory 1002 or programs loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the data processing device of the communication tool. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data processing device of the communication tool to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows the data processing device of the communication tool with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have alternatively.
[0137] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.
[0138] The communication tool data processing device provided in this application, which utilizes the communication tool data processing method described in the aforementioned embodiments, can address the technical issues faced by current instant messaging tools, such as the limited message processing functionality on the server side, which makes it difficult to adapt to service scenarios characterized by rapid online customer iterations and complex business logic. Compared to the prior art, the communication tool data processing device provided in this application offers the same beneficial effects as the communication tool data processing method described in the aforementioned embodiments. Other technical features of the communication tool data processing device are the same as those disclosed in the aforementioned embodiments and are not further elaborated upon here.
[0139] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0140] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0141] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer program) stored thereon, and the computer-readable program instructions are used to execute the data processing method of the communication tool in the above embodiment.
[0142] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems or devices, or any combination thereof. 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 thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0143] The computer-readable storage medium may be included in the data processing device of the communication tool; or may exist independently without being installed in the data processing device of the communication tool.
[0144] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the data processing device of the communication tool, the data processing device of the communication tool: receives the real-time data stream consumed by the user in the communication tool; performs batch stream processing on the real-time data stream to obtain batch stream target data, and stores the batch stream target data in a preset storage system, wherein the batch stream processing includes streaming processing and batch processing; pulls the batch stream target data from the preset storage system based on a preset user list to perform message comparison and determine the number of unread messages; sends the number of unread messages to the client, and the client updates the number of unread messages according to real-time message events and user superior operations.
[0145] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that 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 and / or flowchart and the combination of boxes in the block diagram and / or flowchart can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0147] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0148] The computer-readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the data processing method for the aforementioned communication tool. This computer-readable storage medium can address the technical problem that current instant messaging tools have a single server-side message processing function and are difficult to adapt to service scenarios with fast online customer iterations and complex business logic. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the communication tool data processing method provided in the aforementioned embodiments, and are not further elaborated here.
[0149] The present application also provides a computer program product, comprising a computer program, which implements the steps of the data processing method of the communication tool as described above when the computer program is executed by a processor.
[0150] The computer program product provided in this application can address the technical issues faced by current instant messaging tools, which have limited server-side message processing functionality and are difficult to adapt to service scenarios characterized by rapid online customer iterations and complex business logic. Compared to the prior art, the beneficial effects of the computer program product provided in this application are similar to those of the communication tool data processing methods provided in the aforementioned embodiments, and are not further elaborated here.
[0151] The above description is only part of the embodiments of the present application and does not limit the scope of protection of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the scope of protection of the present application.
Claims
1. A data processing method for a communication tool, characterized in that: The method comprises: Receive real-time data streams consumed by users in communication tools; Performing batch stream processing on the real-time data stream to obtain batch stream target data, and storing the batch stream target data in a preset storage system, wherein the batch stream processing includes stream processing and batch processing; Pulling batch stream target data from the preset storage system based on a preset user list to perform message comparison and determine the number of unread messages; The number of unread messages is sent to the client, and the client updates the number of unread messages according to real-time message events and user superior operations.
2. The method according to claim 1, wherein When the batch stream processing is streaming processing, the step of performing batch stream processing on the real-time data stream to obtain batch stream target data and storing the batch stream target data in a preset storage system includes: Use the Flink framework to perform streaming processing on the real-time data stream to obtain the group chat user list, user notification events, and message records; Perform information association based on the group chat user list, the user notification event, and the message record to obtain group chat user result data; Performing uplink data filtering on the message record to obtain user uplink message result data; The group chat user result data and the user uplink message result data are stored in a first storage system.
3. The method according to claim 2, wherein The step of performing information association based on the group chat user list, the user notification event, and the message record to obtain group chat user result data includes: Extracting a temporary group chat user list and a formal group chat user list from the group chat user list; Performing ID conversion on the temporary group chat user list to obtain an intermediate result of the temporary group chat user list; Associating the temporary group chat user list intermediate result and the formal group chat user list with the user basic information to obtain initial result data; The user notification event and the message record are added to the initial result data to generate group chat user result data.
4. The method according to claim 2, wherein When the batch stream processing is batch processing, the step of performing batch stream processing on the real-time data stream to obtain batch stream target data and storing the batch stream target data in a preset storage system further includes: Perform offline processing on the real-time data stream at a preset time point to obtain end-of-day user uplink message results and end-of-day group chat user results; Perform unread message preprocessing based on the end-of-day user uplink message result and the end-of-day group chat user result to determine the number of unread messages from the previous day; Batch update the end-of-day group chat user results and user basic information, and add the updated results to the number of unread messages of the previous day to determine the second group chat user result data; The second group chat user result data is stored in a second storage system.
5. The method according to claim 1, wherein The step of pulling batch stream target data from the preset storage system based on the preset user list to perform message comparison and determine the number of unread messages includes: Pulling batch flow target data from the preset storage system, and determining whether the user has sent a message based on the batch flow target data; When the user has sent a message, determining whether the message sending time of the user is later than the message reading time of the user's superior; When the message sending time is later than the message reading time, the number of unread messages is determined based on the user's superior's reading time on that day and the user's sending time on that day; wherein, when the reading time on that day is greater than the reading time on the previous day, the number of unread messages is the number of messages sent by the user on that day; when the sending time on that day is greater than the sending time on the previous day, the number of unread messages is the sum of the number of unread messages on that day and the number of unread messages on the previous day.
6. The method according to claim 1, wherein The step of the client updating the number of unread messages according to the real-time message event and the user's superior operation includes: The client is used to obtain real-time message events and user superior operations; The client is configured to update the number of unread messages to zero when there is a parent read notification in the real-time message event or a selected user operation in the user parent operation; The client is configured to update the number of unread messages when there is a new message sent by a user in the real-time message event and there is no selected user operation in the user superior operation.
7. The method according to any one of claims 1 to 6, characterized in that Before the step of receiving the real-time data stream consumed by the user in the communication tool, the method further includes: Save the micro-application information to the configuration table, wherein the micro-application information includes the registration logic and loading and unloading logic of the micro-application; According to the loading and unloading logic, the micro application is loaded based on the micro front-end framework; The micro-application is connected to the communication tool for data communication according to the registration logic, and the micro-application receives status data of the communication tool by splitting into fine granularity.
8. A data processing device for a communication tool, characterized in that: The device comprises: A data stream receiving module is used to receive real-time data streams consumed by users in communication tools; A batch stream processing module is used to perform batch stream processing on the real-time data stream to obtain batch stream target data and store the batch stream target data in a preset storage system, wherein the batch stream processing includes stream processing and batch processing; A message comparison module is used to pull batch stream target data from the preset storage system based on a preset user list to perform message comparison and determine the number of unread messages; The message updating module is used to send the number of unread messages to the client, and the client updates the number of unread messages according to real-time message events and user superior operations.
9. A data processing device for a communication tool, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data processing method of the communication tool according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data processing method of the communication tool according to any one of claims 1 to 7 are implemented.