A mail content display method, device, equipment and storage medium

By performing a preorder traversal of the email content and detecting the amount of data, the problem of lag caused by long email loading times was solved, resulting in more efficient rendering and improved reading experience.

CN122309867APending Publication Date: 2026-06-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-12-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies take a long time to load email content, especially emails with a lot of text, causing lag and affecting the reading experience.

Method used

By performing a preorder traversal of the target email's document object model tree, copying the nodes to the second document object model tree, and monitoring the data volume in real time, rendering and displaying the data when the threshold is reached, unnecessary repeated traversals are avoided.

Benefits of technology

It improves the efficiency of email content loading and rendering, reduces the probability of lag, and enhances the reading experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309867A_ABST
    Figure CN122309867A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and storage medium for displaying email content. In response to a request to view a target email, a first document object model (DOM) tree corresponding to the target email is obtained. A preorder traversal is performed on each node in the first DOM tree. Based on the traversal results, the nodes are copied to a second DOM tree. The first data volume of nodes in the second DOM tree is monitored in real time. If the first data volume does not reach a first threshold, the traversal and copying continue. If the first threshold is reached, the content of the target email is rendered and displayed based on the nodes in the current second DOM tree. This application can effectively improve the efficiency of email content loading and rendering, reduce the probability of lag, and thus improve the email viewing experience. The technical solution of this application can be widely applied in the field of email processing technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of email processing technology, and in particular to a method, apparatus, device, and storage medium for displaying email content. Background Technology

[0002] With the rapid development of information technology, related services have gradually become integrated into people's lives. For example, email service is an application that sends, receives, and manages emails via the Internet. It plays an important role in modern communication and is widely used in many fields such as personal communication, business collaboration, customer service, and marketing.

[0003] In related technologies, when displaying email content, browsers and email clients typically read the corresponding Hypertext Markup Language (HTML) content of the email and then render it onto the interface for viewing. This approach is practical for emails with short body text. However, some emails may have a long body text, and opening such emails can lead to prolonged lag due to the long loading time, negatively impacting the email reading experience. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for displaying email content, which can effectively improve the efficiency of email content loading and rendering, reduce the probability of lag, and thus improve the email reading experience.

[0005] One aspect of this application provides a method for displaying email content, the method comprising:

[0006] In response to a request to view a target email, a first document object model tree corresponding to the target email is obtained; wherein the first document object model tree includes several nodes;

[0007] Perform a preorder traversal on each node in the first document object model tree, and copy the node to the initialized second document object model tree based on the traversal result;

[0008] Detect the first data volume corresponding to all the nodes in the second document object model tree;

[0009] If the first data volume reaches the first threshold, the content of the target email is rendered and displayed according to the node in the second document object model tree;

[0010] If the first data volume does not reach the first threshold, return to the step of performing a preorder traversal of each node in the first document object model tree.

[0011] On the other hand, embodiments of this application provide a device for displaying email content, the device comprising:

[0012] A response unit is configured to respond to a viewing request for a target email by obtaining a first document object model tree corresponding to the target email; wherein the first document object model tree includes a plurality of nodes;

[0013] The traversal unit is used to perform a preorder traversal of each node in the first document object model tree, and copy the node to the initialized second document object model tree according to the traversal result;

[0014] The detection unit is used to detect the first data volume corresponding to all the nodes in the second document object model tree;

[0015] The first execution unit is configured to render and display the content of the target email according to the nodes in the second document object model tree if the first data volume reaches the first threshold.

[0016] The second execution unit is configured to return to the step of performing a preorder traversal of each node in the first document object model tree if the first data volume does not reach the first threshold.

[0017] Optionally, in some embodiments, the display device further includes a trigger unit, the trigger unit being used to:

[0018] Detect the interactive operations of the target object, and generate the reading request based on the interactive operations;

[0019] Alternatively, the voice data of the target object can be obtained, speech recognition can be performed on the voice data, and the reading request can be generated based on the speech recognition result.

[0020] Optionally, in some embodiments, the response unit is specifically used for:

[0021] Obtain the Hypertext Markup Language content corresponding to the target email;

[0022] The hypertext markup language content is parsed to determine the hypertext markup language elements in the target email;

[0023] Based on the Hypertext Markup Language elements, a first document object model tree corresponding to the target email is constructed.

[0024] Optionally, in some embodiments, the traversal unit is specifically used for:

[0025] Perform a preorder traversal of each node in the first document object model tree;

[0026] If the node traversed is a leaf node, copy the node to the second document object model tree;

[0027] If the node traversed is not a leaf node, check the child nodes of the node. If all the child nodes of the node are copied to the second document object model tree, copy the node to the second document object model tree.

[0028] Optionally, in some embodiments, the display device further includes a rendering unit, the rendering unit being used for:

[0029] In the first document object model tree, the nodes that have been copied to the second document object model tree are marked;

[0030] Perform a preorder traversal on each unmarked node in the first document object model tree, and copy the unmarked nodes to the second document object model tree based on the traversal results;

[0031] Detect the second data volume corresponding to the newly added node in the second document object model tree in the current rendering round;

[0032] If the second data volume reaches the second threshold, the content of the target email is rendered and displayed according to the nodes in the second document object model tree;

[0033] Wherein, the second threshold is greater than or equal to the first threshold.

[0034] Optionally, in some embodiments, the display device further includes a first setting unit, which is specifically used for:

[0035] Obtain the display area parameters corresponding to the display page of the target email;

[0036] Detect the currently set display font size;

[0037] The amount of data that the display page can accommodate is determined based on the display area parameters and the display font size;

[0038] The first threshold is determined based on the amount of data to be contained.

[0039] Optionally, in some embodiments, the display device further includes a second setting unit, which is specifically used for:

[0040] Detect the network environment parameters of the mail server corresponding to the target email;

[0041] Based on the network environment parameters, determine the network quality score;

[0042] The first threshold is determined based on the network quality score;

[0043] The magnitude of the first threshold is positively correlated with the magnitude of the network quality score.

[0044] Optionally, in some embodiments, the second setting unit is specifically used for:

[0045] The throughput, round-trip latency, and packet loss rate of the mail server are detected during a predetermined transmission period.

[0046] The network quality score is determined based on the throughput, the round-trip time, and the packet loss rate.

[0047] Optionally, in some embodiments, the display device further includes a cache unit, the cache unit being specifically used for:

[0048] Cache the homepage content of the target email;

[0049] In response to a request to repeatedly view the target email, retrieve the cached homepage content;

[0050] The homepage content is rendered and displayed, and an asynchronous task is started to load other content of the target email besides the homepage content.

[0051] On the other hand, embodiments of this application provide an electronic device, including a processor and a memory;

[0052] The memory is used to store computer programs;

[0053] The processor executes the computer program to implement the aforementioned method for displaying email content.

[0054] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program, which is executed by a processor to implement the aforementioned method for displaying email content.

[0055] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned method for displaying email content.

[0056] The embodiments of this application include at least the following beneficial effects: This application provides a method, apparatus, device, and storage medium for displaying email content. In response to a request to view a target email, a first document object model (DOM) tree corresponding to the target email is obtained. A pre-order traversal is performed on each node in the first DOM tree. Based on the traversal results, the nodes are copied to a second DOM tree. The first data volume of nodes in the second DOM tree is detected in real time. If the first data volume does not reach a first threshold, the traversal and copying continue. If the first threshold is reached, the content of the target email is rendered and displayed based on the nodes in the current second DOM tree. This application can improve the efficiency of email content loading and rendering, reduce the probability of lag, and thus improve the email viewing experience by performing a pre-order traversal on the first DOM tree corresponding to the target email and copying the beginning part of the target email content as nodes to the second DOM tree. Then, when the copied data volume reaches the first threshold, the content in the second DOM tree is directly rendered and displayed. Attached Figure Description

[0057] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0058] Figure 1 This is a schematic diagram illustrating the principle of displaying email content used in related technologies;

[0059] Figure 2 This is a system architecture diagram used for a method of displaying email content provided in an embodiment of this application;

[0060] Figure 3 This is a schematic diagram of the interface of an online shopping application provided in the embodiments of this application;

[0061] Figure 4 This is a flowchart illustrating a method for displaying email content provided in an embodiment of this application;

[0062] Figure 5 This is a schematic diagram of the structure of a first document object model tree provided in the embodiments of this application;

[0063] Figure 6 This is a schematic diagram illustrating a method of copying a fourth node to a second document object model tree, as provided in an embodiment of this application.

[0064] Figure 7 This is a schematic diagram illustrating a method of copying a fifth node to a second document object model tree, as provided in an embodiment of this application.

[0065] Figure 8This is a schematic diagram illustrating a method of copying a second node to a second document object model tree, as provided in an embodiment of this application.

[0066] Figure 9 This is a schematic diagram illustrating the display of email content provided in an embodiment of this application;

[0067] Figure 10 This is a schematic diagram illustrating data transmission for displaying a target email, provided in an embodiment of this application.

[0068] Figure 11 This is a structural block diagram of an email content display device provided in an embodiment of this application;

[0069] Figure 12 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0070] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0071] It is understood that the terms “first,” “second,” etc., used in this application may be used to describe various concepts herein, but unless otherwise stated, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another.

[0072] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.

[0073] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application are explained, and the nouns and terms used in the embodiments of this application shall be interpreted as follows:

[0074] 1) HTML (HyperText Markup Language) is the standard markup language used to create web pages. It forms the foundation of web pages, defining their structure and content.

[0075] 2) SMTP (Simple Mail Transfer Protocol) is a communication protocol used for sending emails. It is one of the standard Internet protocols, primarily used for transmitting emails between mail servers or from mail clients to mail servers, defining the communication rules between email senders and receivers.

[0076] 3) The Document Object Model Tree (DOM tree) is a hierarchical representation generated by the browser when parsing an HTML document. It represents the entire content of a webpage as a tree structure composed of nodes, where each node represents an element, attribute, text, or other component of the document.

[0077] With the rapid development of information technology, related services have gradually become integrated into people's lives. For example, email service is an application that sends, receives, and manages emails via the Internet. It plays an important role in modern communication and is widely used in many fields such as personal communication, business collaboration, customer service, and marketing.

[0078] For example, in personal communication scenarios, people can use email to communicate informally or formally with friends, family, and colleagues; in corporate collaboration scenarios, employees can use email to report tasks, discuss projects, and communicate; and in marketing scenarios, emails can be sent to potential customers to promote new products or special offers.

[0079] Of course, it is understood that the application scenarios for email services are not limited to the examples mentioned above, and this application does not impose any restrictions on them.

[0080] Reference Figure 1 , Figure 1 The diagram illustrates a principle of displaying email content used in related technologies. In these technologies, when displaying email content, browsers and email clients typically read the corresponding Hypertext Markup Language (HTML) content and then render it onto the interface for viewing. This approach is practical for emails with short body text; however, some emails may have lengthy body text. When opening such emails, the long loading time can lead to prolonged lag, negatively impacting the email reading experience.

[0081] In view of this, embodiments of this application provide a method, apparatus, device, and storage medium for displaying email content. In response to a request to view a target email, a first document object model (DOM) tree corresponding to the target email is obtained. A pre-order traversal is performed on each node in the first DOM tree. Based on the traversal results, the nodes are copied to a second DOM tree. The first data volume of nodes in the second DOM tree is monitored in real time. If the first data volume does not reach a first threshold, the traversal and copying continue. If the first threshold is reached, the content of the target email is rendered and displayed based on the nodes in the current second DOM tree. This application can improve the efficiency of email content loading and rendering, reduce the probability of lag, and thus improve the email viewing experience by performing a pre-order traversal on the first DOM tree corresponding to the target email, copying the beginning portion of the target email content as nodes to the second DOM tree, and then directly rendering and displaying the content in the second DOM tree when the copied data volume reaches the first threshold.

[0082] System architecture and scenario description used in the embodiments of this application

[0083] Figure 2 This is a system architecture diagram of an email content display method provided in this application embodiment, which includes a terminal device 240, an Internet 230, a gateway 220, a backend server 210, etc.

[0084] In this embodiment, the terminal device 240 may include various forms such as a desktop computer, laptop computer, PDA (personal digital assistant), mobile phone, vehicle terminal, home theater terminal, and dedicated terminal. Furthermore, it can be a single device or a collection of multiple devices. The terminal device 240 can communicate with the Internet 230 via wired or wireless means to exchange data.

[0085] A backend server 210 refers to a computer system that can provide certain services to terminal devices 240. Compared to ordinary terminal devices 240, backend servers 210 have higher requirements in terms of stability, security, and performance. A backend server 210 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines).

[0086] Gateway 220, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal device 240 to backend server 210 are forwarded to the corresponding backend server 210 via gateway 220. Messages sent from backend server 210 to terminal device 240 are also forwarded to the corresponding terminal device 240 via gateway 220.

[0087] The backend server 210 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0088] The email content display method provided in this application embodiment can be executed independently on the terminal device 240 side, or the email content can be displayed on the terminal device 240 side based on the data transmission between the terminal device 240 and the backend server 210. This application does not limit this.

[0089] Of course, it is understood that the implementation environment corresponding to the method in the embodiments of this application is not limited to that of the implementation environment. Figure 2 As shown, those skilled in the art can flexibly select the specific implementation environment according to actual needs, and this application does not impose any restrictions on this.

[0090] The email content display method provided in this application embodiment can be executed in various scenarios, and the following is an exemplary description of it.

[0091] (a) Scenarios for Status Reporting

[0092] The method provided in this application embodiment can be applied to status reporting scenarios.

[0093] In network communication systems, devices (such as mobile terminals and IoT devices) typically need to report their current network status to servers or network management platforms periodically or irregularly. This network status information may include, but is not limited to: network connection type (such as Wi-Fi, 4G, 5G, etc.), signal strength, latency, packet loss rate, bandwidth, connection stability, and other network performance-related metrics.

[0094] In this scenario, the relevant data can be sent via email. The method in this application embodiment can speed up the display of email content and facilitate reading.

[0095] (II) Online shopping scenarios

[0096] Currently, online shopping is widely popular. E-commerce websites typically contain a large number of product images, videos, and related documents. Shoppers can log in to these websites to make purchases. A good e-commerce website should have high-performance data transmission capabilities and reliable data storage capabilities.

[0097] The method described in this application embodiment can be applied to online shopping scenarios, for example, referring to... Figure 3 , Figure 3 A schematic diagram of the interface of an online shopping application is shown. This application can include an email promotion function, allowing merchants to send promotional emails to potential shoppers. Applying the methods described in this embodiment to the shopper's device can improve the display efficiency of email content.

[0098] General Description of Embodiments in this Application

[0099] Please refer to Figure 4 , Figure 4 This illustration shows a flowchart of a method for displaying email content provided in an embodiment of this application. Figure 4 As shown, a method for displaying email content according to an embodiment of this application includes, but is not limited to, the following steps:

[0100] Step 410: In response to a viewing request for the target email, obtain the first document object model tree corresponding to the target email; wherein the first document object model tree includes several nodes;

[0101] Step 420: Perform a preorder traversal of each node in the first document object model tree, and copy the nodes to the initialized second document object model tree according to the traversal results;

[0102] Step 430: Detect the first data volume corresponding to all nodes in the second document object model tree;

[0103] Step 440: If the first data volume reaches the first threshold, render and display the content of the target email according to the nodes in the second document object model tree;

[0104] Step 450: If the first data volume does not reach the first threshold, return to the step of performing a preorder traversal of each node in the first document object model tree.

[0105] In this embodiment of the application, a method for displaying email content is provided. This method can perform a preorder traversal of the first document object model tree corresponding to the target email, copy the first part of the target email content as nodes to the second document object model tree, and then directly render and display the content in the second document object model tree when the amount of copied data reaches a first threshold. This can effectively improve the efficiency of email content loading and rendering, reduce the probability of lag, and thus improve the email reading experience.

[0106] In this embodiment, the email containing the content to be displayed is referred to as the target email. The content of the target email can be varied. For example, in some embodiments, the target email may be a business communication email, such as a report on project progress or meeting minutes; in some embodiments, the target email may be a job application email, i.e., an email from an applicant sending their resume and cover letter to a potential employer; in some embodiments, the target email may be an invitation to someone to attend an event, meeting, or gathering. In this embodiment, there are no restrictions on the specific content or language used in the target email; it can be flexibly adjusted according to actual needs.

[0107] For the target email, it can generally be edited, sent, and transmitted via an email client or a web page. After the editor completes the content of the target email, they can click the send button, and the email client or web page can deliver the email to the recipient's mailbox. Typically, email transmission can be achieved through SMTP (Simple Mail Transfer Protocol). In this embodiment, the specific transmission process of the target email is not limited.

[0108] After receiving the target email, the recipient can open and view it. The technical solution in this embodiment can be applied to the recipient's terminal device. Specifically, when the recipient opens the target email, a request will be triggered, which is referred to as a viewing request in this embodiment.

[0109] Of course, it should be noted that although the target email is sent to the email address of the designated recipient, the actual person who triggers the viewing request may not be the recipient. In this embodiment of the application, there is no restriction on the person who triggers the viewing request.

[0110] In step 410, upon receiving a request to view the target email, the document object model tree corresponding to the target email can be obtained. In this embodiment, it is referred to as the first document object model tree. Emails generally use Hypertext Markup Language (HTML). The document object model tree is a hierarchical representation generated when parsing HTML content. It is a tree structure with multiple nodes, each of which represents an element, attribute, text, or other component in the original data.

[0111] In this application, the number and type of nodes included in the first document object model tree are not limited. Exemplarily, in some embodiments, the first document object model tree may include element nodes, text nodes, attribute nodes, and comment nodes. Element nodes are tags in Hypertext Markup Language (HTML), text nodes represent the text content between elements, attribute nodes represent the attributes of elements, and comment nodes represent comment sections in HTML. Of course, the first document object model tree may also include other similar nodes, and this application does not impose any limitations on this.

[0112] In some embodiments, based on the correspondence between nodes and emails, nodes can be further divided into root nodes, document structure nodes, and body content nodes, etc., where the root node is the basic node of the target email; document structure nodes can be used to identify which part of the target email each node's content belongs to, for example, they can include nodes such as `head`, `title`, and `meta`, where the `head` node can include metadata, title, and other information of the target email, the `title` node can include the subject information of the target email, and the `meta` node can include character encoding, description, keywords, and other information of the target email. In this embodiment, there are no restrictions on the nodes in the first document object model tree.

[0113] In this embodiment of the application, relationships exist between nodes in the first document object model tree, which can be described using hierarchical structures such as parent-child relationships and sibling relationships. Specifically, in the first document object model tree, nodes have multiple levels. Besides the root node, each node has a unique parent node, which is its direct superior node. A parent node can include one or more child nodes, which are nodes directly below the parent node and connected to it. All child nodes under the same parent node are sibling nodes. In particular, nodes without child nodes are generally called leaf nodes. For example, text nodes are usually leaf nodes because they do not contain other elements.

[0114] For example, please refer to Figure 5 , Figure 5This illustration shows a structural diagram of a first document object model tree provided in an embodiment of this application, such as... Figure 5 As shown, the first document object model tree can include six nodes, denoted as node A, node B, node C, node D, node E, and node F. Node A is the root node. Node A has two child nodes, node B and node C. Node B has two child nodes, node D and node E. Node C has one child node, node F. It's easy to understand that a node can be both a child of other nodes and a parent of some other nodes (such as node B and node C). Of course, an actual first document object model tree can include more or fewer nodes, and the connections between nodes do not necessarily need to be as detailed. Figure 5 As shown, this application does not impose any limitations on this.

[0115] In step 420, after obtaining the first document object model tree, a preorder traversal can be performed on each node. Preorder traversal is a traversal method for tree data structures. Its traversal order can be represented as: starting from the root node, recursively preorder traversing the subtrees on one side from the current node, and then recursively preorder traversing the subtrees on the other side. Generally, the left subtree is preorder traversed, and then the right subtree is preorder traversed. For example, using... Figure 5 Taking the first document object model tree as an example, a preorder traversal is performed on it. The traversal order is as follows: first node A, second node B, fourth node D, fifth node E, third node C, and sixth node F.

[0116] After completing the preorder traversal, the nodes in the first document object model tree can be sequentially copied to another initialized document object model tree based on the traversal results. In this embodiment, this is referred to as the second document object model tree. The second document object model tree is obtained by copying nodes from the first document object model tree. Initially, the second document object model tree does not contain any nodes.

[0117] It should be noted that in this embodiment of the application, when the nodes in the first document object model tree are copied to the second document object model tree, the level of each node and the connection relationship between the nodes are preserved during the copying process.

[0118] In step 420, by copying the nodes in the first document object model tree to the second document object model tree, the content of the target email can be transferred to the second document object model tree. Furthermore, since it is a preorder traversal, the content of the nodes at the beginning of the target email will be transferred to the second document object model tree first. In this way, when using the data in the second document object model tree for rendering and display, the display order of the content of the target email will not be disturbed.

[0119] In step 430, while copying the nodes in the first document object model tree to the second document object model tree, the amount of data corresponding to all nodes in the second document object model tree can be detected in real time. In this embodiment, this amount is referred to as the first data amount.

[0120] Specifically, when detecting the first data volume, the data volume of each node can be statistically analyzed. Generally, the nodes converted from relevant content in an email are mostly text nodes, and the data volume of a text node depends on the length of the text. Therefore, in this embodiment, the data volume of each node in the second document object model tree can be determined relatively easily, and the first data volume can be obtained by accumulating them.

[0121] In this embodiment, for the target email, it is desirable to render and display its content as quickly as possible. Therefore, this application can render and display the nodes contained in the second document object model tree first. This allows the content at the beginning of the target email to be rendered for viewing first, thus speeding up the display process. However, if the amount of data in the second document object model tree is small, even with rapid display, there may be incomplete data, making it unreadable. Therefore, it is necessary to wait until the amount of data in the second document object model tree reaches a certain level before rendering and displaying it.

[0122] In this embodiment, a threshold can be determined, denoted as the first threshold. When detecting the first data volume corresponding to the second document object model tree, the first data volume can be compared with the first threshold to determine whether the node data in the second document object model tree is available for display. This application does not limit the specific size of the first threshold, which can be flexibly set according to actual needs.

[0123] In step 440, the first data volume is compared with the first threshold. If it is determined that the first data volume is greater than or equal to the first threshold, the content of the target email can be rendered and displayed according to the nodes in the second document object model tree.

[0124] Specifically, in this embodiment, a rendering tree can be constructed based on the second document object model tree. The rendering tree is another tree structure that contains various visible elements and style information. Next, layout calculations can be performed based on the page layout, considering attributes such as element width, height, margins, padding, and positioning to determine their display positions in the viewport. This process recursively processes the entire rendering tree, ensuring all elements are correctly placed, thus enabling the display of the target email's content.

[0125] In step 450, the first data volume is compared with the first threshold. If it is determined that the first data volume is less than the first threshold, it means that the data volume in the current second document object model tree is not enough and copying needs to continue. At this time, you can return to continue executing step 420.

[0126] In this embodiment of the application, steps 420 to 450 are a cyclical process. Each time a node is copied to the second document object model tree, the corresponding first data volume is detected and compared with the first threshold. If the first threshold is not reached, another node is copied to the second document object model tree until the detected first data volume reaches the first threshold, and then the corresponding rendering and display task is executed.

[0127] It is understood that the email content display method, apparatus, device, and storage medium provided in this application embodiment, in response to a viewing request for a target email, obtains a first document object model tree corresponding to the target email, performs a preorder traversal of each node in the first document object model tree, copies the nodes to a second document object model tree based on the traversal results, and continuously monitors the first data volume of nodes in the second document object model tree. If the first data volume does not reach a first threshold, the traversal and copying continue; if the first threshold is reached, the content of the target email is rendered and displayed based on the nodes in the current second document object model tree. This application can effectively improve the efficiency of email content loading and rendering, reduce the probability of lag, and thus improve the email viewing experience by performing a preorder traversal of the first document object model tree corresponding to the target email, copying the beginning part of the target email content as nodes to the second document object model tree, and then directly rendering and displaying the content in the second document object model tree when the copied data volume reaches the first threshold.

[0128] Specifically, in some embodiments, the viewing request is triggered through the following steps:

[0129] Detect the interactive actions of the target object and generate a viewing request based on the interactive actions;

[0130] Alternatively, acquire the target object's voice data, perform speech recognition on the voice data, and generate a viewing request based on the speech recognition result.

[0131] In this application, there are various ways to generate a viewing request. In some embodiments, the viewing request can be triggered by an interactive operation by a target object. Here, the target object is the person viewing the target email. In this application, the specific implementation of the interaction between the target object and the terminal device to trigger the viewing request is not limited.

[0132] For example, in some embodiments, the terminal device can receive interaction instructions from the target object to relevant components, and use these interaction instructions as instructions to trigger the generation of a viewing request. Here, the relevant components can be components configured in the underlying system of the terminal device or components configured in relevant software clients, and their implementation can be flexibly set as needed. For example, in some embodiments, the component can be a component with voice interaction function, which can recognize the voice data of the target object through voice recognition technology. The target object can interact with the terminal device through voice, such as saying "Please open the email" to the terminal device, thereby triggering the generation of a viewing request. The voice recognition algorithm used in the embodiments of this application can be implemented with reference to related technologies, and will not be described in detail here.

[0133] In some embodiments, the component can also be a touch component. For example, on the front-end interface of an email client, icons corresponding to several operation options can be displayed, including an icon for initiating a viewing request. The target object's clicking of an operation icon on the terminal device screen can trigger the generation of a viewing request. Of course, it is understood that in some embodiments, the received touch, swipe, or other operations of the target object on a designated screen area of ​​the terminal device can also be used as instructions to trigger the generation of a viewing request; this application does not impose specific limitations on this.

[0134] Specifically, in some embodiments, obtaining the first document object model tree corresponding to the target email includes:

[0135] Retrieve the Hypertext Markup Language content corresponding to the target email;

[0136] Parse the Hypertext Markup Language content to identify the Hypertext Markup Language elements in the target email;

[0137] Based on the Hypertext Markup Language elements, the first document object model tree corresponding to the target email is constructed.

[0138] In this embodiment of the application, when obtaining the first document object model tree corresponding to the target email, the hypertext markup language content corresponding to the target email can be obtained first. Generally, the content of the email is written in hypertext markup language (HTML) format and contains various structured information and styles. Therefore, the hypertext markup language content can be obtained directly from the target email itself.

[0139] After obtaining the Hypertext Markup Language (HTML) content corresponding to the target email, it can be parsed. The parsing process is similar to breaking down a complex piece of content into smaller, more easily understood parts. For example, it can identify and separate all tags within the HTML content (e.g., `...`). `、` `、` The parsing process also handles nested structures and determines the hierarchical relationship between each tag.

[0140] After parsing the Hypertext Markup Language (HTML) content, all the HTML elements in the target email are obtained, and the relationships between them are clear. These elements include text paragraphs, images, links, tables, etc. Each element not only contains its tags and attributes but may also contain child elements or other related content. Next, the parsed HTML content can be organized into a hierarchical tree structure. The root node of the tree can be a specific element representing the entire HTML document (i.e., the target email), the next level nodes can be the document header and body, and further down there will be more child nodes, such as paragraphs, lists, images, etc. It is understood that in this embodiment, each node has a clear parent-child relationship in the first document object model tree, and these relationships reflect the nested structure of the HTML document.

[0141] In this embodiment, the Hypertext Markup Language (HMR) content is extracted from the target email, parsed, all HMR elements are identified, and a clear, hierarchical Document Object Model (DOM) tree is constructed, which can provide a basic structure for the subsequent display of the target email content.

[0142] Specifically, in some embodiments, a preorder traversal is performed on each node in the first document object model tree, and the nodes are copied to the initialized second document object model tree based on the traversal results, including:

[0143] Perform a preorder traversal of each node in the first document object model tree;

[0144] If the node encountered is a leaf node, copy the node to the second document object model tree;

[0145] If the node encountered is not a leaf node, check the node's child nodes. If all of the node's child nodes are copied to the second document object model tree, copy the node to the second document object model tree.

[0146] In this embodiment of the application, when performing a preorder traversal on each node in the first document object model tree and copying the node to the second document object model tree according to the traversal result, during the preorder traversal, for each traversed node, it can be determined from two dimensions whether it needs to be copied to the second document object model tree.

[0147] Specifically, for each node, if it is a leaf node, it can be copied to the second document object model tree. After each node is copied to the second document object model tree, a subsequent first data volume check and comparison are performed, and the traversal begins again. Nodes already copied to the second document object model tree can be marked so that they will not be traversed again during subsequent iterations.

[0148] For example, for Figure 5 The first document object model tree shown, during its first traversal, is traversed in the following order: first node A, second node B, fourth node D, fifth node E, third node C, and sixth node F. The first leaf node encountered is fourth node D. Therefore, during this traversal, when fourth node D is encountered, it is copied to the second document object model tree, and the traversal ends. (See reference...) Figure 6 , Figure 6 This illustration shows a schematic diagram of copying a fourth node to a second document object model tree, as provided in an embodiment of this application. Figure 6 In the second document object model tree, after copying the fourth node D to the second document object model tree, the fourth node D can be marked so that it will not be traversed again.

[0149] Assuming that after comparison, it is determined that nodes need to be copied again, the traversal is performed again, skipping the already copied fourth node D. The traversal order is: first node A, second node B, fifth node E, third node C, and sixth node F. The first leaf node encountered is the fifth node E. During this traversal, when the fifth node E is encountered, it is copied to the second document object model tree, and the traversal ends. (See reference...) Figure 7 , Figure 7 This illustration shows a schematic diagram of copying a fifth node to a second document object model tree, as provided in an embodiment of this application. Similarly, Figure 7 In the second document object model tree, after copying the fifth node E to the second node E, the fifth node E can be marked so that it will not be traversed again.

[0150] In this embodiment of the application, if a node is not a leaf node, but all its child nodes have been copied into the second document object model tree, then when traversing to that node, it can also be copied into the second document object model tree. For example, for Figure 7 In this case, if it's necessary to continue traversing and copying nodes, when traversing to the second node B, it's found that although it's not a leaf node, all its child nodes (the fourth node D and the fifth node E) have already been copied to the second document object model tree. At this point, it can be copied to the second document object model tree, ending the traversal. (See reference...) Figure 8 , Figure 8 This illustration shows a schematic diagram of copying a second node to a second document object model tree, as provided in an embodiment of this application. From Figure 8 As can be seen, in this embodiment of the application, the hierarchical relationship and connection relationship between nodes are preserved when replicating nodes.

[0151] Specifically, in some embodiments, after rendering and displaying the content of the target email, the method further includes:

[0152] In the first document object model tree, the nodes that have been copied to the second document object model tree are marked;

[0153] Perform a preorder traversal of each unmarked node in the first document object model tree, and copy the unmarked nodes to the second document object model tree based on the traversal results;

[0154] Detect the second data volume corresponding to the newly added node in the second document object model tree of the current rendering round;

[0155] If the second data volume reaches the second threshold, the content of the target email is rendered and displayed based on the nodes in the second document object model tree;

[0156] The second threshold is greater than or equal to the first threshold.

[0157] In this embodiment of the application, as described above, when copying a node to the second document object model tree, the node can be marked so that it does not need to be traversed again in subsequent iterations. After the initial rendering and display of the content of the target email, subsequent content can also be rendered segment by segment using the aforementioned logic.

[0158] Specifically, in this embodiment, a preorder traversal can be performed on each unmarked node in the first document object model tree. Based on the traversal result, the unmarked nodes are copied to the second document object model tree. Then, the amount of data corresponding to the newly added nodes in the second document object model tree in the current rendering round can be detected. In this embodiment, this is denoted as the second data amount. A threshold can also be set for the second data amount, which is denoted as the second threshold in this embodiment. Similarly, if the second data amount reaches the second threshold, the content of the target email can be rendered and displayed based on the nodes in the current second document object model tree. For nodes that have already been rendered, there is no need to execute the rendering process again; they can be displayed directly.

[0159] It should be noted that in this embodiment, the second threshold can be greater than or equal to the first threshold. This is because the first threshold corresponds to the amount of data constrained during the initial rendering. Since the goal is to display as much of the target email content as possible to the reader, the first threshold needs to be relatively small, but it shouldn't affect the normal display. After the initial rendering, some content can already be viewed, and the urgency for content display is lower. Therefore, more data can be rendered relatively all at once in subsequent renderings, allowing the second threshold to be slightly larger. This achieves both fast homepage display and reduces the number of rendering iterations, balancing display speed and data processing efficiency.

[0160] Specifically, in some embodiments, the first threshold is determined by the following steps:

[0161] Obtain the display area parameters corresponding to the display page of the target email;

[0162] Detect the currently set display font size;

[0163] Determine the amount of data that the display page can accommodate based on the display area parameters and the display font size;

[0164] Determine the first threshold based on the amount of data to be accommodated.

[0165] In some cases, when determining the first threshold, it can be determined based on the amount of data that the display page can accommodate, so that the first threshold is just enough to display the content of a page.

[0166] Specifically, in this embodiment, the display area parameters corresponding to the display page of the target email can be obtained. The content of the display area parameters may include the width, height, margins, etc. of the display page. These parameters can be obtained through the interface provided by the browser or client, or by querying the style attributes of the container elements in the page. This application does not impose any restrictions on this.

[0167] Furthermore, in this embodiment, the currently set display font size is also obtained. Font size refers to the size of the text on the display page, usually expressed in pixels (px), points (pt), or relative units. In this embodiment, based on the display area parameters and the display font size, the amount of data that the display page can accommodate can be determined, that is, how much data the current display page can display. Specifically, in this embodiment, based on the width of the display area and the font size, combined with the specific characteristics of the font (such as average character width), the approximate number of characters that each line can accommodate can be calculated. Then, based on the height of the display area and the line height, the number of lines of text that the entire display area can accommodate can be calculated. Multiplying the number of characters in each line by the total number of lines yields an approximate number of characters, which is the amount of data that can be accommodated. After obtaining the amount of data that can be accommodated, a first threshold can be determined. The first threshold can be the amount of data that can be accommodated itself, or it can be a value slightly smaller than the amount of data that can be accommodated; this application does not impose any restrictions on this.

[0168] It is understood that, in this embodiment of the application, determining the first threshold by the amount of data the display page can accommodate ensures that the content of the target email displayed initially fills the current page. For example, please refer to... Figure 9 , Figure 9 The illustration shows a schematic diagram of displaying email content provided in an embodiment of this application, such as... Figure 9 As shown, when first displayed, the content of the current page 910 is complete, while the next page 920 (not fully shown in the image) has no content. This constraint ensures that the content of the target email displayed initially is exactly one page, facilitating browsing and preventing unpleasant content interruptions. After browsing the content of the current page 910, the content of the next page 920 has also been largely buffered and rendered, improving the email reading experience.

[0169] Specifically, in some embodiments, the first threshold is determined by the following steps:

[0170] Detect the network environment parameters of the mail server corresponding to the target email;

[0171] Determine the network quality score based on network environment parameters;

[0172] Determine the first threshold based on the network quality score;

[0173] The magnitude of the first threshold is positively correlated with the magnitude of the network quality score.

[0174] In this embodiment, in some cases, the first threshold can also be determined based on the network environment of the mail server. It is understood that when the mail server's network environment is good, the efficiency of processing the target email's data is higher, supporting fast download and rendering. Conversely, when the mail server's network environment is poor, the processing efficiency is lower, and the display is also affected. Therefore, in this embodiment, a corresponding network quality score can be determined based on the mail server's network environment parameters, and then the first threshold can be determined based on the network quality score; the two are positively correlated.

[0175] Specifically, in this embodiment, the network environment parameters of the mail server can be network QoS information. For example, network environment parameters may include, but are not limited to, parameters such as the mail server's retransmission rate (retran_ratio), the number of timeout retransmission packets (retransmit_timeout_packets), the number of TLP (Transaction Layer Packet) retransmission packets, the round-trip time (RTT), the maximum window size (max_cwnd), the packet loss rate (loss_rate), and the throughput (goodput). The RTT can include types such as minimum RTT (min_rtt), smoothed RTT (srtt), and maximum RTT (max_rtt). These network environment parameters can be determined based on their values ​​at the current time point or by taking a predetermined time period backward from the current time point. Specifically, they can be their respective average values ​​(avg_QoS) or a certain quantile value (i-th_QoS), which is not limited in this application.

[0176] For example, in some embodiments, the throughput, round-trip latency, and packet loss rate of the mail server during a predetermined transmission period can be detected. Based on this data, a comprehensive network quality score for the mail server can be determined. Specifically, the higher the throughput, the lower the round-trip latency, and the lower the packet loss rate, the higher the network quality score of the mail server; conversely, the lower the throughput, the higher the round-trip latency, and the higher the packet loss rate, the lower the network quality score. This application does not limit the specific functional relationship between the network quality score and these indicator parameters.

[0177] Specifically, in some embodiments, the method further includes:

[0178] Cache the first page content of the target email;

[0179] In response to repeated viewing requests for the target email, retrieve the cached homepage content;

[0180] Render and display the homepage content, and start an asynchronous task to load other content from the target email besides the homepage content.

[0181] Reference Figure 10 , Figure 10 This illustration shows a data transmission diagram for displaying a target email according to an embodiment of this application. In this embodiment, when the target email is rendered for the first time, its homepage content can be cached in a local database. If there is a need to view the target email again, it can be directly displayed based on the cached homepage content, thereby improving the display efficiency of the target email. Figure 10 As shown, when applying the method in this application embodiment, the relevant application system may include a client, a rendering layer, a service layer, and a local database. The client is the part where the application and the user (e.g., a reader) directly interact; for example, it may be an interactive interface that processes related requests and displays the corresponding results. The rendering layer is responsible for converting data into visual content. In this application embodiment, the rendering layer is mainly responsible for rendering the page layout, style, and specific email content. The service layer acts as a bridge between the rendering layer and the local database. It is responsible for handling the overall business logic and data interaction, and also undertakes security management and performance optimization responsibilities. For example, the service layer in this application embodiment may use a Node.js layer, which can provide interfaces for communication between the front-end (i.e., the client) and the back-end (i.e., the local database). The local database is responsible for storing and managing persistent data, ensuring data integrity and security.

[0182] Specifically, in this embodiment, for the target email, upon initial viewing, the client responds to the viewing request for the target email, obtains the email body, and transmits it to the rendering layer for processing. Simultaneously, the rendering layer transmits it to a local database for persistent storage via the service layer. At the rendering layer, by executing the method in this embodiment, paginated rendering of the target email can be achieved, accelerating the output and presentation efficiency of the email content. At the same time, the obtained homepage content can also be transmitted to a local database for persistent storage via the service layer.

[0183] If there is a need to view the email again, the user can initiate a repeat viewing request. At this time, the rendering layer can directly read the email body and homepage content of the target email from the local database. It then renders and displays the cached homepage content directly. Simultaneously, for other content, an asynchronous task is initiated to load it, achieving paginated rendering of the target email. The specific execution logic can be implemented as described in the aforementioned embodiments, and will not be elaborated upon here.

[0184] To verify the effectiveness of the technical solutions provided in the embodiments of this application, this application compares the email display results corresponding to the solutions using the foregoing embodiments and the solutions in related technologies. Specifically, the solutions in related technologies are based on data obtained when using the Outlook email client, as shown in Table 1:

[0185] Table 1

[0186]

[0187] In Table 1, the initial email reading time refers to the time required from switching emails to the appearance of the email content when viewing an email for the first time. The repeated email reading time refers to the time required from switching emails to the appearance of the email content when repeatedly reading the same email. In comparison, the solution in this application embodiment is faster than Outlook in both initial and repeated email reading, especially in the scenario of repeated email reading, where the reading speed has a significant advantage.

[0188] Reference Figure 11 In this embodiment of the application, an email content display device is also provided, which includes:

[0189] The response unit 1110 is used to respond to a viewing request for the target email and obtain the first document object model tree corresponding to the target email; wherein the first document object model tree includes several nodes;

[0190] Traversal unit 1120 is used to perform a preorder traversal of each node in the first document object model tree and copy the node to the initialized second document object model tree according to the traversal result.

[0191] Detection unit 1130 is used to detect the first data volume corresponding to all nodes in the second document object model tree;

[0192] The first execution unit 1140 is used to render and display the content of the target email according to the nodes in the second document object model tree if the first data volume reaches the first threshold.

[0193] The second execution unit 1150 is used to return to the step of performing a preorder traversal of each node in the first document object model tree if the first data volume does not reach the first threshold.

[0194] Optionally, in some embodiments, the display device further includes a trigger unit, which is used to:

[0195] Detect the interactive actions of the target object and generate a viewing request based on the interactive actions;

[0196] Alternatively, acquire the target object's voice data, perform speech recognition on the voice data, and generate a viewing request based on the speech recognition result.

[0197] Optionally, in some embodiments, the response unit is specifically used for:

[0198] Retrieve the Hypertext Markup Language content corresponding to the target email;

[0199] Parse the Hypertext Markup Language content to identify the Hypertext Markup Language elements in the target email;

[0200] Based on the Hypertext Markup Language elements, the first document object model tree corresponding to the target email is constructed.

[0201] Optionally, in some embodiments, the traversal unit is specifically used for:

[0202] Perform a preorder traversal of each node in the first document object model tree;

[0203] If the node encountered is a leaf node, copy the node to the second document object model tree;

[0204] If the node encountered is not a leaf node, check the node's child nodes. If all of the node's child nodes are copied to the second document object model tree, copy the node to the second document object model tree.

[0205] Optionally, in some embodiments, the display device further includes a rendering unit, which is used for:

[0206] In the first document object model tree, the nodes that have been copied to the second document object model tree are marked;

[0207] Perform a preorder traversal of each unmarked node in the first document object model tree, and copy the unmarked nodes to the second document object model tree based on the traversal results;

[0208] Detect the second data volume corresponding to the newly added node in the second document object model tree of the current rendering round;

[0209] If the second data volume reaches the second threshold, the content of the target email is rendered and displayed based on the nodes in the second document object model tree;

[0210] The second threshold is greater than or equal to the first threshold.

[0211] Optionally, in some embodiments, the display device further includes a first setting unit, which is specifically used for:

[0212] Obtain the display area parameters corresponding to the display page of the target email;

[0213] Detect the currently set display font size;

[0214] Determine the amount of data that the display page can accommodate based on the display area parameters and the display font size;

[0215] Determine the first threshold based on the amount of data to be accommodated.

[0216] Optionally, in some embodiments, the display device further includes a second setting unit, which is specifically used for:

[0217] Detect the network environment parameters of the mail server corresponding to the target email;

[0218] Determine the network quality score based on network environment parameters;

[0219] Determine the first threshold based on the network quality score;

[0220] The magnitude of the first threshold is positively correlated with the magnitude of the network quality score.

[0221] Optionally, in some embodiments, the second setting unit is specifically used for:

[0222] Detect the throughput, round-trip latency, and packet loss rate of the mail server within a predetermined transmission period;

[0223] A network quality score is determined based on throughput, round-trip time, and packet loss rate.

[0224] Optionally, in some embodiments, the display device further includes a cache unit, which is specifically used for:

[0225] Cache the first page content of the target email;

[0226] In response to repeated viewing requests for the target email, retrieve the cached homepage content;

[0227] Render and display the homepage content, and start an asynchronous task to load other content from the target email besides the homepage content.

[0228] It is understandable that, such as Figure 4 The content of the email content display method embodiments shown are all applicable to the email content display device embodiments of this invention. The specific functions implemented by the email content display device embodiments of this invention are the same as those shown below. Figure 4 The method for displaying email content shown is the same as in the embodiment, and the beneficial effects achieved are the same as those described above. Figure 4 The beneficial effects achieved by the illustrated method for displaying email content are also the same.

[0229] This application also discloses an electronic device, including:

[0230] At least one processor;

[0231] At least one memory for storing at least one program;

[0232] When at least one program is executed by at least one processor, such that at least one processor implements as Figure 4 An example of a method for displaying email content is shown.

[0233] The electronic device in the embodiments of this application may be a terminal device, a computer device, or a server device.

[0234] For example, refer to Figure 12 , Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Taking a terminal device as an example, Figure 12 In this context, the electronic device 1200 may include an RF (Radio Frequency) circuit 1210, a memory 1220 including one or more computer-readable storage media, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a short-range wireless transmission module 1270, a processor 1280 including one or more processing cores, and a power supply 1290, among other components. Those skilled in the art will understand that... Figure 12 The device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0235] RF circuit 1210 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 1280 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 1210 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a SIM card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. Furthermore, RF circuit 1210 can also communicate wirelessly with networks and other devices. Wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0236] Memory 1220 can be used to store software programs and modules (or units). Processor 1280 executes various functional applications and data processing by running the software programs and modules (or units) stored in memory 1220. Memory 1220 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of electronic device 1200 (such as audio data, telephone directory, etc.). Furthermore, memory 1220 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. Accordingly, memory 1220 may also include a memory controller to provide access to memory 1220 for processor 1280 and input unit 1230. Although Figure 12 The RF circuit 1210 is shown, but it is understood that it is not a necessary component of the electronic device 1200 and can be omitted as needed without changing the nature of the invention.

[0237] The input unit 1230 can be used to receive input numerical or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to object settings and function control. Specifically, the input unit 1230 may include a touch-sensitive surface 1231 and other input devices 1232. The touch-sensitive surface 1231, also known as a touch display screen or touchpad, can collect touch operations on or near the object (such as operations performed by the object using a finger, stylus, or any suitable object or accessory on or near the touch-sensitive surface 1231), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1231 may include two parts: a touch detection device and a touch controller. The touch detection device detects the touch position of the object and detects the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 1280, and can receive and execute instructions from the processor 1280. In addition, the touch-sensitive surface 1231 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch-sensitive surface 1231, the input unit 1230 may also include other input devices 1232. Specifically, other input devices 1232 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0238] The display unit 1240 can be used to display information input by an object or information provided to an object, as well as various graphical object interfaces for controlling the electronic device 1200. These graphical object interfaces can be composed of graphics, text, icons, video, and any combination thereof. The display unit 1240 may include a display panel 1241, which may optionally be configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or similar display. Further, a touch-sensitive surface 1231 may cover the display panel 1241. When the touch-sensitive surface 1231 detects a touch operation on or near it, it transmits the information to the processor 1280 to determine the type of touch event. Subsequently, the processor 1280 provides corresponding visual output on the display panel 1241 according to the type of touch event. Although in Figure 12 In this embodiment, the touch-sensitive surface 1231 and the display panel 1241 are implemented as two separate components to realize input and output functions. However, in some embodiments, the touch-sensitive surface 1231 and the display panel 1241 can be integrated to realize input and output functions.

[0239] The electronic device 1200 may also include at least one sensor 1250, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1241 according to the ambient light level, and the proximity sensor can turn off the display panel 1241 or the backlight when the electronic device 1200 is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometers, taps), etc. Other sensors that the electronic device 1200 may also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0240] Audio circuitry 1260, speaker 1261, and microphone 1262 provide an audio interface between the device and electronic device 1200. Audio circuitry 1260 converts received audio data into electrical signals and transmits them to speaker 1261, where speaker 1261 converts them into sound signals for output. Conversely, microphone 1262 converts collected sound signals into electrical signals, which are then received by audio circuitry 1260, converted back into audio data, processed by processor 1280, and transmitted via RF circuitry 1210 to another electronic device, or output to memory 1220 for further processing. Audio circuitry 1260 may also include an earphone jack to facilitate communication between external headphones and electronic device 1200.

[0241] The short-range wireless transmission module 1270 can be a WIFI (wireless fidelity) module, Bluetooth module, or infrared module, etc. The electronic device 1200 can transmit information with wireless transmission modules on other devices via the short-range wireless transmission module 1270.

[0242] The processor 1280 is the control center of the electronic device 1200. It connects various parts of the device via various interfaces and lines, and performs various functions and processes data of the electronic device 1200 by running or executing software programs or modules stored in the memory 1220 and calling data stored in the memory 1220, thereby providing overall control of the device. Optionally, the processor 1280 may include one or more processing cores; optionally, the processor 1280 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 1280.

[0243] Electronic device 1200 also includes a power supply 1290 (such as a battery) for supplying power to various components. Optionally, the power supply 1290 can be logically connected to the processor 1280 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1290 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0244] Although not shown, the electronic device 1200 may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0245] This application also discloses a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement, for example... Figure 4 An example of a method for displaying email content is shown.

[0246] Understandable, Figure 4 The content of the email content display method embodiments shown are all applicable to the embodiments of this computer-readable storage medium. The specific functions implemented by the embodiments of this computer-readable storage medium are the same as those shown in the embodiments. Figure 4 The method for displaying the email content shown is the same as the embodiment, and the beneficial effects achieved are the same. Figure 4 The beneficial effects achieved by the illustrated method for displaying email content are also the same.

[0247] This application also discloses a computer program product or computer program, which includes computer instructions stored in the aforementioned computer-readable storage medium. Figure 12 The processor of the illustrated electronic device can read the computer instructions from the aforementioned computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform... Figure 4 An example of a method for displaying email content is shown.

[0248] Understandable, Figure 4 The content of the email content display method embodiments shown are all applicable to this computer program product or computer program embodiment. The specific functions implemented by this computer program product or computer program embodiment are the same as those shown in the embodiments. Figure 4 The method for displaying the email content shown is the same as the embodiment, and the beneficial effects achieved are the same. Figure 4 The beneficial effects achieved by the illustrated method for displaying email content are also the same.

[0249] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.

[0250] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.

[0251] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0252] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0253] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0254] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0255] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0256] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

[0257] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A method for displaying email content, characterized in that, The method includes: In response to a request to view a target email, a first document object model tree corresponding to the target email is obtained; wherein the first document object model tree includes several nodes; Perform a preorder traversal on each node in the first document object model tree, and copy the node to the initialized second document object model tree based on the traversal result; Detect the first data volume corresponding to all the nodes in the second document object model tree; If the first data volume reaches the first threshold, the content of the target email is rendered and displayed according to the node in the second document object model tree; If the first data volume does not reach the first threshold, return to the step of performing a preorder traversal of each node in the first document object model tree.

2. The method for displaying email content according to claim 1, characterized in that, The viewing request is triggered through the following steps: Detect the interactive operations of the target object, and generate the reading request based on the interactive operations; Alternatively, the voice data of the target object can be obtained, speech recognition can be performed on the voice data, and the reading request can be generated based on the speech recognition result.

3. The method for displaying email content according to claim 1, characterized in that, The step of obtaining the first document object model tree corresponding to the target email includes: Obtain the Hypertext Markup Language content corresponding to the target email; The hypertext markup language content is parsed to determine the hypertext markup language elements in the target email; Based on the Hypertext Markup Language elements, a first document object model tree corresponding to the target email is constructed.

4. The method for displaying email content according to claim 1, characterized in that, The step of performing a preorder traversal of each node in the first document object model tree and copying the nodes to the initialized second document object model tree based on the traversal results includes: Perform a preorder traversal of each node in the first document object model tree; If the node traversed is a leaf node, copy the node to the second document object model tree; If the node traversed is not a leaf node, check the child nodes of the node. If all the child nodes of the node are copied to the second document object model tree, copy the node to the second document object model tree.

5. The method for displaying email content according to any one of claims 1-4, characterized in that, After rendering and displaying the content of the target email, the method further includes: In the first document object model tree, the nodes that have been copied to the second document object model tree are marked; Perform a preorder traversal on each unmarked node in the first document object model tree, and copy the unmarked nodes to the second document object model tree based on the traversal results; Detect the second data volume corresponding to the newly added node in the second document object model tree in the current rendering round; If the second data volume reaches the second threshold, the content of the target email is rendered and displayed according to the nodes in the second document object model tree; Wherein, the second threshold is greater than or equal to the first threshold.

6. The method for displaying email content according to claim 1, characterized in that, The first threshold is determined through the following steps: Obtain the display area parameters corresponding to the display page of the target email; Detect the currently set display font size; The amount of data that the display page can accommodate is determined based on the display area parameters and the display font size; The first threshold is determined based on the amount of data to be contained.

7. The method for displaying email content according to claim 1, characterized in that, The first threshold is determined by the following steps: Detect the network environment parameters of the mail server corresponding to the target email; Based on the network environment parameters, determine the network quality score; The first threshold is determined based on the network quality score; The magnitude of the first threshold is positively correlated with the magnitude of the network quality score.

8. The method for displaying email content according to claim 7, characterized in that, The process of determining the network quality score based on the network environment parameters includes: The throughput, round-trip latency, and packet loss rate of the mail server are detected during a predetermined transmission period. The network quality score is determined based on the throughput, the round-trip time, and the packet loss rate.

9. The method for displaying email content according to claim 1, characterized in that, The method further includes: Cache the homepage content of the target email; In response to a request to repeatedly view the target email, retrieve the cached homepage content; The homepage content is rendered and displayed, and an asynchronous task is started to load other content of the target email besides the homepage content.

10. A device for displaying email content, characterized in that, The device includes: A response unit is configured to respond to a viewing request for a target email by obtaining a first document object model tree corresponding to the target email; wherein the first document object model tree includes a plurality of nodes; The traversal unit is used to perform a preorder traversal of each node in the first document object model tree, and copy the node to the initialized second document object model tree according to the traversal result; The detection unit is used to detect the first data volume corresponding to all the nodes in the second document object model tree; The first execution unit is configured to render and display the content of the target email according to the nodes in the second document object model tree if the first data volume reaches the first threshold. The second execution unit is configured to return to the step of performing a preorder traversal of each node in the first document object model tree if the first data volume does not reach the first threshold.

11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method for displaying email content as described in any one of claims 1 to 9.

12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for displaying email content as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for displaying email content as described in any one of claims 1 to 9.