CN111405342B - Rich text message display method, device, system, medium and electronic equipment - Google Patents

Rich text message display method, device, system, medium and electronic equipment Download PDF

Info

Publication number
CN111405342B
CN111405342B CN202010187234.7A CN202010187234A CN111405342B CN 111405342 B CN111405342 B CN 111405342B CN 202010187234 A CN202010187234 A CN 202010187234A CN 111405342 B CN111405342 B CN 111405342B
Authority
CN
China
Prior art keywords
display
information
message
picture
rich text
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
CN202010187234.7A
Other languages
Chinese (zh)
Other versions
CN111405342A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010187234.7A priority Critical patent/CN111405342B/en
Publication of CN111405342A publication Critical patent/CN111405342A/en
Application granted granted Critical
Publication of CN111405342B publication Critical patent/CN111405342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Abstract

The present disclosure relates to a rich text message display method, apparatus, system, medium, and electronic device, the method comprising: the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server; constructing a display view of the rich text message according to the display content information and the display format information; sending the display view to a message main thread to display the display view by the message main thread. Therefore, the rich text message can be analyzed by the message sub-thread, and the data processing pressure of the message main thread can be effectively relieved. And the message sub-thread constructs a display view based on the rich text message, so that the message main thread can directly display based on the display view, the rendering time required by the rich text message display can be effectively shortened, the rich text message is completely displayed through one-time construction, and the response efficiency and the real-time performance of the rich text message display are improved.

Description

Rich text message display method, device, system, medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a rich text message display method, apparatus, system, medium, and electronic device.
Background
With the development of computer technology, various real-time interactive applications have come into play. Taking a live broadcast room as an example, a large number of users usually comment in real time, Text comments and picture comments, gift messages and the like can be supported in the prior art, and the comment content is usually displayed by adopting a Rich Text Format (RTF) message (i.e., a multi-Text Format).
In the prior art, because there are multiple text formats in the rich text format message, when rendering and displaying the rich text message, the rich text message is generally received and parsed by a message main thread, and then spliced and rendered according to the parsed result to display the rich text message. In the above scheme, because the loading times of the multiple text formats are different, multiple renderings are usually needed to complete the display of the rich text format message, the rendering time is long, the message resolution complexity is high, and the problem of message blocking easily occurs in a large number of user interaction scenes, so that the use requirement of a high-instantaneity scene is difficult to meet.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a rich text message display method, the method comprising:
the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server;
constructing a display view of the rich text message according to the display content information and the display format information;
sending the display view to a message main thread to display the display view by the message main thread.
In a second aspect, the present disclosure provides a rich text message display apparatus, the apparatus comprising:
the determining module is used for determining display content information and display format information corresponding to the rich text message according to the rich text message received from the server by the message sub-thread;
the construction module is used for constructing a display view of the rich text message according to the display content information and the display format information;
and the sending module is used for sending the display view to a message main thread so that the message main thread displays the display view.
In a third aspect, the present disclosure provides a rich text message display system, the system comprising:
one or more message sub-threads for performing the steps of the method of the first aspect;
and the message main thread is communicated with the message sub thread and is used for receiving the display view from the message sub thread and displaying the display view.
In a fourth aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method of the first aspect.
In a fifth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method of the first aspect.
In the technical scheme, the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server, constructs a display view of the rich text message according to the display content information and the display format information, and sends the display view to the message main thread so that the message main thread displays the display view. Therefore, through the technical scheme, the rich text message can be analyzed by the message sub-thread, so that the data processing pressure of the message main thread can be effectively relieved, and the real-time performance and the efficiency of the message main thread for displaying the message are improved. And the message sub-thread constructs a display view based on the rich text message, so that the message main thread can directly display based on the display view, the rendering time required by the rich text message display can be effectively shortened, the rich text message can be completely displayed through one-time construction, and the response efficiency and the real-time performance of the rich text message display are improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
fig. 1 is a flowchart of a rich text message display method provided by an embodiment of the present disclosure;
FIG. 2 is a flow diagram of an exemplary implementation of constructing a display view of a rich text message from display content information and display format information;
FIG. 3 is a flow diagram of an exemplary implementation of rendering a display view of text corresponding to text information according to display format information;
FIG. 4 is a block diagram of a rich text message display device provided by one embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Fig. 1 is a flowchart of a rich text message display method provided for one embodiment of the present disclosure, and as shown in fig. 1, the method includes:
in S11, the message sub-thread determines display content information and display format information corresponding to the rich text message based on the rich text message received from the server.
In the embodiment of the present disclosure, when receiving a rich text message from a message interface of a server, the rich text message is received through a message sub-thread, and the rich text message is analyzed through the message sub-thread, so as to obtain the display content information and the display format information. Taking a live room comment scene as an example, the display content information may be content of a specific comment, and the display format information is used to indicate how the content of the comment is displayed, such as what font, font size, color, and the like are adopted. The parsing of the rich text message is a conventional technique in the art, and is not described herein again.
In S12, a display view of the rich text message is constructed from the display content information and the display format information.
Wherein the display view is used to represent a specific representation of the rich text message when displayed in the display area, e.g., a final representation of the rich text message when displayed in the comment area. Illustratively, a certain number of ItemViews may be built and cached in each message child thread in advance, and therefore, the ItemView may be directly used when building the display view of the rich text message, reducing the overhead of creating the ItemView.
In S13, a display view is sent to the message main thread to be displayed by the message main thread.
After the message sub-thread constructs the display view, the display view can be thrown out to be processed by the message main thread, so that the message main thread can directly acquire the display view when needing to display the message and perform rendering display based on the display view. In the prior art, based on the result of parsing and splicing the rich text message, the rich text message is rendered by TextView. In the present disclosure, the message main thread may directly perform rendering based on the display view to display the rich text message, and therefore, the rich text message may be directly rendered and rendered in a Layout container that is commonly used in Layout of Layout.
In the technical scheme, the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server, constructs a display view of the rich text message according to the display content information and the display format information, and sends the display view to the message main thread so that the message main thread displays the display view. Therefore, through the technical scheme, the rich text message can be analyzed by the message sub-thread, so that the data processing pressure of the message main thread can be effectively relieved, and the real-time performance and the efficiency of the message main thread for displaying the message are improved. And the message sub-thread constructs a display view based on the rich text message, so that the message main thread can directly display based on the display view, the rendering time required by the rich text message display can be effectively shortened, the rich text message can be completely displayed through one-time construction, and the response efficiency and the real-time performance of the rich text message display are improved.
Optionally, in S11, an exemplary embodiment of the message sub-thread determining the display content information and the display format information corresponding to the rich text message according to the rich text message received from the server is as follows, and the step may include:
and analyzing the rich text message to obtain display content information corresponding to the rich text message and user information and/or message type corresponding to the rich text message.
The user information is information for characterizing the user who originates the rich text message, such as rating information (e.g. common user, VIP user, etc.) of the user, and user authority information (e.g. commendable authority, etc.). The message type is information for representing the message category, such as a comment type and a gift type, the comment type may be used for representing a comment display message sent by a user, and the gift type may be used for representing a gift display message triggered by sending a gift by the user.
And determining display format information corresponding to the user information and/or the message type as the display format information corresponding to the rich text message.
The display format information may be preset in various forms, for example, corresponding display format information is preset for the user information and/or the message type, so that when the user information and/or the message type are acquired, the corresponding display format information may be directly determined.
As an example, parsing the rich text message may obtain user information corresponding to the rich text message. Illustratively, the obtained user information indicates that the user is a VIP user, and at this time, display format information (e.g., displaying large font text) corresponding to the VIP user may be determined as display format information corresponding to the rich text message.
As another example, parsing the rich text message may obtain a message type corresponding to the rich text message. For example, the obtained message type is a gift type, and at this time, display format information (e.g., displaying color text) corresponding to the gift type may be determined as display format information corresponding to the rich text message.
As another example, parsing the rich text message may obtain user information and a message type corresponding to the rich text message. Illustratively, the obtained user information indicates that the user is a VIP user, and the obtained message type is a gift type, at which time, display format information (for example, displaying a large font, color text) corresponding to the VIP user and the gift type may be determined as display format information corresponding to the rich text message.
Therefore, through the technical scheme, the display format information of the rich text message can be determined by analyzing the rich text message, so that data support is provided for constructing the display view, and the accuracy and the applicability of the display view construction are ensured.
Optionally, the display content information includes text information and picture information, and in S12, an exemplary implementation of constructing a display view of the rich text message according to the display content information and the display format information is as follows, as shown in fig. 2, this step may include:
in S21, a picture corresponding to the picture information is acquired from the picture information. The picture information may be a URL (Uniform Resource Locator) address of the picture. The picture may be a medal corresponding to the user level, a picture given a gift by the user, or the like.
As an example, the picture may be requested from a server according to the URL address. As another example, the exemplary implementation manner of acquiring a picture corresponding to picture information according to the picture information may include the following:
and inquiring the picture corresponding to the picture information in a preset picture library. The preset picture library may be a local picture library of the device, and the picture and the URL corresponding to the picture may be stored in the picture library in advance, so that the corresponding picture may be directly queried in the picture library based on the URL of the picture.
If the picture is inquired, acquiring the picture from the picture library; and if the picture is not inquired, requesting the picture from the server according to the picture information.
In this embodiment, if the picture is searched in the picture library, which indicates that the picture is stored locally, the picture can be directly read from the local picture library at this time, and loading is not required by a request, so that the loading efficiency of the picture can be effectively reduced. If the picture is not queried in the picture library, it indicates that the picture is not stored locally, and at this time, a request needs to be initiated to the server to load the picture.
In S22, after the picture is acquired, a display view is drawn for the text corresponding to the text information according to the display format information, and the picture is stitched to the display view based on the display position of the picture indicated in the display format information.
In this embodiment, after the message sub-thread acquires the picture, the display view is constructed according to the text information and the picture information based on the display format information, and the constructed display view can contain both the text information and the picture information, so that the construction of the display view of the rich text message can be completed through one construction process, thereby avoiding loading the same message for multiple times and improving the display speed of the rich text message.
Optionally, in S22, an exemplary implementation manner of drawing the display view for the text corresponding to the text information according to the display format information is as follows, as shown in fig. 3, where the step may include:
in S31, the display width corresponding to the text information is determined based on the display position corresponding to the text information indicated in the display format information.
The display position corresponding to the text information is used for representing the display position of the text displayed in the screen display area, so that the display width can be determined according to the area corresponding to the display position. For example, the display width of the screen corresponding to the display position is X pixels, and then the X pixels may be determined as the display width. In another embodiment, the display width of the screen corresponding to the display position may also be adaptively reduced to determine the display width, for example, 85% X pixels.
In S32, the display height corresponding to the text information is determined based on the text corresponding to the text information, the display format information, and the display width.
The font, the font size, the color and other information of the text can be determined based on the display format information, so that the display height of the text can be determined according to the data amount (such as the word number), the display format information and the display width of the text corresponding to the text information. For example, it may be determined from the display format information that the height of a single line displayed is, for example, Y pixels, and the number of lines (rounded up) for displaying the text is determined based on the width of each word in the text, for example, Z lines, and then the display height may be H1(Y × Z) pixels. It should be noted that the above description for determining the display height is only an exemplary description, and does not limit the scheme of the present disclosure. For example, the correspondence relationship between the text corresponding to the text information, the display format information, the display width, and the display height may be preset, and when the data size of the text is [ a1, a2], the display font size is 12, and the display width is X pixels, the corresponding display height is H2, so that the display height can be determined quickly according to the correspondence relationship.
In S33, the display view is drawn in accordance with the display format information and the text in the area formed by the display width and the display height corresponding to the text information.
And determining a display area corresponding to the text information according to the display width and the display height corresponding to the text information, so as to display an area formed by the display width X and the display height H1, and displaying the text in the format indicated by the display format information in the area, thereby realizing the drawing of the display view. For example, in the region, a format is indicated according to display format information, such as a four-script regular script display text "used here for testing the comment view" so that when the message main thread displays the rich text message, the display can be performed directly based on the display view.
In the technical scheme, the message sub-thread can measure the display height and the display width of the rich text message in advance, so that the display view of the message display is drawn in the area formed by the display height and the display width, and the display view is matched with the area for displaying the rich text message when the message main thread displays the rich text message based on the display view, thereby ensuring the display accuracy and the adaptability of the rich text message and increasing the display readability of the rich text message.
As an example, the display view may be drawn according to the display format information and the text based on a DynamicLayout manner in a Layout container of Layout. The Layout container is a Layout container commonly used in an android system, and is not described herein again.
As another example, another exemplary implementation of the rendering the display view according to the display format information and the text is as follows, including:
and drawing the display view based on StaticLayout according to the display format information and the text.
The dynamic layout mode can be suitable for drawing editable texts, and text update is executed when the texts change, so that the real-time performance of text drawing and the accuracy of text contents are ensured. In the technical scheme of the disclosure, the display view of the rich text message is constructed in advance in the message sub-thread, so that when the text is drawn in the disclosure, the text is drawn once after being analyzed and loaded based on all the content of the rich text message, and therefore, the display view can be drawn by adopting StaticLayout in the disclosure.
Optionally, the method further comprises:
the pictures requested by the server are stored in the picture library, so that the picture data of the local picture library can be further increased, the picture samples in the picture library are enriched, the pictures can be directly read from the local picture library when being acquired next time, the picture acquisition efficiency is further improved, the drawing time of the display view can be shortened, and the rich text display efficiency can be ensured.
The present disclosure also provides a rich text message display apparatus, as shown in fig. 4, the apparatus 10 including:
a determining module 100, configured to determine, by a message sub-thread, display content information and display format information corresponding to a rich text message received from a server;
a construction module 200, configured to construct a display view of the rich text message according to the display content information and the display format information;
a sending module 300, configured to send the display view to a message main thread, so that the message main thread displays the display view.
Optionally, the display content information includes text information and picture information, and the construction module includes:
the first obtaining sub-module is used for obtaining a picture corresponding to the picture information according to the picture information;
and the first drawing sub-module is used for drawing the display view for the text corresponding to the text information according to the display format information after the picture is obtained, and splicing the picture to the display view based on the display position of the picture indicated in the display format information.
Optionally, the first obtaining sub-module includes:
the query submodule is used for querying a picture corresponding to the picture information in a preset picture library;
the second obtaining sub-module is used for obtaining the picture from the picture library under the condition that the picture is inquired;
the request sub-module is used for requesting the picture from the server according to the picture information under the condition that the picture is not inquired;
the device further comprises:
and the storage module is used for storing the pictures requested from the server in the picture library.
Optionally, the first rendering submodule includes:
the first determining submodule is used for determining the display width corresponding to the text information according to the display position corresponding to the text information indicated in the display format information;
the second determining submodule is used for determining the display height corresponding to the text information based on the text corresponding to the text information, the display format information and the display width;
and the second drawing submodule is used for drawing the display view according to the display format information and the text in an area formed by the display width and the display height corresponding to the text information.
Optionally, the second rendering sub-module is configured to:
and drawing the display view based on StaticLayout according to the display format information and the text.
Optionally, the determining module includes:
the analysis submodule is used for analyzing the rich text message to obtain display content information corresponding to the rich text message and user information and/or message types corresponding to the rich text message;
and the third determining submodule is used for determining the display format information corresponding to the user information and/or the message type as the display format information corresponding to the rich text message.
The present disclosure also provides a rich text message display system, the system comprising:
one or more message sub-threads for performing the steps of the rich text display method;
and the message main thread is communicated with the message sub thread and is used for receiving the display view from the message sub thread and displaying the display view.
Referring now to FIG. 5, a block diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server; constructing a display view of the rich text message according to the display content information and the display format information; sending the display view to a message main thread to display the display view by the message main thread.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not constitute a limitation to the module itself in some cases, for example, the determining module may also be described as "a module for the message sub-thread to determine the display content information and the display format information corresponding to the rich text message according to the rich text message received from the server".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides a rich text message display method according to one or more embodiments of the present disclosure, wherein the method includes:
the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server;
constructing a display view of the rich text message according to the display content information and the display format information;
sending the display view to a message main thread to display the display view by the message main thread.
Example 2 provides the method of example 1, wherein the display content information includes text information and picture information, and the constructing the display view of the rich text message according to the display content information and the display format information includes:
acquiring a picture corresponding to the picture information according to the picture information;
after the picture is obtained, drawing the display view for the text corresponding to the text information according to the display format information, and splicing the picture to the display view based on the display position of the picture indicated in the display format information.
Example 3 provides the method of example 2, wherein the obtaining a picture corresponding to the picture information according to the picture information includes:
inquiring a picture corresponding to the picture information in a preset picture library;
if the picture is inquired, acquiring the picture from the picture library;
if the picture is not inquired, the picture is requested from the server according to the picture information;
the method further comprises the following steps:
storing the picture requested from the server in the picture library.
Example 4 provides the method of example 2, wherein the drawing the display view of the text corresponding to the text information according to the display format information includes:
determining a display width corresponding to the text information according to the display position corresponding to the text information indicated in the display format information;
determining a display height corresponding to the text information based on the text corresponding to the text information, the display format information and the display width;
and drawing the display view according to the display format information and the text in an area formed by the display width and the display height corresponding to the text information.
Example 5 provides the method of example 4, wherein the rendering the display view according to the display format information and the text, according to one or more embodiments of the present disclosure, includes:
and drawing the display view based on StaticLayout according to the display format information and the text.
Example 6 provides the method of example 1, wherein the message sub-thread determines, from a rich text message received from a server, display content information and display format information corresponding to the rich text message, including:
analyzing the rich text message to obtain display content information corresponding to the rich text message and user information and/or message types corresponding to the rich text message;
and determining display format information corresponding to the user information and/or the message type as the display format information corresponding to the rich text message.
Example 7 provides a rich text message display apparatus, according to one or more embodiments of the present disclosure, wherein the apparatus comprises:
the determining module is used for determining display content information and display format information corresponding to the rich text message according to the rich text message received from the server by the message sub-thread;
the construction module is used for constructing a display view of the rich text message according to the display content information and the display format information;
and the sending module is used for sending the display view to a message main thread so that the message main thread displays the display view.
Example 8 provides, in accordance with one or more embodiments of the present disclosure, a rich text message display system, the system comprising:
one or more message sub-threads for performing the steps of the method of any one of examples 1 to 6;
and the message main thread is communicated with the message sub thread and is used for receiving the display view from the message sub thread and displaying the display view.
Example 9 provides a computer readable medium having stored thereon a computer program that, when executed by a processing apparatus, performs the steps of the method of any one of examples 1 to 6, in accordance with one or more embodiments of the present disclosure.
Example 10 provides, in accordance with one or more embodiments of the present disclosure, an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method of any one of claims 1 to 6.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims (9)

1. A rich text message display method, the method comprising:
the message sub-thread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server;
constructing a display view of the rich text message according to the display content information and the display format information;
sending the display view to a message main thread to display the display view by the message main thread;
wherein the display content information includes text information and picture information, and the constructing the display view of the rich text message according to the display content information and the display format information includes:
acquiring a picture corresponding to the picture information according to the picture information;
after the picture is obtained, drawing the display view for the text corresponding to the text information according to the display format information, and splicing the picture to the display view based on the display position of the picture indicated in the display format information.
2. The method according to claim 1, wherein the obtaining a picture corresponding to the picture information according to the picture information comprises:
inquiring a picture corresponding to the picture information in a preset picture library;
if the picture is inquired, acquiring the picture from the picture library;
if the picture is not inquired, the picture is requested from the server according to the picture information;
the method further comprises the following steps:
storing the picture requested from the server in the picture library.
3. The method according to claim 1, wherein the rendering the display view for the text corresponding to the text information according to the display format information comprises:
determining a display width corresponding to the text information according to the display position corresponding to the text information indicated in the display format information;
determining a display height corresponding to the text information based on the text corresponding to the text information, the display format information and the display width;
and drawing the display view according to the display format information and the text in an area formed by the display width and the display height corresponding to the text information.
4. The method of claim 3, wherein said rendering the display view according to the display format information and the text comprises:
and drawing the display view based on StaticLayout according to the display format information and the text.
5. The method of claim 1, wherein the message subthread determines display content information and display format information corresponding to the rich text message according to the rich text message received from the server, and comprises:
analyzing the rich text message to obtain display content information corresponding to the rich text message and user information and/or message types corresponding to the rich text message;
and determining display format information corresponding to the user information and/or the message type as the display format information corresponding to the rich text message.
6. A rich text message display apparatus, the apparatus comprising:
the determining module is used for determining display content information and display format information corresponding to the rich text message according to the rich text message received from the server by the message sub-thread;
the construction module is used for constructing a display view of the rich text message according to the display content information and the display format information;
a sending module, configured to send the display view to a message main thread, so that the message main thread displays the display view;
wherein, the display content information comprises text information and picture information, and the construction module comprises:
the first obtaining sub-module is used for obtaining a picture corresponding to the picture information according to the picture information;
and the first drawing sub-module is used for drawing the display view for the text corresponding to the text information according to the display format information after the picture is obtained, and splicing the picture to the display view based on the display position of the picture indicated in the display format information.
7. A rich text message display system, the system comprising:
one or more message sub-threads for performing the steps of the method of any one of claims 1-5;
and the message main thread is communicated with the message sub thread and is used for receiving the display view from the message sub thread and displaying the display view.
8. A computer-readable medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, carries out the steps of the method of any one of claims 1 to 5.
9. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 5.
CN202010187234.7A 2020-03-17 2020-03-17 Rich text message display method, device, system, medium and electronic equipment Active CN111405342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010187234.7A CN111405342B (en) 2020-03-17 2020-03-17 Rich text message display method, device, system, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010187234.7A CN111405342B (en) 2020-03-17 2020-03-17 Rich text message display method, device, system, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111405342A CN111405342A (en) 2020-07-10
CN111405342B true CN111405342B (en) 2021-05-07

Family

ID=71414027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010187234.7A Active CN111405342B (en) 2020-03-17 2020-03-17 Rich text message display method, device, system, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111405342B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838607A (en) * 2014-03-05 2014-06-04 天闻数媒科技(北京)有限公司 Text display method and device
CN105872679A (en) * 2015-12-31 2016-08-17 乐视网信息技术(北京)股份有限公司 Barrage display method and device
CN106250000A (en) * 2016-07-29 2016-12-21 深圳市金立通信设备有限公司 The display packing of a kind of user interface and terminal
CN107820114A (en) * 2017-09-28 2018-03-20 武汉斗鱼网络科技有限公司 Special efficacy methods of exhibiting and device
CN108897541A (en) * 2018-07-03 2018-11-27 腾讯科技(深圳)有限公司 Vision restoring method, device, storage medium and the terminal of application program
CN109379637A (en) * 2018-10-15 2019-02-22 武汉斗鱼网络科技有限公司 A kind of method and device for adding barrage information
CN109949391A (en) * 2019-03-18 2019-06-28 武汉斗鱼鱼乐网络科技有限公司 Graphic rendering method, apparatus, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6061659A (en) * 1997-06-03 2000-05-09 Digital Marketing Communications, Inc. System and method for integrating a message into a graphical environment
US7050079B1 (en) * 2000-01-04 2006-05-23 International Business Machines Corporation System and method for dynamically generating viewable graphics
CN104462029B (en) * 2013-09-18 2017-11-21 北京新媒传信科技有限公司 The method and system that rich text is shown in a kind of intelligent terminal
CN108322807B (en) * 2018-02-24 2021-09-07 武汉斗鱼网络科技有限公司 Bullet screen display method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838607A (en) * 2014-03-05 2014-06-04 天闻数媒科技(北京)有限公司 Text display method and device
CN105872679A (en) * 2015-12-31 2016-08-17 乐视网信息技术(北京)股份有限公司 Barrage display method and device
CN106250000A (en) * 2016-07-29 2016-12-21 深圳市金立通信设备有限公司 The display packing of a kind of user interface and terminal
CN107820114A (en) * 2017-09-28 2018-03-20 武汉斗鱼网络科技有限公司 Special efficacy methods of exhibiting and device
CN108897541A (en) * 2018-07-03 2018-11-27 腾讯科技(深圳)有限公司 Vision restoring method, device, storage medium and the terminal of application program
CN109379637A (en) * 2018-10-15 2019-02-22 武汉斗鱼网络科技有限公司 A kind of method and device for adding barrage information
CN109949391A (en) * 2019-03-18 2019-06-28 武汉斗鱼鱼乐网络科技有限公司 Graphic rendering method, apparatus, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111405342A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN111399956B (en) Content display method and device applied to display equipment and electronic equipment
US11711441B2 (en) Method and apparatus for publishing video synchronously, electronic device, and readable storage medium
CN109684589B (en) Client comment data processing method and device and computer storage medium
CN111459364B (en) Icon updating method and device and electronic equipment
CN115600629B (en) Vehicle information two-dimensional code generation method, electronic device and computer readable medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN112053286A (en) Image processing method, image processing device, electronic equipment and readable medium
CN110619101B (en) Method and apparatus for processing information
CN111756953A (en) Video processing method, device, equipment and computer readable medium
CN111405342B (en) Rich text message display method, device, system, medium and electronic equipment
CN111581556B (en) Page data processing method, device, electronic equipment and readable medium
CN110618811A (en) Information presentation method and device
CN111259287B (en) Page content display method and device, electronic equipment and storage medium
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113296771A (en) Page display method, device, equipment and computer readable medium
CN111212296B (en) Live broadcast room gift list configuration method, device, medium and electronic equipment
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN112445478A (en) Graphic file processing method, device, equipment and medium
CN115209215A (en) Video processing method, device and equipment
CN111753238A (en) Data mapping method and device and electronic equipment
CN111324349A (en) Method, device, terminal and storage medium for generating interactive interface
CN111538552A (en) Gift panel configuration method and device, readable medium and electronic equipment
CN111290812A (en) Application control display method and device, terminal and storage medium
CN112307717A (en) Text labeling information display method and device, electronic equipment and medium

Legal Events

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