CN105376134B - Method and device for displaying communication message - Google Patents
Method and device for displaying communication message Download PDFInfo
- Publication number
- CN105376134B CN105376134B CN201410423098.1A CN201410423098A CN105376134B CN 105376134 B CN105376134 B CN 105376134B CN 201410423098 A CN201410423098 A CN 201410423098A CN 105376134 B CN105376134 B CN 105376134B
- Authority
- CN
- China
- Prior art keywords
- user
- type
- communication message
- message
- communication
- 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
Links
Images
Landscapes
- Telephonic Communication Services (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method and a device for displaying communication messages, and belongs to the field of communication. The method comprises the following steps: receiving a first communication message, wherein the first communication message carries message content and a first user identifier, and the type of the first communication message is a first type; acquiring a second user in the same session with the first user according to the first user identification; if the type of the communication message displayed by the terminal corresponding to the second user is the second type, converting the first communication message into a second communication message based on the message content, wherein the type of the second communication message is the second type; and sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message. The invention displays the communication message in a full voice form or a full text form, thereby improving the operability of acquiring the message content.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for displaying a communication message.
Background
With the rapid development of communication technology, more and more instant messaging tools are emerging. The instant messaging tool can support one-to-one communication between two users and also can support group communication between at least three users, and a terminal corresponding to each communicating user can display communication messages among the multiple users.
Currently, the process of displaying the communication message may be: when the first user communicates in a voice mode, the server receives a voice message sent by a terminal corresponding to the first user, wherein the voice message carries a message content and a first user identifier. And the server acquires a second user bound with the first user and sends the voice message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the voice message in a voice bar form. Similarly, when the first user communicates in the text form, the server sends the text message sent by the terminal corresponding to the first user to the terminal corresponding to the second user, so that the terminal corresponding to the second user displays the text message in the text box.
When a plurality of users communicate with each other, especially at least three users communicate with each other, if some users of the at least three users communicate with each other in a voice form and other users communicate with each other in a text form, a phenomenon that a voice bar and a text box are alternately displayed occurs when a terminal displays a communication message, and then the user needs to click the voice bar for playing the communication message and needs to view the communication message in the text box for a while, if the terminal is in a moving state, the operability of acquiring the communication message according to the method is not high.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for displaying a communication message. The technical scheme is as follows:
in one aspect, a method of displaying a communication message is provided, the method comprising:
receiving a first communication message, wherein the first communication message carries message content and a first user identifier, and the type of the first communication message is a first type;
acquiring a second user in the same session with the first user according to the first user identification;
if the type of the communication message displayed by the terminal corresponding to the second user is the second type, converting the first communication message into a second communication message based on the message content, wherein the type of the second communication message is the second type;
and sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message.
In another aspect, an apparatus for displaying a communication message is provided, the apparatus comprising:
a first receiving module, configured to receive a first communication message, where the first communication message carries a message content and a first user identifier, and a type of the first communication message is a first type;
the first acquisition module is used for acquiring a second user in the same session with the first user according to the first user identification;
a first conversion module, configured to, if the type of the communication message displayed by the terminal corresponding to the second user is a second type, convert the first communication message into a second communication message based on the message content, where the type of the second communication message is the second type;
and the first sending module is used for sending the second communication message to a terminal corresponding to the second user so that the terminal corresponding to the second user displays the second communication message.
In the embodiment of the present invention, when two users perform one-to-one communication or at least three users form a communication group to perform communication, all communication messages corresponding to the multiple users may be displayed as communication messages in a voice format or all communication messages in a text format, so as to avoid the phenomenon that a voice bar and a text box appear alternately. And when the user acquires the message content of the communication message, the opposite terminal of the user can continuously play the communication messages of a plurality of voice types or continuously check the message content in the text box, so that the mode of acquiring the message content is simplified, and the efficiency of acquiring the message content is improved. In addition, according to the method provided by the embodiment of the invention, the user does not need to frequently click the voice bar, and the operability of acquiring the message content is improved when the terminal is in a moving state.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a conversation interface for displaying communication messages according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for displaying a communication message according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for displaying communication messages according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another conversation interface for displaying communication messages according to an embodiment of the present invention;
fig. 5 is a flowchart of another method for displaying a communication message according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a further conversation interface for displaying communication messages according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus for displaying a communication message according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Before explaining the embodiments of the present invention in detail, an application scenario of the present invention will be described. When the user communicates through the instant messaging tool, the user can communicate in a voice mode and can communicate in a text mode. For example, when four users form a communication group to communicate, if the first user and the third user communicate in the form of text and the second user and the fourth user communicate in the form of voice, a session interface as shown in fig. 1 may be displayed in a terminal corresponding to the third user. In fig. 1, the communication messages of the first user and the third user are displayed in the form of a voice bar, and the communication messages of the second user and the fourth user are displayed in the form of text boxes, so that the voice bar and the text boxes are alternately displayed. When a third user wants to know the communication message sent by the first user, the third user can check the text box corresponding to the first user; when a third user wants to know the communication messages sent by the second user and the fourth user, the third user needs to click the voice bars corresponding to the second user and the fourth user respectively to play the communication messages. Thus, the efficiency of acquiring the message content is reduced, and the operability of clicking the voice bar and viewing the text box is not high when the terminal is in a moving state. Therefore, the embodiment of the present invention provides a method for displaying a communication message, which can simplify a manner of obtaining message content, improve efficiency of obtaining message content, and quickly obtain message content when a terminal is in a mobile state.
Fig. 2 is a flowchart of a method for displaying a communication message according to an embodiment of the present invention. Referring to fig. 2, the method includes:
step 201: and receiving a first communication message, wherein the first communication message carries message content and a first user identifier, and the type of the first communication message is a first type.
Step 202: and acquiring a second user in the same session with the first user according to the first user identification.
Step 203: and if the type of the communication message displayed by the terminal corresponding to the second user is the second type, converting the first communication message into the second communication message based on the message content, wherein the type of the second communication message is the second type.
Step 204: and sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message.
In the embodiment of the present invention, when two users perform one-to-one communication or at least three users form a communication group to perform communication, all communication messages corresponding to the multiple users may be displayed as communication messages in a voice format or all communication messages in a text format, so as to avoid the phenomenon that a voice bar and a text box appear alternately. And when the user acquires the message content of the communication message, the opposite terminal of the user can continuously play the communication messages of a plurality of voice types or continuously check the message content in the text box, so that the mode of acquiring the message content is simplified, and the efficiency of acquiring the message content is improved. In addition, according to the method provided by the embodiment of the invention, the user does not need to frequently click the voice bar, and the operability of acquiring the message content is improved when the terminal is in a moving state.
Optionally, when the first type is a text type and the second type is a voice type, the converting the first communication message into the second communication message based on the message content includes:
searching corresponding voice parameters from the corresponding relation between the stored user identification and the voice parameters according to the first user identification, wherein the voice parameters comprise intensity, tone and frequency;
and if the corresponding voice parameter is found, converting the first communication message into a second communication message based on the voice parameter and the message content.
Optionally, before searching for the corresponding voice parameter from the stored correspondence between the user identifier and the voice parameter according to the first user identifier, the method further includes:
when a third communication message sent by a terminal corresponding to the first user is received, identifying a voice parameter of the third communication message, wherein the type of the third communication message is a second type;
the first user identification and the speech parameter are stored in a correspondence between the user identification and the speech parameter.
Optionally, the method further comprises:
if the corresponding voice parameter is not found, acquiring a preset voice parameter;
and converting the first communication message into a second communication message based on the preset voice parameter and the message content.
Optionally, the method further comprises:
receiving a conversion request message, wherein the conversion request message carries a third user identifier, and the third user is any one of the first user and the second user;
according to the third user identification, selecting a fourth communication message from the communication messages sent to the terminal corresponding to the third user, wherein the type of the fourth communication message is the first type;
converting the fourth communication message into a fifth communication message, wherein the type of the fifth communication message is a second type;
and sending the fifth communication message to a terminal corresponding to the third user, so that the terminal corresponding to the third user replaces the displayed fourth communication message with the fifth communication message.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiment of the present invention, which is not described in detail herein.
Because two different implementation modes are included when the communication message is displayed, the first implementation mode is that the communication message is converted into a full-voice form to be displayed, and the second implementation mode is that the communication message is converted into a full-text form to be displayed. These two implementations are described in detail below in two different embodiments.
Fig. 3 is a flowchart of a method for displaying a communication message according to an embodiment of the present invention. The embodiment of the present invention explains a first implementation manner of displaying a communication message, that is, in the embodiment of the present invention, the first type is a text type, and the second type is a voice type. Referring to fig. 3, the method includes:
step 301: when a terminal corresponding to a first user receives message content input by the first user, a first communication message is sent to a server, the message content and a first user identifier are carried in the first communication message, and the type of the first communication message is a text type.
Specifically, when a terminal corresponding to a first user receives message content input by the first user in a text form, a first communication message is generated according to the message content and a first user identifier, and the first communication message is sent to a server.
In the embodiment of the present invention, when the first user inputs the message content in the form of text, the terminal corresponding to the first user may detect text information input by the first user in the text box, and determine the detected text information as the message content.
In addition, when the terminal corresponding to the first user receives the message content input by the first user in the form of text, the terminal corresponding to the first user can also display the message content. If the type of the displayed communication message of the terminal corresponding to the first user is the voice type, the terminal corresponding to the first user can convert the first communication message into a second communication message based on the message content and display the second communication message, wherein the type of the second communication message is the voice type.
Since the second communication message is a communication message in a voice form, when the terminal corresponding to the first user displays the second communication message, the second communication message may be displayed in a voice bar form.
Step 302: and when the server receives the first communication message, acquiring a second user in the same session with the first user according to the first user identification.
In the embodiment of the present invention, two users may perform one-to-one communication, and at least three users may perform group communication. When two users perform one-to-one communication, a first communication message sent to the server by a terminal corresponding to the first user may also carry a second user identifier, and at this time, the server may determine the user corresponding to the second user identifier as the second user. When group communication is performed among at least three users, a first communication message sent to the server by a terminal corresponding to a first user may also carry the group identifier, and at this time, the server may obtain a second user in the same session with the first user according to the first user identifier and the group identifier.
The specific operation of the server obtaining the second user in the same session with the first user according to the first user identifier and the group identifier may be: and the server acquires the corresponding user identification from the corresponding relation between the stored group identification and the user identification according to the group identification. And determining the user identification except the first user identification in the obtained user identifications as a second user identification, and determining the user corresponding to the second user identification as a second user in the same session with the first user.
For example, the first user ID is ID1, the group ID is GroupID1, and the server obtains the corresponding user IDs ID1, ID2, DI3, and ID4 from the corresponding relationship between the group ID and the user ID shown in table 1 below according to the first user ID1 and the group ID GroupID 1. And determining the obtained user identifications ID2, DI3 and ID4 as second user identifications, and determining users corresponding to the second user identifications ID2, DI3 and ID4 as second users in the same session with the first user.
TABLE 1
It should be noted that, in the embodiment of the present invention, only the correspondence between the group identifier and the user identifier in table 1 is taken as an example for description, and other forms may also be possible in practical application, and the embodiment of the present invention is not limited to this.
Step 303: and if the type of the communication message displayed by the terminal corresponding to the second user is the voice type, converting the first communication message into the second communication message based on the message content, wherein the type of the second communication message is the voice type.
Specifically, if the type of the communication message displayed by the terminal corresponding to the second user is a voice type, searching a corresponding voice parameter from a corresponding relationship between the stored user identifier and the voice parameter according to the first user identifier, where the voice parameter includes intensity, tone and frequency. And if the corresponding voice parameter is found, converting the first communication message into a second communication message based on the voice parameter and the message content.
For example, the server finds the corresponding voice parameter from the corresponding relationship between the user ID and the voice parameter as shown in table 2 below according to the first user ID1, and the intensity is 100, the tone is mute, and the frequency is 200 Hz. The server converts the first communication message to a second communication message based on the voice parameters and the message content.
TABLE 2
It should be noted that, in the embodiment of the present invention, only the correspondence between the user identifier and the voice parameter in the above table 2 is taken as an example for description, and other forms may also be possible in practical application, and the embodiment of the present invention is not limited to this specifically.
Further, if the corresponding voice parameter is not found, the preset voice parameter is obtained. And converting the first communication message into a second communication message based on the preset voice parameters and the message content.
It should be added that when the first user previously communicated in the instant messenger in the form of voice, the server records the voice parameters of the first user. The method specifically comprises the following steps: and the terminal corresponding to the first user sends a third communication message to the server, wherein the third communication message carries the message content and the first user identifier, and the type of the third communication message is a voice type. When the server receives the third communication message, the server identifies the voice parameters of the third communication message. The first user identification and the speech parameter are stored in a correspondence between the user identification and the speech parameter. In addition, when the first user does not communicate in the form of voice in the instant messaging tool before, the server does not record the voice parameters of the first user, that is, the corresponding relationship between the user identifier and the voice parameters does not include the record corresponding to the first user identifier. At this time, when the server searches the corresponding voice parameter from the stored corresponding relationship between the user identifier and the voice parameter according to the first user identifier, the server cannot search the corresponding voice parameter.
Further, before performing step 303, the server may further search for a corresponding display type from the stored correspondence between the user identifier and the display type according to the second user identifier. And if the corresponding display type is found and the found display type is the voice type, determining that the type of the communication message displayed by the terminal corresponding to the second user is the voice type.
However, whether the display type corresponding to the second user can be found from the correspondence between the user identifier and the display type is determined according to the voice conversion request message sent by the user. The method specifically comprises the following steps: when the second user wants to convert the displayed communication message into a full voice form, the terminal corresponding to the second user sends a voice conversion request message to the server, wherein the voice conversion request message carries a second user identifier. When the server receives the voice conversion request message, the server stores the second user identification and the voice type in the corresponding relation between the user identification and the display type. After the terminal corresponding to the second user sends the voice conversion request message to the server according to the method, the server can search the display type corresponding to the second user identification from the corresponding relation between the user identification and the display type.
Further, if the terminal corresponding to the second user does not send the voice conversion request message to the server according to the method, the server does not find the display type corresponding to the second user identifier from the corresponding relationship between the user identifier and the display type. At this time, the server does not convert the first communication message into the second communication message, and directly sends the first communication message to the terminal corresponding to the second user, so that the terminal corresponding to the second user displays the first communication message. At this time, a phenomenon that the voice bar and the text box are alternately displayed may occur.
It should be added that only the conversion request message that is sent by the user last time is maintained in the corresponding relationship between the user identifier and the display type, that is, when the user last sent a voice conversion request, the display type stored in the corresponding relationship between the user identifier and the display type is the voice type.
Step 304: and sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message.
When the server receives a first communication message sent by a terminal corresponding to a first user, the server adds a timestamp to the first communication message. And when the server converts the first communication message into a second communication message and sends the second communication message to the terminal corresponding to the second user, the server also sends the timestamp to the terminal corresponding to the second user. And when the terminal corresponding to the second user receives the second communication message and the time stamp, displaying the second communication message according to the time stamp.
The timestamp may be a time when the terminal corresponding to the first user sends the first communication message, or may be a time when the server receives the first communication message, which is not specifically limited in this embodiment of the present invention.
In addition, when the second user wants to display the communication message in a full voice form in step 303, the terminal corresponding to the second user may transmit a voice conversion request message to the server. In the embodiment of the present invention, when the first user wants to display the communication message in a full voice form, the terminal corresponding to the first user may also send a voice conversion request message to the server. For convenience of description herein, a third user may be introduced, the third user being any one of the first user and the second user. If the terminal corresponding to the third user does not send the voice conversion request message to the server when the session starts, but sends the voice conversion request to the server in the session process, that is, the voice conversion request is sent to the server when the session is performed for a period of time, and the voice conversion request carries the third user identifier. At this time, when the server receives the voice conversion request, the server selects a fourth communication message from the communication messages sent to the terminal corresponding to the third user according to the third user identifier, wherein the type of the fourth communication message is a text type. And converting the fourth communication message into a fifth communication message, wherein the type of the fifth communication message is a voice type. And the server sends the fifth communication message to a terminal corresponding to the third user. And when the terminal corresponding to the third user receives the fifth communication message, the terminal corresponding to the third user replaces the displayed fourth communication message with the fifth communication message.
In this case, when the server sends the fifth communication message to the terminal corresponding to the third user, the server also sends the timestamp corresponding to the fifth communication message to the terminal corresponding to the third user. And when the terminal corresponding to the third user receives the fifth communication message and the timestamp corresponding to the fifth communication message, the terminal corresponding to the third user replaces the displayed fourth communication message with the corresponding fifth communication message according to the timestamp corresponding to the fifth communication message.
The terminal corresponding to the third user may replace the displayed fourth communication message with the corresponding fifth communication message according to the reverse order of the timestamps corresponding to the fifth communication message, and may also replace the displayed fourth communication message with the corresponding fifth communication message according to the order of the timestamps corresponding to the fifth communication message. The embodiment of the present invention is not particularly limited to this.
For example, when a communication message is displayed by the above-described method, the conversation interface shown in fig. 1 may be changed to the conversation interface shown in fig. 4.
In the embodiment of the invention, when two users carry out one-to-one communication or at least three users form a communication group to carry out communication, all the communication messages corresponding to the users can be displayed as the communication messages in the voice form, so that the phenomenon that the voice bars and the text boxes alternately appear is avoided. And when the user acquires the message content of the communication message, the opposite terminal of the user can continuously play the communication messages of a plurality of voice types, so that the mode of acquiring the message content is simplified, and the efficiency of acquiring the message content is improved. In addition, according to the method provided by the embodiment of the invention, the user does not need to frequently click the voice bar, and the operability of acquiring the message content is improved when the terminal is in a moving state.
Fig. 5 is a flowchart of a method for displaying a communication message according to an embodiment of the present invention. The embodiment of the present invention explains a second implementation manner of displaying a communication message, that is, in the embodiment of the present invention, the first type is a voice type, and the second type is a text type. Referring to fig. 5, the method includes:
step 501: when a terminal corresponding to a first user receives message content input by the first user, a first communication message is sent to a server, the message content and a first user identifier are carried in the first communication message, and the type of the first communication message is a voice type.
Specifically, when a terminal corresponding to a first user receives message content input by the first user in a voice form, a first communication message is generated according to the message content and a first user identifier, and the first communication message is sent to a server.
In the embodiment of the present invention, when the first user inputs the message content in a form of voice, the terminal corresponding to the first user may record the voice input by the first user, so as to obtain the message content.
In addition, when the terminal corresponding to the first user receives the message content input by the first user in the form of voice, the terminal corresponding to the first user can also display the message content. If the type of the displayed communication message of the terminal corresponding to the first user is the text type, the terminal corresponding to the first user can convert the first communication message into a second communication message based on the message content and display the second communication message, wherein the type of the second communication message is the text type.
Since the second communication message is a text-form communication message, when the terminal corresponding to the first user displays the second communication message, the second communication message may be displayed in the form of a text box.
Step 502: and when the server receives the first communication message, acquiring a second user in the same session with the first user according to the first user identification.
In the embodiment of the present invention, two users may perform one-to-one communication, and at least three users may perform group communication. When two users perform one-to-one communication, a first communication message sent to the server by a terminal corresponding to the first user may also carry a second user identifier, and at this time, the server may determine the user corresponding to the second user identifier as the second user. When group communication is performed among at least three users, a first communication message sent to the server by a terminal corresponding to a first user may also carry the group identifier, and at this time, the server may obtain a second user in the same session with the first user according to the first user identifier and the group identifier.
The specific operation of the server obtaining the second user in the same session with the first user according to the first user identifier and the group identifier may be: and the server acquires the corresponding user identification from the corresponding relation between the stored group identification and the user identification according to the group identification. And determining the user identification except the first user identification in the obtained user identifications as a second user identification, and determining the user corresponding to the second user identification as a second user in the same session with the first user.
For example, the first user ID is ID1, the group ID is GroupID1, and the server obtains the corresponding user IDs ID1, ID2, DI3, and ID4 from the corresponding relationship between the group ID and the user ID shown in table 1 below according to the first user ID1 and the group ID GroupID 1. And determining the obtained user identifications ID2, DI3 and ID4 as second user identifications, and determining users corresponding to the second user identifications ID2, DI3 and ID4 as second users in the same session with the first user.
TABLE 1
It should be noted that, in the embodiment of the present invention, only the correspondence between the group identifier and the user identifier in table 1 is taken as an example for description, and other forms may also be possible in practical application, and the embodiment of the present invention is not limited to this.
Step 503: and if the type of the communication message displayed by the terminal corresponding to the second user is the text type, converting the first communication message into the second communication message based on the message content, wherein the type of the second communication message is the text type.
Specifically, if the type of the communication message displayed by the terminal corresponding to the second user is a text type, the message content is identified, the message content in the voice form is converted into the text form, and the first communication message is converted into the second communication message.
Further, before performing step 503, the server may further search for a corresponding display type from the stored correspondence between the user identifier and the display type according to the second user identifier. And if the corresponding display type is found and the found display type is the text type, determining that the type of the communication message displayed by the terminal corresponding to the second user is the text type.
However, whether the display type corresponding to the second user can be found from the correspondence between the user identifier and the display type is determined according to the text conversion request message sent by the user. The method specifically comprises the following steps: when the second user wants to convert the displayed communication message into a full text form, the terminal corresponding to the second user sends a text conversion request message to the server, wherein the text conversion request message carries a second user identifier. When the server receives the text conversion request message, the server stores the second user identification and the text type in the correspondence between the user identification and the display type. After the terminal corresponding to the second user sends the text conversion request message to the server according to the method, the server can search the display type corresponding to the second user identification from the corresponding relation between the user identification and the display type.
Further, if the terminal corresponding to the second user does not send the text conversion request message to the server according to the method, the server does not find the display type corresponding to the second user identifier from the corresponding relationship between the user identifier and the display type. At this time, the server does not convert the first communication message into the second communication message, and directly sends the first communication message to the terminal corresponding to the second user, so that the terminal corresponding to the second user displays the first communication message. At this time, a phenomenon that the voice bar and the text box are alternately displayed may occur.
It should be added that only the conversion request message that is sent by the user last time is maintained in the correspondence between the user identifier and the display type, that is, when the text conversion request that is sent by the user last time, the display type stored in the correspondence between the user identifier and the display type is the text type.
Step 504: and sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message.
When the server receives a first communication message sent by a terminal corresponding to a first user, the server adds a timestamp to the first communication message. And when the server converts the first communication message into a second communication message and sends the second communication message to the terminal corresponding to the second user, the server also sends the timestamp to the terminal corresponding to the second user. And when the terminal corresponding to the second user receives the second communication message and the time stamp, displaying the second communication message according to the time stamp.
The timestamp may be a time when the terminal corresponding to the first user sends the first communication message, or may be a time when the server receives the first communication message, which is not specifically limited in this embodiment of the present invention.
In addition, when the second user wants to display the communication message in a full text form, the terminal corresponding to the second user may transmit a text conversion request message to the server in step 503. In the embodiment of the present invention, when the first user wants to display the communication message in a full text form, the terminal corresponding to the first user may also send a text conversion request message to the server. For convenience of description herein, a third user may be introduced, the third user being any one of the first user and the second user. If the terminal corresponding to the third user does not send the text conversion request message to the server when the conversation starts, but sends the text conversion request to the server in the conversation process, namely, the text conversion request is sent to the server when the conversation is carried out for a period of time, and the text conversion request carries the third user identification. At this time, when the server receives the text conversion request, the server selects a fourth communication message from the communication messages sent to the terminal corresponding to the third user according to the third user identifier, wherein the type of the fourth communication message is a voice type. And converting the fourth communication message into a fifth communication message, wherein the type of the fifth communication message is a text type. And the server sends the fifth communication message to a terminal corresponding to the third user. And when the terminal corresponding to the third user receives the fifth communication message, the terminal corresponding to the third user replaces the displayed fourth communication message with the fifth communication message.
In this case, when the server sends the fifth communication message to the terminal corresponding to the third user, the server also sends the timestamp corresponding to the fifth communication message to the terminal corresponding to the third user. And when the terminal corresponding to the third user receives the fifth communication message and the timestamp corresponding to the fifth communication message, the terminal corresponding to the third user replaces the displayed fourth communication message with the corresponding fifth communication message according to the timestamp corresponding to the fifth communication message.
The terminal corresponding to the third user may replace the displayed fourth communication message with the corresponding fifth communication message according to the reverse order of the timestamps corresponding to the fifth communication message, and may also replace the displayed fourth communication message with the corresponding fifth communication message according to the order of the timestamps corresponding to the fifth communication message. The embodiment of the present invention is not particularly limited to this.
For example, when a communication message is displayed by the above-described method, the conversation interface shown in fig. 1 may be changed to the conversation interface shown in fig. 6.
In the embodiment of the invention, when two users carry out one-to-one communication or at least three users form a communication group to carry out communication, all the communication messages corresponding to the users can be displayed as the communication messages in the text form, so that the phenomenon that the voice bars and the text boxes alternately appear is avoided. And when the user acquires the message content of the communication message, the user can directly check the message content displayed in the text box without clicking a voice bar, so that the method for acquiring the message content is simplified, and the efficiency for acquiring the message content is improved. In addition, according to the method provided by the embodiment of the invention, the user does not need to click the voice bar, and the operability of acquiring the message content is improved when the terminal is in a mobile state.
Fig. 7 is a schematic structural diagram of an apparatus for displaying a communication message according to an embodiment of the present invention. Referring to fig. 7, the apparatus includes: a first receiving module 701, a first obtaining module 702, a first converting module 703 and a first sending module 704;
a first receiving module 701, configured to receive a first communication message, where the first communication message carries a message content and a first user identifier, and a type of the first communication message is a first type;
a first obtaining module 702, configured to obtain, according to the first user identifier, a second user in the same session as the first user;
a first conversion module 703, configured to, if the type of the communication message displayed by the terminal corresponding to the second user is a second type, convert the first communication message into a second communication message based on the message content, where the type of the second communication message is the second type;
the first sending module 704 is configured to send the second communication message to the terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message.
Optionally, when the first type is a text type and the second type is a speech type, the first conversion module includes:
the searching unit is used for searching corresponding voice parameters from the corresponding relation between the stored user identification and the voice parameters according to the first user identification if the type of the communication message displayed by the terminal corresponding to the second user is the second type, wherein the voice parameters comprise intensity, tone and frequency;
and the conversion unit is used for converting the first communication message into the second communication message based on the voice parameter and the message content if the corresponding voice parameter is found.
Optionally, the first conversion module 703 further includes:
the identification unit is used for identifying the voice parameter of the third communication message when the third communication message sent by the terminal corresponding to the first user is received, wherein the type of the third communication message is a second type;
and the storage unit is used for storing the first user identification and the voice parameter in the corresponding relation between the user identification and the voice parameter.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring the preset voice parameters if the corresponding voice parameters are not found;
and the second conversion module is used for converting the first communication message into a second communication message based on the preset voice parameter and the message content.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving a conversion request message, wherein the conversion request message carries a third user identifier, and the third user is any one of the first user and the second user;
the selection module is used for selecting a fourth communication message from the communication messages sent to the terminal corresponding to the third user according to the third user identification, and the type of the fourth communication message is the first type;
the third conversion module is used for converting the fourth communication message into a fifth communication message, and the type of the fifth communication message is a second type;
and the second sending module is used for sending the fifth communication message to the terminal corresponding to the third user, so that the terminal corresponding to the third user replaces the displayed fourth communication message with the fifth communication message.
In the embodiment of the present invention, when two users perform one-to-one communication or at least three users form a communication group to perform communication, all communication messages corresponding to the multiple users may be displayed as communication messages in a voice format or all communication messages in a text format, so as to avoid the phenomenon that a voice bar and a text box appear alternately. And when the user acquires the message content of the communication message, the opposite terminal of the user can continuously play the communication messages of a plurality of voice types or continuously check the message content in the text box, so that the mode of acquiring the message content is simplified, and the efficiency of acquiring the message content is improved. In addition, according to the method provided by the embodiment of the invention, the user does not need to frequently click the voice bar, and the operability of acquiring the message content is improved when the terminal is in a moving state.
It should be noted that: in the device for displaying a communication message provided in the above embodiment, when displaying a communication message, only the division of the above functional modules is taken as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus for displaying a communication message and the method for displaying a communication message provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (11)
1. A method for displaying a communication message, applied to a server, the method comprising:
receiving a first communication message sent by a terminal corresponding to a first user, wherein the first communication message carries message content and a first user identifier, and the type of the first communication message is a first type, wherein if the type of the communication message displayed by the terminal corresponding to the first user is a second type, the terminal corresponding to the first user converts the first communication message into a second communication message according to the type of the displayed communication message and displays the second communication message, and the type of the second communication message is the second type; when a first user inputs the message content at a terminal corresponding to the first user in a voice form, the first type is a voice type, and when the first user inputs the message content at the terminal corresponding to the first user in a text form, the first type is a text type;
determining a second user in the same session with the first user according to the first user identification;
if the type of the communication message displayed by the terminal corresponding to the second user is the second type, converting the first communication message into a second communication message based on the message content, wherein the type of the second communication message is the second type;
sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message;
in the session process, receiving a conversion request message, wherein the conversion request message carries a third user identifier, the conversion request message is used for indicating the target type of the message to be converted, and the third user is any one of the first user and the second user;
and converting the communication message with the type inconsistent with the target type in the communication message sent to the third user into the communication message with the target type according to the conversion request message and the third user identifier, and sending the converted communication message to the terminal of the third user so as to enable the terminal of the third user to replace the communication message with the type inconsistent with the target type.
2. The method of claim 1, wherein said converting the first communication message to a second communication message based on the message content when the first type is a text type and the second type is a voice type comprises:
searching corresponding voice parameters from the corresponding relation between the stored user identification and the voice parameters according to the first user identification, wherein the voice parameters comprise intensity, tone and frequency;
and if the corresponding voice parameter is found, converting the first communication message into a second communication message based on the voice parameter and the message content.
3. The method of claim 2, wherein before searching for the corresponding voice parameter from the stored correspondence between the user identifier and the voice parameter according to the first user identifier, the method further comprises:
when a third communication message sent by a terminal corresponding to the first user is received, identifying a voice parameter of the third communication message, wherein the type of the third communication message is the second type;
storing the first user identification and the voice parameters in a corresponding relation between the user identification and the voice parameters.
4. The method of claim 2, wherein the method further comprises:
if the corresponding voice parameter is not found, acquiring a preset voice parameter;
and converting the first communication message into a second communication message based on the preset voice parameters and the message content.
5. The method according to any of claims 1-4, wherein said converting the communication message with the type inconsistent with the target type in the communication message sent to the third user into the communication message with the target type according to the conversion request message and the third user identifier, and sending the converted communication message to the terminal of the third user, so that the terminal of the third user replaces the communication message with the type inconsistent with the target type, comprises:
selecting a fourth communication message from communication messages sent to a terminal corresponding to the third user according to the third user identifier and the conversion request message, wherein the type of the fourth communication message is the first type, the first type is different from the target type, the conversion request message comprises a voice conversion request message and a text conversion request message, when the conversion request message is the voice conversion request message, the target type is the voice type, when the conversion request message is the text conversion request message, the target type is the text type, and the fourth communication message comprises one or more messages;
converting the fourth communication message into a fifth communication message, wherein the type of the fifth communication message is the second type, and the second type is the same as the target type;
and sending the fifth communication message to a terminal corresponding to the third user, so that the terminal corresponding to the third user replaces the displayed fourth communication message with the fifth communication message.
6. An apparatus for displaying a communication message, the apparatus comprising:
a first receiving module, configured to receive a first communication message sent by a terminal corresponding to a first user, where the first communication message carries a message content and a first user identifier, and a type of the first communication message is a first type, where if the type of the communication message displayed by the terminal corresponding to the first user is a second type, the terminal corresponding to the first user converts the first communication message into a second communication message according to the type of the displayed communication message, and displays the second communication message, where the type of the second communication message is the second type; when a first user inputs the message content at a terminal corresponding to the first user in a voice form, the first type is a voice type, and when the first user inputs the message content at the terminal corresponding to the first user in a text form, the first type is a text type;
the first acquisition module is used for determining a second user in the same session with the first user according to the first user identification;
a first conversion module, configured to, if the type of the communication message displayed by the terminal corresponding to the second user is a second type, convert the first communication message into a second communication message based on the message content, where the type of the second communication message is the second type;
the first sending module is used for sending the second communication message to a terminal corresponding to the second user, so that the terminal corresponding to the second user displays the second communication message;
a second receiving module, configured to receive a conversion request message in a session, where the conversion request message carries a third user identifier, and the conversion request message is used to indicate a target type of a message to be converted, and the third user is any one of the first user and the second user;
a third conversion module, configured to convert, according to the conversion request message and the third user identifier, a communication message that is in a communication message sent to the third user and whose corresponding type is inconsistent with the target type into a communication message of the target type;
and the second sending module is used for sending the converted communication message to the terminal of the third user so as to enable the terminal of the third user to replace the communication message with the type inconsistent with the target type.
7. The apparatus of claim 6, wherein when the first type is a text type and the second type is a speech type, the first conversion module comprises:
a searching unit, configured to search, according to the first user identifier, a corresponding voice parameter from a correspondence between a stored user identifier and the voice parameter if the type of the communication message displayed by the terminal corresponding to the second user is a second type, where the voice parameter includes intensity, tone, and frequency;
and the conversion unit is used for converting the first communication message into a second communication message based on the voice parameter and the message content if the corresponding voice parameter is found.
8. The apparatus of claim 7, wherein the first conversion module further comprises:
the identification unit is used for identifying the voice parameter of a third communication message when the third communication message sent by the terminal corresponding to the first user is received, wherein the type of the third communication message is the second type;
and the storage unit is used for storing the first user identification and the voice parameters in the corresponding relation between the user identification and the voice parameters.
9. The apparatus of claim 7, wherein the apparatus further comprises:
the second acquisition module is used for acquiring the preset voice parameters if the corresponding voice parameters are not found;
and the second conversion module is used for converting the first communication message into a second communication message based on the preset voice parameters and the message content.
10. The apparatus of any one of claims 6-9, wherein the third conversion module is specifically configured to:
selecting a fourth communication message from communication messages sent to a terminal corresponding to the third user according to the third user identifier and the conversion request message, wherein the type of the fourth communication message is the first type, the first type is different from the target type, the conversion request message comprises a voice conversion request message and a text conversion request message, when the conversion request message is the voice conversion request message, the target type is the voice type, when the conversion request message is the text conversion request message, the target type is the text type, and the fourth communication message comprises one or more messages;
a third conversion module, configured to convert the fourth communication message into a fifth communication message, where the type of the fifth communication message is the second type, and the second type is the same as the target type;
accordingly, the number of the first and second electrodes,
the second sending module is specifically configured to: and sending the fifth communication message to a terminal corresponding to the third user, so that the terminal corresponding to the third user replaces the displayed fourth communication message with the fifth communication message.
11. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a method of displaying a communication message according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410423098.1A CN105376134B (en) | 2014-08-26 | 2014-08-26 | Method and device for displaying communication message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410423098.1A CN105376134B (en) | 2014-08-26 | 2014-08-26 | Method and device for displaying communication message |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105376134A CN105376134A (en) | 2016-03-02 |
CN105376134B true CN105376134B (en) | 2020-04-03 |
Family
ID=55377956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410423098.1A Active CN105376134B (en) | 2014-08-26 | 2014-08-26 | Method and device for displaying communication message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105376134B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106919540B (en) * | 2016-08-02 | 2021-07-13 | 创新先进技术有限公司 | Text display method, system and device |
CN106789602B (en) * | 2017-03-15 | 2019-09-06 | Oppo广东移动通信有限公司 | Voice control method for playing back, terminal and mobile terminal |
WO2020051881A1 (en) * | 2018-09-14 | 2020-03-19 | 深圳市欢太科技有限公司 | Information prompt method and related product |
CN109787966B (en) * | 2018-12-29 | 2020-12-01 | 北京金山安全软件有限公司 | Monitoring method and device based on wearable device and electronic device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101079836A (en) * | 2006-12-21 | 2007-11-28 | 腾讯科技(深圳)有限公司 | An instant communication method and system based on asymmetric media |
CN103095557A (en) * | 2012-12-18 | 2013-05-08 | 上海量明科技发展有限公司 | Instant messaging information voice output method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101815257B (en) * | 2009-02-20 | 2013-03-20 | 华为软件技术有限公司 | Method, device and system of text message voice communication and terminal equipment |
-
2014
- 2014-08-26 CN CN201410423098.1A patent/CN105376134B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101079836A (en) * | 2006-12-21 | 2007-11-28 | 腾讯科技(深圳)有限公司 | An instant communication method and system based on asymmetric media |
CN103095557A (en) * | 2012-12-18 | 2013-05-08 | 上海量明科技发展有限公司 | Instant messaging information voice output method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105376134A (en) | 2016-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111756917B (en) | Information interaction method, electronic device and computer readable medium | |
CN106713323B (en) | page content preview method, client, server and system | |
CN104965842B (en) | Method and apparatus are recommended in search | |
US20190230174A1 (en) | Method and Apparatus for Selecting Information Pushed-To Terminal | |
TW201407485A (en) | Device for operating module identification information | |
CN105376134B (en) | Method and device for displaying communication message | |
US11004445B2 (en) | Information processing method, server, terminal, and information processing system | |
CN105337843A (en) | Interaction system and method, client, and background server | |
CN105357475A (en) | Video playing method and device | |
CN108900855B (en) | Live content recording method and device, computer readable storage medium and server | |
JP6580132B2 (en) | Method and apparatus for providing information associated with media content | |
CN108595483B (en) | Data processing method and related device | |
CN109412821B (en) | Message processing method and device and electronic equipment | |
CN106100974B (en) | Information sharing method and device | |
CN105100244A (en) | Head portrait setting method and apparatus | |
CN106034065B (en) | Information display method and device | |
CN112311818B (en) | Method, device, terminal and storage medium for downloading applet data packet | |
CN103490982A (en) | Message processing method and device | |
EP2814211A1 (en) | Method and device for displaying conversation information | |
CN104735482A (en) | Video pushing implementation method, system and device | |
CN104917754A (en) | Video data sending and receiving methods, servers and clients | |
CN105577712A (en) | File uploading method, file uploading device, and file uploading system | |
CN113468346B (en) | Resource processing method and device, electronic equipment and storage medium | |
CN105589616A (en) | Method and apparatus for combining multiple application operations on terminal and terminal | |
CN105681723B (en) | Audio and video call method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |