Picture display method and device in streaming receiving scene and storage medium
By introducing a state machine module and local placeholder graph technology in streaming scenarios, the problems of poor user experience and performance degradation during Markdown image display are solved, achieving seamless image loading and smooth interface display.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies cannot hide the receiving process when displaying Markdown images in streaming scenarios, resulting in a poor user experience and performance degradation due to frequent image loading and interface refreshes.
A state machine module is introduced to manage the message receiving task status. A local placeholder image is used to hide the receiving process during image loading. The interface refresh is controlled by recognizing start and end markers. Image display is optimized by combining local caching and asynchronous loading technologies.
It completely solves the page flickering problem in streaming scenarios, improves user experience and reduces resource consumption.
Smart Images

Figure CN121858196A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission and processing technology, and in particular to a method and apparatus for displaying images in a streaming reception scenario. Background Technology
[0002] In streaming scenarios such as AI chat, messages are often received and rendered in real time. Traditional solutions face significant challenges when messages contain Markdown images (images embedded in Markdown documents). Existing solutions for displaying streaming Markdown images typically fall into two categories: ① Plain text display: During streaming, the original Markdown image code () is always displayed, and then rendered as an image only after the message is fully received. This method cannot hide the receiving process, resulting in a poor user experience. ② Real-time rendering display: When the client receives new data streaming, it frequently triggers interface refreshes to load images. However, this method can cause severe page flickering, easily leading to a jittery and unpleasant user experience. Furthermore, frequent image loading and interface redrawing consume significant resources, causing a decline in client performance.
[0003] Therefore, there is an urgent need for a new method for displaying images in streaming reception scenarios that can not only overcome the problems of frequent flickering and resource consumption, but also hide the reception process and improve the user experience. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide an image display method and apparatus in a streaming reception scenario. By introducing a state machine to manage the state of message reception tasks and using a local placeholder map to achieve seamless hiding of the image link reception process, the method completely solves the page flickering problem in streaming reception scenarios and greatly improves the user experience.
[0005] One aspect of the present invention provides a method for displaying images in a streaming reception scenario. The method is executed by a client, which includes a listening module, a state machine module, and a view display module. The method includes the following steps: The listening module receives messages from the server in a streaming manner and sends the received messages to the state machine module in real time. The complete message from the server includes the syntax structure of the image to be loaded embedded in the Markdown document, and the syntax structure of the image to be loaded includes the link of the image to be loaded. The state machine module reads and identifies messages in real time. When a predetermined start marker is identified, the status of the message receiving task is updated to receiving. The pre-stored local placeholder image is used as a temporary image to be loaded, so that the view display module refreshes the display interface to display the local placeholder image at the display interface position corresponding to the image to be loaded. When the state machine module recognizes the predetermined end marker, it updates the status of the message receiving task from "receiving" to "completed" and extracts the link of the image to be loaded from the data between the start and end markers. The image to be loaded is then loaded based on the link, so that the view display module can replace the local placeholder image with the image to be loaded.
[0006] In some embodiments of the present invention, the client further includes a network loading module, and the client's local cache stores the mapping relationship between locally cached images and corresponding links, as well as the locally cached images; The image to be loaded is obtained by loading the link of the image to be loaded, including: If a matching image link is found based on the mapping relationship, the state machine module retrieves the corresponding image directly from the client's local cache. Otherwise, the state machine module controls the network loading module to initiate an asynchronous loading request to the server, thereby loading the image to be loaded. The asynchronous loading request contains the link to the image to be loaded.
[0007] In some embodiments of the present invention, after loading the image to be loaded, the method further includes: adding the mapping relationship between the link of the image to be loaded and the image to be loaded, as well as the loaded image to be loaded, to the local cache of the client.
[0008] In some embodiments of the present invention, after the image to be loaded is obtained, the method further includes: the state machine module sending the image to be loaded to the view display module, and controlling the view display module to perform asynchronous rendering.
[0009] In some embodiments of the present invention, the client further includes a placeholder image management module; the locally cached images include local placeholder images; Use pre-stored local placeholder images as temporary images to be loaded, including: The state machine module controls the start of the placeholder image management module to generate placeholder image links; based on the mapping relationship between the placeholder image links obtained from the placeholder image management module and the client's local cache, the state machine module retrieves the local placeholder image from the client's local cache and sends the local placeholder image to the view display module for display; or The state machine module retrieves the local placeholder image from the client's local cache based on the pre-stored placeholder image links and the mapping relationship stored in the client's local cache, and sends the local placeholder image to the view display module for display.
[0010] In some embodiments of the present invention, the view display module does not refresh the display interface after displaying the local placeholder image and before loading the image to be loaded. Before the state machine module recognizes the predetermined start marker, or after a set time after recognizing the end marker, the state machine module sets the status of the message receiving task to "not started".
[0011] In some embodiments of the present invention, the syntax structure of the image to be loaded is ![alternative text] (link to the image to be loaded "optional title"), the predetermined start identifier is the "![" character, and the predetermined end identifier is the ")" character.
[0012] Another aspect of the present invention provides an image display device for a streaming reception scenario, including a processor, a memory, and a computer program / instructions stored in the memory. The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the method described in any of the above embodiments.
[0013] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the method described in any of the above embodiments.
[0014] Another aspect of the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described in any of the above embodiments.
[0015] The image display method and apparatus proposed in this invention for streaming reception scenarios use a state machine module to identify messages and perform state transitions, determine different processes of message reception tasks, and guide other modules such as the network loading module and view display module to perform different operations in different states. This achieves seamless hiding of the image link reception process, improves user experience, and prevents frequent flickering of the display interface.
[0016] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.
[0017] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings: Figure 1 This is a flowchart illustrating an image display method in a streaming reception scenario according to an embodiment of the present invention.
[0019] Figure 2 This is a flowchart illustrating an image display method in a streaming reception scenario according to another embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0021] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0022] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0023] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0024] Existing Markdown image display solutions for streaming have significant drawbacks. For example, they cannot hide the image receiving process and directly display the original Markdown code, resulting in a poor user experience. They can also render the actual image directly when new data is received, but in a streaming environment, this leads to frequent image requests and page refreshes, causing severe page flickering.
[0025] Based on this, this application proposes a novel image display method for streaming reception scenarios. It not only uses a local placeholder image for temporary display when the link to the image to be loaded has not finished loading, but also introduces a state machine module. This module uses character recognition to identify different message reception task states to indicate different progress levels, thereby enabling the state machine module to perform different operations in different states. This method not only prevents frequent display screen flickering but also significantly improves the user experience.
[0026] The image display method proposed in this application is applicable to message transmission in streaming reception scenarios. "Streaming reception" is a data acquisition method that generates, transmits, and receives data simultaneously. Its core characteristics are real-time, continuous, low latency, and no need to occupy complete storage space. Furthermore, the method proposed in this application can be implemented by a client. After the client sends a communication request to the server, it can receive the corresponding message from the server in a streaming manner. The client can be a mobile device or a personal computer, etc., and this invention is not limited to these; it only needs to be able to receive messages from the server in a streaming manner and implement the method proposed in this application. The client designed in this application may include a listening module, a state machine module, and a view display module. The listening module is used to receive messages streaming from the server and send them to the state machine module in real time. The state machine module is the core component of the client, used to determine the progress of the message reception task by recognizing characters in the message, and then control other modules to perform corresponding operations. The view display module is used to notify the client's display interface to refresh to display the received image at key time nodes (when the state machine module recognizes the start and end markers), and to ensure efficient and smooth interface refresh. In this application, the client may further include a network loading module and a placeholder image management module. The network loading module is used to send an image loading request to the server through the control of the state machine module when the image to be loaded is not stored in the client's local cache. The placeholder image management module is used to generate a temporary placeholder image link when the state machine module recognizes the start marker, so as to replace the incomplete image to be loaded with the local placeholder image. In addition, the client's local cache stores at least the mapping relationship between the local cached images and the corresponding links, as well as the local cached images. This application may refer to the cache area storing the mapping relationship and the local cached images as an image cache pool. During the image display process, cache queries and cache updates can be performed in the image cache pool based on the link of the image to be loaded and the placeholder image link. The local cached images include the loaded image to be loaded and the local placeholder image.
[0027] like Figure 1 As shown, the image display method in the streaming reception scenario proposed in this application may include steps S110 to S130, and the specific process is as follows: Step S110: The listening module continuously listens for and streams messages from the server, and after receiving messages from the server in a streaming manner, it sends the received messages to the state machine module in real time.
[0028] Because the server and client use a streaming reception method, the messages that the listening module listens for and sends to the state machine module in real time are mostly not complete messages. Instead, the messages are transmitted to the client in segments, word by word, or sentence by sentence. Therefore, the real-time received messages that the listening module receives and transmits to the state machine module may only contain one or more characters from the complete message. The method proposed in this application requires that the complete message sent from the server to the client includes the syntax structure of the image to be loaded embedded in the Markdown document (hereinafter, the image to be loaded embedded in the Markdown document can be referred to as the Markdown image to be loaded).
[0029] More specifically, Markdown is a lightweight markup language. The syntax structure of a Markdown image can be ![alternative text] (image link "optional title"), where the alternative text (alt text) describes the content of the image and is displayed when the Markdown image cannot be displayed; the image link (image URL) can be the image's web address or a local relative path; and the optional title provides additional descriptions. Furthermore, since the syntax structure of Markdown images is universal, this application can design a predetermined start identifier as the "![" character and a predetermined end identifier as the ")" character, and use a state machine module to identify the start and end identifiers to determine the progress of the message receiving task.
[0030] As an example, a complete message sent from the server to the client may also include other text that does not belong to the syntax structure of the Markdown image to be loaded. Therefore, when the message receiving task is not in the process of receiving or completed (e.g., ...), ... Figure 2 As shown, at this time, the state machine module puts the message receiving task in an unstarted state. The state machine module can transmit the messages received from the listening module to the view display module in real time, so that the view display module can render them on the display interface to achieve a layout effect of mixed text and graphics in the same text view.
[0031] Step S120: The state machine module reads and identifies the messages transmitted in real time by the listening module; when a predetermined start marker is identified, the state machine module updates the status of the message receiving task to receiving and uses the pre-stored local placeholder image as a temporary image to be loaded, so that the view display module refreshes the client's display interface to display the local placeholder image at the display interface position corresponding to the image to be loaded.
[0032] More specifically, the state machine module can read the real-time input messages character by character. When the state machine module recognizes the start identifier "![", it can determine that a message receiving task has started. Therefore, when the state machine module recognizes the start identifier, the status of the message receiving task can be updated from "never started" or "completed" to "receiving". Furthermore, this application design allows the state machine module to obtain a local placeholder image and send it to the view display module when the message receiving task status is updated to "receiving". This ensures that the view display module only refreshes the display interface once upon receiving the corresponding image (i.e., the local placeholder image), thereby displaying the local placeholder image at a specific display position on the display interface. Additionally, as... Figure 2 As shown, this application can further describe the state change of the message receiving task when the start marker is identified in more detail: when the state machine module identifies the predetermined start marker, the state of the message receiving task is updated to start, and at a specific time after the start marker is identified (e.g., 10 seconds after the start marker is identified), the state of the message receiving task is updated from start to receiving; while the state of the message receiving task is start, a pre-stored local placeholder image can be used as a temporary image to be loaded, so that the local placeholder image is displayed at the display interface position corresponding to the image to be loaded. For simplicity, the following description focuses on the state update of the message receiving task to receiving when the predetermined start marker is identified.
[0033] In some embodiments of the present invention, a pre-stored local placeholder image is used as a temporary image to be loaded, including: the state machine module controlling the placeholder image management module to start, so as to generate a placeholder image link; the state machine module obtaining a local placeholder image from the client's local cache based on the mapping relationship between the placeholder image link obtained from the placeholder image management module and the local cache stored in the client, and sending the local placeholder image to the view display module for display; or, the state machine module obtaining a local placeholder image from the client's local cache based on the mapping relationship between the pre-stored placeholder image link and the local cache stored in the client, and sending the local placeholder image to the view display module for display.
[0034] More specifically, the process of the state machine module obtaining the placeholder image link in this application can be as follows: upon recognizing a predetermined start identifier, the state machine module generates a placeholder image link generation instruction and sends it to the placeholder image management module, thereby controlling the start of the placeholder image management module; after the placeholder image management module starts, it can generate a placeholder image link, allowing the state machine module to obtain the placeholder image link from the placeholder image management module; alternatively, the state machine module may pre-store self-set placeholder image links. After the state machine module obtains the placeholder image link, it can generate an image query request containing the placeholder image link and send it to the image cache pool, thereby matching the corresponding local placeholder image based on the mapping relationship stored in the image cache pool, allowing the state machine module to obtain the local placeholder image. After the state machine module obtains the local placeholder image, it can generate a control instruction containing the local placeholder image and send it to the view display module. Upon receiving the instruction, the view display module refreshes the display interface and displays the local placeholder image at the display interface position corresponding to the image to be loaded.
[0035] The method of obtaining placeholder image links by the state machine module mentioned above is merely an example, and the present invention is not limited thereto. For example, although the client loads images via image links in the above example, since the syntax structure of Markdown images contains image links, the syntax structure of Markdown placeholder images can also be pre-stored in the state machine module (i.e., the syntax structure of local placeholder images embedded in the Markdown document (such as "![local placeholder image (http: / / www.placeholder.com)")), or the syntax structure of Markdown placeholder images can be generated by the placeholder image management module.
[0036] It should be noted that, to reduce the number of screen flickering events, this application uses placeholder images to temporarily occupy the image positions until the images to be loaded are fully loaded, thus providing visual anticipation. Therefore, the client's local cache always stores local placeholder images and the mapping relationship between them and their corresponding links. Furthermore, this application can use a single, unified placeholder image to display all images that have not yet been fully loaded, or it can store multiple local placeholder images in the client's local cache and use different placeholder images to replace different images to be loaded.
[0037] As an example, this application can design only a temporary, uniform placeholder image link (such as http: / / www.placeholder.com). When the link to the image to be loaded in the message is not fully received (at this time, the message receiving task status is "receiving"), the listening module and state machine module can continuously receive messages from the server in the background, but the view display module only refreshes the display interface once, thereby displaying the local placeholder image corresponding to the placeholder image link at the display interface position corresponding to the image to be loaded. At this time, what is displayed on the display interface is the local placeholder image, rather than the syntax structure of the Markdown image to be loaded or the constantly changing link to the image to be loaded. This can hide the message receiving process and fix the view layout, avoiding interface flickering caused by frequent refreshes when the link changes later.
[0038] Step S130: When the state machine module recognizes the predetermined end marker, the status of the message receiving task is updated from receiving to completed, and the link of the image to be loaded is extracted from the data between the start marker and the end marker (or the currently received message). The image to be loaded is then loaded based on the link of the image to be loaded, so that the view display module can replace the local placeholder image with the image to be loaded, and finally display the image to be loaded at the display interface position corresponding to the image to be loaded.
[0039] More specifically, during the period from when the message receiving task is in "receiving" to when it is updated to "complete," although the listening module and state machine module continue to receive messages, the display interface remains in a state of displaying a local placeholder image. That is, the view display module does not continuously refresh the display interface as the link content of the image to be loaded is gradually received. When the state machine module recognizes the ")" character, it can determine that the link of the image to be loaded has been completely received (i.e., the actual link of the image to be loaded can be extracted from the currently received message). At this time, the status of the message receiving task can be updated from "receiving" to "complete." This application's design allows the state machine module to extract the link of the image to be loaded from the currently received message when the message receiving task is complete, load the image based on the link, and control the client's local cache and view display module to update.
[0040] In some embodiments of the present invention, since the image cache pool stores the mapping relationship between locally cached images and their corresponding links, loading the image to be loaded based on the link of the image to be loaded includes: the state machine module comparing the link of the image to be loaded with the mapping relationship stored in the image cache pool; if an image link matching the link of the image to be loaded is found in the image cache pool, the state machine module can directly retrieve the corresponding image from the client's local cache; otherwise, the state machine module (or the network loading module controlled by the state machine module) initiates a loading request to the server to obtain the image to be loaded. The loading request includes the link information of the image to be loaded.
[0041] More specifically, the process of loading the image to be loaded may include: Step S01, cache query: The state machine module generates a query instruction based on the link of the image to be loaded, and compares the mapping relationship in the image cache pool with the link of the image to be loaded based on the instruction; if a matching image link is found in the image cache pool, the state machine module can directly obtain the corresponding local cached image from the client's local cache according to the matching image link. Step S02, network loading: If no matching image link is found in the image cache pool, the state machine module can initiate a loading request to the server (or the state machine module controls the network loading module to initiate a loading request to the server), thereby enabling the state machine module to obtain the image to be loaded. Regardless of whether it is cache query or network loading, after the state machine module obtains the image to be loaded, it will generate a control instruction containing the image to be loaded and send it to the view display module, so that after receiving the instruction, the view display module will refresh the display interface and display the image to be loaded at the display interface position corresponding to the image to be loaded. This display interface update will display the final image to be loaded, and can achieve a smooth, flicker-free transition from the local placeholder image to the actual image. In this application, the network loading module can be set up separately or included in the state machine module.
[0042] As an example, to achieve a smooth transition, this application can be designed to load the image to be loaded using an asynchronous loading method (in this case, the loading request sent to the server is an asynchronous loading request) in the background of the client, so as to smoothly replace the local placeholder image at the display position corresponding to the image to be loaded. The view display module also uses an asynchronous rendering method when rendering the image to be loaded. Similarly, since the local placeholder image is stored in the local cache of the client and the retrieval speed is fast, the local placeholder image does not need to be loaded asynchronously. However, the view display module can still use an asynchronous rendering method when rendering the local placeholder image to avoid interface lag and improve smoothness.
[0043] Furthermore, for newly loaded images from the network, the loaded images and their corresponding links can be stored in an image cache pool for later use, avoiding duplicate network requests and image decoding, thus improving loading speed. In other words, the images already loaded in the local cache are images previously loaded by the client. The image cache pool can be an LruCache maintained in the client cache, with a capacity of multiple image objects.
[0044] Furthermore, this application can also design the image cache pool to be updated periodically or when its capacity reaches its limit. For example, when the image cache pool reaches its limit, the mapping relationships and corresponding local cached images in the image cache pool can be cleared in batches, or the image added to the client's local cache and its earliest added image and corresponding mapping relationship can be replaced with the image to be added to the client's local cache. The above update methods are merely examples, and the present invention is not limited thereto.
[0045] Before the state machine module recognizes the predetermined start marker, or after a set time following the recognition of the end marker, the state machine module can set the status of the message receiving task to "not started".
[0046] The method proposed in this application is applicable to the field of mobile application development technology, particularly to chat message fragments containing Markdown format image links received in a streaming manner in instant messaging applications. Furthermore, the method proposed in this application has the following significant advantages: ① It introduces a state machine module to manage the state of the message receiving task. Recognizing the start identifier "![" immediately triggers the replacement of the local placeholder image with the new one, and recognizing the end identifier ")" triggers the loading and display of the image to be loaded. ② During the lengthy streaming process, the mechanism of replacing the start identifier with a local placeholder image, along with the asynchronous loading and rendering process, completely hides the process of receiving and splicing the links to the image to be loaded. The display interface only relies on the local placeholder image for a single refresh, completely eliminating frequent refreshes and flickering caused by the incremental changes in link content. This allows the user to perceive only a momentary, smooth evolution from placeholder to clear image. ③ The designed image cache pool, through an efficient caching mechanism, greatly reduces network requests in streaming scenarios (such as discussing the same image multiple times with AI) or when messages are repeatedly displayed (such as scrolling through a playback), significantly improving image loading speed and saving bandwidth. Furthermore, based on the client's local caching function, the image loading process can be optimized by querying the local cache, loading from the network, and updating the cache when loading images to be loaded. ④ The image display method proposed in this application summarizes the complete process of state recognition, local placeholder image stabilization, asynchronous loading of images to be loaded, caching acceleration, and smooth replacement.
[0047] Corresponding to the above method, the present invention also provides an image display device for a streaming reception scenario. The device includes a computer device, which includes a processor and a memory. The memory stores computer programs / instructions, and the processor is used to execute the computer programs / instructions stored in the memory. When the computer programs / instructions are executed by the processor, the device implements the steps of the method described above.
[0048] This invention also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0049] This invention also provides a computer program product storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer program product can be a tangible product, such as random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of product known in the art.
[0050] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0051] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0052] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0053] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for displaying images in a streaming reception scenario, characterized in that, The method is executed by a client, which includes a listening module, a state machine module, and a view display module. The method includes the following steps: The listening module receives messages from the server in a streaming manner and sends the received messages to the state machine module in real time; wherein, the complete message from the server includes the syntax structure of the image to be loaded embedded in the Markdown document, and the syntax structure of the image to be loaded includes the link of the image to be loaded. The state machine module reads and identifies the message in real time. When a predetermined start marker is identified, the status of the message receiving task is updated to receiving. The pre-stored local placeholder image is used as a temporary image to be loaded, so that the view display module refreshes the display interface to display the local placeholder image at the display interface position corresponding to the image to be loaded. When the state machine module recognizes a predetermined end marker, it updates the status of the message receiving task from "receiving" to "completed" and extracts the link of the image to be loaded from the data between the start marker and the end marker. The image to be loaded is then loaded based on the link, so that the view display module can replace the local placeholder image with the image to be loaded.
2. The method according to claim 1, characterized in that, The client also includes a network loading module, and the client's local cache stores the mapping relationship between locally cached images and corresponding links, as well as the locally cached images; The process of loading the image based on the link to be loaded includes: If a matching image link is found based on the mapping relationship, the state machine module directly retrieves the corresponding image from the client's local cache according to the matched image link. Otherwise, the state machine module controls the network loading module to initiate an asynchronous loading request to the server, thereby loading the image to be loaded. The asynchronous loading request contains the link to the image to be loaded.
3. The method according to claim 2, characterized in that, After loading the image to be loaded, the method further includes: adding the mapping relationship between the link of the image to be loaded and the image to be loaded, as well as the loaded image to be loaded, to the local cache of the client.
4. The method according to claim 2, characterized in that, After the image to be loaded is obtained, the method further includes: the state machine module sending the image to be loaded to the view display module, and controlling the view display module to perform asynchronous rendering.
5. The method according to claim 2, characterized in that, The client also includes a placeholder image management module; the locally cached images include local placeholder images; The step of using a pre-stored local placeholder image as a temporary image to be loaded includes: The state machine module controls the placeholder image management module to start, generating placeholder image links; based on the mapping relationship between the placeholder image links obtained from the placeholder image management module and the client's local cache, the state machine module retrieves a local placeholder image from the client's local cache and sends the local placeholder image to the view display module for display; or The state machine module retrieves a local placeholder image from the client's local cache based on the pre-stored placeholder image links and the mapping relationship stored in the client's local cache, and sends the local placeholder image to the view display module for display.
6. The method according to claim 1, characterized in that, The view display module does not refresh the display interface after displaying the local placeholder image and before loading the image to be loaded. Before the state machine module recognizes the predetermined start marker, or after a set time following the recognition of the end marker, the state machine module sets the state of the message receiving task to "not started".
7. The method according to claim 1, characterized in that, The syntax structure of the image to be loaded is ![alternative text] (link to the image to be loaded "optional title"), the predetermined start identifier is the "![" character, and the predetermined end identifier is the ")" character.
8. An image display device for a streaming reception scenario, comprising a processor, a memory, and a computer program / instructions stored in the memory, characterized in that, The processor is configured to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the method as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.