CN112260935B - Message processing method and device, electronic equipment and readable storage medium - Google Patents

Message processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112260935B
CN112260935B CN202011120289.2A CN202011120289A CN112260935B CN 112260935 B CN112260935 B CN 112260935B CN 202011120289 A CN202011120289 A CN 202011120289A CN 112260935 B CN112260935 B CN 112260935B
Authority
CN
China
Prior art keywords
message
target
messages
candidate
target session
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011120289.2A
Other languages
Chinese (zh)
Other versions
CN112260935A (en
Inventor
林春立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202011120289.2A priority Critical patent/CN112260935B/en
Publication of CN112260935A publication Critical patent/CN112260935A/en
Application granted granted Critical
Publication of CN112260935B publication Critical patent/CN112260935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/18Commands or executable codes

Abstract

The application discloses a message processing method and device, and belongs to the technical field of communication. The method comprises the following steps: receiving a query request of a target user for a target message in a target session; responding to the query request, identifying a first number of candidate terminals in the terminals of which the target session is in an online state, acquiring the target message based on the fragment messages of the target session stored by the candidate terminals, and outputting the target message to the target terminal corresponding to the target user. The method and the device can ensure accurate message query and reduce the occupancy rate of the chat content in the target session to the local storage space of the terminal.

Description

Message processing method and device, electronic equipment and readable storage medium
Technical Field
The application belongs to the technical field of communication, and particularly relates to a message processing method and device, electronic equipment and a readable storage medium.
Background
Currently, with the development of communication technology, researchers and researchers develop more and more instant communication programs.
The instant messaging program is mainly used for storing the instant messaging messages among users in a terminal provided with the instant messaging program, so that the users can conveniently inquire required partial messaging messages in all the locally stored instant messaging messages, but the instant messaging program can cause the user terminal to store a large amount of messaging messages and occupy a large amount of storage space of the terminal.
Disclosure of Invention
An object of the embodiments of the present application is to provide a message processing method, an apparatus, an electronic device, and a readable storage medium, which can solve the problem in the related art that an occupancy rate of a local storage space of a terminal for a communication message is too high when a terminal of a communication user stores all instant communication messages to facilitate message query.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a message processing method, where the method includes:
receiving a query request of a target user for a target message in a target session;
responding to the query request, identifying a first number of candidate terminals in the terminals of which the target session is in an online state, acquiring the target message based on the fragment messages of the target session stored by the candidate terminals, and outputting the target message to the target terminal corresponding to the target user.
In a second aspect, an embodiment of the present application provides a message processing apparatus, including:
the receiving module is used for receiving a query request of a target user for a target message in a target session;
and the response module is used for responding to the query request, identifying a first number of candidate terminals from the terminals of which the target session is in an online state, acquiring the target message based on the fragment messages of the target session stored by the candidate terminals, and outputting the target message to the target terminal corresponding to the target user.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, only the fragment message aiming at the target session needs to be stored in the candidate terminal of the target session, and all session messages of the target session do not need to be stored, so that the data storage amount of the chat content of the target session in the terminal of each member in the target session is reduced, and the occupancy rate of the chat content in the target session to the local storage space of the terminal is reduced; because only part of session messages of the target session are stored in the candidate terminals, when a certain target user needs to query the target message in the target session, a first number of candidate terminals can be selected from the terminals of which the target session is in an online state, and the target message is acquired based on the fragment messages which are stored by the candidate terminals and are specific to the target session, although the chat content is fragmented into the fragment messages, when the target message needs to be queried, the target message which needs to be queried can still be recovered by using a certain amount of fragment messages, so that the data volume of the chat content stored in the terminal is reduced, the user can accurately view the chat content in the target session, and the accuracy of the provided target message is also ensured.
Drawings
FIG. 1 is a flow diagram of a message processing method according to one embodiment of the present application;
FIG. 2 is a flow diagram of a message processing method according to another embodiment of the present application;
FIG. 3 is a flow chart of a message processing method of yet another embodiment of the present application;
FIG. 4 is a block diagram of a message processing apparatus according to an embodiment of the present application;
FIG. 5 is a diagram of a hardware configuration of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic hardware configuration diagram of an electronic device according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The message processing method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
The application provides a message processing method, which can be applied to electronic equipment (such as a terminal) and a server.
In the related art, the session content of the instant messaging program, that is, the chat content (that is, the candidate message described in the embodiment of the present application) is stored in the storage space of the electronic device corresponding to the user in the session. Therefore, when the method of the embodiment of the present application is applied to an electronic device, that is, an electronic device (for example, a terminal) of a member in a conversation, in which the instant messaging program is installed, the electronic device may directly obtain the candidate message from local and execute the method of the embodiment of the present application; when the method of the embodiment of the present application is applied to a server, the server does not locally store the chat content for security of the chat content, so that the server can obtain candidate messages from the electronic devices of the members in the conversation, in which the instant messaging program is installed, and execute the method of the embodiment of the present application.
Referring to fig. 1, a flow chart of a message processing method according to an embodiment of the present application is shown.
The method may specifically include a message query process formed in step 103 and step 104, and optionally, before the message query, the method may also include a message fragmentation process formed in step 101 and step 102.
Specifically, the method comprises the following steps:
step 101, carrying out fragmentation processing on a plurality of candidate messages in a target session to generate fragmentation messages;
wherein, the size of the storage space occupied by the fragment message is smaller than the size of the total storage space occupied by the candidate messages;
the target session may be a session of an instant messaging program, and the target session may be an instant messaging session between two users or a group session between multiple users.
The members in the target session are users (e.g., a first user, a second user, a third user, a target user, etc.) described in various embodiments of the present application.
Wherein, for the object of the slicing processing: and a plurality of candidate messages, wherein the plurality of candidate messages can be all chat contents of the target session, such as a set of chat contents sent by all members in the target session, or can be partial chat contents in the target session.
By fragmenting the multiple candidate messages into fragmented messages, the size of the storage space occupied by the messages can be reduced, and obviously, the size of the storage space occupied by a single fragmented message is smaller than the size of the total storage space occupied by the multiple candidate messages before fragmentation.
The present application is not limited to whether the sizes of the storage spaces occupied by different fragmentation messages are the same.
102, storing different fragmentation messages to different terminals corresponding to different users in the target session respectively;
in the related art, each terminal stores chat content generated by a local instant messaging program, and the chat content is not limited to a message sent by a user of the terminal in the target session; in the embodiment of the present application, in order to reduce the occupancy rate of the chat content to the storage space of the local terminal, it is only necessary to store the fragmentation message into the storage space of the terminal, and the fragmentation messages stored by different terminals are different.
Optionally, when storing, all chat content updates of the target session originally stored locally at the terminal may be stored as a fragment message allocated to the terminal.
It should be noted that the fragmentation process may be triggered by a user of any one of the session members in the target session, for example, the fragmentation process may be performed by a terminal used by any one of the session members in the target session.
In the embodiment of the invention, the fragment message is generated by carrying out fragment processing on a plurality of candidate messages in the target session; different fragment messages are respectively stored to different terminals corresponding to different users in the target session, and different fragment messages after the chat content in the target session is fragmented can be respectively stored in the terminals of different members of the target session. In addition, the candidate messages of the target session are respectively stored in different terminals in a slicing mode, so that the storage and recovery processes of the chatting data are safer.
Step 103, receiving a query request of a target user for a target message in the target session;
optionally, any session member in the target session may be used as the target user to trigger the query request for the target message in the target session.
Then the risk of chat content leakage is reduced, since only the members in the target session can query the chat content.
In one example, the target user may trigger a query request for the target message by sliding up and down in a conversation interface of the target conversation, or by entering key information (e.g., keywords, a third user who is the sender of the message).
Step 104, in response to the query request, identifying a first number of candidate terminals from the terminals of which the target session is in an online state, acquiring the target message based on the fragmentation messages for the target session stored by the candidate terminals, and outputting the target message to a target terminal corresponding to the target user.
Although the instant messaging program is installed in the terminal of each member in the target session, the instant messaging program of each terminal is not necessarily in a user login state (that is, the target session is in an online state), and therefore, the terminal of which the target session is in the online state needs to be determined in each terminal corresponding to each member of the target session; then, a number of candidate terminals are identified among the terminals whose target sessions are in an online state.
Here, the reason why the candidate terminal that needs to acquire the fragment message is determined among the terminals whose target sessions are online is that if the target session of a terminal is offline, the fragment message stored in the terminal cannot be acquired from the terminal in time, and therefore, the above operation may be performed here to improve the reliability of the fragment message.
Then, the target message requested by the target user may be obtained based on each fragment message respectively obtained from a certain number of candidate terminals, and the target message is returned to the target terminal corresponding to the target user.
In addition, when the method of the embodiment of the application is executed by an electronic device, when acquiring the fragment messages stored by other electronic devices (i.e. other terminals), the fragment messages may be grabbed from the other terminals by the server by sending a request to the server, so that the electronic device may acquire the fragment messages stored by a certain number of electronic devices, so that the electronic device acquires the target message based on the fragment messages.
Optionally, the fragmentation messages stored by each of the first number of candidate terminals can be used to recover the plurality of candidate messages before fragmentation of the target session.
It should be noted that the above message query process may be executed by a target terminal corresponding to a target user.
Optionally, after step 103, the method according to the embodiment of the present application may further include step 105;
step 105, responding to the query request, locally querying whether the target message exists, and if so, outputting the local target message to a target terminal; if not, go to step 104.
In the embodiment of the application, only the fragment message aiming at the target session needs to be stored in the candidate terminal of the target session, and all session messages of the target session do not need to be stored, so that the data storage amount of the chat content of the target session in the terminal of each member in the target session is reduced, and the occupancy rate of the chat content in the target session to the local storage space of the terminal is reduced; because only part of session messages of the target session are stored in the candidate terminals, when a certain target user needs to query the target message in the target session, a first number of candidate terminals can be selected from the terminals of which the target session is in an online state, and the target message is acquired based on the fragment messages which are stored by the candidate terminals and are specific to the target session, although the chat content is fragmented into the fragment messages, when the target message needs to be queried, the target message which needs to be queried can still be recovered by using a certain amount of fragment messages, so that the data volume of the chat content stored in the terminal is reduced, the user can accurately view the chat content in the target session, and the accuracy of the provided target message is also ensured.
Referring to fig. 2, a flowchart of a message processing method according to another embodiment of the present application is shown, where the method specifically includes a query process in step 203 and step 204, and optionally may also include a fragmentation storage process defined in step 201 and step 202 before querying, specifically:
step 201, when the number of users corresponding to the target session exceeds two and the total message amount of the candidate messages in the target session is greater than a preset threshold, performing fragmentation processing on the candidate messages according to the number of users to generate fragmented messages;
wherein, the size of the storage space occupied by the fragment message is smaller than the size of the total storage space occupied by the candidate messages;
when the number of the members in the target session is three or more, for example, in a scenario where the target session is a group session and the group content in the target session reaches a certain amount, the method in the embodiment of fig. 2 may be adopted to perform fragmentation processing and recover fragmented data, thereby obtaining a scheme of the target message. Such an execution condition is set because, when the chat content in the target session is less or the session is just established for a short period of time, because the user uses or views the messages in the session more frequently, the chat content does not need to be stored in segments, and all the chat content of the session can still be stored by each terminal in the related art.
The total message amount of the candidate messages in the target session may be the total message amount of all the communication messages in the target session, or may be the size of the storage space occupied by all the communication messages in the target session, and then the preset threshold may be a message amount threshold (for example, 100 messages), or may be a message size threshold (for example, 100M). Of course, the number of messages in the target time period or the size of the storage space occupied by the messages may be used.
The object of the segment, that is, the plurality of candidate messages, may be all chat content of the target session, or may be chat content generated in the target session before the last period of time.
In this step, when the multiple candidate messages are fragmented according to the number n of users in the target session to generate fragmented messages and the multiple candidate messages are recovered by using the fragmented messages, a (t, n) threshold secret sharing scheme can be adopted, and key sharing is an important means for realizing information security and data confidentiality. Based on the safety and recoverability of the scheme, the method provided by the embodiment of the application is applied to fragment storage of chat records of the target session and recovery of fragmented data.
In this embodiment, n is the number of users in the target session, t is the first number in step 204, t may be a preset number, n and t are positive integers, where n > t > 1.
The value of t may be different values according to the security consideration of the candidate message, for example, the requirement for security is higher, the value of t may be higher, and when the requirement for security is lower, the value of t may be lower.
A (t, n) threshold secret sharing scheme may be employed to divide candidate messages, such as fragmented messages with group content divided into n shares, k1, k2, k3 … kn.
Wherein, the content of the n slicing messages is different.
In addition, when multiple candidate messages are fragmented, the fragmentation can be performed according to the sequence of the time of the chat content, or the random fragmentation can be performed without the sequence of the time, that is, the specific mode of the fragmentation is not limited in the present application.
Step 202, storing different fragmentation messages to different terminals corresponding to different users in the target session respectively;
the detailed principle is similar to that of step 101, and is not described herein again.
The n pieces of fragmentation messages can be stored to the terminals of the n users of the target session respectively, and the fragmentation messages stored by different terminals are different.
Step 203, receiving a query request of a target user for a target message in the target session;
the target user can trigger the query request by searching a session interface of the target session or sliding a chat record and the like.
Step 204, in response to the query request, first identifying a first number of candidate terminals based on preset parameters or randomly among the terminals of which the target session is in an online state, wherein the preset parameters include network performance and/or operating state; then, based on the fragment messages for the target session stored by each of the first number of candidate terminals, recovering the plurality of candidate messages for the target session; then, the target message is obtained from the candidate messages; and finally, outputting the target message to a target terminal corresponding to the target user.
The target message may be one or more candidate messages, and the target message is a message selected from the recovered candidate messages and conforming to the query request.
Specifically, the first number is t, and when t candidate terminals are selected from the online terminals (where the number of terminals whose target sessions are in the online state is less than or equal to n), the t candidate terminals with better network performance and better operating state can be preferentially selected from the online terminals according to the network performance (e.g., network speed, bandwidth) and/or the operating state (e.g., CPU utilization) of the online terminals; of course, t candidate terminals may be randomly selected from the online terminals; then, t pieces of fragment information which are respectively stored by the determined t candidate terminals and are related to the target session are obtained, the t pieces of fragment information are processed according to a (t, n) threshold data recovery algorithm to generate candidate information before fragmentation, and the recovery of the candidate information is completed; and then, inquiring and acquiring the target message from the candidate messages and outputting the target message to the target terminal.
When the candidate messages are fragmented according to the (t, n) threshold data recovery algorithm and the candidate messages before fragmentation are recovered based on t fragmented messages (fragmentation and recovery based on the lagrangian interpolation formula), the following principle can be referred to:
data fragment storage: assuming that the group chat records to be sharded and stored are K (for example, the above candidate messages to be sharded), the system selects a large prime number P and a threshold value t, selects a1, a2, …, and a (t-1) as a random number smaller than P, and establishes an equation shown in formula 1:
f(x)=[a1x1+a2x2+…+Gi-1xi-1+K]mod p
formula 1;
wherein x isiRepresenting a terminal i, or a user i in a target session;
then, x isi*f(xi) And distributing the message to the terminal i as a fragmentation message for storage.
And (3) data recovery:
and reconstructing K according to the following formula of Lagrange interpolation so as to achieve the aim of recovering K.
Figure BDA0002731784120000101
(ii) a Wherein the content of the first and second substances,
Figure BDA0002731784120000102
xjrepresenting terminal j, or user j in the target session.
Optionally, when the fragment object, that is, the plurality of candidate messages are chat content generated before the latest period in the target session, each terminal of the target session may further store the chat content in the target session within the latest period, so when responding to the query request, first query whether there is a target message in the locally stored chat content in the latest period, if there is a target message, directly return to the target terminal, and if there is no target message, recover the plurality of candidate messages by using step 204, and then query.
Optionally, the first number t is smaller than the number of users n.
In the embodiment of the application, when the number of users corresponding to the target session exceeds two and the total message amount of the candidate messages in the target session is greater than a preset threshold, the candidate messages may be fragmented according to the number of users to generate fragmented messages, and the fragmented messages are respectively stored in different terminals of different users of the target session, so that the message storage amount of the terminals is reduced; then, identifying a first number of candidate terminals based on preset parameters or randomly in the terminals of which the target session is in an online state, wherein the preset parameters comprise network performance and/or running state; the plurality of candidate messages of the target session are recovered based on the fragment messages stored by the first number of candidate terminals, and because the selected candidate terminal is the terminal with the better state, the efficiency of acquiring the fragment messages from the candidate terminals is higher, so that the recovery efficiency of the candidate messages is improved, and the system delay of the user side on the inquired target message is reduced; and because the target message is obtained from the recovered candidate message, the accuracy of the obtained target message can be ensured.
In addition, when the target user is a member in the target session, only the member in the target session can recover the candidate message before fragmentation in the target session in a manner of acquiring the target message, so that the recovery of the chat information in the target session is safer, and the risk of the chat information leakage is reduced.
Optionally, when the step of identifying a first number of candidate terminals based on a preset parameter or randomly is performed in the terminals of which the target session is in an online state in step 204, a number of (t-1) candidate terminals may be identified based on a preset parameter or randomly in the terminals other than the target terminal of which the target session is in an online state, where t is the first number; then, the target terminal and the (t-1) candidate terminals are taken as t candidate terminals.
Each of n terminals corresponding to n users of a target session stores a fragment message of the target session, so when t fragment messages are obtained, one fragment message stored in the target terminal can be directly obtained from the target terminal requesting for querying the target message, then (t-1) candidate terminals are selected from terminals in an online state except the target terminal, the stored fragment messages of the target session are respectively obtained from the (t-1) candidate terminals, finally, one fragment message from the target terminal and (t-1) fragment messages obtained from the (t-1) candidate terminals are combined to obtain t fragment messages, and the t fragment messages are used for recovering the candidate messages.
In the embodiment of the application, when the candidate terminal to which the t pieces of fragment information for recovering the candidate information belong is selected, since the target terminal requesting the target information is always in the online state of the target session, in order to promote the acquisition of the fragment information, one piece of fragment information can be directly acquired from the target terminal, and the other (t-1) pieces of fragment information are acquired from other candidate terminals, so that the recovery efficiency of the candidate information can be further promoted, and the acquisition delay of the user on the requested target information can be reduced.
Referring to fig. 3, a flowchart of a message processing method according to still another embodiment of the present application is shown, where the method specifically includes a query process of step 304 and step 305, and optionally may also include a shard storage process defined in step 301, step 302, and step 303 before querying, specifically:
the method comprises the following steps:
step 301, identifying a first message sent by a first user and a second message sent by a second user from a plurality of candidate messages in a target session;
wherein the plurality of candidate messages include the first message and the second message, and the first message and the second message are different, and the second user is a user selected by the first user in the target session;
step 302, using the first message and the second message as a fragment message;
that is to say, in this embodiment, when fragmenting the candidate message, a requirement of the first user requesting to fragment in the target session may be referred to, for example, the first user requesting to fragment the candidate message may select which members (i.e., the second users, the number of which may be one or more) to locally save the chat content sent by the members in the target session.
Then, the method of the embodiment of the application may find, among the plurality of candidate messages of the target session, a first message sent by the first user, and a second message sent by the selected second user in the target session; then, the first message and the second message are regarded as one fragmented message, and the fragmented message is the fragmented message corresponding to the first user.
In addition, when the first user selects the chat content of the second user that needs to be stored in the terminal of the first user, the first user may select not only which second user specifically needs to be selected, but also the start time and the end time of the transmission of the chat information of the second user, so that the chat content of the target session, in which the transmission time transmitted by the second user is within the range of the start time and the end time (for example, the last week, the last month), may be used as the second message.
Step 303, storing the different fragmentation messages to different terminals corresponding to different users in the target session respectively;
the fragmentation message obtained in step 302, that is, the fragmentation message corresponding to the first user, may be stored in the terminal of the first user.
Similarly, the other user may also select the chat content that the other user needs to store in the local member (for example, the second user) by referring to the first user, and therefore, in this step 303, the chat content that the user selected by the other user in the target session sent in the target session and the chat content that the other user sent in the target session are also stored as a fragmented message in the terminal of the other user.
Step 304, receiving a query request of a target user for a target message in the target session;
step 305, in response to the query request, first, identifying a message sender corresponding to a fragment message stored by each terminal in the terminals whose target session is in an online state; then, identifying the minimum number of candidate terminals meeting a preset condition from the terminals of which the target session is in an online state; then, acquiring the target message based on the fragment message which is stored by the candidate terminal and aims at the target session; and finally, outputting the target message to a target terminal corresponding to the target user.
The union set of the message senders corresponding to the fragment messages stored by the minimum number of candidate terminals meeting the preset condition is as follows: and the minimum number is a first number.
As described above, the fragment message stored in the terminal of the first user in the target session is a combination of the first message corresponding to the first user and the second message corresponding to the second user selected by the first user, that is, the fragment message stored in the terminal in which the fragment message is stored corresponds to at least two message senders, and specifically includes: a first user, one or more second users; however, not every terminal corresponding to every user in the target session stores the fragmented message.
Then the minimum number of terminals whose union of message senders corresponding to the fragment message existing in each terminal is the total users (i.e. user set) of the target session needs to be found in the terminals on line.
For example, all users of the target session, i.e. the set of users, include user 1, user 2 and user 3, while the online terminals include terminal 1 of user 1, terminal 2 of user 2 and terminal 3 of user 3;
the fragmentation messages stored by the terminal 1 are a first message of a user 1 and a second message of a user 2;
the fragmentation message stored by the terminal 2 is a set of a second message of the user 2 and a third message of the user 3;
the fragmented message stored by the terminal 3 is the third message of the user 3.
Of course, since the message about the second user existing in different terminals is determined by the selection of the first user of the terminal, the message contents about the same user between the fragmented messages stored in different terminals are not necessarily identical, for example, the second message about user 2 stored in terminal 1 is not necessarily identical to the second message about user 2 stored in terminal 2.
Therefore, the union of the message senders corresponding to the terminal 1 and the terminal 2 is the minimum number of terminals, or the union of the message senders corresponding to the terminal 1 and the terminal 3 is the minimum number of terminals, and the minimum number is 2 here.
Compared to the embodiment shown in fig. 2, the first quantity t is a predetermined value, and the second quantity in this embodiment is a flexibly determined value.
For example, the fragment messages stored in terminal 1 and terminal 2 may be acquired from them, respectively, that is, a set of the first message of user 1, the second message of user 2, and the third message of user 3 may be obtained; then, the target message is obtained from the message set and returned to the target terminal.
Optionally, since the first terminal of the first user may select the start time and the end time corresponding to the message for the second message of the second user when the fragment message is stored, when determining the minimum number of candidate terminals, the minimum number of candidate terminals whose message contents can cover all chat contents of the second user may also be found by referring to the start time and the end time of the message corresponding to the second message of the second user in the fragment message stored by each online terminal.
Alternatively, when determining the minimum number of candidate terminals, since the target terminal is a terminal whose target session is in an online state, the target terminal may be directly used as one candidate terminal, and then (minimum number-1) candidate terminals are identified among other online terminals.
In the embodiment of the application, when the candidate message in the target session is fragmented, the first message sent by the first user and the second message sent by the second user in the target session can be flexibly used as the fragmented messages stored in the first terminal of the first user according to the storage requirement of the first user on the candidate message in the target session and the second user selected by the first user in the target session, so that the fragmented messages are fragmented according to the message sender, the messages sent by other users interested by the user can be more conveniently obtained by using the fragmented messages, and the user can store the chat content concerned by the user in a customized manner; in addition, in the fragmentation mode, when a query request of a target user for a target message is responded, the fragmentation messages stored in the fragmentation messages can be acquired from the minimum number of candidate terminals which cover all users of a target session in the union set of message senders of the fragmentation messages, so that the target message required by the user is searched by using the fragmentation messages, and the acquisition reliability of the target message is improved.
In addition, when the target user is a member in the target session, only the member in the target session can recover the candidate message before fragmentation in the target session in a manner of acquiring the target message, so that the recovery of the chat information in the target session is safer, and the risk of the chat information leakage is reduced.
Optionally, in an embodiment, when the step of obtaining the target message based on the fragment messages stored by the candidate terminals and addressed to the target session in step 305 is executed, according to a message sender corresponding to the fragment message, merging and deduplication processing may be performed on the fragment messages stored by each of the first number of candidate terminals, so as to generate the plurality of candidate messages before fragmentation; then, the target message is obtained from the candidate messages.
Because there may be duplicate message senders among the message senders corresponding to the fragment messages stored in the first number of candidate terminals, for example, both the terminal 1 and the terminal 2 store the second message of the user 2, the duplicate message content may be removed from two groups of messages belonging to the same message sender, and the two groups of messages belonging to the same message sender are merged (for example, the message sending times of the two groups of messages are different, so that the chat content sent by the message sender may be obtained by splicing according to the sequence data of the message sending times), and finally the candidate messages are recovered by using the fragment messages, where the candidate messages may be all chat content of the target session or partial chat content.
In this embodiment of the present application, when obtaining the target message based on the fragment messages stored in the candidate terminals, merging and deduplication processing may be performed on the fragment messages stored in each of the first number of candidate terminals according to a message sender of the fragment message, so as to generate the candidate messages; then, the target message is obtained from the candidate messages, so that the candidate messages can be recovered by using the fragment messages, and then the target message is inquired from the recovered candidate messages, so that the inquiry accuracy of the target message can be improved; in addition, when the candidate messages are recovered by using the fragment messages, the fragment messages stored by the first number of candidate terminals are merged and deduplicated according to the message senders of the fragment messages, so that the content of the recovered candidate messages without repetition can be improved, the messages are continuous according to the message time sequence, and the accuracy of recovering the candidate messages can be improved.
Alternatively, in another embodiment, when the step of obtaining the target message based on the fragment messages for the target session stored by the candidate terminals in step 305 is executed, in the case that the query request includes a keyword, first fragment messages matching the keyword may be queried respectively from the fragment messages for the target session stored by each of the first number of candidate terminals, and the target message may be obtained based on the first fragment messages.
In an embodiment, in a case that the query request includes a keyword, it is not necessary to recover the candidate message using the fragment message, but it may be directly queried whether there is a first fragment message matching the keyword in the determined first number of fragment messages stored by each candidate terminal, where the keyword and the first fragment message matching means: the text matching degree or the semantic matching degree is larger than a preset matching degree threshold value.
Since each candidate terminal stores the fragment message, the fragment message which is queried from each candidate terminal and matches with the keyword may be referred to as a first fragment message, and thus the number of the first fragment messages may be one or more, and there may be repeated partial message contents between the first fragment messages.
Therefore, when the target message is obtained based on the first fragmented message, if the number of the first fragmented messages is multiple, the target message (which may include one or more chat messages) may be obtained by performing message content deduplication processing on multiple first fragmented messages and then querying the deduplicated first fragmented messages for chat content matching the keywords.
In this embodiment of the present application, under the condition that the query request includes a keyword, first fragment messages matched with the keyword may be respectively queried in fragment messages respectively stored by the first number of candidate terminals, and then, a target message may be obtained based on the first fragment messages.
Optionally, in a further embodiment, when the step of obtaining the target message based on the fragment messages stored by the candidate terminals for the target session in step 305 is executed, in a case where the query request includes identification information of a third user as a message sender, second fragment messages of the message sender identified as the identification information of the third user may be queried in the fragment messages respectively stored by the first number of candidate terminals, and the target message may be obtained based on the second fragment messages.
That is, when the target user triggers the query request, it may be specified which user (i.e., the third user, the number of which may be one or more) in the target session needs to query the chat content sent by the target user; when responding to the query request, the candidate messages do not need to be recovered by using the fragment messages, and only the second fragment messages with the message sender being the third user need to be queried directly in the fragment messages stored in each candidate terminal; similarly, the number of the second fragmented messages may be one or more, and there may be repeated message contents between different second fragmented messages, so that, when the target message is obtained based on the second fragmented message, the message contents of the plurality of second fragmented messages may be subjected to the deduplication processing, so as to obtain the chat contents sent by the third user in the target session, that is, the target message.
In this embodiment of the application, in a case that the query request includes identification information of a third user as a message sender, second fragment messages having identification information of the message sender as the identification information of the third user may be respectively queried in fragment messages stored in each of the first number of candidate terminals, and then a target message may be obtained based on the second fragment messages.
Optionally, in any of the above embodiments, when the multiple candidate messages in the target session are fragmented and fragmented messages are generated, the fragmentation messages may be generated by fragmenting the candidate messages in the target session according to a preset period, or when the number of users corresponding to the target session is updated, or when the total message amount of the multiple candidate messages in the target session is increased by a preset message amount.
The updating of the number of users may include two cases, namely, an increase of the number of users and a decrease of the number of users, and either case may trigger the re-fragmentation of the candidate message. Because the update of the number of users can result in the update of the candidate messages in the target session, the fragmentation needs to be performed again; similarly, when the fragmented message is stored in each terminal, the last fragmented message stored in each terminal is updated to the fragmented message obtained after the current fragmentation.
Under the condition that the message quantity of the candidate message in the target session is increased by the preset message quantity, the candidate message in the target session is updated and changed to a larger extent, so that fragmentation needs to be carried out again on the basis of the latest candidate message; similarly, when the fragmented message is stored in each terminal, the last fragmented message stored in each terminal is updated to the fragmented message obtained after the current fragmentation.
In addition, the candidate messages in the target session may be fragmented according to a preset period to generate fragmented messages, that is, the candidate messages are fragmented again at intervals, because the candidate messages are easily updated at intervals, and thus the fragmentation needs to be repeated; (ii) a Similarly, when the fragmented message is stored in each terminal, the last fragmented message stored in each terminal is updated to the fragmented message obtained after the current fragmentation.
In this embodiment of the present application, when performing fragment processing on candidate messages in a target session and generating fragment messages, the fragment processing may be performed on the candidate messages in the target session to generate fragment messages under the condition that the number of users corresponding to the target session is updated, or under the condition that the message quantity of the candidate messages in the target session is increased by a preset message quantity, or according to a preset period. And when the candidate message is updated, re-fragmenting the candidate message based on the updated candidate message to obtain a new fragmented message.
Optionally, in any of the above embodiments, when different fragmentation messages are stored in different terminals corresponding to different users in the target session, candidate messages for the target session stored in different terminals corresponding to different users in the target session may be updated to different fragmentation messages, respectively.
In the embodiment of the present application, after the candidate messages are fragmented for the first time, when the fragmented messages are stored in each terminal, since all chat contents, that is, all candidate messages, in the target session are originally stored in each terminal according to the scheme in the related art, when the fragmented messages are stored, all chat contents stored in each terminal can be updated to the fragmented messages allocated to the terminal, so that the message volume stored in each terminal is greatly reduced, and the occupation of the chat contents on the terminal storage space is reduced.
Optionally, after the first fragmented fragment message is respectively stored in each terminal of the target session, if re-fragmentation is triggered again (for example, if the number of users corresponding to the target session is updated, or if the message amount of the candidate message in the target session is increased by the preset message amount, or according to a preset period), the last fragmented fragment message originally stored in each terminal may be updated to the fragment message allocated to each terminal generated after the current re-fragmentation, so as to ensure that the fragment message stored in each terminal is the latest fragment message obtained after the latest fragmentation, so as to obtain an accurate target message by using the latest fragment message.
It should be noted that, in the message processing method provided in the embodiment of the present application, the execution main body may be a message processing apparatus, or a control module in the message processing apparatus for executing the message processing method. The message processing apparatus provided in the embodiment of the present application is described with an example in which a message processing apparatus executes a message processing method.
Referring to fig. 4, a block diagram of a message processing apparatus according to an embodiment of the present application is shown. The message processing apparatus includes:
a receiving module 401, configured to receive a query request of a target user for a target message in a target session;
a response module 402, configured to, in response to the query request, identify a first number of candidate terminals from among the terminals in the online state of the target session, obtain the target message based on the fragmentation messages for the target session stored in the candidate terminals, and output the target message to a target terminal corresponding to the target user.
Optionally, the apparatus further comprises:
a fragmentation module 403, configured to perform fragmentation processing on multiple candidate messages in the target session to generate a fragmentation message, where a size of a storage space occupied by the fragmentation message is smaller than a size of a total storage space occupied by the multiple candidate messages;
a storage module 404, configured to store the different fragmentation messages to different terminals corresponding to different users in the target session, respectively.
Optionally, the slicing module 403 includes:
the first fragmentation sub-module is used for carrying out fragmentation processing on the plurality of candidate messages according to the number of users to generate fragmentation messages under the condition that the number of users corresponding to the target session exceeds two and the total message quantity of the plurality of candidate messages in the target session is greater than a preset threshold value;
optionally, the response module 402 includes:
the first identification submodule is used for identifying a first number of candidate terminals based on preset parameters in the terminals of which the target session is in an online state, wherein the preset parameters comprise network performance and/or running states;
a first recovery sub-module, configured to recover the plurality of candidate messages of the target session based on the fragmented messages for the target session that are stored by each of the first number of candidate terminals;
a first obtaining sub-module, configured to obtain the target message from the candidate messages.
Optionally, the first identification submodule includes:
the identification unit is used for identifying (t-1) candidate terminals based on preset parameters in the terminals except the target terminal, of which the target session is in an online state, wherein t is a first number;
and the setting unit is used for taking the target terminal and the candidate terminals with the number of (t-1) as t candidate terminals.
Optionally, the slicing module 403 includes:
a second identification submodule, configured to identify a first message sent by a first user and a second message sent by a second user in multiple candidate messages in a target session, where the multiple candidate messages include the first message and the second message, and the first message and the second message are different, and the second user is a user selected by the first user in the target session;
setting a sub-module, which is used for forming a fragment message by the first message and the second message;
optionally, the response module 402 includes:
the third identification submodule is used for identifying a message sender corresponding to the fragment message stored by each terminal in the terminals of which the target session is in the online state;
and a fourth identification submodule, configured to identify a minimum number of candidate terminals that meet a preset condition from among the terminals in the online state of the target session, where a union of message senders corresponding to the fragment messages stored in the minimum number of candidate terminals that meet the preset condition is a user set corresponding to the target session, and the minimum number is the first number.
Optionally, the response module 402 includes:
a second recovery sub-module, configured to perform merging and deduplication processing on the fragmented messages for the target session, which are stored by the first number of candidate terminals, respectively, according to a message sender corresponding to the fragmented message, so as to generate the multiple candidate messages;
and the second acquisition sub-module is used for acquiring the target message from the candidate messages.
Optionally, the query request includes a keyword;
the response module 402 includes:
and the first query submodule is used for respectively querying the first fragment messages matched with the keywords in the fragment messages aiming at the target session and stored by the first number of candidate terminals, and acquiring the target messages based on the first fragment messages.
Optionally, the query request includes identification information of a third user as a sender of the message;
the response module 402 includes:
and a second query submodule, configured to query, in the fragmented messages for the target session stored in each of the first number of candidate terminals, a second fragmented message that is identified by the message sender as the identification information of the third user, and acquire a target message based on the second fragmented message.
Optionally, the fragmentation module 403 is further configured to, when the number of users corresponding to the target session is updated, or when a total message amount of multiple candidate messages in the target session is increased by a preset message amount, or according to a preset period, perform fragmentation processing on the multiple candidate messages in the target session to generate a fragmented message.
Optionally, the storage module 404 includes:
and the updating submodule is used for respectively updating the candidate messages aiming at the target session, which are stored in different terminals corresponding to different users in the target session, into different fragment messages.
In the embodiment of the application, only the fragment message aiming at the target session needs to be stored in the candidate terminal of the target session, and all session messages of the target session do not need to be stored, so that the data storage amount of the chat content of the target session in the terminal of each member in the target session is reduced, and the occupancy rate of the chat content in the target session to the local storage space of the terminal is reduced; because only part of session messages of the target session are stored in the candidate terminals, when a certain target user needs to query the target message in the target session, a first number of candidate terminals can be selected from the terminals of which the target session is in an online state, and the target message is acquired based on the fragment messages which are stored by the candidate terminals and are specific to the target session, although the chat content is fragmented into the fragment messages, when the target message needs to be queried, the target message which needs to be queried can still be recovered by using a certain amount of fragment messages, so that the data volume of the chat content stored in the terminal is reduced, the user can accurately view the chat content in the target session, and the accuracy of the provided target message is also ensured.
The message processing apparatus in the embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not limited in particular.
The message processing apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system (Android), an iOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The message processing apparatus provided in the embodiment of the present application can implement each process implemented by the foregoing method embodiment, and is not described here again to avoid repetition.
Optionally, as shown in fig. 5, an electronic device 2000 is further provided in this embodiment of the present application, and includes a processor 2002, a memory 2001, and a program or an instruction stored in the memory 2001 and executable on the processor 2002, where the program or the instruction implements each process of the above-mentioned message processing method embodiment when executed by the processor 2002, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may further comprise a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The user input unit 1007 is used to receive a query request of a target user for a target message in a target session;
a processor 1010, configured to, in response to the query request, identify a first number of candidate terminals among the terminals whose target session is in an online state, and obtain the target message based on the fragmentation messages stored by the candidate terminals for the target session;
an audio output unit 1003 or a display unit 1006, configured to output the target message to a target terminal corresponding to the target user.
In the embodiment of the application, only the fragment message aiming at the target session needs to be stored in the candidate terminal of the target session, and all session messages of the target session do not need to be stored, so that the data storage amount of the chat content of the target session in the terminal of each member in the target session is reduced, and the occupancy rate of the chat content in the target session to the local storage space of the terminal is reduced; because only part of session messages of the target session are stored in the candidate terminals, when a certain target user needs to query the target message in the target session, a first number of candidate terminals can be selected from the terminals of which the target session is in an online state, and the target message is acquired based on the fragment messages which are stored by the candidate terminals and are specific to the target session, although the chat content is fragmented into the fragment messages, when the target message needs to be queried, the target message which needs to be queried can still be recovered by using a certain amount of fragment messages, so that the data volume of the chat content stored in the terminal is reduced, the user can accurately view the chat content in the target session, and the accuracy of the provided target message is also ensured.
Optionally, the processor 1010 is configured to perform fragmentation processing on multiple candidate messages in the target session to generate a fragmented message, where a size of a storage space occupied by the fragmented message is smaller than a size of a total storage space occupied by the multiple candidate messages;
a memory 1009, configured to store the different fragment messages to different terminals corresponding to different users in the target session respectively.
In the embodiment of the invention, the fragment message is generated by carrying out fragment processing on a plurality of candidate messages in the target session; different fragment messages are respectively stored to different terminals corresponding to different users in the target session, and different fragment messages after the chat content in the target session is fragmented can be respectively stored in the terminals of different members of the target session. In addition, the candidate messages of the target session are respectively stored in different terminals in a slicing mode, so that the storage and recovery processes of the chatting data are safer.
Optionally, the processor 1010 is further configured to perform fragmentation processing on the multiple candidate messages according to the number of users to generate fragmented messages when the number of users corresponding to the target session exceeds two and the total message amount of the multiple candidate messages in the target session is greater than a preset threshold; identifying a first number of candidate terminals based on preset parameters or randomly in the terminals of which the target session is in an online state, wherein the preset parameters comprise network performance and/or running state; recovering the plurality of candidate messages of the target session based on the fragmented messages for the target session stored by each of the first number of candidate terminals; and acquiring the target message from the plurality of candidate messages.
In the embodiment of the application, when the number of users corresponding to the target session exceeds two and the total message amount of the candidate messages in the target session is greater than a preset threshold, the candidate messages can be fragmented according to the number of users to generate fragmented messages, and the fragmented messages are respectively stored in different terminals of different users of the target session, so that the message storage amount of the terminals is reduced; then, identifying a first number of candidate terminals based on preset parameters or randomly in the terminals of which the target session is in an online state, wherein the preset parameters comprise network performance and/or running state; the plurality of candidate messages of the target session are recovered based on the fragment messages stored by the first number of candidate terminals, and because the selected candidate terminal is the terminal with the better state, the efficiency of acquiring the fragment messages from the candidate terminals is higher, so that the recovery efficiency of the candidate messages is improved, and the system delay of the user side on the inquired target message is reduced; and because the target message is obtained from the recovered candidate message, the accuracy of the obtained target message can be ensured.
Optionally, the processor 1010 is configured to, in terminals other than the target terminal, where the target session is in an online state, identify a number of (t-1) candidate terminals based on a preset parameter or randomly, where t is a first number; and taking the target terminal and the candidate terminals with the number of (t-1) as t candidate terminals.
In the embodiment of the application, when the candidate terminal to which the t pieces of fragment information for recovering the candidate information belong is selected, since the target terminal requesting the target information is always in the online state of the target session, in order to promote the acquisition of the fragment information, one piece of fragment information can be directly acquired from the target terminal, and the other (t-1) pieces of fragment information are acquired from other candidate terminals, so that the recovery efficiency of the candidate information can be further promoted, and the acquisition delay of the user on the requested target information can be reduced.
Optionally, the processor 1010 is configured to identify, in a plurality of candidate messages in a target session, a first message sent by a first user and a second message sent by a second user, where the plurality of candidate messages includes the first message and the second message, and the first message and the second message are different, and the second user is a user selected by the first user in the target session; the first message and the second message are used as a fragment message; identifying a message sender corresponding to the fragment message stored by each terminal in the terminal with the target session in an online state; and identifying the minimum number of candidate terminals meeting a preset condition from the terminals of which the target session is in an online state, wherein a union of message senders corresponding to the fragment messages stored by the minimum number of candidate terminals meeting the preset condition is a user set corresponding to the target session, and the minimum number is a first number.
In the embodiment of the application, when the candidate message in the target session is fragmented, the first message sent by the first user and the second message sent by the second user in the target session can be flexibly used as the fragmented messages stored in the first terminal of the first user according to the storage requirement of the first user on the candidate message in the target session and the second user selected by the first user in the target session, so that the fragmented messages are fragmented according to the message sender, the messages sent by other users interested by the user can be more conveniently obtained by using the fragmented messages, and the user can store the chat content concerned by the user in a customized manner; in addition, in the fragmentation mode, when a query request of a target user for a target message is responded, the fragmentation messages stored in the fragmentation messages can be acquired from the minimum number of candidate terminals which cover all users of a target session in the union set of message senders of the fragmentation messages, so that the target message required by the user is searched by using the fragmentation messages, and the acquisition reliability of the target message is improved.
Optionally, the processor 1010 is configured to perform merging and deduplication processing on the fragmented messages for the target session, which are stored by the first number of candidate terminals, according to a message sender corresponding to the fragmented message, so as to generate the multiple candidate messages; and acquiring the target message from the plurality of candidate messages.
In this embodiment of the present application, when obtaining the target message based on the fragment messages stored in the candidate terminals, merging and deduplication processing may be performed on the fragment messages stored in the respective candidate terminals of the first number according to a message sender of the fragment messages, so as to generate the candidate messages; then, the target message is obtained from the candidate messages, so that the candidate messages can be recovered by using the fragment messages, and then the target message is inquired from the recovered candidate messages, so that the inquiry accuracy of the target message can be improved; in addition, when the candidate messages are recovered by using the fragment messages, the fragment messages stored by the first number of candidate terminals are merged and deduplicated according to the message senders of the fragment messages, so that the content of the recovered candidate messages without repetition can be improved, the messages are continuous according to the message time sequence, and the accuracy of recovering the candidate messages can be improved.
Optionally, the processor 1010 is configured to, if the query request includes a keyword, query, in the fragmented messages for the target session stored in each of the first number of candidate terminals, first fragmented messages matching the keyword, and obtain a target message based on the first fragmented messages.
In this embodiment of the application, under the condition that the query request includes a keyword, first fragment messages matched with the keyword may be respectively queried in fragment messages respectively stored by the first number of candidate terminals, and then, a target message may be obtained based on the first fragment messages.
Optionally, the processor 1010 is configured to, in a case that the query request includes identification information of a third user as a message sender, query, in the fragmented messages for the target session stored in each of the first number of candidate terminals, second fragmented messages of the message sender, which are identified as the identification information of the third user, respectively, and acquire the target message based on the second fragmented messages.
In this embodiment of the application, in a case that the query request includes identification information of a third user as a message sender, second fragment messages having identification information of the message sender as the identification information of the third user may be respectively queried in fragment messages stored in the first number of candidate terminals, and then a target message may be obtained based on the second fragment messages.
Optionally, the processor 1010 is configured to, when the number of users corresponding to the target session is updated, or when a total message amount of the multiple candidate messages in the target session is increased by a preset message amount, or according to a preset period, perform fragmentation processing on the multiple candidate messages in the target session to generate a fragmented message.
In the embodiment of the present application, when the candidate messages in the target session are fragmented and fragmented messages are generated, the fragmentation processing may be performed on the candidate messages in the target session to generate fragmented messages under the condition that the number of users corresponding to the target session is updated, or under the condition that the message quantity of the candidate messages in the target session is increased by a preset message quantity, or according to a preset period. And when the candidate message is updated, re-fragmenting the candidate message based on the updated candidate message to obtain a new fragmented message.
Optionally, the processor 1010 is configured to update candidate messages for the target session, stored in different terminals corresponding to different users in the target session, to the different fragmented messages respectively.
In the embodiment of the application, after the candidate messages are fragmented for the first time, when the fragmented messages are stored in each terminal, since all chat contents, that is, all candidate messages, in the target session are originally stored in each terminal according to the scheme in the related art, when the fragmented messages are stored, all chat contents stored in each terminal can be updated to the fragmented messages distributed to the terminal, so that the message amount stored in each terminal is greatly reduced, and the occupation of the chat contents on the storage space of the terminal is reduced.
It should be understood that in the embodiment of the present application, the input Unit 1004 may include a Graphics Processing Unit (GPU) 10041 and a microphone 10042, and the Graphics Processing Unit 10041 processes image data of still pictures or videos obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 may include two parts, a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 1009 may be used to store software programs as well as various data, including but not limited to application programs and operating systems. Processor 1010 may integrate an application processor that handles primarily operating systems, user interfaces, applications, etc. and a modem processor that handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1010.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above-mentioned message processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the above-mentioned message processing method embodiment, and can achieve the same technical effect, and is not described here again to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. A method of message processing, the method comprising:
receiving a query request of a target user for a target message in a target session;
responding to the query request, identifying a first number of candidate terminals from the terminals of which the target session is in an online state, acquiring the target message based on the fragment messages of the target session stored by the candidate terminals, and outputting the target message to the target terminal corresponding to the target user;
before receiving a query request of a target user for a target message in a target session, the method further comprises:
carrying out fragmentation processing on a plurality of candidate messages in the target session to generate fragmented messages, wherein the size of a storage space occupied by the fragmented messages is smaller than the size of a total storage space occupied by the plurality of candidate messages;
and respectively storing the different fragment messages to different terminals corresponding to different users in the target session.
2. The method of claim 1,
the fragmenting the multiple candidate messages in the target session to generate fragmented messages includes:
under the condition that the number of users corresponding to the target session exceeds two and the total message quantity of the candidate messages in the target session is greater than a preset threshold value, carrying out fragmentation processing on the candidate messages according to the number of the users to generate fragmentation messages;
the identifying a first number of candidate terminals among the terminals whose target session is in an online state includes:
identifying a first number of candidate terminals based on preset parameters in the terminals of which the target session is in an online state, wherein the preset parameters comprise network performance and/or running state;
the acquiring the target message based on the fragmentation messages stored by the candidate terminals and aiming at the target session comprises:
recovering the plurality of candidate messages of the target session based on the fragmented messages for the target session stored by each of the first number of candidate terminals;
and acquiring the target message from the plurality of candidate messages.
3. The method of claim 1,
the fragmenting the multiple candidate messages in the target session to generate fragmented messages includes:
identifying a first message sent by a first user and a second message sent by a second user in a plurality of candidate messages in a target session, wherein the plurality of candidate messages comprise the first message and the second message, the first message and the second message are different, and the second user is a user selected by the first user in the target session;
the first message and the second message are used as a fragment message;
the identifying a first number of candidate terminals among the terminals whose target session is in an online state includes:
identifying a message sender corresponding to the fragment message stored by each terminal in the terminals of which the target session is in an online state;
and identifying the minimum number of candidate terminals meeting a preset condition from the terminals of the target session in the online state, wherein the union of message senders corresponding to the fragment messages stored by the minimum number of candidate terminals meeting the preset condition is a user set corresponding to the target session, and the minimum number is a first number.
4. The method of claim 3, wherein the obtaining the target message based on the fragmented messages stored by the candidate terminals for the target session comprises:
according to the message sender corresponding to the fragment message, merging and de-duplicating the fragment messages aiming at the target session, which are respectively stored by the first number of candidate terminals, to generate a plurality of candidate messages;
and acquiring the target message from the plurality of candidate messages.
5. The method of claim 3, wherein the query request includes a keyword;
the acquiring the target message based on the fragmentation messages stored by the candidate terminals and aiming at the target session comprises:
and respectively inquiring first fragment messages matched with the keywords in the fragment messages aiming at the target session stored by the candidate terminals of the first number, and acquiring the target messages based on the first fragment messages.
6. The method of claim 3, wherein the query request includes identification information of a third user that is a sender of the message;
the acquiring the target message based on the fragment message stored by the candidate terminal for the target session comprises:
and in the fragmented messages aiming at the target session and stored by the first number of candidate terminals, respectively inquiring a second fragmented message of which the identifier of the message sender is the identifier information of the third user, and acquiring the target message based on the second fragmented message.
7. A message processing apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving a query request of a target user for a target message in a target session;
a response module, configured to, in response to the query request, identify a first number of candidate terminals from among terminals in an online state of the target session, obtain the target message based on a fragmentation message for the target session stored in the candidate terminals, and output the target message to a target terminal corresponding to the target user;
the device further comprises:
the fragmentation module is used for carrying out fragmentation processing on a plurality of candidate messages in the target session to generate fragmentation messages, wherein the size of the storage space occupied by the fragmentation messages is smaller than the size of the total storage space occupied by the candidate messages;
and the storage module is used for respectively storing the different fragment messages to different terminals corresponding to different users in the target session.
8. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the message processing method according to any one of claims 1 to 6.
9. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implement the steps of the message processing method according to any one of claims 1 to 6.
CN202011120289.2A 2020-10-19 2020-10-19 Message processing method and device, electronic equipment and readable storage medium Active CN112260935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011120289.2A CN112260935B (en) 2020-10-19 2020-10-19 Message processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011120289.2A CN112260935B (en) 2020-10-19 2020-10-19 Message processing method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112260935A CN112260935A (en) 2021-01-22
CN112260935B true CN112260935B (en) 2022-04-15

Family

ID=74243900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011120289.2A Active CN112260935B (en) 2020-10-19 2020-10-19 Message processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112260935B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113727134A (en) * 2021-08-31 2021-11-30 康键信息技术(深圳)有限公司 Live chat information distribution method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402507A (en) * 2010-09-07 2012-04-04 重庆邮电大学 Heterogeneous data integration system for service-oriented architecture (SOA) multi-message mechanism
CN103309998A (en) * 2013-06-25 2013-09-18 腾讯科技(深圳)有限公司 Message query method, message query device and terminal equipment
CN105337747A (en) * 2015-11-17 2016-02-17 小米科技有限责任公司 Group historical message processing method and device
CN107391523A (en) * 2016-05-17 2017-11-24 谷歌公司 Suggestion for being interacted with automation assistant is provided in multi-user message interaction topic
CN109787888A (en) * 2019-01-25 2019-05-21 上海创景信息科技有限公司 Support more equipment message distribution stocking systems and method and storage medium
CN109829086A (en) * 2018-12-29 2019-05-31 维沃移动通信有限公司 Chat record querying method, device, terminal and computer storage medium
CN109873757A (en) * 2019-03-29 2019-06-11 上海连尚网络科技有限公司 Message display method, electronic equipment and readable medium for multi-conference
CN110191193A (en) * 2019-06-12 2019-08-30 广州吱呀网络科技有限公司 A kind of terminal message synchronous method, device and mobile terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8909621B2 (en) * 2012-11-16 2014-12-09 International Business Machines Corporation Contextual search history in collaborative archives
CN106161176A (en) * 2015-03-23 2016-11-23 腾讯科技(深圳)有限公司 Cluster conversation message treatment method and device
CN110581772B (en) * 2019-09-06 2020-10-13 腾讯科技(深圳)有限公司 Instant messaging message interaction method and device and computer readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402507A (en) * 2010-09-07 2012-04-04 重庆邮电大学 Heterogeneous data integration system for service-oriented architecture (SOA) multi-message mechanism
CN103309998A (en) * 2013-06-25 2013-09-18 腾讯科技(深圳)有限公司 Message query method, message query device and terminal equipment
CN105337747A (en) * 2015-11-17 2016-02-17 小米科技有限责任公司 Group historical message processing method and device
CN107391523A (en) * 2016-05-17 2017-11-24 谷歌公司 Suggestion for being interacted with automation assistant is provided in multi-user message interaction topic
CN109829086A (en) * 2018-12-29 2019-05-31 维沃移动通信有限公司 Chat record querying method, device, terminal and computer storage medium
CN109787888A (en) * 2019-01-25 2019-05-21 上海创景信息科技有限公司 Support more equipment message distribution stocking systems and method and storage medium
CN109873757A (en) * 2019-03-29 2019-06-11 上海连尚网络科技有限公司 Message display method, electronic equipment and readable medium for multi-conference
CN110191193A (en) * 2019-06-12 2019-08-30 广州吱呀网络科技有限公司 A kind of terminal message synchronous method, device and mobile terminal

Also Published As

Publication number Publication date
CN112260935A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
CN110489417B (en) Data processing method and related equipment
CN110601956B (en) Content aggregation method and device, computer equipment and storage medium
CN109040227B (en) Service request response method and device based on block chain and computer equipment
CN112286887A (en) File sharing method and device and electronic equipment
CN102769640B (en) The update method of user profile, server and system
CN106470150B (en) Relation chain storage method and device
CN113676589B (en) Unread message display method and device and electronic equipment
CN112947807A (en) Display method and device and electronic equipment
CN112770129A (en) Live broadcast-based group chat establishing method, related device, equipment and medium
CN113127432A (en) Operation execution method, device, electronic equipment and medium
CN112260935B (en) Message processing method and device, electronic equipment and readable storage medium
CN111130986A (en) Message sending method, device, equipment and storage medium
CN104702488A (en) System and method for recommending friends
US20160275193A1 (en) Socially driven feed of aggregated content in substantially real time
CN111191178A (en) Information pushing method and device, server and storage medium
CN106487653B (en) Message processing method and server
CN108737246B (en) Message issuing method, device, storage medium and server
CN114124874B (en) Chat information sending method and device
CN113364915B (en) Information display method and device and electronic equipment
CN113676395B (en) Information processing method, related device and readable storage medium
CN106156166B (en) Relation chain query system, document retrieval method, index establishment method and device
CN112765483A (en) Matching recommendation method based on activity, related device, equipment and medium
CN110750749A (en) Community maintenance method, electronic device and computer-readable storage medium
CN113420230A (en) Matching consultation pushing method based on group chat, related device, equipment and medium
CN112084151A (en) File processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant