CN111147354B - Message processing method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN111147354B
CN111147354B CN201911353829.9A CN201911353829A CN111147354B CN 111147354 B CN111147354 B CN 111147354B CN 201911353829 A CN201911353829 A CN 201911353829A CN 111147354 B CN111147354 B CN 111147354B
Authority
CN
China
Prior art keywords
message
message element
attribute
target
character string
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
CN201911353829.9A
Other languages
Chinese (zh)
Other versions
CN111147354A (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.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili Information Technology 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 Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN201911353829.9A priority Critical patent/CN111147354B/en
Publication of CN111147354A publication Critical patent/CN111147354A/en
Application granted granted Critical
Publication of CN111147354B publication Critical patent/CN111147354B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a message processing method, a message processing device, message processing equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: receiving message data sent by a sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; respectively acquiring corresponding message element contents according to the message element attributes; and according to the position identification corresponding to each message element attribute, replacing the corresponding position indication character in the target character string by using each message element content, and displaying the replaced target character string as the target message sent by the sending terminal. The technical scheme provided by the embodiment of the application can reduce the overhead cost of software to a certain extent.

Description

Message processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a message.
Background
Currently, it is more and more common in people's daily life to perform message transmission between terminals, for example, in the field of live webcasting, a certain audience terminal may send a gift sending message and a speech message to other audience terminals through a live webcasting server. In general, the types of messages transmitted between terminals are various, and the gift sending message and the speaking message in the above example belong to different message types.
In the related art, the message transmitted between the terminals may include a message header and a message body in an XML format, where the message header carries type information of the message, and after receiving the message sent by the sending terminal, the receiving terminal may call a corresponding message parser according to the type information carried in the message header, so as to process the content in the message body by using the message parser, thereby obtaining and displaying the message sent by the sending terminal.
However, since different types of messages in the related art need to call different message resolvers for processing, technicians need to write and maintain a large number of message resolvers, which results in high cost of software.
Disclosure of Invention
Based on this, embodiments of the present application provide a message processing method, apparatus, device, and storage medium, which can reduce software cost overhead in a message transmission process.
In a first aspect, a message processing method is provided, where the method includes:
receiving message data sent by a sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; respectively acquiring corresponding message element contents according to the message element attributes; and according to the position identification corresponding to each message element attribute, replacing the corresponding position indication character in the target character string by using each message element content, and displaying the replaced target character string as the target message sent by the sending terminal.
In one embodiment, there is a first message element attribute in the at least one message element attribute, the first message element attribute including a picture storage address; respectively acquiring corresponding message element contents according to the message element attributes, wherein the method comprises the following steps: and acquiring a target picture according to the picture storage address as the message element content corresponding to the first message element attribute.
In one embodiment, a second message element attribute exists in the at least one message element attribute, where the second message element attribute includes a user identifier, and the obtaining of corresponding message element contents according to each message element attribute includes: rendering the user identifier by using a preset rendering mode, and taking the rendered user identifier as the message element content corresponding to the second message element attribute.
In one embodiment, a third message element attribute exists in the at least one message element attribute, where the third message element attribute includes a font format, and the obtaining of corresponding message element contents according to each message element attribute includes: determining a target position indication character corresponding to a target position identification from the target character string, wherein the target position identification corresponds to the third message element attribute, and the target position indication character comprises a text character; rendering the text character by using the font format, and taking the rendered text character as the message element content corresponding to the third message element attribute.
In one embodiment, the message element attribute includes a click attribute, where the click attribute is used to indicate an instruction that needs to be executed after a message element content corresponding to the message element attribute is clicked, and after the replaced target character string is presented as a target message sent by the sending terminal, the method further includes: displaying the target message; and after the clicking operation on the message element content in the target message is detected, executing an instruction according to the clicking attribute in the message element attribute corresponding to the clicked message element content.
In a second aspect, a message processing method is provided, and the method includes:
acquiring at least one message element attribute corresponding to a target message to be sent; generating a target character string and position identifications respectively corresponding to the attributes of each message element according to the message format corresponding to the target message, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; and sending message data to a receiving terminal, wherein the message data comprises the target character string, at least one message element attribute and at least one position identifier.
In a third aspect, a message processing apparatus is provided, the apparatus including:
the receiving module is used for receiving message data sent by the sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications;
the acquisition module is used for respectively acquiring corresponding message element contents according to the message element attributes;
and the replacing module is used for replacing the corresponding position indication character in the target character string by using the content of each message element according to the position identification corresponding to each message element attribute, and displaying the replaced target character string as the target message sent by the sending terminal.
In one embodiment, there is a first message element attribute in the at least one message element attribute, the first message element attribute including a picture storage address; the acquisition module is specifically configured to: and acquiring a target picture according to the picture storage address as the message element content corresponding to the first message element attribute.
In one embodiment, a second message element attribute exists in the at least one message element attribute, where the second message element attribute includes a user identifier, and the obtaining module is specifically configured to: rendering the user identifier by using a preset rendering mode, and taking the rendered user identifier as the message element content corresponding to the second message element attribute.
In one embodiment, a third message element attribute exists in the at least one message element attribute, where the third message element attribute includes a font format, and the obtaining module is specifically configured to: determining a target position indication character corresponding to a target position identification from the target character string, wherein the target position identification corresponds to the third message element attribute, and the target position indication character comprises a text character; rendering the text character by using the font format, and taking the rendered text character as the message element content corresponding to the third message element attribute.
In one embodiment, the message element attribute comprises a click attribute, the click attribute is used for indicating an instruction which needs to be executed after the message element content corresponding to the message element attribute is clicked, and the device further comprises an instruction execution module;
the instruction execution module is used for displaying the target message and executing the instruction according to the click attribute in the message element attribute corresponding to the clicked message element content after the click operation of the message element content in the target message is detected.
In a fourth aspect, there is provided a message processing apparatus, comprising:
the acquisition module is used for acquiring at least one message element attribute corresponding to a target message to be sent;
a generating module, configured to generate a target character string and location identifiers respectively corresponding to attributes of message elements according to a message format corresponding to the target message, where the target character string includes location indicator characters respectively corresponding to the location identifiers;
and the sending module is used for sending message data to the receiving terminal, wherein the message data comprises the target character string, at least one message element attribute and at least one position identifier.
In a fifth aspect, there is provided a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, implements the message processing method as described in any of the first aspects above.
A sixth aspect provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the message processing method according to any of the first aspects above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
a receiving terminal of the message receives message data sent by a sending terminal, the message data comprises a target character string, at least one message element attribute and position identifiers respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifiers, then the receiving terminal respectively obtains corresponding message element contents according to the message element attributes, and respectively replaces the corresponding position indication characters in the target character string by the message element contents according to the position identifiers respectively corresponding to the message element attributes, and takes the replaced target character string as a target message sent by the sending terminal, so that the receiving terminal can obtain the corresponding message element contents according to the message element attributes to achieve the purpose of rendering, and then the receiving terminal can replace the position indication characters in the target character string by the message element contents, therefore, the receiving terminal can adopt the same assembly logic to assemble the messages corresponding to different types of messages, and the receiving terminal does not need to render the messages through the message parser, so that technicians do not need to write and maintain the message parser for different types of messages in the message processing method provided by the embodiment of the application, and the overhead cost of software can be reduced.
Drawings
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of a message processing method according to an embodiment of the present application;
fig. 3 is a flowchart of another message processing method according to an 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 block diagram of another message processing apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of another message processing apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In practical applications, message transmission and message display are increasingly common in people's daily life. Taking live webcasting as an example, a playing interface of live video may generally include a public screen, where the public screen is a main carrier of live viewers and anchor interaction, and may show various types of messages sent by terminals corresponding to the live viewers, where the various types of messages may include a speech message, a gift-sending message, and the like.
In practical applications, the public screen supports various message display forms, for example, the public screen supports display of foreground colors and background colors of text characters, the public screen supports display of underlined and bold text characters, the public screen supports display of emoticons, static pictures and dynamic pictures, a message in the public screen can be clicked, and after the click, the message can jump to other pages.
Because the public screen supports the display of various types of messages and supports various message display forms, the message system involved in the public screen is very complex, and how to process the messages so that the processed messages can be suitable for the public screen to be displayed is an important problem.
In the related art, a message to be displayed on a public screen may be packaged according to an XML format, and the packaged message may include a message header and a message body, where the message header includes type information of the message and the message body includes content of the message. After receiving the packaged message, a receiving terminal of the message (which may be a terminal corresponding to a live viewer) may parse the message header to obtain type information of the message through parsing, and then the receiving terminal may call a corresponding message parser according to the type information to render the message content in the message body by using the message parser, and the receiving terminal may display the rendered message content in a public screen.
However, although the solutions provided by the related art can process different types of messages and implement various message display forms through rendering, they still have many disadvantages, and one of them will be described in the embodiments of the present application.
First, the message packed in the XML format is often complex in format and large in size, so that it is difficult to parse the message, and occupies a large transmission bandwidth.
A second, different type of message needs to invoke a different message parser for rendering, so a technician needs to write and maintain a larger number of message parsers, which results in a larger cost overhead for software.
Thirdly, since the message parser can only render the message content in the message body with a specific format, if the format of the message body is changed, the message parser cannot render the message content in the message body, that is, the problem that the format of the message body is not compatible with the version of the message parser easily occurs in the scheme provided by the related art.
Fourthly, because different types of messages may have quite similar message bodies, codes for rendering the quite similar message bodies are generally similar, however, in the scheme provided by the related art, different types of messages need to call different message parsers for rendering, so that different message parsers may have quite similar codes, and because the quite similar codes belong to different message parsers, multiplexing of the quite similar codes cannot be realized, which results in code redundancy.
In view of the above, an embodiment of the present application provides a message processing method, in which a receiving terminal of a message may receive message data sent by a sending terminal, where the message data includes a target character string, at least one message element attribute, and a location identifier corresponding to each message element attribute, where the target character string includes a location indicator character corresponding to each location identifier, and then the receiving terminal may obtain corresponding message element contents according to each message element attribute, replace the corresponding location indicator character in the target character string with each message element content according to the location identifier corresponding to each message element attribute, and use the replaced target character string as a target message sent by the sending terminal, so that the receiving terminal may obtain the corresponding message element contents according to the message element attributes, therefore, the receiving terminal can adopt the same assembly logic to assemble the messages corresponding to different types of messages, and the receiving terminal does not need to render the messages through a message parser, so that technical personnel do not need to write and maintain the message parsers for different types of messages, and the overhead cost of software can be reduced.
Further, since technicians are not required to write and maintain the message parser, the problem that the message body format is incompatible with the message parser version can be solved, and the problem of code redundancy can be solved.
In addition, in the message processing method provided in the embodiment of the present application, the message data transmitted between the sending terminal and the receiving terminal only includes the target character string, at least one message element attribute, and the location identifier corresponding to each message element attribute, and compared with the message packaged according to the XML format, the size of the message processing method is smaller and the message processing method is easy to parse.
In the following, a brief description will be given of an implementation environment related to the message processing method provided in the embodiment of the present application.
As shown in fig. 1, the enforcement environment may include a sending terminal 101 of a message, a live server 102, and a receiving terminal 103 of the message.
In this embodiment of the application, the sending terminal 101 may send the message data to the live broadcast server 102 through wired or wireless network connection, after receiving the message data, the live broadcast server 102 may send the message data to the receiving terminal 103 through wired or wireless network connection, and the receiving terminal 103 may obtain the target message according to the message data and display the target message on a public screen.
The sending terminal 101 and the receiving terminal 103 may be terminals corresponding to live viewers in live webcasting, the sending terminal 101 and the receiving terminal 103 may be smart phones, tablet computers, desktop computers, and the like, and the live server 102 may be one server or a server cluster composed of a plurality of servers.
Referring to fig. 2, a flowchart of a message processing method provided in an embodiment of the present application is shown, where the message processing method can be applied to the receiving terminal 103 in the embodiment shown in fig. 1. As shown in fig. 2, the message processing method may include the steps of:
step 201, the receiving terminal receives the message data sent by the sending terminal.
The message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, and the target character string comprises position indication characters respectively corresponding to the position identifications.
In practical applications, a message transmitted between a sending terminal and a receiving terminal (i.e. a message that needs to be presented on a public screen) may generally include renderable message element content, where the renderable message element content refers to the message element content that needs to be rendered before being presented on the public screen. For example, pictures are renderable message element content, certain specific symbols (e.g., user identifications) are renderable message element content, and certain text characters having a particular font format are renderable message element content.
The message element attribute in the message data may be used to indicate an attribute of the renderable message element content, and optionally, in this embodiment, the message element attribute may include a picture storage address, a user identifier, or a font format.
Wherein the picture storage address may include one of a local storage address and a remote storage address. The local storage address is a storage address in the local of the receiving terminal, for example, the local storage address may be local:// image/businessname ═ picture 1. The remote storage address is a storage address in a server (e.g., a live server or a picture server), and optionally, the remote storage address may be implemented by using an HTTP protocol or an FTP protocol. The user identifier may be an identifier of a user corresponding to the sending terminal (the user may be a live viewer), for example, the user identifier may be an ID of the user corresponding to the sending terminal, a nickname of the user corresponding to the sending terminal, or the like. Font formats may include foreground colors, background colors, font types of text characters, and whether bold or italic, etc.
In an alternative embodiment of the present application, the location identifier may be a location index value, for example, the location identifier may be 0, 1, 2, 3, etc.
In an alternative embodiment of the present application, the target string may include text characters in addition to the location indicator characters. Alternatively, the position indicator character may be a placeholder.
An exemplary target string is shown below: % { # }% { # } 5% { flowers }% { # } was sent to the anchor% { # }.
Wherein% { # } and% { flower } are both placeholders, i.e., location indicating characters as described above, wherein% { # } is a placeholder that does not include a text character and% { flower } is a placeholder that includes a text character, wherein the text character in the placeholder is "flower". "give anchor" and "5 sent" as text characters. As described above, each location indicator character corresponds to one location identification, e.g., the 1 st placeholder% { # } may correspond to a location index value of 0, the 2 nd placeholder% { # } may correspond to a location index value of 1, the 3 rd placeholder% { # } may correspond to a location index value of 2, the 4 th placeholder% { flower } may correspond to a location index value of 3, and the 5 th placeholder% { # } may correspond to a location index value of 4.
In an optional embodiment of the present application, the receiving terminal may receive the target plain text after the serialization processing sent by the sending terminal, and by performing the deserialization processing on the target plain text, the receiving terminal may obtain the message data described above.
An exemplary target plain text is shown below:
{
"text"% { # }% { # } sends 5 pieces% { flower }% { # } to the anchor% { # }
{
“url”:“local://image/levelname=Lv5”,
“pos”:“0”
}
{
"nick" means "Zhang III",
“pos”:“1”
}
{
"nick" means "LiSi",
“pos”:“2”
}
{
“type”:“aa”,
“pos”:“3”
}
{
“url”:“local://image/giftname=flower”,
“pos”:“4”
}
by performing deserialization processing on the target plain text, the receiving terminal can obtain 5 message element attributes, wherein the 5 message element attributes respectively include a picture storage address: local:// image/levelname ═ Lv5, user identification: zhang III, user identification: lie four, font format: aa and picture storage address: local:// image/giftname ═ flower. Meanwhile, the receiving terminal may obtain the location identifiers respectively corresponding to the 5 message element attributes, which are 0, 1, 2, 3, and 4, respectively. In addition, the receiving terminal may also obtain a target string: the% { # }% { # } sends 5% { flowers }% { # } to the anchor% { # } and each placeholder in the target character string corresponds to a position mark, wherein the 1 st placeholder% { # } corresponds to a position mark 0, the 2 nd placeholder% { # } corresponds to a position mark 1, the 3 rd placeholder% { # } corresponds to a position mark 2, the 4 th placeholder% { flowers } corresponds to a position mark 3, and the 5 th placeholder% { # } corresponds to a position mark 4.
Step 202, the receiving terminal obtains the corresponding message element content according to each message element attribute.
As described above, the message element attribute may be used to indicate an attribute of renderable message element content, and thus, in step 202, the receiving terminal may respectively acquire the content of the message element corresponding to each message element attribute according to the attribute indicated by each message element attribute.
And 203, the receiving terminal replaces the corresponding position indication character in the target character string by using the content of each message element according to the position identification corresponding to each message element attribute, and displays the replaced target character string as the target message sent by the sending terminal.
In an optional embodiment of the present application, the receiving terminal may sort the content of each message element according to the position identifier corresponding to each message element attribute, so as to obtain a message element content queue.
For example, if the position identifier corresponding to the message element attribute a is 0, the position identifier corresponding to the message element attribute b is 1, the position identifier corresponding to the message element attribute c is 2, the position identifier corresponding to the message element attribute d is 3, and the position identifier corresponding to the message element attribute e is 4, the receiving terminal may sort the message element content aa corresponding to the message element attribute a, the message element content bb corresponding to the message element attribute b, the message element content cc corresponding to the message element attribute c, the message element content dd corresponding to the message element attribute d, and the message element content ee corresponding to the message element attribute e according to the position identifiers 0, 1, 2, 3, and 4, and the result of the sorting is: message element content aa, message element content bb, message element content cc, message element content dd, and message element content ee.
After the content of each message element is sequenced, the content of the message elements can be sequentially acquired from the message element content queue according to the sequencing order, and after the content of the message element is acquired each time, the receiving terminal can replace a first position indication character in the target character string by using the acquired content of the message element, and finally the replaced target character string is obtained.
Optionally, in an embodiment of the present application, the message element attribute may further include a click attribute, where the click attribute is used to indicate that the message element content corresponding to the message element attribute is clicked and then a command that the receiving terminal needs to execute is received.
In the embodiment of the application, after obtaining the target message, the receiving terminal may display the target message in a public screen, and in the process of displaying the target message, if the click operation on the message element content in the target message is detected, the receiving terminal may execute a corresponding instruction according to a click attribute in the message element attribute corresponding to the clicked message element content. For example, the instruction may be an instruction of a jump interface, and the instruction may be an instruction that shows a preset animation effect, and the like, which is not specifically limited in this embodiment of the application.
In this embodiment, a message element attribute including a picture storage address may be referred to as a first message element attribute, a message element attribute including a user identifier may be referred to as a second message element attribute, and a message element attribute including a font format may be referred to as a third message element attribute.
Next, in the embodiments of the present application, a brief description will be given of technical processes for acquiring a corresponding message element content according to a first message element attribute, acquiring a corresponding message element content according to a second message element attribute, and acquiring a corresponding message element content according to a third message element attribute, respectively.
Firstly, the corresponding message element content is obtained according to the first message element attribute.
And the receiving terminal acquires a target picture according to the picture storage address and takes the target picture as the message element content corresponding to the first message element attribute.
As an example, the picture storage address may be local:// image/giftname ═ flow, and the receiving terminal may obtain the target picture locally according to the picture storage address, where the obtained target picture is the content of the message element.
And secondly, acquiring corresponding message element content according to the second message element attribute.
And rendering the user identification by using a preset rendering mode, and taking the rendered user identification as the message element content corresponding to the second message element attribute.
As shown in the above example, the user identifier may be "zhang san", and the receiving terminal may render the "zhang san" according to a preset rendering manner, so that the rendered "zhang san" has a special display effect, for example, the special display effect may be a light-emitting effect. Wherein the rendered three-page is the content of the message element.
Thirdly, acquiring corresponding message element content according to the third message element attribute
And the receiving terminal determines a target position indication character corresponding to the target position identification from the target character string, wherein the target position identification corresponds to the third message element attribute, and the target position indication character comprises a text character.
As shown in the above example, the message element attribute including the font format aa is the third message element attribute, the corresponding location identifier 3 is the target location identifier, the placeholder (i.e., the location indicator character)% { flower } corresponding to the target location identifier is the target location indicator character, and the target location indicator character includes the text character "flower".
After determining the target position indication character, the receiving terminal may render a text character in the target position indication character by using a font format, and use the rendered text character as the message element content corresponding to the third message element attribute.
As exemplified above, the receiving terminal may render the text character "flower" using the font format aa, and use the rendered text character "flower" as the message element content.
As an example, the target string after replacement may be: picture a shows three pictures of 5 flowers in the anchor plum four picture B.
The picture a in the replaced target character string may be a user-level picture obtained according to a picture storage address local:// image/levelname ═ Lv5, where "zhangsan" in the replaced target character string is rendered "zhangsan" with a special display effect, "liquan" in the replaced target character string is rendered "liquan" with a special display effect, "flower" in the replaced target character string is rendered "flower" according to a font format, and the picture B in the replaced target character string may be a picture of a flower obtained according to a picture storage address local:// image/giftname ═ flower.
Referring to fig. 3, a flowchart of a message processing method provided in an embodiment of the present application is shown, where the message processing method can be applied to the sending terminal 101 in the embodiment shown in fig. 1. As shown in fig. 3, the message processing method may include the steps of:
step 301, the sending terminal obtains at least one message element attribute corresponding to a target message to be sent.
Step 302, the sending terminal generates a target character string and a position identifier corresponding to each message element attribute according to the message format corresponding to the target message.
The target character string includes position indication characters corresponding to the position identifications respectively.
Step 303, the sending terminal sends message data to the receiving terminal.
Wherein the message data includes a target string, at least one message element attribute, and at least one location identification.
Referring to fig. 4, a block diagram of a message processing apparatus 400 according to an embodiment of the present application is shown, where the message processing apparatus 400 may be configured in the receiving terminal described above. As shown in fig. 4, the message processing apparatus 400 may include: a receiving module 401, an obtaining module 402 and a replacing module 403.
The receiving module 401 is configured to receive message data sent by a sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications.
The obtaining module 402 is configured to obtain corresponding message element contents according to each message element attribute.
The replacing module 403 is configured to replace the corresponding position indication character in the target character string with each message element content according to the corresponding position identifier of each message element attribute, and display the replaced target character string as the target message sent by the sending terminal.
In one embodiment of the present application, there is a first message element attribute in the at least one message element attribute, the first message element attribute including a picture storage address; the obtaining module 402 is specifically configured to: and acquiring a target picture according to the picture storage address as the message element content corresponding to the first message element attribute.
In an embodiment of the present application, a second message element attribute exists in the at least one message element attribute, where the second message element attribute includes a user identifier, and the obtaining module 402 is specifically configured to: rendering the user identifier by using a preset rendering mode, and taking the rendered user identifier as the message element content corresponding to the second message element attribute.
In an embodiment of the application, a third message element attribute exists in the at least one message element attribute, where the third message element attribute includes a font format, and the obtaining module 402 is specifically configured to: determining a target position indication character corresponding to a target position identification from the target character string, wherein the target position identification corresponds to the third message element attribute, and the target position indication character comprises a text character; rendering the text character by using the font format, and taking the rendered text character as the message element content corresponding to the third message element attribute.
Referring to fig. 5, an embodiment of the present application further provides another message processing apparatus 500, where the message processing apparatus 500 includes, in addition to the modules included in the message processing apparatus 400, optionally, the message processing apparatus 500 may further include an instruction execution module 404.
In one embodiment of the present application, the message element attribute includes a click attribute, and the click attribute is used to indicate an instruction to be executed after the message element content corresponding to the message element attribute is clicked.
The instruction executing module 404 is configured to display the target message, and execute an instruction according to a click attribute in a message element attribute corresponding to a clicked message element content after detecting a click operation on the message element content in the target message.
The message processing apparatus provided in the embodiment of the present application can implement the method embodiments described above, and the implementation principle and the technical effect are similar, which are not described herein again.
For the specific definition of the message processing device, reference may be made to the above definition of the message processing method, which is not described herein again. The respective modules in the message processing apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Referring to fig. 6, a block diagram of a message processing apparatus 600 according to an embodiment of the present application is shown, where the message processing apparatus 600 may be configured in the sending terminal described above. As shown in fig. 6, the message processing apparatus 600 may include:
the obtaining module 601 is configured to obtain at least one message element attribute corresponding to a target message to be sent.
The generating module 602 is configured to generate a target character string and location identifiers respectively corresponding to attributes of message elements according to a message format corresponding to the target message, where the target character string includes location indicator characters respectively corresponding to the location identifiers;
the sending module 603 is configured to send message data to the receiving terminal, where the message data includes the target character string, at least one attribute of the message element, and at least one location identifier.
The message processing apparatus provided in the embodiment of the present application can implement the method embodiments described above, and the implementation principle and the technical effect are similar, which are not described herein again.
For the specific definition of the message processing device, reference may be made to the above definition of the message processing method, which is not described herein again. The respective modules in the message processing apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment of the present application, a computer device is provided, and the computer device may be a terminal or a server, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor and a memory connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The computer program is executed by a processor to implement a message processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment of the present application, there is provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program:
receiving message data sent by a sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; respectively acquiring corresponding message element contents according to the message element attributes; and according to the position identification corresponding to each message element attribute, replacing the corresponding position indication character in the target character string by using each message element content, and displaying the replaced target character string as the target message sent by the sending terminal.
In an embodiment of the application, the processor, when executing the computer program, further performs the following steps: and acquiring a target picture according to the picture storage address as the message element content corresponding to the first message element attribute.
In an embodiment of the application, the processor, when executing the computer program, further performs the following steps: rendering the user identifier by using a preset rendering mode, and taking the rendered user identifier as the message element content corresponding to the second message element attribute.
In an embodiment of the application, the processor, when executing the computer program, further performs the following steps: determining a target position indication character corresponding to a target position identification from the target character string, wherein the target position identification corresponds to the third message element attribute, and the target position indication character comprises a text character; rendering the text character by using the font format, and taking the rendered text character as the message element content corresponding to the third message element attribute.
In an embodiment of the present application, the message element attribute includes a click attribute, where the click attribute is used to indicate an instruction that needs to be executed after a message element content corresponding to the message element attribute is clicked, and when the processor executes the computer program, the processor further implements the following steps: displaying the target message; and after the clicking operation on the message element content in the target message is detected, executing an instruction according to the clicking attribute in the message element attribute corresponding to the clicked message element content.
The implementation principle and technical effect of the computer device provided by the embodiment of the present application are similar to those of the method embodiment described above, and are not described herein again.
In one embodiment of the present application, there is provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program:
acquiring at least one message element attribute corresponding to a target message to be sent; generating a target character string and position identifications respectively corresponding to the attributes of each message element according to the message format corresponding to the target message, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; and sending message data to a receiving terminal, wherein the message data comprises the target character string, at least one message element attribute and at least one position identifier.
The implementation principle and technical effect of the computer device provided by the embodiment of the present application are similar to those of the method embodiment described above, and are not described herein again.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of:
receiving message data sent by a sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; respectively acquiring corresponding message element contents according to the message element attributes; and according to the position identification corresponding to each message element attribute, replacing the corresponding position indication character in the target character string by using each message element content, and displaying the replaced target character string as the target message sent by the sending terminal.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of: and acquiring a target picture according to the picture storage address as the message element content corresponding to the first message element attribute.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of: rendering the user identifier by using a preset rendering mode, and taking the rendered user identifier as the message element content corresponding to the second message element attribute.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: determining a target position indication character corresponding to a target position identification from the target character string, wherein the target position identification corresponds to the third message element attribute, and the target position indication character comprises a text character; rendering the text character by using the font format, and taking the rendered text character as the message element content corresponding to the third message element attribute.
The message element attribute comprises a click attribute, the click attribute is used for indicating an instruction which needs to be executed after the message element content corresponding to the message element attribute is clicked, and in one embodiment of the application, when being executed by a processor, the computer program further realizes the following steps: displaying the target message; and after the clicking operation on the message element content in the target message is detected, executing an instruction according to the clicking attribute in the message element attribute corresponding to the clicked message element content.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of:
acquiring at least one message element attribute corresponding to a target message to be sent; generating a target character string and position identifications respectively corresponding to the attributes of each message element according to the message format corresponding to the target message, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; and sending message data to a receiving terminal, wherein the message data comprises the target character string, at least one message element attribute and at least one position identifier.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (7)

1. A method of message processing, the method comprising:
receiving message data sent by a sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; the message element attribute comprises a click attribute, and the click attribute is used for indicating an instruction which needs to be executed after the message element content corresponding to the message element attribute is clicked;
respectively acquiring corresponding message element contents according to the message element attributes;
according to the position identification corresponding to each message element attribute, replacing the corresponding position indication character in the target character string by using each message element content, and displaying the replaced target character string as the target message sent by the sending terminal;
and after the clicking operation on the message element content in the target message is detected, executing an instruction according to the clicking attribute in the message element attribute corresponding to the clicked message element content.
2. The method of claim 1, wherein a first message element attribute exists in the at least one message element attribute, the first message element attribute comprising a picture storage address; the obtaining of the corresponding message element content according to each message element attribute includes:
and acquiring a target picture according to the picture storage address as the message element content corresponding to the first message element attribute.
3. The method according to claim 1, wherein a second message element attribute exists in the at least one message element attribute, the second message element attribute including a user identifier, and the obtaining the corresponding message element content according to each of the message element attributes respectively comprises:
rendering the user identifier by using a preset rendering mode, and taking the rendered user identifier as the message element content corresponding to the second message element attribute.
4. The method according to claim 1, wherein a third message element attribute exists in the at least one message element attribute, the third message element attribute including a font format, and the obtaining the corresponding message element content according to each of the message element attributes respectively comprises:
determining a target position indicating character corresponding to a target position identifier from the target character string, wherein the target position identifier corresponds to the third message element attribute, and the target position indicating character comprises a text character;
rendering the text characters by using the font format, and taking the rendered text characters as the message element content corresponding to the third message element attribute.
5. A message processing apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving message data sent by the sending terminal; the message data comprises a target character string, at least one message element attribute and position identifications respectively corresponding to the message element attributes, wherein the target character string comprises position indication characters respectively corresponding to the position identifications; the message element attribute comprises a click attribute, and the click attribute is used for indicating an instruction which needs to be executed after the message element content corresponding to the message element attribute is clicked;
the acquisition module is used for respectively acquiring corresponding message element contents according to the message element attributes;
the replacing module is used for replacing the corresponding position indication character in the target character string by using the content of each message element according to the position identification corresponding to each message element attribute, and displaying the replaced target character string as the target message sent by the sending terminal;
and the instruction execution module is used for executing an instruction according to the click attribute in the message element attribute corresponding to the clicked message element content after the click operation on the message element content in the target message is detected.
6. A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, implements a message processing method as claimed in any one of claims 1 to 4.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a message processing method according to any one of claims 1 to 4.
CN201911353829.9A 2019-12-25 2019-12-25 Message processing method, device, equipment and storage medium Active CN111147354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911353829.9A CN111147354B (en) 2019-12-25 2019-12-25 Message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911353829.9A CN111147354B (en) 2019-12-25 2019-12-25 Message processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111147354A CN111147354A (en) 2020-05-12
CN111147354B true CN111147354B (en) 2022-04-26

Family

ID=70519862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911353829.9A Active CN111147354B (en) 2019-12-25 2019-12-25 Message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111147354B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112672181A (en) * 2020-12-25 2021-04-16 广州博冠信息科技有限公司 Information processing method and device, computer storage medium and electronic equipment
CN115150349A (en) * 2021-03-30 2022-10-04 北京字节跳动网络技术有限公司 Message processing method, device, equipment and storage medium
CN113255291A (en) * 2021-05-31 2021-08-13 杭州米络星科技(集团)有限公司 Live broadcast room message processing method and device and terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200430B (en) * 2012-01-04 2017-05-31 华为终端有限公司 personal content sharing method, system, server and terminal device
CN103685665A (en) * 2012-09-11 2014-03-26 中兴通讯股份有限公司 Sending method and device for text contents
CN108416009A (en) * 2018-03-01 2018-08-17 广东欧珀移动通信有限公司 Text searching method, device, storage medium and the mobile terminal of mobile terminal
CN108804631A (en) * 2018-05-31 2018-11-13 北京字节跳动网络技术有限公司 Emoticon storage method, device, computer readable storage medium and terminal
CN110209315B (en) * 2019-06-11 2021-11-02 北京字节跳动网络技术有限公司 Method and device for displaying characters in user interface, electronic equipment and storage medium
CN110489386A (en) * 2019-08-06 2019-11-22 Oppo广东移动通信有限公司 Information processing method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN111147354A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111147354B (en) Message processing method, device, equipment and storage medium
CN103942225B (en) A kind of resource transfer method, client and the system of mixed type applications client
AU2016382741B2 (en) Interface data displaying method and device
US10795629B2 (en) Text and custom format information processing method, client, server, and computer-readable storage medium
JP2020511711A (en) Message processing method, storage medium, and computer device
CN107092625B (en) Data configuration method, data processing method and device
US7609280B2 (en) High level graphics stream
US11924503B2 (en) Bullet comment presentation method and system
CN110958462A (en) Live broadcast activity page display method and device, storage medium and live broadcast system
US8706803B1 (en) Client-side generation of preliminary version of network page
US20240007701A1 (en) Continuing video playback when switching from a dynamic page to a non-dynamic page
CN113672405A (en) Data interaction system and page display method based on data interaction system
CN112486806A (en) Test case execution method and device, electronic equipment and readable storage medium
CN111223155A (en) Image data processing method, image data processing device, computer equipment and storage medium
CN109525852A (en) Live video method for stream processing, device, system and computer readable storage medium
CN106878145B (en) Display method, display device and display system of user-defined picture
CN109522066B (en) Interactive graph display method in information list
CN109614592B (en) Text processing method and device, storage medium and electronic equipment
CN111258434A (en) Method, device, equipment and storage medium for inserting pictures into chat interface
CN106202296B (en) Local updating method and system for webpage
CN111064986A (en) Animation data sending method with transparency, animation data playing method and computer equipment
CN106156308B (en) Local updating method and system for webpage
CN113946615A (en) Data structuring processing method, device, equipment and storage medium
CN114564270A (en) List component rendering method, list component rendering method, page front-end display method, device, equipment and medium
CN108376161B (en) Method, device, terminal and storage medium for displaying webpage

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
TA01 Transfer of patent application right

Effective date of registration: 20210115

Address after: 511400 3108, 79 Wanbo 2nd Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Applicant after: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 511400 24 / F, block B1, Wanda Plaza, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Applicant before: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant