A message processing method and related products
By identifying and binding multiple serial numbers, the reliability and orderliness issues of message management in social scenarios are solved, enabling diversified message processing and enhancing the application and competitiveness of social products.
Patent Information
- Application Number
- CN202210597945.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-05-30
AI Technical Summary
Message management in social scenarios is complex and requires higher reliability and orderliness in receiving messages. Existing technologies are insufficient to meet the diverse processing needs of various scenarios.
By identifying the target message type, generating and binding multiple sequence numbers, reliable message reception and strict ordering in social conversations are ensured, and a multi-sequence mechanism is used to handle various message types.
It achieves reliable message reception and strict ordering, supports diverse message processing scenarios, and expands the application scope and competitiveness of social products.
Smart Images

Figure CN117201445B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a message processing method, a message processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] As social scenarios (such as live streaming and instant messaging) become increasingly diverse, message management within these scenarios becomes more complex. This places higher demands on the reliability and orderliness of message reception in social scenarios, and requires messages to be processed in more diverse ways. Summary of the Invention
[0003] This application provides a message processing method and related products that can ensure reliable message reception and strict order, thereby helping to meet the needs of diverse processing scenarios.
[0004] On one hand, embodiments of this application provide a message processing method, including:
[0005] When a target message is generated in a social conversation, the target message type to which the target message belongs is identified. The message types supported by the social conversation include global types and N extended types. Each message type corresponds to a sequence, and the sequence contains one or more sequence numbers. Each sequence number is used to indicate the order of messages in the social conversation under the corresponding message type. Wherein, N is a positive integer.
[0006] Determine the target sequence corresponding to the target message type, and increment the sequence number of the target sequence.
[0007] Bind the new sequence number obtained by incrementing the sequence number in the target sequence to the target message.
[0008] On one hand, embodiments of this application provide a message processing apparatus, including:
[0009] The identification module is used to identify the target message type when a target message is generated in a social session. The message types supported by the social session include global types and N extended types. Each message type corresponds to a sequence, and the sequence contains one or more sequence numbers. Each sequence number is used to indicate the order of messages in the social session under the corresponding message type. Here, N is a positive integer.
[0010] The determination module is used to determine the target sequence corresponding to the target message type and to perform an auto-increment operation on the sequence number of the target sequence;
[0011] The binding module is used to bind a new sequence number obtained by incrementing the sequence number in the target sequence to the target message.
[0012] Accordingly, this application provides a computer device, including: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the message processing method in this application.
[0013] Accordingly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the message processing method of embodiments of this application.
[0014] Accordingly, this application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the message processing method of this application.
[0015] In this embodiment, the social session supports both a global message type and N extended message types, with each message type corresponding to a sequence. Each message in the social session can be sorted according to its sequence number within the corresponding message type. When a target message is generated in the social session, the target sequence is determined by identifying the target message type to which the target message belongs. The sequence number of the target sequence is then atomically incremented, binding the newly incremented sequence number to the target message. This new sequence number in the target sequence records the sorting of the target message within its target message type. This multi-sequence mechanism ensures reliable reception and strict ordering of messages under each message type. Furthermore, based on this reliable reception and strict ordering, personalized application and processing of messages of various types are supported. This expands the diversity of message processing scenarios and broadens the application scope and competitiveness of social products. Attached Figure Description
[0016] Figure 1 This is an architecture diagram of a message processing system provided in an exemplary embodiment of this application;
[0017] Figure 2 This is a flowchart illustrating a message processing method provided in an exemplary embodiment of this application. Figure 1 ;
[0018] Figure 3a This is a schematic diagram of a global sequence and an extended sequence provided in an exemplary embodiment of this application;
[0019] Figure 3b This is an architectural diagram of a multi-sequence generation system provided in an exemplary embodiment of this application;
[0020] Figure 4 This is a flowchart illustrating a message processing method provided in an exemplary embodiment of this application. Figure 2 ;
[0021] Figure 5 This is an interactive schematic diagram of a message sending process provided in an exemplary embodiment of this application;
[0022] Figure 6 This is an interactive schematic diagram of a message receiving process provided in an exemplary embodiment of this application;
[0023] Figure 7 This is a schematic diagram illustrating an application scenario provided by an exemplary embodiment of this application;
[0024] Figure 8 This is a schematic diagram of the structure of a message processing apparatus provided in an exemplary embodiment of this application;
[0025] Figure 9 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0026] To better understand the solutions of the embodiments of this application, the relevant terms and concepts that may be involved in the embodiments of this application will be introduced below.
[0027] I. Social Applications:
[0028] Social applications are applications that provide social functions. Social applications can include instant messaging applications (also known as instant communication applications, software that enables online chat and communication through instant messaging (IM) technology). Instant messaging applications have a wide range of functions; for example, they can support online chat, video calls, email, and many other features, and can connect to various communication terminals.
[0029] II. Social Conversation Interface:
[0030] A social conversation interface refers to the functional interface used for social conversations. This interface can be provided by a social client installed on a terminal device. The social conversation page can display conversation messages sent by participants, which can include one or more of the following: emoticons, text, voice, video, images, mini-programs, links, files, geolocation, etc. Mini-programs are applications that can be used without downloading or installation; links are used to open new pages, such as clicking a link in a subscription account's content to jump to the corresponding page; files include compressed files, online documents, offline documents, etc.; and geolocation can be used to represent the location data of an individual, such as shared location data shared by other participants in the conversation.
[0031] III. Social Conversation:
[0032] A social conversation refers to a dialogue between an individual or a group. Correspondingly, social conversations can include individual conversations and group conversations. An individual conversation involves two participants exchanging information; a group conversation involves multiple participants exchanging information. For example, in a one-on-one chat, participant A and participant B exchange messages, establishing a unique conversation. In a group chat, everyone within a group is in the same conversation. A social conversation contains a sequence of messages participating in the conversation.
[0033] IV. News:
[0034] In a broad sense, a message refers to the communication content exchanged between two parties. In instant messaging scenarios, messages include, but are not limited to: chat messages, group joining and leaving notifications, friend addition notifications, administrator change notifications, etc. Messages can be categorized from different dimensions, such as by message visibility or by message function.
[0035] Here, message transmission involves the following two concepts:
[0036] (1) Reliable reception: Regardless of whether the recipient is online or not at the time the message is sent, or the network status / online status, all messages in the session can be guaranteed to be delivered to the recipient.
[0037] Due to the complexity of network environments and the uncertainty of online objects, message reliability (no loss, no duplication) is undoubtedly crucial. The reliability of a message processing system typically refers to the reliability of message delivery, commonly known as "message delivery guaranteed," and is usually evaluated using two technical indicators: no message loss and no duplication. Reliable message delivery ensures that once a message is sent, it is received by the receiver, achieving reliable message reception.
[0038] When a message is not received by the receiver, there will be a message gap on the receiver's end. For example, in message queue 1(2)3, message 2 was not received, which will trigger the gap retrieval mechanism to fill the missing message.
[0039] (2) Strictly ordered: The message sorting rules are clear and stable, and the message order displayed is consistent on any terminal that receives the same message sequence.
[0040] In social conversation scenarios, message ordering is a crucial aspect that needs special consideration to ensure semantic coherence and clearly convey the meaning of conversational messages. Message ordering can also be referred to as message sending and receiving consistency (or ordering). In this application, the absolute order of messages can be guaranteed by using an incrementing global sequence number.
[0041] V. Unread readings:
[0042] In instant messaging chat scenarios, unread messages refer to messages that the message recipient has not read within a session. Unread messages are also called unread message counts, and are usually indicated by a notification indicator, which can be a dot or a counter. For example, a red dot in the message list indicates the total number of unread session messages.
[0043] VI. Unread message counts for multiple message types:
[0044] Unread message counts for different message types. In certain scenarios, it's often necessary to provide separate unread message count alerts for different message types to promptly remind recipients to check their messages. For example, in scenarios involving e-resource packages and targeted reminders, separate unread counts can be implemented for e-resource packages and targeted reminders. For instance, a red dot notation could be used to indicate "You have x unread red envelopes, and y people in the group have tagged you."
[0045] VII. Atomicity:
[0046] Atomicity refers to the property that one or more operations cannot be interrupted during execution on the CPU (Central Processing Unit). An atomic operation is one or a series of operations that cannot be interrupted. An atomic operation is a complete operation within a transaction; that is, a transaction is either executed completely or not executed at all. Atomic operations possess atomicity.
[0047] 8. Primary Key:
[0048] Data is typically stored in a database as a list. A primary key uniquely identifies each row of data in the list, and one or more columns in the table are called the table's primary key. Primary key constraints facilitate faster retrieval of the required data from the table.
[0049] IX. Distributed Storage Systems:
[0050] Distributed storage systems employ a scalable system architecture, distributing data across multiple independent devices and utilizing multiple storage servers to share the storage load. This improves system reliability, availability, and access efficiency, and facilitates easy expansion. Common distributed storage systems include Redis Cluster (a Redis distributed storage system) and MongoDB Cluster (a MongoDB cluster, where MongoDB is a database based on distributed file storage).
[0051] Based on the above terms and concepts, the architecture of the message processing system provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0052] Please see Figure 1 , Figure 1 This is an architecture diagram of a message processing system provided in an exemplary embodiment of this application. (See diagram for details.) Figure 1 As shown, the message processing system includes multiple terminal devices (including a first terminal 100a, a second terminal 100b, a third terminal 100c, etc.) and a server 101. Each terminal device can establish a communication connection with the server 101 via wired or wireless means, which is not limited in this application.
[0053] Each terminal device can run a client, specifically a social client. This social client can provide social conversation functionality, enabling the sending and receiving of messages generated within the social conversation. These messages include visible messages (e.g., conversation messages) and invisible messages (e.g., signaling for setting permissions for conversation objects). It should be noted that the aforementioned terminal devices include, but are not limited to: smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart voice interaction devices, smart home appliances (e.g., smart TVs), in-vehicle terminals, aircraft, etc., and this application does not impose any limitations on these. This application also does not limit the number of terminal devices.
[0054] Server 101 is used to provide service support for social clients. This service support includes, but is not limited to: managing messages in social conversations of various social clients (e.g., forwarding messages, storing messages), identifying the message type of messages generated in social conversations, generating various sequence numbers and binding them to messages, etc. It should be noted that Server 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but is not limited to these. This application does not limit the number of servers.
[0055] The following example, using the first terminal 100a sending a session message, illustrates the interaction between the various terminals involved in the message processing scheme provided in this application. Assume that session object A corresponding to the first terminal 100a, session object B corresponding to the second terminal 100b, and session object C corresponding to the third terminal 100c are contacts of each other, and each session object is a session member in session group Q. The interaction process required for message processing includes the following steps 1) to 4):
[0056] 1) Session object A sends a session message in a social session through a social client running on the first terminal 100a, and the session message is uploaded to the server 101.
[0057] 2) Upon receiving the session message, server 101 determines that a target message was generated in the social session and identifies the target message type to which the session message belongs. Since a social session can simultaneously support multiple message types, including global types and N extended types, the target message type to which the session message belongs can include multiple types. In one implementation, the target message type includes a global type and may also include at least one of the N extended types.
[0058] 3) The server determines the target sequence corresponding to the target message type and increments the sequence number of the target sequence.
[0059] Each message type supported by a social session corresponds to a sequence, and the sequence number in the sequence can be used to record the order of messages in the social session under the corresponding message type. By determining the target sequence corresponding to the target message type, the order of messages belonging to the target message type in the social session can be obtained. A new sequence number can be obtained by incrementing the sequence number of the target sequence. The sequence number increment operation refers to the operation of incrementing the sequence number based on the existing sequence number in the sequence. In one implementation, the maximum sequence number in the target sequence can be incremented by a preset step size to obtain a new sequence number; for example, if the maximum sequence number in the target sequence is 1, and the step size (i.e., the preset step size) of the target sequence is 1, then the sequence number increment operation can be to perform an operation of adding 1 to the maximum sequence number 1. The result of this operation, 2, is the new sequence number in the target sequence, and also the new maximum sequence number. It can be seen that with the sequence number increment operation, the maximum sequence number in the target sequence will also be updated (for example, the maximum sequence number is updated from 1 to 2 in the above example), and the entire target sequence will also be updated (for example, the updated target sequence contains the new sequence number 2). The new sequence number can be used to represent the order of the target messages under the target message type. It should be noted that when the target message belongs to multiple target message types, multiple target sequences can be determined. Each target sequence corresponds to a target message type. For each target sequence, the sequence number can be incremented in a similar way to obtain multiple sequence numbers representing the order of the target message under different target message types.
[0060] 4) Bind the new sequence number obtained by incrementing the sequence number in the target sequence to the target message.
[0061] After a new sequence number for the corresponding target message type is bound to the target message, related processing of the target message can be performed based on the bound new sequence number. This processing can include, but is not limited to, storage processing, query processing, and unread count calculation. In one feasible implementation, the target message and its bound sequence number can be stored together. This association allows for quick retrieval of the target message. In another implementation, a new sequence number for the corresponding target message type, obtained through an auto-incrementing operation, can be sent to the first terminal 100a. The social client running on the first terminal 100a stores this new sequence number so that when there are message gaps, the social client can fill in the gaps based on the stored new sequence number. The target message and its bound sequence number can also be sent to the second terminal 100b of session object B and the third terminal 100c of session object C. When there are message gaps, the second terminal 100b and the third terminal 100c can also fill in the gaps based on the sequence number. Each terminal can also calculate unread counts based on the received sequence number for the corresponding message type, thereby outputting an unread count reminder.
[0062] In one embodiment, a multi-sequence generation system (i.e., a multi-seq generation system) can be deployed in server 101. This multi-sequence generation system supports the entire message processing system in processing messages generated in various social sessions. The processing includes, but is not limited to: identifying the message type of a message, generating sequence numbers for each message type, and storing the sequence numbers and messages. Optionally, the multi-sequence generation system deployed in server 101 includes a logic layer, a multi-sequence number generator, and a message storage layer. The logic layer performs step 2) above. By identifying the message type of the target message, the logic layer can determine whether the sequence of the corresponding message type needs to be adjusted for each message type. The multi-sequence generator performs step 3) above. By incrementing the sequence, it can generate a sequence number for the target message under the target message type, thus achieving a sorted record of the target message under the target message type. The message storage layer performs step 4) above, storing the target message and the sequence number bound to it. By storing the message and the sequence number, not only can the message and the sequence number be backed up, but messages can also be fully retrieved when there are unreceived messages on various terminals, thereby ensuring reliable message reception in social sessions. It should be noted that each message generated in a social conversation can be executed in the above manner. In this way, each message in a social conversation can be bound to one or more sequence numbers, and all of them can be achieved with the help of a multi-sequence generation system.
[0063] As can be seen, the message processing system provided in this application can determine the target sequence by identifying the target message type to which the target message belongs when a target message is generated in a social session, and perform an auto-incrementing operation on the sequence number of the target sequence to obtain a new sequence number, which is then bound to the target message. The new sequence number enables the sorting and recording of target messages under the target message type. Since messages generated in a social session can all be processed in the same way, the sequence numbers in these sequences can represent the sorting of each message under the corresponding message type for the various message types supported by the social session. Through this multi-sequence mechanism, reliable reception and strict ordering of messages under various message types (including global and extended types) can be supported. Furthermore, based on the reliable reception and strict ordering of each message type, personalized application and processing of messages under any message type can be supported, thereby expanding the message processing scenarios and enabling more diverse message processing scenarios.
[0064] It is understood that the message processing scheme in this application relates to the field of cloud storage technology. Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to aggregate a large number of storage devices (also called storage nodes) of various types in the network through application software or application interfaces to work together and jointly provide data storage and business access functions. For example, the multi-sequence generation system in this application can be a distributed cloud storage system. The message storage layer included in the multi-sequence generation system can be the allocated physical storage space, and each message in the social conversation and the sequence number bound to the message can be stored in the message storage layer.
[0065] In the specific implementation of this application, data such as messages are involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from the subject is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0066] Please see Figure 2 , Figure 2 This is a flowchart illustrating a message processing method provided in an exemplary embodiment of this application. Figure 1 This message processing method can be performed by computer devices (such as...) Figure 1 The message handling method can be executed by server 101 in the middle, and may include the following:
[0067] S201, When a target message is generated in a social conversation, identify the target message type to which the target message belongs.
[0068] The message types supported by social sessions include global types and N extended types. Each message type corresponds to a sequence, which contains one or more sequence numbers. Each sequence number is used to indicate the order of messages in the social session under the corresponding message type, where N is a positive integer.
[0069] A global type refers to a type belonging to a social conversation. Since any message in a social conversation belongs to that social conversation, any message in a social conversation is a message of the global type (hereinafter referred to as a global message). Global messages in a social conversation have an absolute sending order to ensure the orderliness of messages in the social conversation. For example, if a social conversation contains 5 messages, then all 5 messages belong to the global type, and these 5 messages are presented in the social conversation interface in the order of their sending time. An extended type refers to a type obtained by classifying messages according to one or more dimensions. In one implementation, the message type can be classified according to the message visibility dimension, including visible messages and invisible messages. In another implementation, the message type can be classified according to the message function dimension, including targeted reminder types, ordinary message types, electronic resource types, virtual resource types, etc. Based on different application needs, different classification dimensions can be used to obtain different extended types, so that social conversations can meet richer application needs. It is understood that the message type of any message in a social conversation can belong only to the global type, or it can belong to both the global type and one or more extended types.
[0070] Each message type corresponds to a sequence, and a sequence includes one or more sequence numbers. The order of messages in a social session under a given message type is indicated by the sequence number in the sequence under that message type. Optionally, based on the N+1 message types supported by the social session, there can be N+1 sequences, including: a global sequence for recording the order of messages in the social session under a global type, and N extended sequences for recording the order of messages in the social session under a corresponding extended type. The global sequence is used to record the generation order of each message in the social session. The global sequence contains a global sequence number, which is an identifier used to mark the order of a message among all messages generated in the social session. In one implementation, the global sequence number can be represented by numbers, such as 1, 2, 3, etc. In another implementation, the global sequence number can also be represented by binary encoding, such as 0001, 0010, etc. Any message in the social session is bound to a global sequence number in the global sequence. Extended sequences are used to record the generation order of messages of corresponding extended types in a social session on demand. Each extended sequence contains an extended sequence number, which is an identifier used to mark the order of a message within all messages of its corresponding extended type in the social session. In one implementation, the extended sequence number can be represented by numbers, such as 1, 2, 3, etc. In another implementation, the extended sequence number can also be represented by binary encoding, such as 0001, 0010, etc. Any message belonging to a corresponding extended type in a social session is bound to an extended sequence number in that extended sequence. It is understood that the sequence number (global sequence number or extended sequence number) is used to indicate the order of messages within the corresponding message type. The representation of this sequence number is not limited to the numbers or binary encoding mentioned above; it can also include other forms, such as letters, symbols, etc. This application does not limit the representation of the sequence number.
[0071] Based on sequence numbers in different sequences, messages in a social conversation can be sorted and recorded under different message types. Since the sequence numbers are ordered, each sequence can support reliable reception and strict ordering of messages under various message types. Specifically, global sequences can guarantee the strict ordering and reliable reception of any message in a social conversation, while extended sequences can guarantee the strict ordering and reliable reception of messages under extended types. Furthermore, based on the sequence numbers of different sequences, messages under corresponding message types can be processed conveniently and efficiently. As the message types expand, the message processing scenarios supported in the social conversation can also be expanded, thereby achieving diversified message processing.
[0072] When a target message is generated in a social conversation, it refers to the latest message in the social conversation. In one implementation, the target message can be a conversation message sent by any conversation object in the social conversation or a signaling message sent by the backend system. Here, conversation messages can include, but are not limited to, any of the following: ordinary conversation messages, conversation messages containing reminders (e.g., @ messages), conversation messages containing electronic resources (e.g., electronic red envelope messages), conversation messages containing virtual resources (e.g., virtual gifts), etc. Signaling messages can include, but are not limited to, any of the following: notification messages (e.g., notifications of changes in the number of member objects in the social conversation, notifications of changes in member permissions, etc.), system messages (e.g., system operation messages in the social conversation, etc.). The message type of the target message generated in the social conversation can be identified to obtain the target message type to which the target message belongs; for example: identifying that the target message is a visible message sent by a conversation object in the social conversation; or identifying that the target message is an invisible message generated by the backend system for managing the social conversation. The target message type includes at least one message type supported by the social conversation. Specifically: the target message type can only include global types, or the target message includes one or more of global types and N extended types.
[0073] S202, determine the target sequence corresponding to the target message type, and perform an auto-increment operation on the sequence number of the target sequence.
[0074] In one implementation, the target message type includes a global type, so the target sequence should include a global sequence. In another implementation, the target message type may include a global type and at least one extended type, so the target sequence may include a global sequence and at least one extended sequence. That is, the number of target sequences is greater than or equal to one.
[0075] For example, please see Figure 3a The diagram illustrates the global sequence and extended sequence. Due to the binding between the global sequence number and the message, the number of messages currently generated in a social session can be determined based on the global sequence number, and the ordered generation order of messages within the social session can be recorded based on the sequentially arranged global sequence numbers, thus ensuring reliable reception and strict order of each message in the social session. For example... Figure 3aThe global sequence shown includes 99 sequentially arranged global sequence numbers, with a step size of 1 between any two adjacent global sequence numbers. Each global sequence number increments by this step size. Based on the maximum global sequence number 99, it can be determined that there are 99 messages in the social session. These 99 global sequence numbers indicate the order in which these 99 messages were generated within the social session. Similarly, the extended sequence numbers in the extended sequence are also bound to messages. Therefore, based on the extended sequence numbers, the number of messages under a corresponding extended type in the social session can be determined. Furthermore, the extended sequence numbers in the extended sequence record the generation order of messages under that extended type in the social session. Based on the extended sequence, reliable reception and strict ordering of messages under a corresponding extended type in the social session can be guaranteed. Figure 3a The step size between two adjacent extension sequence numbers in the shown extension sequence is 1. Each extension sequence number increases according to the step size. Based on the maximum extension sequence number 10, it can be known that there are 10 messages belonging to one extension type in the social conversation. The sending order of the 10 messages under this extension type can also be known through the corresponding extension sequence number.
[0076] Furthermore, based on the sequence numbers contained in these sequences, the number of intervals between messages can be obtained. For example, when there are unread messages in a social conversation, the number of unread messages can be determined by the difference between the maximum global sequence number of read messages and the maximum global sequence number of unread messages, thus enabling convenient statistical processing based on sequences.
[0077] As messages are generated in a social conversation, the maximum global sequence number in the global sequence is updated, and the number of global sequence numbers contained in the global sequence also increases. As messages of the corresponding extended type are generated in a social conversation, the maximum extended sequence number in the corresponding extended sequence is also updated, and the number of extended sequence numbers contained in the extended sequence also increases.
[0078] In one embodiment, an optional implementation of S202 includes: obtaining the maximum sequence number in the target sequence; obtaining the step size of the target sequence; and incrementing the maximum sequence number according to the step size of the target sequence.
[0079] In the target sequence, the difference between any two adjacent sequence numbers is one step size. Here, the step size refers to the difference between two adjacent sequence numbers. For example, if the target sequence is a global sequence, and the two adjacent sequence numbers in the global sequence are global sequence number 1 and global sequence number 2, then the step size of the global sequence is 1. Similarly, if the target sequence includes an extended sequence, and the two adjacent sequence numbers in the extended sequence are extended sequence number 2 and extended sequence number 4, then the step size of the extended sequence is 2. The maximum sequence number in the target sequence is incremented according to the step size of the target sequence; that is, the sum of the maximum sequence number and the step size is used as a new sequence number. For example, if the maximum sequence number recorded in the target sequence is 5, and the step size is 1, then the increment operation (i.e., 5 + 1) results in 6, which is the new sequence number. It is understandable that the maximum sequence number in the target sequence here is based on the time when the target message is generated. Before the target message is generated, the maximum sequence number in the target sequence refers to the maximum value of all sequence numbers in the target sequence. After the target message is generated, the target sequence will perform a sequence number increment operation to generate a new sequence number, and the maximum sequence number in the target sequence will change to the new sequence number.
[0080] If the target message type generated in a social conversation includes a global type, then the target sequence includes a global sequence. The increment operation on the global sequence can be performed by incrementing the maximum global sequence number according to the step size corresponding to the global sequence. Figure 3a As shown, after the maximum global sequence number 99 is incremented, a new global sequence number 100 will be added to the global sequence, and the maximum global sequence number will be updated to 100. If the target message type includes an extended type, then the target sequence includes an extended sequence. Similarly, the increment operation on the extended sequence can be performed by incrementing the maximum extended sequence number according to the step size corresponding to the extended sequence, such as... Figure 3a After the maximum extended sequence number 10 is incremented, an extended sequence number 11 will be added to the extended sequence, and the maximum extended sequence number will be updated to 11.
[0081] As can be seen, the target sequence can be updated through the sequence number increment operation, specifically by updating the maximum sequence number in the target sequence. Due to the monotonically increasing nature of the increment operation, the maximum sequence number changes as a new sequence number is generated. The updated maximum sequence number (i.e., the new sequence number) can then serve as the basis for performing the sequence number increment operation on the next target message in the target sequence. The sequence numbers in the target sequence can be updated as messages in the social conversation are updated. This update allows for real-time recording of the message order under the corresponding message type in the social conversation, thus facilitating subsequent processing.
[0082] In one implementation, the incrementing step size in each sequence can be the same or different: if the number of target sequences is greater than 1 and the step size of each target sequence is the same, then each target sequence uses the same step size to increment its sequence number; or, if the number of target sequences is greater than 1 and the step size of each target sequence is different, then each target sequence uses its own step size to increment its sequence number.
[0083] In other words, if the target message belongs to at least two target message types, the corresponding target sequences also include at least two (i.e., the number is greater than 1). In one implementation, the step size between each target sequence can be the same. Therefore, when each target sequence needs to perform a sequence number increment operation, its maximum sequence number is incremented by the same step size. For example, if the step size of sequence A and sequence B is 1, the maximum sequence number of sequence A is 2, and after incrementing, it becomes the new sequence number 3. The maximum sequence number of sequence B is 4, and after incrementing, it becomes the new sequence number 5. In another implementation, the step size between each target sequence can also be different. In this case, each target sequence performs a sequence number increment according to its corresponding step size. For example, if the step size of sequence A is 1 and the step size of sequence B is 2, then the maximum sequence number 2 in sequence A, after incrementing by the corresponding step size, becomes the new sequence number 3, and the maximum sequence number 3 in sequence B, after incrementing by the corresponding step size, becomes the new sequence number 5.
[0084] Furthermore, if the number of target sequences is greater than one, the atomicity of the sequence number increment operations performed on each target sequence is maintained. Atomicity here refers to the characteristic that the operation is uninterrupted. That is, the sequence number increment operation performed on each target sequence is completed at once; either the sequence number increment operation is performed on all target sequences to obtain the new sequence number of the target message, or no sequence number increment operation is performed on any single target sequence. By maintaining the atomicity of the operations, the sequence number increment operations in each target sequence can be executed quickly, thereby enabling the rapid construction of a reliable message sending and receiving system for message sending and receiving, as well as other application processing of messages.
[0085] S203, bind the new sequence number obtained by the sequence number increment operation in the target sequence to the target message.
[0086] A new sequence number can be obtained by incrementing the sequence number in the target sequence. This new sequence number is an additional entry in the target sequence. By binding this new sequence number to the target message, not only can the order of the target message under the corresponding message type be recorded in the appropriate sequence, but it also allows for convenient use of the sequence number in the target sequence for other application processing.
[0087] The message processing scheme provided in this application supports multiple message types in social conversations, including global types and N extended types. Each message type corresponds to a sequence for recording the order of messages in the social conversation under the corresponding message type, specifically including global sequences and extended sequences. When a target message is generated in a social conversation, the identified target message type may include at least one of the message types supported by the social conversation. By incrementing the sequence number of the target sequence corresponding to the target message type, a new sequence number can be obtained and bound to the target message, thereby realizing the order recording of the target message under the target message type. When there are multiple target message types, atomic incrementing operations can be performed on multiple target sequences to bind multiple sequence numbers to a single target message. Through the multi-sequence mechanism, reliable reception and strict ordering of messages under various message types can be supported. Furthermore, based on the reliable reception and strict ordering of messages under various message types, personalized applications and processing of messages of different message types can be supported, thereby enriching message processing scenarios and expanding the application scope and competitiveness of social products.
[0088] In one embodiment, such as Figure 2 The message processing method shown is applied to a multi-sequence generation system. A multi-sequence generation system is a system that generates new sequence numbers based on multiple sequences and binds them to a target message for storage. In one implementation, the multi-sequence generation system is a distributed storage system that supports batch atomic operations, such as Redis Cluster or MongoDB Cluster. Optionally, the multi-sequence generation system includes a logic layer, a multi-sequence number generator, and a message storage layer; wherein: the logic layer is used to identify the target message type when a target message is generated in a social session; the multi-sequence number generator is used to determine the target sequence corresponding to the target message type and perform a sequence number increment operation on the target sequence; the message storage layer is used to bind and store the new sequence numbers obtained by the sequence number increment operation in the target sequence with the target message.
[0089] Supporting batch atomic operations means supporting non-interrupted incrementing of sequence numbers across multiple sequences. Multi-sequence generation systems can be deployed in environments such as... Figure 1 In server 101 shown, the logic layer is used to perform actions such as... Figure 2 As shown in S201, the multi-sequence number generator (i.e., the multi-seq generator) is used to perform actions such as... Figure 2 As shown in S202, the message storage layer is used to perform actions such as... Figure 2As shown in S203, the new sequence number after binding is stored with the target message. It should be noted that the use of the multi-sequence number generator and the message storage layer can be implemented by the logic layer according to the corresponding business logic. That is, after the logic layer identifies the target message type, it can call the multi-sequence number generator to obtain a new sequence number through the sequence number auto-increment operation, and according to the storage logic indicated by the logic layer, it can bind the new sequence number with the target message and store it in the message storage layer.
[0090] In one embodiment, generating a target message in a social session includes: generating a target message in a social session when any session object in the social session sends a new session message; or generating a target message in a social session when the social session management system sends a new signaling message.
[0091] In other words, the message processing solution provided in this application can be applied to at least the following two scenarios: Scenario 1, when conversation objects send new conversation messages in a social conversation; Scenario 2, when the social conversation management system sends new signaling messages.
[0092] In this scenario, new conversation messages include any of the following: ordinary conversation messages, conversation messages containing reminders, conversation messages containing electronic resources, and conversation messages containing virtual resources. Ordinary conversation messages include, for example, text messages, image messages, video messages, file messages, etc. Conversation messages containing reminders can contain targeted reminder content, such as @ a specific conversation object or @ all conversation members. Conversation messages containing electronic resources include, for example, conversation messages containing electronic red envelopes (digital cash gifts), and conversation messages containing virtual resources include, for example, conversation messages containing virtual gifts. The order in which these conversation messages are generated in the social conversation interface can be recorded in a global sequence. New conversation messages can be forwarded by the server to other conversation objects in the social conversation. During the forwarding to other conversation objects, the server can execute the message processing scheme according to the embodiments of this application to obtain the sequence number of the target message type to which the new conversation message belongs, and perform relevant application processing based on the obtained sequence number.
[0093] In Scenario 2, signaling messages include any of the following: notification messages and system messages. Notification messages aim to alert session participants to messages received from other session participants, allowing them to stay informed about new events. For example, a notification message could be a notification about changes in management permissions within a social session, or a notification about changes in the number of session members. System messages can be business-related messages within the social session, such as verification messages requesting to join the session, or system operation messages, such as recommendation service messages related to session messages, or news messages. System messages help session participants in a social session stay informed about business messages in a timely manner, ensuring the normal operation of the business.
[0094] Signaling messages can be generated by the server and sent to specific session objects in a social session, specifically by a management system deployed on the server. During the sending of this new signaling message, the server can also execute the message processing scheme of this application embodiment to obtain the sequence number of the target message type to which the new session message belongs, and perform related application processing based on the obtained sequence number. The management system is used to manage social sessions, and its management content includes, but is not limited to: setting permissions for social session members, managing message publishing permissions in social sessions, etc. The social session management system and the multi-sequence generation system can be two independent systems, but both are service systems serving social sessions, and there is related data interaction when applied to this scheme.
[0095] Based on the above scenarios, the interaction flowchart for message processing in a multi-sequence generation system can be described as follows: Figure 3b As shown in the diagram. For example, client A sends a session message to client B. The server-side multi-sequence generation system performs the corresponding processing as described above, binding the session message with a corresponding sequence number. Client B receives the session message and the bound sequence number. Furthermore, the management system deployed on the server also sends system signaling to client B. Similarly, the server-side multi-sequence generation system first performs the corresponding processing as described above, binding the system signaling with a corresponding sequence number. Client B receives the system signaling and the bound sequence number.
[0096] This multi-sequence generation system can be equipped with a mechanism for reliable message reception and strict ordering. Furthermore, based on the auto-incrementing sequence number operation, it can support the generation of multiple sequence numbers within a single system. This allows for convenient message processing across various message types (including global types and at least one extended type), such as simplified calculation of unread message values. Building upon this foundation, a reliable message sending and receiving system can be quickly constructed within an instant messaging system, exhibiting strong scalability. It supports and extends to allow personalized applications and processing of messages of any type, thereby enhancing the diversity of message processing scenarios.
[0097] Please see Figure 4 , Figure 4 This is a flowchart illustrating a message processing method provided in an exemplary embodiment of this application. Figure 2 This message processing method can be performed by computer devices (such as...) Figure 1 The message handling method can be executed by server 101 in the middle, and may include the following:
[0098] S401, When a target message is generated in a social conversation, identify the target message type to which the target message belongs.
[0099] S402, determine the target sequence corresponding to the target message type, and perform an auto-increment operation on the sequence number of the target sequence.
[0100] S403, bind the new sequence number obtained by the sequence number increment operation in the target sequence to the target message.
[0101] The above steps S401 and S402 can be found in the description of the foregoing embodiments, and will not be repeated here.
[0102] In one embodiment, the target message type includes a global type, and the target sequence includes a global sequence; the global sequence is used to record the generation order of each message in the social session; any message in the social session is bound to a global sequence number in the global sequence.
[0103] By following the steps shown in S401 to S403, a global sequence number can be obtained and bound to the target message. In other words, a target message can be bound to a global sequence number, and the generation order of the target message in the social session can be recorded in the global sequence using the bound global sequence number. For any message generated in the social session, a global sequence number can be bound to it. Therefore, the generation order of each message in the social session can be recorded sequentially using the global sequence. This way, even messages generated within the same second can be distinguished by different global sequence numbers, ensuring the strict order of messages in the social session. Furthermore, if a message is not successfully received, it can be retrieved using the global sequence number, thus ensuring reliable reception of each message in the social session. In addition, the global sequence number can also be used to count unread messages in the social session.
[0104] In one implementation, N extension types correspond to N extension sequences; the target message type includes the i-th extension type among the N extension types; the target sequence includes the i-th extension sequence among the N extension sequences; the i-th extension sequence is used to record the generation order of messages belonging to the i-th extension type in sequence, and any message belonging to the i-th extension type in the social session is bound to an extension sequence number in the i-th extension sequence, where i is a positive integer and i≤N.
[0105] Since each extension type corresponds to an extension sequence, and the target message type includes the i-th of N extension types, the target sequence can be the i-th extension sequence corresponding to the i-th extension type. This extension sequence is used to record the order in which messages belonging to the i-th extension type are generated in the social session. By incrementing the sequence number of the i-th extension sequence, a new extension sequence number is obtained and bound to the target message. Thus, the target message is bound to an extension sequence number from the i-th extension sequence. For any message belonging to the i-th extension type in the social session, the above process can be followed, and any message of any extension type is bound to an extension sequence number from the extension sequence corresponding to that extension type. Through the binding between messages of the corresponding extension type and extension sequence numbers, messages of various extension types in the social session can be processed based on the extension sequence number. For example, the unread count of messages of an extension type can be easily counted using the extension sequence number. Since message types can be continuously expanded, extension sequences can also be expanded. Based on multiple sequences, the processing of messages of different message types can be greatly broadened, thus making message processing scenarios more diverse.
[0106] It's important to note that all messages generated in a social conversation can be processed in the same way. Each message can be bound to a unique sequence number under its message type. Since global messages encompass all messages in the social conversation, all messages in the social conversation can be sequentially arranged using the global message type's sequence number, thus ensuring reliable reception and strict ordering of messages within the social conversation. Sequence numbers based on different extended types can further guarantee reliable reception and strict ordering of messages belonging to the corresponding message types. In summary, sequences corresponding to different message types can diversify message processing scenarios, and the sequence numbers contained within the sequences can facilitate convenient message processing within specific scenarios. For example, the sequence number of an extended type can be used to count the number of messages under a particular extended type, which is very simple and convenient.
[0107] In one feasible implementation, the target message is bound to a global sequence number and at least one extended sequence number. That is, the target message belongs to multiple target message types, including a global type and at least one extended type; the number of corresponding target sequences is greater than one, and each target sequence includes a global sequence and at least one extended sequence; after maintaining the atomicity of the sequence number increment operation when performing an auto-increment operation on the global sequence and at least one extended sequence, the target message can be bound to a global sequence number and at least one extended sequence number at once. Under these conditions, the message processing scheme provided in this application also includes the following S404 to S405.
[0108] S404 uses the identifier of the social session and the global sequence number to construct the primary key index of the target message.
[0109] A primary key index is a unique lookup identifier. The constructed primary key index consists of two items: the identifier of the social session and a global sequence number. The identifier of the social session is, for example, the session ID (IdentityDocument), also known as the session identifier. Different social sessions have different identifiers. Because the social session identifier is unique, different identifiers can distinguish each social session. If messages are managed by category based on social sessions, messages belonging to that specific social session can be easily found based on the social session identifier.
[0110] Global sequence numbers can be used to record the order of messages in a social session under the global type. Since global type messages include all messages in the social session, any message in the social session can be found based on the global sequence number in the global sequence. However, extended type messages may only cover a portion of the messages in the social session, and a comprehensive search of all messages in the social session cannot be performed based on the extended sequence number. Therefore, using the social session identifier and the global sequence number bound to the target message as the primary key index of the target message can accurately and quickly locate the target message and further obtain other information related to the target message, such as the extended sequence number bound to the target message.
[0111] S405, the primary key index of the target message, the target message, and at least one extended sequence number bound to the target message are stored together.
[0112] Association-based storage refers to mapping the target message and its associated representation information (including the primary key index and at least one bound extended sequence number) to corresponding relationships during storage. Through association-based storage, all content associated with the desired message can be retrieved based on a single query (such as the primary key index), thus improving search efficiency.
[0113] In one implementation, S405 includes: locating the storage space of the social session based on the identifier of the social session; adding the primary key index of the target message as a target index item to the index table of the social session, and storing the target message and at least one extended sequence number bound to the target message as a target content item in the storage space of the social session; and establishing a mapping relationship between the target index item and the target content item.
[0114] The storage space for social sessions provides dedicated storage services for these sessions. This storage space can be located using the social session's identifier. It can be pre-allocated for the social session or allocated in real-time when storing the first message. The dedicated storage service provided by this space can serve all messages within the social session; that is, each message and its associated representation information can be written to the storage space through associative storage. Optionally, the social session's storage space includes hash slots in a Redis database (a key-value storage system); or, it includes shards in a MongoDB database (a database based on distributed file storage). Both Redis and MongoDB databases can be database clusters. Locating the storage space using the social session's identifier ensures that operations within the same session fall within the same storage space. Specifically, if using a Redis database, the identifier of the social session (e.g., session ID) can be used as a hash tag to ensure that operations within the same session fall within the same hash slot. After determining the target sequence for the target message type, the sequence number needs to be incremented for each message type. This can be achieved using Lua (a small scripting language that provides flexible extension and customization for applications) to generate / change all types of sequence numbers (seq) for a message, and the hash tag mechanism ensures the atomicity of the entire operation. If using a MongoDB database, the identifier of the social session (e.g., session ID) can be used as a cluster shard key to ensure that the same session falls within the same shard. After determining the target message type, the sequence number needs to be incremented for that target message type. This can be achieved by using the MongoDB aggregate pipeline (used for batch data processing) to generate / change all types of sequence numbers for a message, ensuring the atomicity of the entire operation.
[0115] The storage space for social conversations contains an index table of social conversations and content items that map to the index entries in the index table. Based on the mapping relationship between index entries and content items, the corresponding content item can be found in the storage space by using the index entry in the index table.
[0116] Since messages in different social sessions may have duplicate global sequence numbers, they can be distinguished by the social session identifier. Therefore, a primary key index built using the global sequence number and the social session identifier can retrieve any message. The primary key index can be added to the index table as a target index item, while the target message and at least one extended sequence number bound to the target message can be stored as target content items in the social session's storage space. By establishing a mapping relationship between target index items and target content items, the corresponding content items can be quickly retrieved based on the primary key index later.
[0117] In one implementation, the mapping between content items and index items in the index table can be recorded using a data storage table. For example, as shown in Table 1 below.
[0118] Table 1 Data Storage Table
[0119]
[0120]
[0121] As shown in Table 1, the data storage table records the primary key indexes (i.e., index entries in the index table) of all messages in the two social sessions, as well as the content entries mapped to these index entries. Specifically, it includes the primary key indexes and content entries of messages in social sessions 01 and 02. The index entry for each message consists of the social session identifier and the global sequence number msg_seq. The content entry for each message includes the extended sequence number cnt_seq, the extended sequence number at_all_seq, and the message sender. msg_seq is used to mark each message in the social session, incrementing by 1 for each message. msg_seq ensures reliable message reception. cnt_seq is used to mark visible messages in the social session; for visible messages, cnt_seq increments by 1. For invisible messages, cnt_seq remains unchanged, i.e., incremented by 0. cnt_seq is used to calculate the unread count of visible messages. at_all_seq is used to mark @all messages in the social session. @all messages are session messages containing reminders; for @all messages, at_all_seq can increment by 1, otherwise it remains unchanged. Similarly, this principle can be applied to sequence numbers of other message types, and similar processing can be used to change the sequence numbers. The content items can also be further expanded, for example, to include the message recipient, message content, message sending time, and so on.
[0122] Four messages were generated in social session 01, sent by session object A, session object B, session object C, and the management system, respectively. Four messages were also generated in social session 02, sent by session object D, session object A, session object R, and the management system, respectively. In each social session, each message is bound to a global sequence number, but not necessarily to an extended sequence number. For example, the message with global sequence number 3 in social session 01 does not have corresponding extended sequence numbers cnt_seq and at_all_seq. Based on the global sequence number, the global sequence of the social sessions can be determined: the global sequence of both social session 01 and social session 02 is {1,2,3,4}. Based on the extended sequence number, the extended sequences in the social sessions can be obtained: the two extended sequences in social session 01 are {1,2,3} and {1}, and the two extended sequences in social session 02 are {1} and {1,2}.
[0123] As shown in the data storage table, each column's index item is unique, and each row's index item maps to a content item. Although sequence numbers may be duplicated across different sequences, a message can be uniquely identified from the data storage table using the index item. Furthermore, the content items in the data storage table can include not only the extended sequence number bound to the message but also the message sender. The extended sequence number within the content items can be further deduced, enriching the message processing scenarios. In addition to expanding the extended types, other content items (such as message receivers) can be added to comprehensively record relevant message information.
[0124] In one embodiment, when a target message generated in a social session is a new session message sent by any session object in the social session, the new sequence number obtained based on the auto-increment operation of the target sequence can be synchronized to the session object that sent the target message. For example, the global sequence number of the target message can be sent to the session object, or the global sequence number and at least one extended sequence number can be sent to the session object. The client logged into by the session object can also store the target message and the sequence number bound to the target message as described in S404 and S405. For example, a local index table can be built on the client. However, at this time, the storage space refers to the client's local storage space, rather than the storage space provided by the server.
[0125] Based on the content described in S401 to S405 above, the following example, using a multi-sequence generation system, illustrates the message sending process between the client and server as follows: Figure 5As shown, when a client sends a new message (i.e., the target message), the logic layer in the multi-sequence generation system can identify the message type of this new message. The multi-sequence generator can atomically generate multiple sequence numbers (including a global sequence number and at least one extended sequence number). That is, it generates a sequence number for the new message type based on a non-interrupted auto-incrementing operation. Then, using the global sequence number (e.g., msg_seq) and the social session identifier (e.g., session ID) as the primary key index for message storage, it writes the message to the corresponding storage space. In addition, the multiple sequence numbers generated by the multi-sequence number generator can also be synchronized to the client that sent the new message. Within that client, the message content and at least one extended sequence number can be stored using the global sequence number and the session identifier as the primary key index.
[0126] By constructing a primary key index using social session identifiers and global sequence numbers, each message within a social session can be uniquely represented. The primary key index, the target message, and the extended sequence number bound to the target message are stored in association, allowing for quick and accurate retrieval of any message within a social session using the primary key index. Specifically, a dedicated storage service space can be provided for each social session, with the primary key index of that social session recorded in an index table within this space. The corresponding content items can be stored within the social session's storage space. Establishing a mapping between index items and content items allows for the association of information related to the target message (including the message content and the extended sequence number bound to it), facilitating management and rapid retrieval.
[0127] In one embodiment, under the condition of associating storage as described above, the following step is also included: synchronizing the content items of the social session to the session object of the social session according to the index table of the social session already stored in the storage space of the social session.
[0128] Based on the index table of social sessions stored in the social session's storage space, the content items of the social session corresponding to each primary key index in the index table can be determined from the storage space. Each content item can include a message and at least one sequence number bound to the message. By synchronizing the content items to the session objects in the social session, it can be ensured that the session objects reliably receive messages.
[0129] In one implementation, any session object in a social session is represented as the first session object. The first session object can be the session object receiving the target message. The content items of the social session are synchronized to the session object according to the social session index table already stored in the social session's storage space. Specifically, this may include the following steps: 1) comparing the differences between the social session index table already stored in the social session's storage space and the social session index table already saved in the first session object; 2) determining the missing primary key index that the first session object needs to synchronize based on the differences; 3) retrieving the corresponding missing content item from the social session's storage space according to the missing primary key index; 4) sending the missing primary key index and the missing content item to the first session object, enabling the first session object to perform application processing based on the received missing primary key index and missing content item.
[0130] In addition to the social session index table stored in the server's social session storage space, the client to which the first session object logs can also store a social session index table (hereinafter referred to as the local index table). This local index table is used to compare with the social session index table stored on the server to determine whether there are message gaps (i.e., whether any messages have not been received). Theoretically, when the server sends a target message to the client, it can carry the global sequence number bound to the target message, thereby updating the client's local index table. The ordered identifier of the global sequence number in the index table can determine the reliability of the message.
[0131] If the global sequence number of the target message received by the client logged into by the first session object is not consecutive with the maximum global sequence number stored locally, a discrepancy is determined between the two index tables. A discrepancy between the local index table and the index table stored on the server means that the local index table is incomplete, specifically that the primary key index in the local index table is missing. The server can then determine the missing primary key index that the first session object needs to synchronize based on the stored index table. This missing primary key index is the global sequence number and the social session identifier that are not stored in the local index table. For example, the global sequence number for social session 03 in the local index table only records up to 10, while the global sequence number for social session 03 in the index table stored on the server side records up to 15. Therefore, the first session object did not receive messages with global sequence numbers 11 to 15 from social session 03, resulting in a message gap.
[0132] Retrieve the missing content item from the social session's storage space based on the missing primary key index, including the missing message and at least one extended sequence number bound to the missing message. Then, the missing primary key index, the missing message, and at least one extended sequence number bound to the missing message can be sent to the first session object, which could be the client the first session object is logged into. The first session object then performs application processing on the received missing primary key index and missing content item.
[0133] The synchronization of content items specifically involves the message receiving process. Taking the multi-sequence system described above as an example, please refer to [reference needed]. Figure 6 The diagram illustrates the message receiving interaction. Figure 6 As shown, the client can determine whether a message gap exists based on the primary key index (including the global sequence number and session identifier). Specifically, the client can check whether the global sequence numbers in the global sequence of local messages are consecutive. If they are not consecutive, it indicates that some messages have not been received. The client can then specify to retrieve messages within the missing seq (i.e., sequence number, such as the global sequence number) range to complete the local message. Specifically, if a message gap exists, the logic layer in the multi-sequence generation system calculates the number of messages to be retrieved and directly accesses the message storage layer to retrieve the corresponding number of messages according to the missing primary key index, returning them to the client to complete the local message storage. It should be noted that the client here can be either a client sending new messages or a client receiving new messages. That is, either type of client can follow this process to complete missing messages.
[0134] In one implementation, the application processing performed by the first session object based on the received missing primary key index and missing content item includes any one or more of the following:
[0135] ① Update the index table of the social sessions already saved in the first session object based on the received missing primary key index, and update the content items of the social sessions already saved in the first session object based on the missing content items.
[0136] The client logged into the first session object can update the local index table already saved by the first session object based on the missing primary key index. Specifically, this can be done by adding the missing primary key index to the local index table, thereby completing the missing primary key index in the local index table. Based on missing content items, the content items of the social sessions already saved in the first session object can also be updated, filling in unreceived messages and extended sequence numbers in the local storage space, thereby completing the locally stored messages.
[0137] ② Based on the difference between the maximum global sequence number in the index table of the social conversation that has been saved and updated in the first conversation object and the maximum global sequence number of the read messages in the first conversation object, output a global unread reminder.
[0138] Since the global sequence number of each message in a social session is incremental, the number of unread messages can be determined and a global unread reminder can be output based on the difference between the maximum global sequence number in the local index table saved and updated in the first session object and the maximum global sequence number of read messages. Specifically, the number of unread messages = (maximum global sequence number in the index table - maximum global sequence number of read messages) / step size of the global sequence. When the step size of the global sequence is 1, the global sequence numbers in the global sequence are continuously increasing, and the number of unread messages can be obtained by directly calculating the difference between the maximum global sequence number and the maximum global sequence number of read messages. When the step size of the global sequence is not 1, the number of unread messages needs to be calculated in units of the step size after obtaining the difference. For example, if the step size of the global sequence is 2, the maximum global sequence number in the index table is 6, the maximum global sequence number of messages marked as read is 2, and the number of unread messages is (6-2) / 2 = 2, that is, messages with global sequence number 4 and global sequence number 6 are unread.
[0139] ③ Based on the difference between the maximum extended sequence number of any extended type in the content items of the social conversation that has been saved and updated in the first conversation object and the maximum extended sequence number of the read messages in the first conversation object under the corresponding extended type, output the unread reminder under the corresponding extended type.
[0140] For any of the N extension types, the calculation of unread message counts follows a similar logic to that for global message types. That is, calculating unread message counts for an extension type determines the difference between extension sequence numbers within the same extension type. Specifically, it can be determined based on the difference between the maximum extension sequence number in the updated social session's content items and the maximum extension sequence number of read messages. Assuming any extension type is the i-th extension type, then: Unread message count for the i-th extension type = (Maximum extension sequence number of the i-th extension type in the index table - Maximum extension sequence number of read messages belonging to the i-th extension type) / Step size of the i-th extension sequence. Similar to the calculation of unread global message counts, when the step size of the extension sequence is 1, the difference can be directly used as the unread message count for the i-th extension type. Then, an unread notification for the i-th extension type can be output to visually inform the first session object that no messages have been read and to remind the first session object to read them.
[0141] Both of the above application processing steps ② and ③ can be: based on the difference between the sequence number of any message type saved and updated in the first session object and the maximum sequence number of the corresponding message type in the first session object, output the unread reminder for the corresponding message type. The message type includes global type and extended type, and the sequence number includes global sequence number and extended sequence number.
[0142] As can be seen, unread message counts can be calculated very simply and quickly using sequence numbers for the corresponding message type. Especially with extended sequence numbers, a message can be statistically analyzed from different dimensions based on its extended type, supporting simplified calculations of unread message counts for the desired message type. For example, while binding each message to only one global sequence number ensures reliable message reception and strict order, when it's necessary to count unread counts for visible messages, since each message may contain invisible system signaling, simply subtracting the sequence number to obtain the sequence number range covers this invisible system signaling, thus failing to accurately and quickly count unread message counts for visible messages. Extended sequence numbers solve this problem well. When extended sequence numbers are consecutively increasing, the value obtained by directly subtracting two sequence numbers can be used as the message unread count. The interval formed by the two sequence numbers is the sequence number interval corresponding to the unread message, greatly simplifying the calculation of unread counts.
[0143] When a client needs to perform batch operations on specific messages, such as batch deleting execution messages, the message to be operated on can be precisely specified based on the message's primary key index. This allows for accurate and rapid operation on the corresponding message. Since complex message attributes are not required, the message can be determined based on the primary key index, making the processing mechanism very simple. The message scheme provided in this application can be applied to instant messaging systems, specifically as a multi-sequence generation system in the message sending stage. This system supports reliable message reception and ensures strict ordering, and also supports rapid calculation of message unread counts for various message types.
[0144] This solution can be applied to various social scenarios, such as social media channels. Figure 7 As shown, in the context of social channels, the channel service interface includes unread message notifications for various message types. For example... Figure 7 The number 7 to the right of the "Chat Hall" item indicates that there are 7 unread messages in the "Chat Hall" sub-channel. This number of unread messages can be calculated using the extended sequence number cnt_seq. The "Chat Hall" only displays the latest unread message. When a conversation partner clicks to enter the "Chat Hall," the unreceived messages will be completed using the global sequence number msg_seq. The red number 1 in the upper right corner of the "Channel" tab icon indicates that there is 1 strong notification (actually an at all message) unread message in the channel. This number of unread messages is calculated using the extended sequence number at all_seq.
[0145] Please see Figure 8 , Figure 8This is a schematic diagram illustrating the structure of a message processing apparatus provided in an exemplary embodiment of this application. The aforementioned message processing apparatus can be a computer program (including program code) running on a computer device; for example, the message processing apparatus is application software. The message processing apparatus can be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 8 As shown, the message processing device 800 may include at least one of the following: an identification module 801, a determination module 802, a binding module 803, a storage module 804, and a synchronization module 805.
[0146] The identification module 801 is used to identify the target message type to which the target message belongs when a target message is generated in a social session. The message types supported by the social session include global types and N extended types. Each message type corresponds to a sequence, and the sequence contains one or more sequence numbers. Each sequence number is used to indicate the order of messages in the social session under the corresponding message type. Wherein, N is a positive integer.
[0147] The determination module 802 is used to determine the target sequence corresponding to the target message type and to perform an auto-increment operation on the sequence number of the target sequence;
[0148] Binding module 803 is used to bind a new sequence number obtained by incrementing the sequence number in the target sequence to the target message.
[0149] In one embodiment, the target message type includes a global type, and the target sequence includes a global sequence; the global sequence is used to record the generation order of each message in the social session; any message in the social session is bound to a global sequence number in the global sequence.
[0150] In one embodiment, N extension types correspond to N extension sequences; the target message type includes the i-th extension type among the N extension types; the target sequence includes the i-th extension sequence among the N extension sequences, where i is a positive integer and i≤N; the i-th extension sequence is used to record the generation order of messages belonging to the i-th extension type in sequence, and any message belonging to the i-th extension type in the social session is bound to an extension sequence number in the i-th extension sequence.
[0151] In one embodiment, the determining module 802 is configured to: obtain the maximum sequence number in the target sequence; obtain the step size of the target sequence; wherein, there is a step size difference between two adjacent sequence numbers in the target sequence; increment the maximum sequence number according to the step size of the target sequence; wherein, when a new sequence number is obtained in the target sequence through the sequence number increment operation, the maximum sequence number in the target sequence is changed to the new sequence number.
[0152] In one embodiment, if the number of target sequences is greater than 1 and the step size of each target sequence is the same, then each target sequence uses the same step size to perform the sequence number increment operation; or, if the number of target sequences is greater than 1 and the step size of each target sequence is different, then each target sequence uses its own step size to perform the sequence number increment operation; wherein, if the number of target sequences is greater than 1, the atomicity of the sequence number increment operations performed on each target sequence is maintained.
[0153] In one embodiment, the target message is bound to a global sequence number and at least one extended sequence number; the storage module 804 is configured to: construct a primary key index of the target message using the identifier of the social session and the global sequence number; and associate and store the primary key index of the target message, the target message, and at least one extended sequence number bound to the target message.
[0154] In one embodiment, the storage module 804 is specifically configured to: locate the storage space of the social session based on the identifier of the social session, the storage space of the social session being used to provide dedicated storage services for the social session; the storage space of the social session stores an index table of the social session and content items mapped to the index items in the index table; add the primary key index of the target message as a target index item to the index table of the social session, and store the target message and at least one extended sequence number bound to the target message as a target content item in the storage space of the social session; and establish a mapping relationship between the target index item and the target content item.
[0155] In one embodiment, the synchronization module 805 is used to: synchronize the content items of the social session to the session object of the social session according to the index table of social sessions already stored in the storage space of the social session.
[0156] In one embodiment, any session object in a social session is represented as a first session object. The synchronization module 805 specifically includes: comparing the differences between the index table of social sessions already stored in the storage space of the social session and the index table of social sessions already saved in the first session object; determining the missing primary key index that the first session object needs to synchronize based on the differences; retrieving the corresponding missing content item from the storage space of the social session according to the missing primary key index; and sending the missing primary key index and the missing content item to the first session object, so that the first session object can perform application processing according to the received missing primary key index and missing content item.
[0157] In one embodiment, the application processing includes any one or more of the following: updating the index table of the social sessions already saved in the first session object based on the received missing primary key index, and updating the content items of the social sessions already saved in the first session object based on the missing content items; outputting a global unread reminder based on the difference between the maximum global sequence number in the index table of the social sessions already saved and updated in the first session object and the maximum global sequence number of the read messages of the first session object; and outputting an unread reminder for the corresponding extended type based on the difference between the maximum extended sequence number under any extended type in the content items of the social sessions already saved and updated in the first session object and the maximum extended sequence number of the read messages of the first session object under the corresponding extended type.
[0158] In one embodiment, generating a target message in a social session includes: generating a target message in a social session when any session object in the social session sends a new session message; or, generating a target message in a social session when the social session management system sends a new signaling message; wherein, the session message includes any of the following: a normal session message, a session message containing a reminder, a session message containing electronic resources, or a session message containing virtual resources; and the signaling message includes any of the following: a notification message or a system message.
[0159] In one embodiment, the message processing method provided in this application is applied to a multi-sequence generation system, which is a distributed storage system that supports batch atomic operations. The multi-sequence generation system includes a logic layer, a multi-sequence number generator, and a message storage layer. The logic layer is used to identify the target message type to which the target message belongs when a target message is generated in a social conversation. The multi-sequence number generator is used to determine the target sequence corresponding to the target message type and perform a sequence number increment operation on the target sequence. The message storage layer is used to bind and store the new sequence number obtained by the sequence number increment operation in the target sequence with the target message.
[0160] It is understood that the functions of each functional module of the message processing apparatus described in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here. In addition, the beneficial effects of using the same method will not be repeated here either.
[0161] Please see Figure 9 , Figure 9This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 900 may include one or more independent devices (such as servers, nodes, terminals, etc.), or it may include components within independent devices (such as chips, software modules, or hardware modules). The computer device 900 may include at least one processor 901 and a communication interface 902. Further optionally, the computer device 900 may also include at least one memory 903 and a bus 904. The processor 901, communication interface 902, and memory 903 are connected via the bus 904.
[0162] The processor 901 is a module that performs arithmetic and / or logical operations. Specifically, it can be one or a combination of processing modules such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a complex programmable logic device (CPLD), a coprocessor (to assist the central processing unit in completing corresponding processing and applications), and a microcontroller unit (MCU).
[0163] The communication interface 902 can be used to provide information input or output to at least one processor. And / or, the communication interface 902 can be used to receive data transmitted externally and / or transmit data externally, and can be a wired link interface including such as an Ethernet cable, or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, vehicular short-range communication technology, and other short-range wireless communication technologies, etc.). The communication interface 902 can serve as a network interface.
[0164] The memory 903 provides storage space, in which data such as the operating system and computer programs can be stored. The memory 903 can be one or a combination of several of the following: random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).
[0165] At least one processor 901 in the computer device 900 is used to invoke a computer program stored in at least one memory 903 to execute the aforementioned cross-modal search method, such as the one described above. Figure 2 as well as Figure 4 The message processing method described in the illustrated embodiment.
[0166] In one possible implementation, the processor 901 in the computer device 900 is used to call a computer program stored in at least one memory 903 to perform the following operations: when a target message is generated in a social session, identify the target message type to which the target message belongs; the message types supported by the social session include global types and N extended types, each message type corresponds to a sequence, the sequence contains one or more sequence numbers, each sequence number is used to represent the order of messages in the social session under the corresponding message type; where N is a positive integer; determine the target sequence corresponding to the target message type, and perform a sequence number increment operation on the target sequence; bind the new sequence number obtained by the sequence number increment operation in the target sequence to the target message.
[0167] In one embodiment, the target message type includes a global type, and the target sequence includes a global sequence; the global sequence is used to record the generation order of each message in the social session; any message in the social session is bound to a global sequence number in the global sequence.
[0168] In one embodiment, N extension types correspond to N extension sequences; the target message type includes the i-th extension type among the N extension types; the target sequence includes the i-th extension sequence among the N extension sequences, where i is a positive integer and i≤N; the i-th extension sequence is used to record the generation order of messages belonging to the i-th extension type in sequence, and any message belonging to the i-th extension type in the social session is bound to an extension sequence number in the i-th extension sequence.
[0169] In one embodiment, the processor 901 is specifically configured to: obtain the maximum sequence number in the target sequence; obtain the step size of the target sequence; wherein, there is a step size difference between two adjacent sequence numbers in the target sequence; increment the maximum sequence number according to the step size of the target sequence; wherein, when a new sequence number is obtained in the target sequence through the sequence number increment operation, the maximum sequence number in the target sequence is changed to the new sequence number.
[0170] In one embodiment, if the number of target sequences is greater than 1 and the step size of each target sequence is the same, then each target sequence uses the same step size to perform the sequence number increment operation; or, if the number of target sequences is greater than 1 and the step size of each target sequence is different, then each target sequence uses its own step size to perform the sequence number increment operation; wherein, if the number of target sequences is greater than 1, the atomicity of the sequence number increment operations performed on each target sequence is maintained.
[0171] In one embodiment, the target message is bound to a global sequence number and at least one extended sequence number; the processor 901 is further configured to: construct a primary key index of the target message using the identifier of the social session and the global sequence number; and associate and store the primary key index of the target message, the target message, and at least one extended sequence number bound to the target message.
[0172] In one embodiment, the processor 901 is further configured to: locate the storage space of the social session based on the identifier of the social session, the storage space of the social session being used to provide dedicated storage services for the social session; the storage space of the social session stores an index table of the social session and content items mapped to the index items in the index table; add the primary key index of the target message as a target index item to the index table of the social session, and store the target message and at least one extended sequence number bound to the target message as a target content item in the storage space of the social session; and establish a mapping relationship between the target index item and the target content item.
[0173] In one embodiment, the processor 901 is further configured to: synchronize the content items of the social session to the session object of the social session according to the index table of social sessions already stored in the storage space of the social session.
[0174] In one embodiment, any session object in a social session is represented as a first session object; the processor 901 is specifically configured to: compare the differences between the index table of social sessions already stored in the storage space of the social session and the index table of social sessions already saved in the first session object; determine the missing primary key index that the first session object needs to synchronize based on the differences; retrieve the corresponding missing content item from the storage space of the social session according to the missing primary key index; and send the missing primary key index and the missing content item to the first session object, so that the first session object performs application processing according to the received missing primary key index and missing content item.
[0175] In one embodiment, the application processing includes any one or more of the following: updating the index table of the social sessions already saved in the first session object based on the received missing primary key index, and updating the content items of the social sessions already saved in the first session object based on the missing content items; outputting a global unread reminder based on the difference between the maximum global sequence number in the index table of the social sessions already saved and updated in the first session object and the maximum global sequence number of the read messages of the first session object; and outputting an unread reminder for the corresponding extended type based on the difference between the maximum extended sequence number under any extended type in the content items of the social sessions already saved and updated in the first session object and the maximum extended sequence number of the read messages of the first session object under the corresponding extended type.
[0176] In one embodiment, generating a target message in a social session includes: generating a target message in a social session when any session object in the social session sends a new session message; or, generating a target message in a social session when the social session management system sends a new signaling message; wherein, the session message includes any of the following: a normal session message, a session message containing a reminder, a session message containing electronic resources, or a session message containing virtual resources; and the signaling message includes any of the following: a notification message or a system message.
[0177] In one embodiment, the message processing method provided in this application is applied to a multi-sequence generation system, which is a distributed storage system that supports batch atomic operations. The multi-sequence generation system includes a logic layer, a multi-sequence number generator, and a message storage layer. The logic layer is used to identify the target message type to which the target message belongs when a target message is generated in a social conversation. The multi-sequence number generator is used to determine the target sequence corresponding to the target message type and perform a sequence number increment operation on the target sequence. The message storage layer is used to bind and store the new sequence number obtained by the sequence number increment operation in the target sequence with the target message.
[0178] It should be understood that the computer device 900 described in the embodiments of this application can execute the message processing method described in the corresponding embodiments above, and can also execute the methods described above. Figure 8 The description of the message processing device 800 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.
[0179] Furthermore, it should be noted that an exemplary embodiment of this application also provides a storage medium storing a computer program for the aforementioned message processing method. This computer program includes program instructions that, when loaded and executed by one or more processors, can implement the message processing method described in the embodiments, which will not be repeated here. The beneficial effects of employing the same method will also not be repeated here. It is understood that the program instructions can be deployed on one or more computer devices capable of communicating with each other for execution.
[0180] The aforementioned computer-readable storage medium can be an internal storage unit of the message processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0181] One aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in one aspect of the embodiments of this application.
[0182] In one aspect of this application, another computer program product is provided, which includes a computer program or computer instructions that, when executed by a processor, implement the steps of the message processing method provided in the embodiments of this application.
[0183] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.
[0184] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.
[0185] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of this application still fall within the scope of the invention.
Claims
1. A message processing method, characterized in that, include: When a target message is generated in a social conversation, the target message type to which the target message belongs is identified; The social session supports message types including global types and N extended types. Each message type corresponds to a sequence, which contains one or more sequence numbers. Each sequence number indicates the order of messages in the social session under the corresponding message type; where N is a positive integer. The global type refers to the type belonging to the social session, and any message in the social session belongs to the global type. The extended type refers to the type obtained by classifying messages according to one or more dimensions, including message visibility dimension or message function dimension. Determine the target sequence corresponding to the target message type, and perform a sequence number increment operation on the target sequence; wherein, if the target message type includes at least one of the global type and the N extended types, the target sequence includes a global sequence and at least one extended sequence, and the atomicity of the sequence number increment operations performed on each target sequence is maintained; The new sequence number obtained by the sequence number increment operation in the target sequence is bound to the target message. The target message is bound to a global sequence number and at least one extended sequence number.
2. The method as described in claim 1, characterized in that, The target message type includes the global type, and the target sequence includes a global sequence; The global sequence is used to record the order in which each message in the social session is generated; each message in the social session is bound to a global sequence number in the global sequence.
3. The method as described in claim 1, characterized in that, The N extension types correspond to N extension sequences; the target message type includes the i-th extension type among the N extension types; the target sequence includes the i-th extension sequence among the N extension sequences, where i is a positive integer and i≤N; The i-th extension sequence is used to record the generation order of messages belonging to the i-th extension type in sequence, and any message belonging to the i-th extension type in the social session is bound to an extension sequence number in the i-th extension sequence.
4. The method according to any one of claims 1 to 3, characterized in that, The step of incrementing the sequence number of the target sequence includes: Obtain the maximum sequence number in the target sequence; Obtain the step size of the target sequence; wherein, there is a step size difference between two adjacent sequence numbers in the target sequence; The maximum sequence number is incremented according to the step size of the target sequence; Specifically, when a new sequence number is obtained in the target sequence through the sequence number increment operation, the maximum sequence number in the target sequence is changed to the new sequence number.
5. The method as described in claim 4, characterized in that, If the number of target sequences is greater than 1, and the step size of each target sequence is the same, then each target sequence uses the same step size for sequence number increment; or, If the number of target sequences is greater than 1, and each target sequence uses a different step size, then each target sequence will increment its sequence number using its own step size.
6. The method as described in claim 1, characterized in that, The method further includes: The primary key index of the target message is constructed using the identifier of the social session and the global sequence number; The primary key index of the target message, the target message, and at least one extended sequence number bound to the target message are stored together.
7. The method as described in claim 6, characterized in that, The primary key index of the target message, the target message, and at least one extended sequence number bound to the target message are associated and stored together, including: The social session is located based on its identifier, and the social session's storage space is used to provide dedicated storage services for the social session. The social session's storage space stores an index table of the social session and content items that map to the index entries in the index table. The primary key index of the target message is added as a target index item to the index table of the social session, and the target message and at least one extended sequence number bound to the target message are stored as target content items in the storage space of the social session; and, Establish a mapping relationship between the target index item and the target content item.
8. The method as described in claim 7, characterized in that, The method further includes: According to the index table of the social sessions already stored in the storage space of the social sessions, synchronize the content items of the social sessions to the session objects of the social sessions.
9. The method as described in claim 8, characterized in that, Any session object in the social session is represented as the first session object; synchronizing the content items of the social session to the session objects of the social session according to the index table of the social session includes: Compare the differences between the index table of the social sessions already stored in the storage space of the social sessions and the index table of the social sessions already saved in the first session object; Based on the differences, determine the missing primary key index that the first session object needs to synchronize; Retrieve the corresponding missing content item from the storage space of the social session according to the missing primary key index; The missing primary key index and the missing content item are sent to the first session object, so that the first session object performs application processing based on the received missing primary key index and the missing content item.
10. The method as described in claim 9, characterized in that, The application processing includes one or more of the following: Update the index table of the social session already saved in the first session object according to the received missing primary key index, and update the content item of the social session already saved in the first session object according to the missing content item; Based on the difference between the maximum global sequence number in the index table of the social session that has been saved and updated in the first session object and the maximum global sequence number of the read messages in the first session object, a global unread reminder is output; Based on the difference between the maximum extended sequence number of any extended type in the content items of the social session that has been saved and updated in the first session object and the maximum extended sequence number of the read messages in the first session object under the corresponding extended type, the unread reminder under the corresponding extended type is output.
11. The method as described in claim 1, characterized in that, The target message generated in the social conversation includes: When any session object in the social session sends a new session message, the target message is generated in the social session; or... When the management system of the social session sends a new signaling message, a target message is generated in the social session; The session messages include any of the following: ordinary session messages, session messages containing reminders, session messages containing electronic resources, and session messages containing virtual resources; the signaling messages include any of the following: notification messages and system messages.
12. The method as described in claim 1, characterized in that, The method is applied to a multi-sequence generation system, which is a distributed storage system supporting batch atomic operations; the multi-sequence generation system includes a logic layer, a multi-sequence number generator, and a message storage layer; wherein: The logic layer is used to identify the target message type to which the target message belongs when a target message is generated in a social session; The multi-sequence number generator is used to determine the target sequence corresponding to the target message type and to perform an auto-increment operation on the target sequence; The message storage layer is used to bind and store the new sequence number obtained by the sequence number increment operation in the target sequence with the target message.
13. A message processing device, characterized in that, include: The identification module is used to identify the target message type to which the target message belongs when a target message is generated in a social conversation; The social session supports message types including global types and N extended types. Each message type corresponds to a sequence, which contains one or more sequence numbers. Each sequence number indicates the order of messages in the social session under the corresponding message type; where N is a positive integer. The global type refers to the type belonging to the social session, and any message in the social session belongs to the global type. The extended type refers to the type obtained by classifying messages according to one or more dimensions, including message visibility dimension or message function dimension. The determination module is used to determine the target sequence corresponding to the target message type and perform a sequence number increment operation on the target sequence; wherein, if the target message type includes at least one of the global type and the N extended types, the target sequence includes a global sequence and at least one extended sequence, and the atomicity of the sequence number increment operations performed on each target sequence is maintained; A binding module is used to bind a new sequence number obtained by the sequence number increment operation in the target sequence to the target message. The target message binding has a global sequence number and at least one extended sequence number.
14. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the message processing method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, perform the message processing method according to any one of claims 1 to 12.
16. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the message processing method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Message scheduling method and system and related components
CN114443327A
Techniques for sequencing system log messages
US20070110070A1
