Rich text rendering method and device, electronic equipment and storage medium

By replacing the target placeholder with a multimedia component during the rich text rendering process, the problems of poor rendering effect and maintainability are solved, achieving efficient and fast rendering effect and improving maintainability.

CN111222063BActive Publication Date: 2026-06-12BEIJING DAJIA INTERNET INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2019-11-26
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Traditional rich text rendering suffers from poor rendering quality and maintainability, especially since modified text content is difficult to maintain, leading to browsers being unable to distinguish between them and causing numerous logical problems.

Method used

By obtaining the symbol parameters of the target placeholder in the rich text, replacing them with multimedia components, a second rich text is formed. The multimedia components are then used to isolate the content before and after the text, avoiding logical problems and improving rendering efficiency and maintainability.

🎯Benefits of technology

It achieves efficient and fast rendering effects, improves the efficiency and maintainability of rich text rendering process, and enhances the display effect of multimedia pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111222063B_ABST
    Figure CN111222063B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for rendering a rich text, an electronic device and a storage medium, to at least solve the problems of poor rendering effect and poor maintainability in the traditional rich text rendering process. The method comprises: obtaining a symbol parameter of a target placeholder in a first rich text, the target placeholder containing target multimedia information; replacing the content of the target placeholder with a multimedia component according to the symbol parameter to obtain a second rich text; and rendering the second rich text to obtain a target multimedia page. The present disclosure is applied to the scenario of multimedia page display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet technology, and in particular to rich text rendering methods, apparatus, electronic devices, and storage media. Background Technology

[0002] Currently, internet content is increasingly created and shared directly by users. In the content creation process, plain text or even simple rich text (such as HyperText Markup Language (HTML)) can no longer meet users' demands for browsing experience. Therefore, embedding various multimedia content (such as images, videos, audio, carousels, or responsive ads) into rich text becomes essential.

[0003] In traditional technology, when browsers display multimedia content in rich text, they usually modify the text content describing the multimedia content in the rich text to enhance the display effect before rendering.

[0004] However, since the modified text content is usually plain text, it is not only difficult to maintain, but also causes the browser to be unable to distinguish the modified text content, which in turn leads to a lot of logical problems in the rendering process and results in poor rendering effect. Summary of the Invention

[0005] This disclosure provides a rich text rendering method, apparatus, electronic device, and storage medium to at least solve the problems of poor rendering effect and poor maintainability in traditional rich text rendering processes.

[0006] The technical solution disclosed herein is as follows:

[0007] According to a first aspect of the present disclosure, a rich text rendering method is provided, comprising: obtaining symbol parameters of a target placeholder in a first rich text, the target placeholder containing target multimedia information; replacing the content of the target placeholder with a multimedia component according to the symbol parameters of the target placeholder to obtain a second rich text; and rendering the second rich text to obtain a target multimedia page.

[0008] According to a second aspect of the present disclosure, a rich text rendering apparatus is provided, comprising: an acquisition unit configured to acquire symbol parameters of a target placeholder in a first rich text, the target placeholder containing target multimedia information; a replacement unit configured to replace the content of the target placeholder with a multimedia component according to the symbol parameters of the target placeholder acquired by the acquisition unit, thereby obtaining a second rich text; and a rendering unit configured to render the second rich text obtained by the replacement unit, thereby obtaining a target multimedia page.

[0009] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor, and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the rich text rendering method as shown in the first aspect.

[0010] According to a fourth aspect of the present disclosure, a storage medium is provided that, when instructions in the storage medium are executed by a processor of a rich text rendering apparatus, enables the rich text rendering apparatus to perform the rich text rendering method as described in the first aspect.

[0011] According to a fifth aspect of the present disclosure, a computer program product is provided that can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by the computer, the computer program can implement the rich text rendering method shown in the first aspect.

[0012] The technical solution provided in this disclosure offers at least the following advantages: After obtaining the symbol parameters of the target placeholder in the first rich text, the rich text rendering device can replace the content of the target placeholder with a multimedia component based on the symbol parameters, thus obtaining the second rich text. Since the content format of the multimedia component is different from that of other content in the second rich text, it can isolate the content before and after the multimedia component in the second rich text. Therefore, when the rich text rendering device renders the second rich text, it can avoid a large number of logical problems, thereby efficiently and quickly obtaining a target multimedia page with better rendering effects, improving the rendering efficiency of the entire rich text rendering process. Simultaneously, since the replaced content is in component form, the maintainability of the replaced content and development efficiency are improved.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0014] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0015] Figure 1 This is an architecture diagram of an implementation environment illustrated according to an exemplary embodiment;

[0016] Figure 2 This is a flowchart illustrating a rich text rendering method according to an exemplary embodiment;

[0017] Figure 3 This is a block diagram illustrating a rich text rendering apparatus according to an exemplary embodiment;

[0018] Figure 4 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0019] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0020] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0021] Before providing a detailed description of the rich text rendering method provided in the embodiments of this disclosure, a brief introduction is given to the application scenarios and implementation environment involved in the embodiments of this disclosure.

[0022] In traditional technologies, when browsers display multimedia content in rich text, they typically replace the text describing the multimedia content in the rich text to enhance the display effect before rendering. Taking HTML rich text as an example, since the replaced text content is usually pure HTML text, it is difficult to include CSS for describing styles and JavaScript (a programming language) for executing logic. This makes this pure HTML text content difficult to maintain independently, hinders modularity, and seriously affects development efficiency.

[0023] To address this issue, the technical solution provided in this disclosure replaces the target placeholder content in the rich text with a multimedia component. This multimedia component isolates the content before and after it within the rich text, thus avoiding numerous logical problems during subsequent rich text rendering. This allows for a more efficient and faster generation of a target multimedia page with better rendering effects, improving the overall rendering efficiency of the rich text rendering process. Furthermore, since the replaced content is in component form, the maintainability of the replaced content and development efficiency are enhanced.

[0024] 1) A brief introduction to the application scenarios involved in the embodiments of this disclosure.

[0025] In this embodiment of the disclosure, the rich text rendering method can be applied to multimedia page display scenarios or other multimedia scenarios, and this disclosure does not limit it.

[0026] For example, in the content editing stage, only a few parameters are often needed to describe the multimedia content (such as images, audio, video, or advertisements) that needs to be embedded in rich text. However, in the rich text rendering scenario, it is necessary to replace the text content used to describe the multimedia content (such as specific HTML tags) in the rich text with renderable text content before rendering is performed. After rendering, the multimedia page corresponding to the multimedia content can be displayed.

[0027] 2) A brief introduction to the implementation environment involved in the embodiments of this disclosure.

[0028] Figure 1 It is based on an architecture diagram of a possible implementation environment, such as Figure 1 As shown, the following rich text rendering method can be applied to this implementation environment. This implementation environment includes electronic device 01 and server 02. Electronic device 01 and server 02 can be interconnected and communicate via a network.

[0029] Among them, electronic device 01 can be a device capable of rich text rendering. An application (e.g., a browser) that can perform rich text rendering runs on electronic device 01, so that after receiving rich text fed back by server 02, electronic device 01 can perform the corresponding text replacement process and text rendering process on the rich text through the application.

[0030] Electronic device 01 can be any electronic product that can interact with the user through one or more means such as a keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as mobile phone, tablet computer, handheld computer, personal computer (PC), wearable device, smart TV, etc.

[0031] Server 02 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.

[0032] In typical internet services, server O2 is only responsible for providing metadata (such as rich text), while various clients execute decisions on the display style. Different clients can produce completely different visual effects for the same metadata. In this embodiment of the invention, the electronic device abstracts different visuals into independent multimedia components for reuse, that is, converts specific content in the rich text into corresponding multimedia components.

[0033] Those skilled in the art should understand that the above-described electronic devices and servers are merely examples, and other existing or future electronic devices or servers that are applicable to this disclosure should also be included within the scope of protection of this disclosure, and are hereby incorporated by reference.

[0034] The technical solution provided in this application will be described below with reference to the accompanying drawings.

[0035] Figure 2 This is a flowchart illustrating a rich text rendering method according to an exemplary embodiment, applied to a rich text rendering apparatus, such as... Figure 2 As shown, the rich text rendering method includes the following steps.

[0036] In step S11, the symbol parameters of the target placeholder in the first rich text are obtained.

[0037] In this embodiment of the disclosure, after receiving the first rich text sent by the server, the symbol parameters of the target placeholder in the first rich text can be obtained.

[0038] Generally, rich text content comes from two main sources: rich text editors and web crawlers. Regardless of the source, the resulting rich text content is usually quite clean, lacking HTML tags specifically for user interaction or those that don't directly contribute to the article's content. In other words, almost every pair of HTML tags in the rich text content contains a portion of the article's content. For example, the tag corresponding to an image is... The video's corresponding tags are <video>< / video> The audio tag is <audio>< / audio> .

[0039] In this embodiment of the disclosure, the symbol parameters of the target placeholder include: the position and length of the target placeholder in the first rich text; the target placeholder contains target multimedia information, that is, the characters contained in the placeholder in the first rich text are characters used to represent multimedia information (e.g., image information, audio information, video information, etc.).

[0040] In one example, in order to perform secondary processing (e.g., rendering) on ​​external resources referenced by multimedia information in the first rich text, embodiments of this disclosure store the details of these resources separately as structured data. In this way, there is no need to use HTML tags for marking, and the corresponding storage location can be directly commented in the placeholder containing the corresponding multimedia information.

[0041] In one example, the placeholders in the first rich text above may contain not only multimedia information, but also details of the external resources referenced by that multimedia information.

[0042] In step S12, the content of the target placeholder in the first rich text is replaced with a multimedia component according to the symbol parameter of the target placeholder, to obtain the second rich text.

[0043] In this embodiment of the disclosure, the target placeholder can be at least one placeholder in the first rich text.

[0044] In this embodiment of the disclosure, when replacing the content of the target placeholder, the content of the target placeholder can be replaced with the corresponding multimedia component according to the display effect corresponding to the target multimedia information in the target placeholder.

[0045] For example, since the character position of the target placeholder in the first rich text and the character length of the target placeholder itself are already known, the target placeholder can be easily replaced. That is, only part of the target placeholder in the first rich text can be replaced, and other parts can be left unprocessed.

[0046] Furthermore, compared to the traditional replacement process, which replaces the text content describing the multimedia content with a string with a fixed template, this embodiment replaces specific placeholders in the rich text with multimedia components, so that the multimedia components play an isolation role in the rich text. This avoids data conflicts and data chaos caused by the replacement content being consistent with the context format during the rich text rendering process, thereby improving the rich text rendering efficiency and accuracy.

[0047] Optionally, in this embodiment of the disclosure, the multimedia component described above can be a Vue component within the Vue (a rendering tool) environment. It is understood that in the Vue environment, the electronic device directly compiles the content in the target placeholder into a Vue component, and then hands it over to the Vue framework for rendering, thus improving the maintainability of the Vue component.

[0048] For example, in a Vue environment, the content after the target placeholder is replaced is pure Vue template syntax, and you can use the colon ":" for property passing and the "@" symbol for event binding.

[0049] In step S13, the second rich text is rendered to obtain the target multimedia page.

[0050] Optionally, in this embodiment of the disclosure, step S12 may include the following step S12a:

[0051] In step S12a, placeholders in the first rich text are traversed.

[0052] For example, during the process of traversing the placeholders in the first rich text, if the content of the currently traversed placeholder includes multimedia information corresponding to the target multimedia type, then the currently traversed placeholder is taken as the target placeholder.

[0053] For example, during the process of traversing the placeholders in the first rich text, if the content of the currently traversed placeholder does not include the multimedia information corresponding to the target multimedia type, then continue traversing the next placeholder of the currently traversed placeholder.

[0054] Further, optionally, in this embodiment of the disclosure, during step S12a, the placeholders in the first rich text can be traversed in ascending order according to their initial order. Alternatively, the placeholders in the first rich text can be traversed in descending order according to their initial order. This embodiment of the disclosure does not limit the specific method used.

[0055] For example, when traversing the placeholders in the first rich text in reverse order, one can start from the last character of the first rich text and traverse the placeholders in the first rich text in reverse order, or one can start from the last placeholder in the first rich text and traverse the placeholders in the first rich text in reverse order. This disclosure does not limit the specific method used.

[0056] Furthermore, when traversing the placeholders in the first rich text, each character in the first rich text can be traversed. Of course, only the placeholders in the first rich text can be traversed. This embodiment of the present disclosure does not limit this.

[0057] Since replacing the content of a placeholder may change the position of other characters following that placeholder in the entire rich text, traversing the placeholders in reverse order can avoid the increased computation due to the change in the position of subsequent placeholders, thus improving the overall efficiency of placeholder traversal.

[0058] For example, during the process of traversing the placeholders in the first rich text, for each placeholder, pattern matching can be performed using the regular expression corresponding to the content of that placeholder, based on its format, to extract the placeholder parameters and the multimedia type of the multimedia information contained in the placeholder. For instance, the regular expression corresponding to the content of a certain placeholder (using JavaScript as an example) can be expressed as: / <!--{(img|video|audio):(\d+)}-- / ig.

[0059] In one example, each pattern matching process needs to know four pieces of information about the placeholder: (1) the character length of the placeholder; (2) the multimedia type of the multimedia information contained in the placeholder, such as the content matched by the first parenthesis in the above regular expression example, which is usually at least one of the three: img, video, and audio; (3) the index in the DetailArray pointed to by the placeholder, that is, the content matched by the second parenthesis in the above regular expression example, which is a positive integer starting from 0; (4) the character position of the first character of the placeholder in the entire rich text.

[0060] In one example, in JavaScript, the `exec` method of a `RegExp` object instance can be called multiple times to match all placeholders. The four pieces of information for each placeholder are then stored together in a hash table structure, and all hash table structures are stored in a sorted array `S` in reverse order. Then, the array `S` is traversed according to the order of the placeholders, which is equivalent to traversing all placeholders in reverse order. The four pieces of information in each hash structure are: `matches` (the entire content of the placeholder), `tag` (the type of the placeholder), `tagIndex` (the index in the `DetailArray`), and `index` (the character position of the first character of the placeholder in the entire rich text).

[0061] Optionally, in this embodiment of the disclosure, step S13 may include the following step S13a:

[0062] In step S13a, based on the symbol parameter of the target placeholder, the character content of the target placeholder is replaced with a multimedia component using a component editing function to obtain the second rich text.

[0063] For example, the component editing functions described above may include the render function or other functions that can perform component editing, and this disclosure does not limit this.

[0064] For example, declaring a JavaScript object containing a `render` function makes it a valid Vue component. See Code 1 below for a concrete example:

[0065] Code 1:

[0066]

[0067] In the above program, "custom-video" and "custom-audio" are child components of Vue components.

[0068] Furthermore, when the `render` function returns, the Vue framework's built-in real-time template compilation method, `compile`, needs to be used. This method returns a hash table structure, one of which contains an entry called the `render` function. This `render` function can be used as the `render` function for the Vue component mentioned above. To respond to changes in the template string within the Vue component and update the `render` function accordingly, this template string can be passed as an attribute to the component. Changes to this string can be monitored to recompile and update the `render` function. See Code 2 below for a concrete example:

[0069] Code 2:

[0070]

[0071]

[0072] The rich text rendering method provided in this embodiment allows the rich text rendering device to replace the content of a target placeholder in a first rich text with a multimedia component based on the symbol parameters of the target placeholder, thereby obtaining a second rich text. Since the content format of the multimedia component differs from that of other content in the second rich text, it can isolate the content before and after the multimedia component in the second rich text. Thus, when the rich text rendering device renders the second rich text, it can efficiently and quickly obtain a target multimedia page with better rendering effects, improving the rendering efficiency of the entire rich text rendering process.

[0073] Figure 3 This is a block diagram illustrating a rich text rendering apparatus according to an exemplary embodiment. (Refer to...) Figure 3 The rich text rendering apparatus 200 includes an acquisition unit 201, a replacement unit 202, and a rendering unit 203, wherein: the acquisition unit 201 is configured to acquire symbol parameters of a target placeholder in a first rich text, the target placeholder containing target multimedia information; the replacement unit 202 is configured to replace the content of the target placeholder with a multimedia component according to the symbol parameters acquired by the acquisition unit 201, to obtain a second rich text; and the rendering unit 203 is configured to render the second rich text obtained by the replacement unit 202, to obtain a target multimedia page.

[0074] Optional, such as Figure 3 As shown, the rich text rendering device 200 further includes a traversal unit 204, wherein the traversal unit is configured to traverse placeholders in the first rich text, and if the content of the currently traversed placeholder includes multimedia information corresponding to the target multimedia type, then the currently traversed placeholder is used as the target placeholder.

[0075] Optionally, the traversal unit 204 is configured to continue traversing the next placeholder if the content of the currently traversed placeholder does not contain multimedia information corresponding to the target multimedia type.

[0076] Optionally, the traversal unit 204 is configured to traverse the placeholders in the first rich text in reverse order according to their order in the first rich text.

[0077] Optionally, the aforementioned replacement unit is specifically configured to replace the character content of the target placeholder with a multimedia component using a component compilation function based on the symbol parameters obtained by the acquisition module 201, thereby obtaining a second rich text.

[0078] The rich text rendering apparatus provided in this embodiment, after obtaining the symbol parameters of the target placeholder in the first rich text, can replace the content of the target placeholder with a multimedia component according to the symbol parameters of the target placeholder to obtain a second rich text. Since the content format of the multimedia component is different from that of other content in the second rich text, it can isolate the content before and after the multimedia component in the second rich text. Thus, when the rich text rendering apparatus renders the second rich text, it can efficiently and quickly obtain a target multimedia page with better rendering effect, thereby improving the rendering efficiency of the entire rich text rendering process.

[0079] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0080] It should be noted that, as Figure 3 As shown, modules that are necessarily included in the rich text rendering device 200 are indicated by solid boxes, such as the acquisition unit 201; modules that may or may not be included in the rich text rendering device 200 are indicated by dashed boxes, such as the traversal unit 204.

[0081] Figure 4 This is a block diagram illustrating an electronic device 300 for rich text rendering according to an exemplary embodiment. The electronic device includes, but is not limited to, mobile phones, tablets, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers. Figure 4 As shown, the electronic device 300 includes, but is not limited to: processor 301, memory 302, display 303, input unit 304, output unit 305, network unit 306, interface unit 307, radio frequency unit 308, power supply 309, and sensor 310, etc.

[0082] The processor 301 described above is a memory used to store processor-executable instructions; the processor 301 is configured to execute the instructions to implement the method described above. It can be understood that the processor 301 is configured to execute any step of the method described above.

[0083] It should be noted that those skilled in the art will understand that Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device; the electronic device may include, but is not limited to, other electronic devices. Figure 4 This may indicate more or fewer components, or combinations of certain components, or different component arrangements.

[0084] Processor 301 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in memory 302, and by calling data stored in memory 302, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Processor 301 may include one or more processing units; optionally, processor 301 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into processor 301.

[0085] The memory 302 can be used to store software programs and various data. The memory 302 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0086] The display 303 is used to display information input by the user or information provided to the user. The display 303 may include a display panel, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0087] Input unit 304 can be used to receive audio or video signals. Input unit 304 may include a graphics processing unit (GPU) and a microphone. The GPU processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display 303. The image frames processed by the GPU can be stored in memory 302 (or other storage media) or transmitted via radio frequency unit 308 or network unit 306. The microphone can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 308 in telephone call mode.

[0088] Input unit 304 can be a user input unit, used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of electronic devices. Specifically, the user input unit includes a touch panel and other input devices. A touch panel, also known as a touchscreen, can collect touch operations performed by the user on or near it (e.g., operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel). The touch panel can include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301, receiving and executing commands from the processor 301. Furthermore, touch panels can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch panel, the user input unit can also include other input devices. Specifically, other input devices can include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be elaborated further here.

[0089] Furthermore, the touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. The touch panel and the display panel 3061 can be used as two independent components to realize the input and output functions of the electronic device, or they can be integrated to realize the input and output functions of the electronic device. The specific method is not limited here.

[0090] The output unit 305 can be an audio output unit, which can convert audio data received by the radio frequency unit 308 or the network unit 306 or stored in the memory 302 into audio signals and output them as sound. Furthermore, the audio output unit can also provide audio output related to specific functions performed by the electronic device 300 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit includes a speaker, a buzzer, and a receiver, etc.

[0091] The electronic device provides users with wireless broadband internet access through the network unit 306, such as helping users send and receive emails, browse web pages, and access streaming media.

[0092] Interface unit 307 serves as an interface for connecting external devices to electronic device 300. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 307 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 300, or it can be used to transmit data between electronic device 300 and external devices.

[0093] The radio frequency (RF) unit 308 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it in the processor 301; additionally, it transmits uplink data to the base station. Typically, the RF unit 308 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, and a duplexer. Furthermore, the RF unit 308 can also communicate with networks and other devices via wireless communication systems.

[0094] The power supply 309 (such as a battery) can be used to power various components. Optionally, the power supply 309 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0095] Sensor 310 may include at least one of a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel according to the ambient light level, and the proximity sensor can turn off the display panel and / or backlight when the electronic device 300 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used to identify the posture of electronic devices (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. Sensor 310 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.

[0096] In addition, the electronic device 300 includes some functional modules (such as a camera) not shown, which will not be described in detail here.

[0097] In an exemplary embodiment, this disclosure also provides a storage medium including instructions, such as a memory 302 including instructions, which can be executed by a processor 301 of an electronic device 300 to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a read-only memory (ROM), random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0098] In an exemplary embodiment, this disclosure also provides a computer program product including one or more instructions, which can be executed by the processor 301 of the electronic device 300 to perform the above-described method.

[0099] It should be noted that when one or more instructions in the above-mentioned storage medium or computer program product are executed by the processor 301, they implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0100] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0101] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A rich text rendering method, characterized in that, include: Obtain the symbol parameters of the target placeholder in the first rich text, wherein the target placeholder contains target multimedia information; Based on the symbol parameters, the content of the target placeholder in the first rich text is replaced with a multimedia component, while the content of other placeholders in the first rich text is left unprocessed, resulting in a second rich text. Render the second rich text to obtain the target multimedia page; In this context, the multimedia components in the second rich text are rendered by the system framework corresponding to the multimedia components.

2. The rich text rendering method according to claim 1, characterized in that, Prior to the step of obtaining the symbol parameter of the target placeholder in the first rich text, the method further includes: Iterate through the placeholders in the first rich text file; If the content of the currently traversed placeholder includes multimedia information corresponding to the target multimedia type, then the currently traversed placeholder is used as the target placeholder.

3. The rich text rendering method according to claim 2, characterized in that, During the process of traversing the placeholders in the first rich text, the method further includes: If the content of the currently traversed placeholder does not contain the multimedia information corresponding to the target multimedia type, then continue traversing the next placeholder of the currently traversed placeholder.

4. The rich text rendering method according to claim 2 or 3, characterized in that, The step of traversing the placeholders in the first rich text includes: Traverse the placeholders in the first rich text in reverse order, following the order of their positions.

5. The rich text rendering method according to claim 1, characterized in that, The step of replacing the content of the target placeholder in the first rich text with a multimedia component according to the symbol parameter, while leaving the content of other placeholders in the first rich text unprocessed, to obtain the second rich text includes: Based on the symbol parameters, the content of the target placeholder is replaced with the multimedia component using the component compilation function to obtain the second rich text.

6. A rich text rendering device, characterized in that, include: The acquisition unit is configured to acquire symbol parameters of a target placeholder in a first rich text, the target placeholder containing target multimedia information; The replacement unit is configured to replace the content of the target placeholder in the first rich text with a multimedia component according to the symbol parameter obtained by the acquisition unit, and leave the content of other placeholders in the first rich text unprocessed, to obtain a second rich text; A rendering unit is configured to render the second rich text obtained by the replacement unit to obtain a target multimedia page; In this context, the multimedia components in the second rich text are rendered by the system framework corresponding to the multimedia components.

7. The rich text rendering apparatus according to claim 6, characterized in that, The rich text rendering apparatus further includes: The traversal unit is configured to traverse the placeholders in the first rich text. If the content of the currently traversed placeholder includes multimedia information corresponding to the target multimedia type, then the currently traversed placeholder is used as the target placeholder.

8. The rich text rendering apparatus according to claim 7, characterized in that, The traversal unit is configured to continue traversing the next placeholder if the content of the currently traversed placeholder does not contain the multimedia information corresponding to the target multimedia type.

9. The rich text rendering apparatus according to claim 7 or 8, characterized in that, The traversal unit is configured to traverse the placeholders in the first rich text in reverse order, according to the order of the placeholders in the first rich text.

10. The rich text rendering apparatus according to claim 6, characterized in that, The replacement unit is specifically configured to replace the content of the target placeholder with the multimedia component using a component compilation function based on the symbol parameters obtained by the acquisition unit, thereby obtaining the second rich text.

11. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the rich text rendering method as described in any one of claims 1 to 5.

12. A storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the rich text rendering apparatus, the rich text rendering apparatus is able to perform the rich text rendering method as described in any one of claims 1 to 5.