Screen Rendering Method, Apparatus, Electronic Device, and Storage Medium

By obtaining the starting position information and flattening processing in the screen rendering method, only the necessary data volume is processed, which solves the problem of slow page rendering under large data volume and achieves a smooth operation experience.

CN114996607BActive Publication Date: 2025-08-05BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210641638.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-07
Publication Date
2025-08-05
Estimated Expiration
2042-06-07

AI Technical Summary

Technical Problem

In the face of the need to render or even tens of millions of data, the existing technology cannot effectively solve the problems of slow data transmission, slow page rendering, and heavy client processing logic, resulting in slow page display or lag in operation, seriously affecting the user experience.

Method used

By receiving rendering data from the server, obtaining starting position information based on location record information, determining the starting tag data, and only obtaining a preset number of tag data for rendering, combining flattening processing, optimizing the data structure and reducing unnecessary data processing.

Benefits of technology

It improves rendering speed, reduces browser pressure, ensures a good and smooth operating experience under tens of millions of data, and avoids the problem of lag with large data volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996607B_ABST
    Figure CN114996607B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a screen rendering method, device, electronic device, and storage medium. The screen rendering method includes: receiving rendering data from a server, wherein the rendering data includes multiple tag data and rendering content data corresponding to each tag data, and the multiple tag data are in a tree structure; in response to receiving an instruction to render the current screen, obtaining starting position information for this rendering from position record information; determining the starting tag data for this rendering based on the starting position information for this rendering; obtaining a preset number of tag data from the multiple tag data based on the starting tag data for this rendering and the tree structure; and rendering the current screen using the rendering content data corresponding to each tag data in the preset number of tag data. The present disclosure can achieve on-demand rendering, reduce the pressure on the browser, and maintain a good and smooth operating experience even when processing tens of millions of data volumes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a screen rendering method, device, electronic device, and storage medium. Background Art

[0002] In the Internet age, more and more people choose to interact with information through various platforms on electronic clients. When users obtain information, they need to render the data transmitted by the server to the local page to complete the information display to the user. However, when faced with the situation where the amount of data that needs to be rendered is even tens of millions, there is currently no good solution in the relevant technology. Summary of the Invention

[0003] The present disclosure provides a screen rendering method, device, electronic device, and storage medium to at least solve the problems in the above-mentioned related technologies, or may not solve any of the above-mentioned problems. The technical solutions of the present disclosure are as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, a screen rendering method is provided, comprising: receiving rendering data from a server, wherein the rendering data comprises a plurality of tag data and rendering content data corresponding to each tag data, and the plurality of tag data are in a tree structure; in response to receiving an instruction to render the current screen, obtaining starting position information for this rendering from position recording information, wherein the position recording information records the starting position information for each rendering, and the starting position information for each rendering indicates information for determining the position of the starting tag data for starting execution of each rendering in the tree structure; based on the starting position information for this rendering, determining the starting tag data for this rendering; based on the starting tag data for this rendering and the tree structure, obtaining a preset number of tag data from the plurality of tag data; and rendering the current screen using the rendering content data corresponding to each tag data in the preset number of tag data.

[0005] Optionally, when the current screen is rendered for the first time, the starting position information used for this rendering is predefined starting position information, wherein the predefined starting position information is used to indicate that the starting tag data of this rendering is the tag data located at the root of the tree structure.

[0006] Optionally, in the case where the current screen is not rendered for the first time, the starting position information used for this rendering is the position information of the end tag data of the last rendering, wherein the last rendering is performed until the end tag data of the last rendering among the multiple tag data; wherein, determining the starting tag data of the current rendering based on the starting position information for this rendering includes: in the tree structure, determining the starting tag data of the current rendering according to the end tag data of the last rendering.

[0007] Optionally, in the tree structure, determining the starting tag data of the current rendering based on the ending tag data of the last rendering includes: obtaining state information indicating whether the ending tag data of the last rendering is expanded or hidden, wherein the ending tag data of the last rendering is in an expanded state, indicating that the child tag data of the ending tag data of the last rendering can be obtained into a preset number of tag data required for the current rendering, and the ending tag data of the last rendering is in a hidden state, indicating that the child tag data of the ending tag data of the last rendering cannot be obtained into the preset number of tag data required for the current rendering; when the ending tag data of the last rendering is in an expanded state, determining that the first child tag data of the ending tag data of the last rendering in the tree structure is the starting tag data of the current rendering; when the ending tag data of the last rendering is in a hidden state, determining the parent tag data of the ending tag data of the last rendering in the tree structure, and determining that the next child tag data of the ending tag data of the last rendering is the starting tag data of the current rendering among all the child tag data of the parent tag data of the ending tag data of the last rendering in the tree structure.

[0008] Optionally, when rendering the current screen based on the label data adjusted in any state, the starting position information for this rendering is the position information of the label data adjusted in any state; wherein, determining the starting label data for this rendering based on the starting position information for this rendering includes: determining the starting label data for this rendering in the tree structure based on the label data adjusted in any state; wherein, the rendering content data corresponding to the label data adjusted in any state has been rendered to the current screen, and the label data adjusted in any state is any label data adjusted from an expanded state to a hidden state, or any label data adjusted from a hidden state to an expanded state, and the label data adjusted in any state is an expanded state, indicating that the sub-label data of the label data adjusted in any state can be obtained into the preset number of label data required for this rendering, and the label data adjusted in any state is a hidden state, indicating that the sub-label data of the label data adjusted in any state cannot be obtained into the preset number of label data required for this rendering.

[0009] Optionally, the determining of the starting tag data for the current rendering in the tree structure based on the tag data after adjustment of any state includes: obtaining state information indicating whether the tag data after adjustment of any state is expanded or hidden; when the tag data after adjustment of any state is in the expanded state, determining that the first child tag data of the tag data after adjustment of any state in the tree structure is the starting tag data for the current rendering; when the tag data after adjustment of any state is in the hidden state, determining the parent tag data of the tag data after adjustment of any state in the tree structure, and determining that the next child tag data of the tag data after adjustment of any state is the starting tag data for the current rendering among all the child tag data of the parent tag data of the tag data after adjustment of any state in the tree structure.

[0010] Optionally, it also includes: adding a positioning index to the label data corresponding to each rendering content data in all currently rendered rendering content data, wherein the positioning index includes identification information of all label data on the path from the label data located at the root of the tree structure to the label data to which the positioning index is added; wherein the position information of the label data after any state adjustment is determined by the following steps: determining the position information of the label data after any state adjustment based on the positioning index of the label data after any state adjustment.

[0011] Optionally, after receiving the rendering data from the server, it also includes: flattening the rendering data to obtain the flattened rendering data, wherein the step of determining the starting tag data of the current rendering, and the step of obtaining a preset number of tag data from the multiple tag data based on the starting tag data of the current rendering and the tree structure are performed based on the flattened rendering data.

[0012] Optionally, the flattening processing of the rendering data to obtain the flattened rendering data includes: determining the label data located at the root of the tree structure; determining each label data pair with a parent-child relationship among the multiple label data; determining the rendering content data corresponding to each label data in the multiple label data; and obtaining the flattened rendering data based on the label data located at the root of the tree structure, each label data pair with a parent-child relationship among the multiple label data, and the rendering content data corresponding to each label data in the multiple label data.

[0013] According to a second aspect of an embodiment of the present disclosure, a screen rendering device is provided, comprising: a data receiving unit, configured to: receive rendering data from a server, wherein the rendering data includes multiple tag data and rendering content data corresponding to each tag data, and the multiple tag data are in a tree structure; a starting position obtaining unit, configured to: in response to receiving an instruction to render the current screen, obtain starting position information for this rendering from position recording information, wherein the position recording information records the starting position information for each rendering, and the starting position information for each rendering indicates information for determining the position of the starting tag data for starting execution of each rendering in the tree structure; a starting tag determining unit, configured to: determine the starting tag data for this rendering based on the starting position information for this rendering; a tag obtaining unit, configured to: obtain a preset number of tag data from the multiple tag data based on the starting tag data for this rendering and the tree structure; and a screen rendering unit, configured to: render the current screen using the rendering content data corresponding to each tag data in the preset number of tag data.

[0014] Optionally, when the current screen is rendered for the first time, the starting position information used for this rendering is predefined starting position information, wherein the predefined starting position information is used to indicate that the starting tag data of this rendering is the tag data located at the root of the tree structure.

[0015] Optionally, in the case where the current screen is not rendered for the first time, the starting position information used for this rendering is the position information of the end tag data of the last rendering, wherein the last rendering is performed until the end tag data of the last rendering among the multiple tag data; the starting tag determination unit is configured to: in the tree structure, determine the starting tag data of the current rendering according to the end tag data of the last rendering.

[0016] Optionally, the start tag determination unit is configured to: obtain state information indicating whether the end tag data of the last rendering is expanded or hidden, wherein the state of the end tag data of the last rendering is expanded, indicating that the child tag data of the end tag data of the last rendering can be obtained into a preset number of tag data required for this rendering, and the state of the end tag data of the last rendering is hidden, indicating that the child tag data of the end tag data of the last rendering cannot be obtained into the preset number of tag data required for this rendering; when the end tag data of the last rendering is in the expanded state, determine that the first child tag data of the end tag data of the last rendering in the tree structure is the start tag data of the current rendering; when the end tag data of the last rendering is in the hidden state, determine the parent tag data of the end tag data of the last rendering in the tree structure, and determine that the next child tag data of the end tag data of the last rendering is the start tag data of the current rendering among all the child tag data of the parent tag data of the end tag data of the last rendering in the tree structure.

[0017] Optionally, when rendering the current screen based on the label data after any state adjustment, the starting position information used for this rendering is the position information of the label data after any state adjustment; the starting label determination unit is configured to: determine the starting label data of this rendering in the tree structure based on the label data after any state adjustment; wherein, the rendering content data corresponding to the label data after any state adjustment has been rendered to the current screen, and the label data after any state adjustment is any label data adjusted from an expanded state to a hidden state, or any label data adjusted from a hidden state to an expanded state, and the label data after any state adjustment is an expanded state, indicating that the sub-label data of the label data after any state adjustment can be obtained into the preset number of label data required for this rendering, and the label data after any state adjustment is a hidden state, indicating that the sub-label data of the label data after any state adjustment cannot be obtained into the preset number of label data required for this rendering.

[0018] Optionally, the starting tag determination unit is configured to: obtain state information indicating whether the tag data after any state adjustment is expanded or hidden; when the tag data after any state adjustment is in the expanded state, determine that the first child tag data of the tag data after any state adjustment in the tree structure is the starting tag data of the current rendering; when the tag data after any state adjustment is in the hidden state, determine the parent tag data of the tag data after any state adjustment in the tree structure, and among all the child tag data of the parent tag data of the tag data after any state adjustment in the tree structure, determine that the next child tag data of the tag data after any state adjustment is the starting tag data of the current rendering.

[0019] Optionally, it also includes an index adding unit, which is configured to: add a positioning index to the label data corresponding to each rendering content data in all currently rendered rendering content data, wherein the positioning index includes the identification information of all label data on the path from the label data located at the root of the tree structure to the label data to which the positioning index is added; wherein the starting position acquisition unit is configured to: determine the position information of the label data after any state adjustment based on the positioning index of the label data after any state adjustment.

[0020] Optionally, a flattening processing unit is further included, which is configured to: flatten the rendering data to obtain flattened rendering data, wherein the start tag determination unit and the tag acquisition unit are executed after the flattening processing unit is executed.

[0021] Optionally, the flattening processing unit is configured to: determine the tag data located at the root of the tree structure; determine each tag data pair with a parent-child relationship among the multiple tag data; determine the rendering content data corresponding to each tag data in the multiple tag data; and obtain the flattened rendering data based on the tag data located at the root of the tree structure, each tag data pair with a parent-child relationship among the multiple tag data, and the rendering content data corresponding to each tag data in the multiple tag data.

[0022] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, prompt the at least one processor to execute the screen rendering method according to the present disclosure.

[0023] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium storing instructions is provided. When the instructions are executed by at least one processor, the at least one processor is prompted to execute the screen rendering method according to the present disclosure.

[0024] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which implement the screen rendering method according to the present disclosure when executed by at least one processor.

[0025] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:

[0026] According to the screen rendering method, device, electronic device and storage medium disclosed in the present invention, each time the screen needs to be rendered, the starting position information for this rendering can be obtained based on the position record information, and then the starting tag data for this rendering can be determined, and only a preset number of tag data can be obtained for this rendering. In this way, only the data required at that time is processed each time without the need to obtain and process all the tag data. The rendering speed can be improved, and problems such as freezes caused by processing a large amount of data at one time can be avoided. Rendering can be achieved on demand, reducing the pressure on the browser, and maintaining a good and smooth operating experience even when processing tens of millions of data volumes.

[0027] In addition, according to the screen rendering method, device, electronic device and storage medium disclosed in the present invention, the rendering data can be flattened, the data structure of the rendering data transmitted by the server can be optimized, the complexity of the tree-nested recursive structure can be reduced, the size of the rendering data can be reduced, and the efficiency of obtaining a preset number of label data can be improved, thereby ensuring the smoothness of the operation.

[0028] In addition, according to the screen rendering method, device, electronic device and storage medium disclosed in the present invention, a positioning index can be added to the label data corresponding to each rendering content data in all the currently rendered rendering content data, and the starting position information of this rendering can be quickly determined, thereby improving the efficiency of obtaining a preset number of label data.

[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0031] Figure 1 The figure is a flowchart of a screen rendering method according to an exemplary embodiment.

[0032] Figure 2 The figure is an overall architecture diagram of a screen rendering method according to an exemplary embodiment.

[0033] Figure 3 The figure shows a page display of a current screen according to an exemplary embodiment.

[0034] Figure 4 The figure is a block diagram of a screen rendering device according to an exemplary embodiment.

[0035] Figure 5 is a block diagram of an electronic device 500 according to an exemplary embodiment. DETAILED DESCRIPTION

[0036] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0037] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0038] It should be noted that the phrase "at least one of the items" in this disclosure includes three types of parallel situations: "any one of the items", "a combination of any multiple items of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. For another example, "performing at least one of step 1 and step 2" includes the following three parallel situations: (1) performing step 1; (2) performing step 2; and (3) performing steps 1 and 2.

[0039] In the Internet age, more and more people choose to interact with information through various platforms on electronic clients. When users obtain information, they need to render the data transmitted by the server to the local page to complete the information display to the user.

[0040] For rendering tree-structured data, especially tabular data in a tree structure, one method in the related technology is: first, the client receives the relevant tag data of the root node of the tree structure sent by the server, and then renders the content of the relevant tag data, and then continuously requests the relevant tag data of the remaining nodes from the server based on the user's operations on the client for rendering. However, this method must render layer by layer based on the user's manual operation, which makes the interaction less friendly, and after multiple manual operations by the user, the amount of rendered data on the client page will increase, and the page may be very stuck when rendering only thousands of data.

[0041] Another method in the related art involves first receiving all rendering data sent by the server and then tiling it. Virtual scrolling is then used to control the amount of data rendered each time. During the initial rendering and when expanding hidden content on the page, all data must be processed before rendering. In this method, virtual scrolling maintains the scrolling effect presented by the rendering, but only a portion of the data is actually rendered at a time. Virtual scrolling implements on-demand loading, a common method for visually optimizing page rendering performance. Its principle is to only display the data currently required by the user. Regardless of the data volume, the amount of data a user can manipulate is limited. Using on-demand loading can reduce the browser's data rendering pressure, thereby reducing the browser's workload without affecting the user's operational experience. For example, if a total of 1,000 data items need to be rendered, but only 100 items can be displayed within the visible area of the screen, to reduce the browser's burden, only approximately 150 items are rendered. By monitoring scroll events on the client and performing flexible rendering, the user's viewing experience on the client is consistent with that of directly rendering all 1,000 items. Flattening can be a solution to solve the problem of computational complexity caused by deeply nested tree structures, by processing deeply nested data structures into a flat format. For example, the tree structure shown in the following code:

[0042] {

[0043] id:1

[0044] children:[{

[0045] id:2,children:[],

[0046] id:3,children:[{

[0047] id:4,children:[]

[0048] }]}]}

[0049] The parent-child relationship it displays includes (based on id description): parent node is 1 and child node is 2, parent node is 1 and child node is 3, parent node is 3 and child node is 4; the hierarchical relationship includes 3 layers (based on id description): 1 is the first layer, 2 and 3 are the second layer, and 4 is the third layer.

[0050] Then the above code can be flattened into:

[0051] [{id:1,level:1},{id:2,level:2,parentId:1},{id:3,level:2,parentId:1},{id:4,level:3,parentId:3}]

[0052] Among them, Level indicates the level.

[0053] However, data transmission using this method is time-consuming, and all data may need to be processed multiple times based on user operations. In the face of huge amounts of data processing requirements, the page may be inoperable for a long time, resulting in a poor user experience.

[0054] For the above two methods, when faced with the situation where the amount of data to be rendered is even tens of millions, due to problems such as slow data transmission, slow page rendering, and heavy logic of client data processing, the page display will be slow or the operation will be stuck, seriously affecting the user's browsing and operation experience.

[0055] In order to solve the problems existing in the above-mentioned related technologies, the present disclosure proposes a screen rendering method, device, electronic device and storage medium, which can obtain the starting position information for this rendering based on the position record information each time the screen needs to be rendered, and then determine the starting tag data for this rendering, and only obtain a preset number of tag data for this rendering. In this way, only the data required at that time is processed during each rendering without the need to obtain and process all the tag data, which can improve the rendering speed, avoid problems such as jamming caused by processing a large amount of data at one time, realize on-demand rendering, reduce the pressure on the browser, and maintain a good and smooth operating experience even when processing tens of millions of data.

[0056] Below, we will refer to Figures 1 to 5 The screen rendering method, device, electronic device and storage medium according to the present disclosure are described in detail.

[0057] Figure 1 The figure is a flowchart of a screen rendering method according to an exemplary embodiment. Figure 1 The process shown is for the client side. Figure 1In step 101, rendering data may be received from the server, wherein the rendering data includes a plurality of tag data and rendering content data corresponding to each tag data, and the plurality of tag data are in a tree structure. Specifically, the rendering data may be used to render a page of the current (client) screen. It should be understood that the rendering of the current screen described in the exemplary embodiment of the present disclosure may be rendering the page in the current screen, and the visible range of the page may be set to, but not limited to, the visible range of the current screen. The rendering data may be, but not limited to, HTML data, XML data, etc., so in the case where the rendering data is HTML data, the tag data may be a tag corresponding to the HTML data, including but not limited to, a table tag, etc.

[0058] In step 102, in response to receiving an instruction to render the current screen, starting position information for the current rendering may be obtained from the position record information. The position record information records the starting position information for each rendering. The starting position information for each rendering indicates information used to determine the position of the starting tag data for starting each rendering in the tree structure. It should be noted that the position record information may include, but is not limited to, a data class format.

[0059] According to an exemplary embodiment of the present disclosure, the position recording information may record the starting position information for each rendering in chronological order, wherein the starting position information for each rendering may be recorded in the position recording information before each rendering. Based on this, in response to receiving an instruction to render the current screen, the last recorded starting position information may be obtained from the position recording information as the starting position information for this rendering.

[0060] In step 103 , the starting tag data for this rendering may be determined based on the starting position information for this rendering.

[0061] According to an exemplary embodiment of the present disclosure, the instruction to render the current screen in step 102 may be received in the following three situations: the first rendering of the current screen, the non-first rendering of the current screen, and the rendering of the current screen based on the label data adjusted in any state. It should be noted that the above three situations are merely exemplary, and the exemplary embodiments of the present disclosure also protect other situations in which the instruction to render the current screen may be received.

[0062] In the case of rendering the current screen for the first time, the starting position information used for this rendering is the predefined starting position information, wherein the predefined starting position information is used to indicate that the starting tag data for this rendering is the tag data located at the root of the tree structure. Specifically, this situation may occur when the user clicks to display the rendering page, which may be the page for rendering using the rendering data received in step 101. In the case where the position record information is in the form of a data class, recording the predefined starting position information into the position record information may be understood as an operation to initialize the class. It should be noted that, in the case where there are multiple tag data located at the roots of the tree structure, the starting tag data for this rendering is the first tag data located at the root of the tree structure.

[0063] When rendering the current screen for a non-initial time, the starting position information for this rendering is the position information of the end tag data of the previous rendering, wherein the previous rendering is performed until the end tag data of the previous rendering among the multiple tag data. Specifically, this situation may occur when the user clicks to display the rendered content data corresponding to the tag data after the end tag data of the previous rendering, for example, this situation may occur when the user pulls down the scroll bar of the rendering page described in the above embodiment to the bottom of the scrollable range.

[0064] For example, the starting position information may include, but is not limited to, information indicating which child tag data of its parent tag data the last rendered end tag data is, information indicating the next child tag data of the last rendered end tag data in the child tag data of the parent tag data of the last rendered end tag data, information indicating the parent tag data of the last rendered end tag data, and information used to determine whether a ring check is constituted until the rendering content data corresponding to the last rendered end tag data is rendered (this can be achieved by recording the identification information of the tag data corresponding to each rendering content data in all rendered content data, wherein, if any pair of recorded identification information is the same, it is determined that a ring check is constituted). An exemplary embodiment of the present disclosure can stop executing the rendering operation when a ring check is constituted, thereby reducing the occurrence of rendering errors.

[0065] For example, the starting position information can be expressed as:

[0066]

[0067]

[0068] Among them, CataLog represents the location record information. The above code representation is only illustrative, and the present disclosure also protects other forms of starting location information.

[0069] In this case, the starting tag data of this rendering can be determined in the tree structure based on the ending tag data of the last rendering. Specifically, first, state information indicating whether the ending tag data of the last rendering is expanded or hidden can be obtained, wherein the ending tag data of the last rendering is in the expanded state, which indicates that the child tag data of the ending tag data of the last rendering can be obtained into the preset number of tag data required for this rendering, and the ending tag data of the last rendering is in the hidden state, which indicates that the child tag data of the ending tag data of the last rendering cannot be obtained into the preset number of tag data required for this rendering. Then, when the ending tag data of the last rendering is in the expanded state, it can be determined that the first child tag data of the ending tag data of the last rendering in the tree structure is the starting tag data of this rendering; when the ending tag data of the last rendering is in the hidden state, the parent tag data of the ending tag data of the last rendering in the tree structure can be determined, and among all the child tag data of the parent tag data of the ending tag data of the last rendering in the tree structure, it can be determined that the next child tag data of the ending tag data of the last rendering is the starting tag data of this rendering.

[0070] In the case of rendering the current screen based on any state-adjusted label data, the starting position information used for this rendering is the position information of any state-adjusted label data. Here, the rendering content data corresponding to any state-adjusted label data has been rendered to the current screen. Any state-adjusted label data is any label data adjusted from an expanded state to a hidden state, or any label data adjusted from a hidden state to an expanded state. Any state-adjusted label data is an expanded state, indicating that the sub-label data of any state-adjusted label data can be obtained from the preset number of label data required for this rendering. Any state-adjusted label data is a hidden state, indicating that the sub-label data of any state-adjusted label data cannot be obtained from the preset number of label data required for this rendering. It should be noted that this situation can occur after the user clicks on the rendering content data corresponding to any adjustable label data on the screen. The adjustable label data can be, but is not limited to, label data containing sub-label data. Specifically, after the user clicks on the rendering content data corresponding to any adjustable label data on the screen, the state of the adjustable label data can be adjusted to obtain the label data after the state is adjusted.

[0071] For example, the starting position information may include, but is not limited to, information indicating which child tag data of any state-adjusted tag data is of its parent tag data, information indicating the next child tag data of any state-adjusted tag data in the child tag data of the parent tag data of any state-adjusted tag data, information indicating the parent tag data of any state-adjusted tag data, and information used to determine whether a ring check is constituted until the rendering content data corresponding to any state-adjusted tag data is rendered (this can be achieved by recording the identification information of the tag data corresponding to each rendering content data in all rendered content data, wherein, if any pair of recorded identification information is the same, it is determined to constitute a ring check). An exemplary embodiment of the present disclosure can stop executing the rendering operation when a ring check is constituted, thereby reducing the occurrence of rendering errors.

[0072] In this case, since the acquisition path of the label data corresponding to the rendering content data rendered to the current screen in the tree structure is determined, an exemplary embodiment of the present disclosure can add a positioning index (customId) to the label data corresponding to each rendering content data in all the rendering content data currently rendered, wherein the positioning index includes identification information of all label data on the path from the label data located at the root of the tree structure to the label data to which the positioning index is added. For example, a positioning index can be added to the label data corresponding to each rendering content data in all the rendering content data currently rendered at the same time as each rendering content data is rendered. For example, the positioning index can be represented as, but not limited to: (identification information of the label data located at the root of the tree structure -… - identification information of the parent label data of the label data to which the positioning index is added - identification information of the label data to which the positioning index is added), then the position information of the label data after any state adjustment can be determined based on the positioning index of the label data after any state adjustment, for example, the position information can be determined by symbol segmentation of the positioning index by the split method.

[0073] In this case, the starting tag data of this rendering can be determined in the tree structure based on the tag data after any state adjustment. Specifically, first, state information indicating whether the tag data after any state adjustment is expanded or hidden can be obtained. Then, when the tag data after any state adjustment is in the expanded state, it can be determined that the first child tag data of the tag data after any state adjustment in the tree structure is the starting tag data of this rendering; when the tag data after any state adjustment is in the hidden state, the parent tag data of the tag data after any state adjustment in the tree structure can be determined, and among all the child tag data of the parent tag data of the tag data after any state adjustment in the tree structure, it can be determined that the next child tag data of the tag data after any state adjustment is the starting tag data of this rendering.

[0074] Back to Figure 1 In step 104, a preset number of tag data may be obtained from the plurality of tag data based on the starting tag data of the current rendering and the tree structure. Here, based on the starting tag data of the current rendering, a preset number of tag data may be obtained one by one from the plurality of tag data in the tree structure. During the process of obtaining each of the tag data, the status information of each obtained tag data and its hierarchical information in the tree structure may be considered to determine whether each of its sub-tag data can be obtained. The preset number may be determined based on the height of the current screen before the first rendering of the current screen.

[0075] According to an exemplary embodiment of the present disclosure, after step 101, the rendering data may be flattened to obtain flattened rendering data, wherein steps 103 and 104 are performed based on the flattened rendering data. It should be noted that the multiple tag data in the rendering data in the exemplary embodiment of the present disclosure are in a tree-like structure, resulting in the rendering data being nested in multiple layers. Flattening may refer to converting the nested rendering data into a single layer of rendering data.

[0076] Here, first, the tag data located at the root of the tree structure can be determined; then, each tag data pair with a parent-child relationship among multiple tag data can be determined; next, the rendering content data corresponding to each tag data among multiple tag data can be determined; finally, based on the tag data located at the root of the tree structure, each tag data pair with a parent-child relationship among multiple tag data, and the rendering content data corresponding to each tag data among multiple tag data, the flattened rendering data can be obtained. It should be noted here that the above description order of the steps of determining the tag data located at the root of the tree structure, determining each tag data pair with a parent-child relationship among multiple tag data, and determining the rendering content data corresponding to each tag data among multiple tag data is merely illustrative, and the order of these three determination steps can be adaptively adjusted.

[0077] For example, but not limited to, the tag data at the root of the tree structure, each tag data pair with a parent-child relationship in the multiple tag data, and the rendering content data corresponding to each tag data in the multiple tag data are used as the flattened rendering data.

[0078] For example, but not limited to, the flattened rendering data can be represented as:

[0079]

[0080] In step 105, the current screen may be rendered using the rendering content data corresponding to each tag data in the preset number of tag data. The exemplary embodiment of the present disclosure may implement on-demand loading by rendering the current screen using the rendering content data corresponding to each tag data in the preset number of tag data.

[0081] According to an exemplary embodiment of the present disclosure, all rendered content data can be recorded in a content information set (dataList). When the user pulls the scroll bar of the rendering page described in the above embodiment upward, the corresponding rendering content data can be obtained from the content information set and rendered on the current screen according to the pulling position.

[0082] Figure 2 The figure is an overall architecture diagram of a screen rendering method according to an exemplary embodiment. Figure 3 This is a page display diagram of the current screen according to an exemplary embodiment. Figure 2 and Figure 3 , further elaborating on the screen rendering method in the exemplary embodiment of the present disclosure.

[0083] First, rendering data can be received from the server, wherein the rendering data includes multiple tag data and rendering content data corresponding to each tag data, and the multiple tag data are in a tree structure. The rendering data can be used to render a rendering page of the current screen. The rendering of the current screen described in the following steps can be understood as rendering the rendering page in the current screen. The visible range of the rendering page can be set to, but not limited to, the visible range of the current screen.

[0084] Then, refer to Figure 2 Before the first rendering, the number of label data required for each rendering can be determined according to the height of the current screen (that is, the height of the visible range of the current screen), and the number of label data required for each rendering can be preset according to the determined number. For example, if the rendering content data corresponding to 20 label data can be displayed within the height of the current screen, the preset number can be 50.

[0085] Next, the current screen can be rendered for the first time. When the current screen is rendered for the first time, the predefined starting position information can be recorded into the position record information (the predefined starting position information is used to indicate that the starting tag data of the rendering is the tag data located at the root of the tree structure), and then the predefined starting position information is obtained from the position record information as the starting position information for this rendering, and then the starting tag data for the first rendering is determined based on the starting position information for this rendering (the tag data located at the root of the tree structure), and then the tag data is obtained according to the preset quantity in the previous step, and the rendering content data corresponding to the obtained tag data is used for the first rendering.

[0086] Next, refer to Figure 2 , when the user pulls down the scroll bar of the rendering page to the bottom of the draggable range, the current screen can continue to be rendered to determine the starting position information for this rendering. As for the method of determining the starting position information for this rendering, the position information of the end tag data of the last rendering can be recorded in the position record information, and then the position information is obtained from the position record information as the starting position information for this rendering, and then the starting tag data of this rendering (the next tag data of the end tag data of the last rendering) is determined based on the starting position information for this rendering, and then the tag data is obtained according to the number preset in the previous step, and the rendering content data corresponding to the obtained tag data is used for this rendering.

[0087] Reference Figure 2 The two arrows on the left indicate the rendering content data corresponding to the adjustable tag data. For example, Figure 3 The row corresponding to "root" and the row corresponding to "1" are both rendering content data corresponding to the adjustable label data. After the user clicks on the rendering content data corresponding to any adjustable label data, the state of the adjustable label data may be adjusted to obtain the label data after the state adjustment. When the current screen is rendered based on the label data after the state adjustment, the starting position information for this rendering is determined. For the method of determining the starting position information for this rendering, the position information of the label data after the state adjustment may be recorded into the position record information, and then the position information is obtained from the position record information as the starting position information for this rendering. The starting label data for this rendering (the next label data of the label data after the state adjustment) is then determined based on the starting position information for this rendering. Next, the label data is obtained according to the quantity preset in the previous step, and the rendering content data corresponding to the obtained label data is used for this rendering.

[0088] After each rendering, all rendered content data can be recorded in the content information set. When the user pulls the scroll bar of the rendering page upward, the corresponding rendering content data can be obtained from the content information set and rendered on the current screen according to the pulling position.

[0089] Figure 4 FIG1 is a block diagram of a screen rendering device according to an exemplary embodiment. Figure 4 The screen rendering device 400 includes a data receiving unit 401 , a start position acquiring unit 402 , a start tag determining unit 403 , a tag acquiring unit 404 and a screen rendering unit 405 .

[0090] The data receiving unit 401 can receive rendering data from the server, wherein the rendering data includes multiple tag data and rendering content data corresponding to each tag data, and the multiple tag data are in a tree structure. Specifically, the rendering data can be used to render a page of the current (client) screen. It should be understood that the rendering of the current screen described in the exemplary embodiment of the present disclosure can be rendering the page in the current screen, and the visible range of the page can be set to, but not limited to, the visible range of the current screen. The rendering data can be, but not limited to, HTML data, XML data, etc., then for the case where the rendering data is HTML data, the tag data can be a tag corresponding to the HTML data, including but not limited to, table tags, etc.

[0091] In response to receiving an instruction to render the current screen, the starting position acquisition unit 402 may acquire starting position information for the current rendering from the position record information. The position record information records starting position information for each rendering. The starting position information for each rendering indicates information used to determine the position of the starting tag data for starting each rendering in the tree structure. It should be noted that the position record information may include, but is not limited to, a data class format.

[0092] According to an exemplary embodiment of the present disclosure, the position recording information may record the starting position information for each rendering in chronological order, wherein the starting position information for each rendering may be recorded in the position recording information before each rendering. Based on this, the starting position acquisition unit 402 may obtain the last recorded starting position information from the position recording information as the starting position information for this rendering in response to receiving an instruction to render the current screen.

[0093] The start tag determining unit 403 may determine the start tag data for this rendering based on the start position information for this rendering.

[0094] According to an exemplary embodiment of the present disclosure, the instruction for rendering the current screen in the starting position acquisition unit 402 can be received in the following three situations: the first rendering of the current screen, the non-first rendering of the current screen, and the rendering of the current screen based on the label data adjusted in any state. It should be noted that the above three situations are merely exemplary, and the exemplary embodiments of the present disclosure also protect other situations in which the instruction for rendering the current screen may be received.

[0095] In the case of rendering the current screen for the first time, the starting position information used for this rendering is the predefined starting position information, wherein the predefined starting position information is used to indicate that the starting tag data for this rendering is the tag data located at the root of the tree structure. Specifically, this situation may occur when the user clicks to display the rendering page, which may be the page for rendering by the rendering data received in the data receiving unit 401. In the case where the position record information is in the form of a data class, recording the predefined starting position information into the position record information may be understood as an operation to initialize the class. It should be noted that, in the case where there are multiple tag data located at the roots of the tree structure, the starting tag data for this rendering is the first tag data located at the root of the tree structure.

[0096] When rendering the current screen for a non-initial time, the starting position information for this rendering is the position information of the end tag data of the previous rendering, wherein the previous rendering is performed until the end tag data of the previous rendering among the multiple tag data. Specifically, this situation may occur when the user clicks to display the rendered content data corresponding to the tag data after the end tag data of the previous rendering, for example, this situation may occur when the user pulls down the scroll bar of the rendering page described in the above embodiment to the bottom of the scrollable range.

[0097] For example, the starting position information may include, but is not limited to, information indicating which child tag data of its parent tag data the last rendered end tag data is, information indicating the next child tag data of the last rendered end tag data in the child tag data of the parent tag data of the last rendered end tag data, information indicating the parent tag data of the last rendered end tag data, and information used to determine whether a ring check is constituted until the rendering content data corresponding to the last rendered end tag data is rendered (this can be achieved by recording the identification information of the tag data corresponding to each rendering content data in all rendered content data, wherein, if any pair of recorded identification information is the same, it is determined that a ring check is constituted). An exemplary embodiment of the present disclosure can stop executing the rendering operation when a ring check is constituted, thereby reducing the occurrence of rendering errors.

[0098] Then in this case, the start tag determination unit 403 can determine the start tag data of this rendering based on the end tag data of the last rendering in the tree structure. Specifically, first, the start tag determination unit 403 can obtain state information indicating whether the end tag data of the last rendering is expanded or hidden, wherein the end tag data of the last rendering is in the expanded state, which indicates that the sub-tag data of the end tag data of the last rendering can be obtained into the preset number of tag data required for this rendering, and the end tag data of the last rendering is in the hidden state, which indicates that the sub-tag data of the end tag data of the last rendering cannot be obtained into the preset number of tag data required for this rendering. Then, the start tag determination unit 403 can determine that the first child tag data of the end tag data rendered last time in the tree structure is the start tag data rendered this time when the end tag data rendered last time is in the expanded state; the start tag determination unit 403 can determine the parent tag data of the end tag data rendered last time in the tree structure when the end tag data rendered last time is in the hidden state, and determine that the next child tag data of the end tag data rendered last time is the start tag data rendered this time among all the child tag data of the parent tag data of the end tag data rendered last time in the tree structure.

[0099] In the case of rendering the current screen based on any state-adjusted label data, the starting position information used for this rendering is the position information of any state-adjusted label data. Here, the rendering content data corresponding to any state-adjusted label data has been rendered to the current screen. Any state-adjusted label data is any label data adjusted from an expanded state to a hidden state, or any label data adjusted from a hidden state to an expanded state. Any state-adjusted label data is an expanded state, indicating that the sub-label data of any state-adjusted label data can be obtained from the preset number of label data required for this rendering. Any state-adjusted label data is a hidden state, indicating that the sub-label data of any state-adjusted label data cannot be obtained from the preset number of label data required for this rendering. It should be noted that this situation can occur after the user clicks on the rendering content data corresponding to any adjustable label data on the screen. The adjustable label data can be, but is not limited to, label data containing sub-label data. Specifically, after the user clicks on the rendering content data corresponding to any adjustable label data on the screen, the state of the adjustable label data can be adjusted to obtain the label data after the state is adjusted.

[0100] For example, the starting position information may include, but is not limited to, information indicating which child tag data of any state-adjusted tag data is of its parent tag data, information indicating the next child tag data of any state-adjusted tag data in the child tag data of the parent tag data of any state-adjusted tag data, information indicating the parent tag data of any state-adjusted tag data, and information used to determine whether a ring check is constituted until the rendering content data corresponding to any state-adjusted tag data is rendered (this can be achieved by recording the identification information of the tag data corresponding to each rendering content data in all rendered content data, wherein, if any pair of recorded identification information is the same, it is determined to constitute a ring check). An exemplary embodiment of the present disclosure can stop executing the rendering operation when a ring check is constituted, thereby reducing the occurrence of rendering errors.

[0101] In this case, since the acquisition path of the tag data corresponding to the rendering content data rendered to the current screen in the tree structure is determined, the screen rendering device 400 may also include an index adding unit, which may add a positioning index (customId) to the tag data corresponding to each rendering content data in all the rendering content data currently rendered, wherein the positioning index includes the identification information of all the tag data on the path from the tag data at the root of the tree structure to the tag data to which the positioning index is added. For example, the index adding unit may add a positioning index to the tag data corresponding to each rendering content data in all the rendering content data currently rendered while rendering it. For example, the positioning index may be represented as, but not limited to: (identification information of the tag data at the root of the tree structure - ... - identification information of the parent tag data of the tag data to which the positioning index is added - identification information of the tag data to which the positioning index is added), then the starting position acquisition unit 402 may determine the position information of the tag data after any state adjustment based on the positioning index of the tag data after any state adjustment, for example, the starting position acquisition unit 402 may determine the position information by symbolically segmenting the positioning index using the split method.

[0102] In this case, the start tag determination unit 403 can determine the start tag data of this rendering in the tree structure based on the tag data after any state adjustment. Specifically, first, the start tag determination unit 403 can obtain state information indicating whether the tag data after any state adjustment is expanded or hidden. Then, the start tag determination unit 403 can determine that the first child tag data of the tag data after any state adjustment in the tree structure is the start tag data of this rendering when the tag data after any state adjustment is in the expanded state; the start tag determination unit 403 can determine the parent tag data of the tag data after any state adjustment in the tree structure when the tag data after any state adjustment is in the hidden state, and determine that the next child tag data of the tag data after any state adjustment in the tree structure is the start tag data of this rendering among all the child tag data of the parent tag data of the tag data after any state adjustment in the tree structure.

[0103] Back to Figure 4 , the tag acquisition unit 404 can acquire a preset number of tag data from multiple tag data based on the starting tag data of this rendering and the tree structure. Here, the tag acquisition unit 404 can acquire a preset number of tag data one by one from the multiple tag data in the tree structure based on the starting tag data of this rendering. In the process of acquiring one by one, the status information of each acquired tag data and its hierarchical information in the tree structure can be considered to determine whether each of its sub-tag data can be acquired. The preset number can be determined according to the height of the current screen before the first rendering of the current screen.

[0104] According to an exemplary embodiment of the present disclosure, the screen rendering device 400 further includes a flattening processing unit, which can flatten the rendering data to obtain flattened rendering data, wherein the start tag determination unit 403 and the tag acquisition unit 404 are executed after the flattening processing unit is completed. It should be noted that the multiple tag data in the rendering data in the exemplary embodiment of the present disclosure are in a tree structure, so that the rendering data is nested in multiple layers. Flattening can refer to converting the nested rendering data into a single layer of rendering data. Here, first, the flattening processing unit can determine the tag data at the root of the tree structure; then, the flattening processing unit can determine each tag data pair with a parent-child relationship in the multiple tag data; next, the flattening processing unit can determine the rendering content data corresponding to each tag data in the multiple tag data; finally, the flattening processing unit can obtain the flattened rendering data based on the tag data at the root of the tree structure, each tag data pair with a parent-child relationship in the multiple tag data, and the rendering content data corresponding to each tag data in the multiple tag data. It should be noted that the order in which the flattening processing unit performs the steps of determining the tag data at the root of the tree structure, determining each tag data pair having a parent-child relationship among the plurality of tag data, and determining the rendering content data corresponding to each tag data among the plurality of tag data is merely illustrative, and the order in which the three determination steps are performed by the flattening processing unit can be adaptively adjusted. For example, but not limited to, the flattening processing unit may use the tag data at the root of the tree structure, each tag data pair having a parent-child relationship among the plurality of tag data, and the rendering content data corresponding to each tag data among the plurality of tag data as the rendering data after flattening.

[0105] For example, but not limited to, the flattened rendering data can be represented as:

[0106]

[0107] The screen rendering unit 405 can render the current screen using the rendering content data corresponding to each tag data in the preset number of tag data. The exemplary embodiment of the present disclosure can achieve on-demand loading by rendering the current screen using the rendering content data corresponding to each tag data in the preset number of tag data.

[0108] According to an exemplary embodiment of the present disclosure, the screen rendering device 400 also includes a saving unit, which can record all rendered rendering content data into a content information set (dataList). When the user pulls the scroll bar of the rendering page described in the above embodiment upward, the corresponding rendering content data can be obtained from the content information set and rendered on the current screen according to the pulling position.

[0109] Figure 5 is a block diagram of an electronic device 500 according to an exemplary embodiment.

[0110] Reference Figure 5 The electronic device 500 includes at least one memory 501 and at least one processor 502. The at least one memory 501 stores a set of computer-executable instructions. When the computer-executable instruction set is executed by the at least one processor 502, the screen rendering method according to the present disclosure is executed.

[0111] As an example, the electronic device 500 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 500 is not necessarily a single electronic device, but may also be any device or circuit that can execute the above-mentioned instructions (or instruction set) individually or in combination. The electronic device 500 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0112] In electronic device 500, processor 502 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0113] The processor 502 can execute instructions or codes stored in the memory 501, wherein the memory 501 can also store data. Instructions and data can also be sent and received over a network via a network interface device, wherein the network interface device can use any known transmission protocol.

[0114] The memory 501 may be integrated with the processor 502, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. Furthermore, the memory 501 may comprise a separate device, such as an external disk drive, a storage array, or any other storage device usable by a database system. The memory 501 and the processor 502 may be operatively coupled or may communicate with each other, for example, via an I / O port, a network connection, or the like, such that the processor 502 can access files stored in the memory.

[0115] In addition, the electronic device 500 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 500 may be connected to each other via a bus and / or a network.

[0116] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to perform the screen rendering method according to the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or ultra-fast digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device configured to store the computer program and any associated data, data files and data structures in a non-transitory manner and provide the computer program and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0117] According to exemplary embodiments of the present disclosure, a computer program product may also be provided. Instructions in the computer program product may be executed by a processor of a computer device to implement the screen rendering method according to the present disclosure.

[0118] According to the screen rendering method, device, electronic device and storage medium disclosed in the present invention, each time the screen needs to be rendered, the starting position information for this rendering can be obtained based on the position record information, and then the starting tag data for this rendering can be determined, and only a preset number of tag data can be obtained for this rendering. In this way, only the data required at that time is processed each time without the need to obtain and process all the tag data. The rendering speed can be improved, and problems such as freezes caused by processing a large amount of data at one time can be avoided. Rendering can be achieved on demand, reducing the pressure on the browser, and maintaining a good and smooth operating experience even when processing tens of millions of data volumes.

[0119] In addition, according to the screen rendering method, device, electronic device and storage medium disclosed in the present invention, the rendering data can be flattened, the data structure of the rendering data transmitted by the server can be optimized, the complexity of the tree-nested recursive structure can be reduced, the size of the rendering data can be reduced, and the efficiency of obtaining a preset number of label data can be improved, thereby ensuring the smoothness of the operation.

[0120] In addition, according to the screen rendering method, device, electronic device and storage medium disclosed in the present invention, a positioning index can be added to the label data corresponding to each rendering content data in all the currently rendered rendering content data, and the starting position information of this rendering can be quickly determined, thereby improving the efficiency of obtaining a preset number of label data.

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

[0122] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A screen rendering method, characterized in that: include: Receive rendering data from a server, wherein the rendering data includes a plurality of tag data and rendering content data corresponding to each tag data, and the plurality of tag data are in a tree structure; In response to receiving an instruction to render the current screen, obtaining starting position information for this rendering from the position record information, wherein the position record information records starting position information for each rendering, and the starting position information for each rendering indicates information used to determine a position of starting tag data for starting execution of each rendering in the tree structure; Determining the starting tag data for the current rendering based on the starting position information for the current rendering; Based on the starting tag data of the current rendering and the tree structure, obtaining a preset number of tag data from the multiple tag data; Rendering the current screen using the rendering content data corresponding to each tag data in the preset number of tag data; Wherein, in a case where the current screen is not rendered for the first time, the starting position information for this rendering is the position information of the end tag data of the last rendering, wherein the last rendering is performed up to the end tag data of the last rendering among the multiple tag data; The screen rendering method further includes: Determining whether the starting position information for the current rendering includes indication information for determining whether a loop check is performed until the rendering content data corresponding to the end tag data of the previous rendering is rendered, wherein a loop check is determined to have been performed if any pair of recorded identification information is identical, the identification information being identification information of the tag data corresponding to each rendering content data in all rendered content data; If it is determined that the starting position information for this rendering includes the indication information, the rendering operation is stopped.

2. The screen rendering method according to claim 1, wherein: When rendering the current screen for the first time, the starting position information used for this rendering is predefined starting position information. The predefined starting position information is used to indicate that the starting tag data of the current rendering is the tag data located at the root of the tree structure.

3. The screen rendering method according to claim 1, wherein: in, The determining the starting tag data for the current rendering based on the starting position information for the current rendering includes: In the tree structure, the start tag data of the current rendering is determined according to the end tag data of the previous rendering.

4. The screen rendering method according to claim 3, wherein: In the tree structure, determining the start tag data of the current rendering according to the end tag data of the previous rendering includes: Obtaining state information indicating whether the end tag data of the last rendering is expanded or hidden, wherein the expanded state of the end tag data of the last rendering indicates that sub-tag data of the end tag data of the last rendering can be obtained into a preset number of tag data required for the current rendering, and the hidden state of the end tag data of the last rendering indicates that sub-tag data of the end tag data of the last rendering cannot be obtained into the preset number of tag data required for the current rendering; When the end tag data of the last rendering is in an expanded state, determining that the first child tag data of the end tag data of the last rendering in the tree structure is the start tag data of the current rendering; When the end tag data of the last rendering is in a hidden state, determine the parent tag data of the end tag data of the last rendering in the tree structure, and among all the child tag data of the parent tag data of the end tag data of the last rendering in the tree structure, determine that the next child tag data of the end tag data of the last rendering is the start tag data of the current rendering.

5. The screen rendering method according to claim 1, wherein: In the case where the current screen is rendered based on the label data after any state adjustment, the starting position information for this rendering is the position information of the label data after any state adjustment; The determining of the starting tag data for the current rendering based on the starting position information for the current rendering includes: Based on the tag data adjusted in any state, determining the starting tag data for the current rendering in the tree structure; Among them, the rendering content data corresponding to the label data after any state adjustment has been rendered to the current screen, and the label data after any state adjustment is any label data adjusted from an expanded state to a hidden state, or any label data adjusted from a hidden state to an expanded state. The label data after any state adjustment is an expanded state, indicating that the sub-label data of the label data after any state adjustment can be obtained into the preset number of label data required for this rendering, and the label data after any state adjustment is a hidden state, indicating that the sub-label data of the label data after any state adjustment cannot be obtained into the preset number of label data required for this rendering.

6. The screen rendering method according to claim 5, wherein: The step of determining the starting tag data for the current rendering in the tree structure based on the tag data adjusted in any state includes: Acquire state information indicating whether the label data after any state adjustment is expanded or hidden; In a case where the tag data after any state adjustment is in an expanded state, determining that the first sub-tag data of the tag data after any state adjustment in the tree structure is the starting tag data of the current rendering; In the case where the label data after any state adjustment is in a hidden state, determine the parent label data of the label data after any state adjustment in the tree structure, and among all the child label data of the parent label data of the label data after any state adjustment in the tree structure, determine that the next child label data of the label data after any state adjustment is the starting label data of this rendering.

7. The screen rendering method according to claim 5, wherein: Also includes: Adding a positioning index to the tag data corresponding to each rendering content data in all currently rendered rendering content data, wherein the positioning index includes identification information of all tag data on a path from the tag data at the root of the tree structure to the tag data to which the positioning index is added; The position information of the tag data after any state adjustment is determined by the following steps: The position information of the tag data after any state adjustment is determined according to the positioning index of the tag data after any state adjustment.

8. The screen rendering method according to any one of claims 1 to 7, wherein: After receiving rendering data from the server, it also includes: Flattening the rendering data to obtain flattened rendering data, Among them, the step of determining the starting tag data of the current rendering and the step of obtaining a preset number of tag data from the multiple tag data based on the starting tag data of the current rendering and the tree structure are performed based on the flattened rendering data.

9. The screen rendering method according to claim 8, wherein: The flattening the rendering data to obtain the flattened rendering data includes: Determining label data at the root of the tree structure; determining each pair of label data having a parent-child relationship among the plurality of label data; Determine the rendering content data corresponding to each tag data in the plurality of tag data; The flattened rendering data is obtained based on the tag data at the root of the tree structure, each tag data pair having a parent-child relationship among the multiple tag data, and the rendering content data corresponding to each tag data among the multiple tag data.

10. A screen rendering device, characterized in that: include: The data receiving unit is configured to: receive rendering data from a server, wherein the rendering data includes a plurality of tag data and rendering content data corresponding to each tag data, and the plurality of tag data are in a tree structure; a starting position obtaining unit configured to: in response to receiving an instruction to render the current screen, obtain starting position information for this rendering from the position recording information, wherein the position recording information records starting position information for each rendering, and the starting position information for each rendering indicates information used to determine a position of starting tag data at which execution of each rendering starts in the tree structure; A start tag determining unit is configured to: determine the start tag data of the current rendering based on the start position information for the current rendering; A tag acquisition unit is configured to: acquire a preset number of tag data from the plurality of tag data based on the starting tag data of the current rendering and the tree structure; A screen rendering unit is configured to render the current screen using rendering content data corresponding to each tag data in the preset number of tag data; Wherein, in a case where the current screen is not rendered for the first time, the starting position information for this rendering is the position information of the end tag data of the last rendering, wherein the last rendering is performed up to the end tag data of the last rendering among the multiple tag data; The screen rendering device also includes: a ring check determination unit configured to: determine whether the starting position information for the current rendering includes indication information for determining whether a ring check is constituted until the rendering content data corresponding to the end tag data of the previous rendering is rendered, wherein a ring check is determined to be constituted if any pair of recorded identification information is the same, the identification information being identification information of the tag data corresponding to each rendering content data in all rendered rendering content data; The rendering stopping unit is configured to: stop executing the rendering operation when it is determined that the starting position information for this rendering includes the indication information.

11. The screen rendering device according to claim 10, wherein: When rendering the current screen for the first time, the starting position information used for this rendering is predefined starting position information. The predefined starting position information is used to indicate that the starting tag data of the current rendering is the tag data located at the root of the tree structure.

12. The screen rendering device according to claim 10, wherein: The start tag determination unit is configured to: In the tree structure, the start tag data of the current rendering is determined according to the end tag data of the previous rendering.

13. The screen rendering device according to claim 12, wherein: The start tag determination unit is configured to: Obtaining state information indicating whether the end tag data of the last rendering is expanded or hidden, wherein the expanded state of the end tag data of the last rendering indicates that sub-tag data of the end tag data of the last rendering can be obtained into a preset number of tag data required for the current rendering, and the hidden state of the end tag data of the last rendering indicates that sub-tag data of the end tag data of the last rendering cannot be obtained into the preset number of tag data required for the current rendering; When the end tag data of the last rendering is in an expanded state, determining that the first child tag data of the end tag data of the last rendering in the tree structure is the start tag data of the current rendering; When the end tag data of the last rendering is in a hidden state, determine the parent tag data of the end tag data of the last rendering in the tree structure, and among all the child tag data of the parent tag data of the end tag data of the last rendering in the tree structure, determine that the next child tag data of the end tag data of the last rendering is the start tag data of the current rendering.

14. The screen rendering device according to claim 10, wherein: In the case where the current screen is rendered based on the label data after any state adjustment, the starting position information for this rendering is the position information of the label data after any state adjustment; The start tag determination unit is configured to: Based on the tag data adjusted in any state, determining the starting tag data for the current rendering in the tree structure; Among them, the rendering content data corresponding to the label data after any state adjustment has been rendered to the current screen, and the label data after any state adjustment is any label data adjusted from an expanded state to a hidden state, or any label data adjusted from a hidden state to an expanded state. The label data after any state adjustment is an expanded state, indicating that the sub-label data of the label data after any state adjustment can be obtained into the preset number of label data required for this rendering, and the label data after any state adjustment is a hidden state, indicating that the sub-label data of the label data after any state adjustment cannot be obtained into the preset number of label data required for this rendering.

15. The screen rendering device according to claim 14, wherein: The start tag determination unit is configured to: Acquire state information indicating whether the label data after any state adjustment is expanded or hidden; In a case where the tag data after any state adjustment is in an expanded state, determining that the first sub-tag data of the tag data after any state adjustment in the tree structure is the starting tag data of the current rendering; In the case where the label data after any state adjustment is in a hidden state, determine the parent label data of the label data after any state adjustment in the tree structure, and among all the child label data of the parent label data of the label data after any state adjustment in the tree structure, determine that the next child label data of the label data after any state adjustment is the starting label data of this rendering.

16. The screen rendering device according to claim 14, wherein: It also includes an index adding unit configured to: Adding a positioning index to the tag data corresponding to each rendering content data in all currently rendered rendering content data, wherein the positioning index includes identification information of all tag data on a path from the tag data at the root of the tree structure to the tag data to which the positioning index is added; The starting position acquisition unit is configured as follows: The position information of the tag data after any state adjustment is determined according to the positioning index of the tag data after any state adjustment.

17. The screen rendering device according to any one of claims 10 to 16, characterized in that: The flattening processing unit is further included and configured to: Flattening the rendering data to obtain flattened rendering data, The start tag determining unit and the tag acquiring unit are executed after the flattening processing unit is executed.

18. The screen rendering device according to claim 17, wherein: The flattening processing unit is configured as follows: Determining label data at the root of the tree structure; determining each pair of label data having a parent-child relationship among the plurality of label data; Determine the rendering content data corresponding to each tag data in the plurality of tag data; The flattened rendering data is obtained based on the tag data at the root of the tree structure, each tag data pair having a parent-child relationship among the multiple tag data, and the rendering content data corresponding to each tag data among the multiple tag data.

19. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer-executable instructions, When the computer-executable instructions are executed by the at least one processor, the computer-executable instructions cause the at least one processor to execute the screen rendering method according to any one of claims 1 to 9.

20. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one processor, the at least one processor is prompted to perform the screen rendering method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Retrieval method and device for displaying retrieval results via tree-like drop-down list boxes

    CN107918615A

  • Display data rendering method, electronic equipment, mobile terminal and storage medium

    CN113190773A