Rendering data processing method and device
By obtaining rendering time and updating configuration rules, the rendering data processing of the front-end database is optimized, solving the problems of slow loading and failure caused by large data volume and improving page loading efficiency.
Patent Information
- Application Number
- CN202510919629.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-14
AI Technical Summary
With the development of network technology, the amount of data required to load when rendering components has gradually increased, resulting in longer server data transmission time, which in turn leads to slow loading speeds or even loading failures.
By obtaining the rendering time of the corresponding component of each page, determining the target rendering time based on multiple rendering times, and uploading it to the backend to update the configuration rules of the front-end database, executing insertion, deletion and/or update of rendering data.
This reduces the possibility of front-end database overload, improves page loading speed, and reduces loading failures.
Smart Images

Figure CN120780937A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for processing rendering data. Background Art
[0002] The rapid development of network technology, coupled with its expanding functionality and increasingly complex application scenarios, places higher demands on component loading capabilities. However, the increasing amount of data required to render components increases the time it takes for servers to transmit data, which can lead to slow loading speeds or even loading failures.
[0003] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the Invention
[0004] Embodiments of the present application provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for processing rendering data to solve or alleviate one or more of the technical problems raised above.
[0005] One aspect of an embodiment of the present application provides a method for processing rendering data, for use in a client, the method comprising: Obtaining the rendering time of the component corresponding to each page; wherein the component is rendered by loading rendering data from a preset front-end database or back-end database, and the front-end database caches the rendering data of some components corresponding to some pages; Determining a target rendering duration according to the plurality of rendering durations; Uploading the target rendering time to the backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns it; Execute corresponding target operations on the front-end database according to the configuration rules; The target operation includes inserting, deleting and / or updating the rendering data in the front-end database.
[0006] Optionally, the backend database stores rendering data of all components corresponding to all pages; rendering is performed using rendering data loaded from a preset front-end database or a back-end database, including: For each page, if the rendering data of some components corresponding to the page are cached in the front-end database, the rendering data of some components corresponding to the page are loaded from the front-end database for rendering; if the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering data of all components corresponding to the page are loaded from the back-end database for rendering.
[0007] Optionally, get the rendering time of the corresponding component of each page, including: For each page, if the rendering data of some components corresponding to the page are cached in the front-end database, the rendering time of the some components corresponding to the page is determined as the rendering time of the components corresponding to the page; if the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering time of all components corresponding to the page is determined as the rendering time of the components corresponding to the page.
[0008] Optionally, the method further includes: In response to a first visit to a first page of the plurality of pages, determining whether an initial configuration rule exists in the front-end database; If the initial configuration rule exists in the front-end database, obtaining the initial configuration rule from the front-end database; In the case that the initial configuration rule does not exist in the front-end database, the initial configuration rule is obtained from the back-end database.
[0009] Optionally, when the initial configuration rule is obtained, the method further includes: Obtaining rendering data of some components corresponding to some pages from the backend database according to the initial configuration rule; The rendering data of the partial components corresponding to the partial pages and the initial configuration rules are written into the front-end database.
[0010] Optionally, the configuration rule includes a storage threshold of the front-end database; performing a corresponding target operation on the front-end database according to the configuration rule includes: determining whether the number of the plurality of rendering data in the front-end database exceeds the storage threshold; When the storage threshold is exceeded, obtaining the writing time of the plurality of rendering data; selecting target rendering data from a plurality of rendering data in the front-end database according to the writing time; Delete the target rendering data.
[0011] Another aspect of an embodiment of the present application provides a rendering data processing device for a client, the device comprising: A first acquisition module is configured to acquire the rendering duration of a component corresponding to each page; wherein the component is rendered by loading rendering data from a preset front-end database or a back-end database, and the front-end database caches rendering data of some components corresponding to some pages; A determination module, configured to determine a target rendering duration based on the plurality of rendering durations; An uploading module, configured to upload the target rendering time to a backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns the updated information; An execution module, configured to execute corresponding target operations on the front-end database according to the configuration rules; The target operation includes inserting, deleting and / or updating the rendering data in the front-end database.
[0012] Another aspect of an embodiment of the present application provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0013] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0014] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the above-mentioned method when executed by a processor.
[0015] The embodiment of the present application adopts the above-mentioned technical solution and may include the following advantages: obtaining the rendering time of the component corresponding to each page (the component is rendered through a preset front-end database cache or by loading rendering data in the back-end database), and determining the target rendering time based on multiple rendering times. The target rendering time is then uploaded to the back-end to update the configuration rules and returned. Subsequently, the rendering data in the front-end database is inserted, deleted and / or updated according to the updated configuration rules. The embodiment of the present application inserts, deletes or updates the rendering data in the front-end database according to the target rendering time of the component corresponding to each page, thereby reducing the possibility of overloading the front-end database, thereby further improving the page loading speed and reducing the number of page loading failures. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.
[0017] Figure 1 A diagram schematically illustrates an operating environment of a method for processing rendering data according to a first embodiment of the present application; Figure 2 The flowchart schematically shows a method for processing rendering data according to the first embodiment of the present application; Figure 3 Schematically shows Figure 2 Flowchart of sub-steps of step S206; Figure 4 Schematically shows the effect diagram of page loading in the embodiment of the present application; Figure 5 Schematically shows the effect diagram of the rendering part components of the embodiment of the present application; Figure 6 An exemplary application flow chart is schematically shown; Figure 7 A flowchart for adjusting configuration rules is schematically shown; Figure 8 A block diagram schematically shows a device for processing rendering data according to a second embodiment of the present application; and Figure 9 The following schematically shows a hardware architecture diagram of a computer device according to the third embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of this application more clear, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0019] It should be noted that the descriptions of "first", "second", etc. in the embodiments of the present application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0020] It should be noted that in all aspects of this application involving the collection, storage, use, transmission, and processing of rendering data, all aspects of this data collection process strictly adhere to the laws, regulations, industry standards, and regulatory requirements of the countries and regions where the data originates and is used, ensuring the legality and compliance of rendering data activities. During the collection process, the purpose, method, and scope of collection are clearly stated to the data subject in a conspicuous manner. Collection is carried out only after obtaining the data subject's legal authorization, ensuring that the collection process adheres to the "minimum necessary" principle and does not exceed the scope of rendering data collection. During storage, storage periods are limited, and after the storage purpose has been achieved, data is promptly deleted, anonymized, or encrypted. During the use process, a strict rendering data security protection mechanism is implemented. Field-level desensitization technology is used to process raw rendering data according to pre-set desensitization rules. Various desensitization strategies, such as generalization, anonymization, and encryption, are employed for different types of rendering data to effectively mitigate the risk of sensitive information leakage and ensure that the rendering data ultimately used is securely desensitized, fully protecting the rights and interests of the data subject and the security of the rendering data. During the transmission and processing stages, the confidentiality and security of rendering data are ensured during transmission and processing.
[0021] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed. They are only used to facilitate the description of this application and to distinguish each step. Therefore, they cannot be understood as limitations on this application.
[0022] First, an explanation of the terms involved in this application is provided: Front-end: The part of the web page that users directly access and interact with using a browser.
[0023] Asynchronous tasks: In JavaScript, asynchronous functions can be declared using the Async keyword. Await expressions are used within the function body, making it non-blocking. When an Await is encountered, the event loop is released, allowing other code to execute.
[0024] Secondly, to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present application, the following describes the relevant technologies: (1) If the front-end completely relies on the rendering data returned by the server for page rendering, the amount of data returned by the server each time will be large, which will lead to a significant increase in bandwidth usage. At the same time, the large amount of data returned by the server will also reduce the transmission speed of the rendering data, thereby extending the time the user waits for the server interface to return the rendering data. (2) The performance of the devices used by users to browse web pages varies, which leads to significant differences in the speed of reading rendering data and rendering components. (3) There are difficulties in determining the appropriate cache capacity of the front-end database, which leads to cache failures or long data reading times in the front-end database when processing large amounts of data, and thus the cache cannot be fully utilized.
[0025] To this end, an embodiment of the present application provides a technical solution for processing rendering data. In this technical solution, the performance of cached data (rendering data) in all user groups is collected by sampling and reporting. If the loading time is found to be too long, the volume of the cached data is appropriately adjusted (it can be reduced or enlarged), and then the reported data results are observed again. After repeated experiments, an optimal cache configuration rule is finally determined. See below for details.
[0026] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0027] like Figure 1 As shown, the operating environment diagram includes: like Figure 1 As shown, the operating environment diagram includes: a service platform 2, and clients (4A, 4B, ..., 4N).
[0028] The service platform 2 can be connected to the client terminals ( 4A, 4B, ..., 4N) via a network.
[0029] The service platform 2 can be a single server, a server cluster or a cloud computing service center.
[0030] The service platform 2 can provide services such as storage and rendering data to the client.
[0031] The service platform 2 can be located in a data center such as a single location, or distributed across different geographical locations (e.g., multiple locations). The service platform 2 can provide services via a network. The network includes various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network can include physical links such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, or wireless links such as cellular links, satellite links, Wi-Fi links, etc. The service platform 2 can be configured with a backend database, wherein the backend database can be used to store configuration rules and all rendering data corresponding to all components.
[0032] Clients (4A, 4B, ..., 4N) can be configured to access content and services on the service platform 2. Clients (4A, 4B, ..., 4N) can include electronic devices with or connected to display panels, such as mobile devices, tablets, laptops, workstations, virtual reality devices, gaming devices, digital streaming devices, vehicle terminals, smart televisions, set-top boxes, and the like. They can also include virtualized computing instances. Virtualized computing instances can include virtual machines, such as emulations of computer systems, operating systems, servers, and the like. Computing devices can load virtual machines based on virtual images and / or other data defining specific software (e.g., operating systems, specialized applications, servers) for emulation. As demand for different types of processing services changes, different virtual machines can be loaded and / or terminated on one or more computing devices.
[0033] Clients (4A, 4B, ..., 4N) can be associated with one or more users. A single user can also use one or more of the clients (4A, 4B, ..., 4N) to access the service platform 2. Clients (4A, 4B, ..., 4N) can travel to various locations and use different networks to access the service platform 2. Clients (4A, 4B, ..., 4N) can be configured with a front-end database, which is used to cache partial rendering data corresponding to certain components.
[0034] The client (4A, 4B, ..., 4N) may include an interface. The interface may include a touchpad, a touch screen, a mouse, a keyboard, or other sensing elements. For example, the input element may be configured to receive user instructions, which may cause the client (4A, 4B, ..., 4N) to perform various operations, such as accessing a web page.
[0035] It should be noted that the above devices are exemplary, and the number and type of devices can be adjusted in different scenarios or according to different needs.
[0036] The following describes the technical solutions of this application using the client (front-end) as the execution body through multiple embodiments. It should be noted that these embodiments can be implemented in many different forms and should not be construed as being limited to the embodiments described here.
[0037] Example 1 Figure 2 The flowchart of the method for processing rendering data according to the first embodiment of the present application is schematically shown.
[0038] like Figure 2 As shown, the method for processing rendering data may include steps S200 to S206, wherein: Step S200, obtaining the rendering time of the component corresponding to each page; wherein the component is rendered by loading rendering data from a preset front-end database or back-end database, and the front-end database caches rendering data of some components corresponding to some pages.
[0039] Step S202: determining a target rendering duration according to the plurality of rendering durations.
[0040] Step S204: uploading the target rendering time to the backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns it.
[0041] Step S206, performing corresponding target operations on the front-end database according to the configuration rules; The target operation includes inserting, deleting and / or updating the rendering data in the front-end database.
[0042] The rendering data processing method provided in this embodiment obtains the rendering time of the component corresponding to each page (the component is rendered through a preset front-end database cache or loading rendering data in the back-end database), and determines the target rendering time based on multiple rendering times. The target rendering time is then uploaded to the back-end to update the configuration rules and returned. Subsequently, the rendering data in the front-end database is inserted, deleted and / or updated according to the updated configuration rules. The embodiment of the present application inserts, deletes or updates the rendering data in the front-end database according to the target rendering time of the component corresponding to each page, thereby reducing the possibility of overloading the front-end database, thereby further improving the page loading speed and reducing the number of page loading failures.
[0043] The following combination Figure 2 , each step in steps S200~S206 and other optional steps are described in detail.
[0044] Step S200, obtaining the rendering time of the component corresponding to each page. The component is rendered by loading rendering data from a preset front-end database or back-end database, and the front-end database caches the rendering data of some components corresponding to some pages.
[0045] Pages can include various types such as live broadcast pages, item details pages, news information pages, etc. Components can include gift components, product card components, barrage components, button components, etc. The rendering time of the corresponding components on each page can be collected by embedding points for subsequent performance analysis and optimization. When a user accesses a page, the rendering data of the corresponding component can be loaded for rendering. The rendering data of the component may come from a preset front-end database (the front-end database caches the rendering data of some components of some pages), or it may come from a preset back-end database. An exemplary rendering data acquisition solution is provided below.
[0046] In an optional embodiment, the back-end database stores rendering data for all components corresponding to all pages. Step S200 may include: for each page, if the rendering data for some components corresponding to the page is cached in the front-end database, loading the rendering data for some components corresponding to the page from the front-end database for rendering; if the rendering data for some components corresponding to the page is not cached in the front-end database, loading the rendering data for all components corresponding to the page from the back-end database for rendering.
[0047] Exemplarily, the front-end database caches the rendering data of part of components of part of pages. The back-end database stores complete component rendering data of all pages (such as rendering data of all gift components corresponding to all live pages), thereby effectively avoiding component rendering abnormities caused by missing rendering data. In actual application, when a user accesses a page, if the front-end database does not cache the rendering data of part of components of the page, the rendering data of part of components of the page can be obtained from the back-end database and written into the front-end database. Finally, the rendering data of these part of components is read from the front-end database for rendering. However, this processing flow is time-consuming. In view of this, the embodiment of the present application innovatively proposes an optimized scheme: when a user accesses a page, the rendering data of all components of the page can be requested from the server, and whether the front-end database caches the rendering data of part of components corresponding to the page is inquired. In the case that the front-end database caches the rendering data of part of components corresponding to the page, the rendering data of the corresponding part of components is preferentially loaded from the front-end database for rendering. In the case that the front-end database does not cache the rendering data of part of components corresponding to the page, a Loading (loading) animation can be displayed, and in the case that the rendering data of all components is successfully requested from the back-end database, the rendering is performed through the rendering data of all components, without waiting for the rendering data of part of components to be written into the front-end database and then read, thereby saving rendering time. The rendering data of part of components can be selected from the rendering data of all components obtained from the back-end database, and part of the rendering data of part of components is associated with the page identifier of the accessed page, and then stored in the front-end database in the form of Map or other data format, so that when the page is accessed again, the components can be quickly displayed, and the waiting time is reduced. It should be noted that the inquiry of whether the front-end database stores the rendering data of part of components of the page and the reading of the rendering data of all components of the page from the back-end database of the server are asynchronous tasks that are not dependent on each other in result and are not sequential in execution time.
[0048] In the embodiment, in the case that the front-end database stores the rendering data of part of components of the accessed page, the rendering data of these part of components is preferentially loaded from the front-end database for rendering, thereby improving the loading speed of components and reducing the amount of data returned by the server, and further reducing the bandwidth occupation. In the case that the front-end database does not store the rendering data of part of components of the accessed page, the rendering data of all components of the page is read from the back-end database of the server, thereby effectively avoiding component rendering abnormities caused by missing rendering data.
[0049] In actual applications, the front-end database can continuously store the rendering data of multiple components. However, if too much rendering data accumulates in the front-end database, it will not only occupy the browser memory, but also cause the rendering data reading speed to decrease. In addition, in certain modes of certain browsers (such as incognito mode), the local storage capacity that can be allocated by the browser is usually only about 5MB. If the rendering data is stored continuously, it is likely to exceed the local storage capacity, which will cause the cache to fail, and the rendering data will not be loaded from the front-end database. In addition, the performance of the devices used by users varies greatly, resulting in uneven reading and rendering speeds of rendering data. This performance difference will also bring challenges to developers in determining a reasonable cache capacity. Therefore, the embodiment of the present application proposes to dynamically adjust the cache strategy (such as subsequent configuration rules) by collecting the usage efficiency of cached data (i.e., rendering data in the front-end database). The efficiency of the use of cached data can be reflected by the rendering time of the component. The following is an exemplary solution for obtaining the rendering time.
[0050] In an optional embodiment, step S200 may include: For each page, if the rendering data of some components corresponding to the page are cached in the front-end database, the rendering time of the some components corresponding to the page is determined as the rendering time of the components corresponding to the page; if the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering time of all components corresponding to the page is determined as the rendering time of the components corresponding to the page.
[0051] For example, when a user visits a certain page, if the rendering data of some components corresponding to the page are cached in the front-end database, the rendering data of some components corresponding to the page are loaded from the front-end database for rendering. The difference between the time point when these components are fully displayed and the time point when the page starts loading is used as the rendering duration of the components of the page. If the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering data of all components corresponding to the page are loaded from the back-end database for rendering. The difference between the time point when all components are fully displayed and the time point when the page starts loading is used as the rendering duration of the components of the page.
[0052] In this embodiment, for each page, depending on whether the front-end database caches some of its component rendering data, the rendering time of some or all components is determined as the rendering time of the corresponding components of the page, so that the efficiency of using the cached data can be accurately evaluated later.
[0053] Step S202 , determining a target rendering duration based on the multiple rendering durations.
[0054] In order to more accurately evaluate the efficiency of using cached data, the period for collecting multiple rendering times can be determined based on the importance of the business. For example, the gift business is a key business in the live broadcast page, and a longer period (such as 5 days) can be set for such business. Get multiple rendering times within the period, and calculate the target rendering time (such as average rendering time or weighted rendering time, etc.) based on the multiple rendering times. In some embodiments, the rendering time can also be collected in real time and the target rendering time can be calculated to quickly respond to performance changes.
[0055] Step S204 , uploading the target rendering time to the backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns it.
[0056] The target rendering time can be uploaded to the backend so that developers or automated strategies can adjust the configuration rules for the frontend database according to the target rendering time, and return the adjusted configuration rules to the frontend. The configuration rules may include the number of pages that can be stored in the frontend database, the number of components stored for each page, page identifiers, etc. For example, you can combine Figure 7 The initial configuration rule can be set to 50 pages, with each page storing rendering data for 8 components. If the target rendering time exceeds the preset threshold, the number of pages in the configuration rule is increased or decreased by 10 at a time, and the number of components corresponding to each page is increased or decreased by 1 at a time. The reported target rendering time is then observed again. Repeating the experiment multiple times results in an optimal configuration rule, thereby reducing component loading speed and improving user experience.
[0057] Step S206 , performing corresponding target operations on the front-end database according to the configuration rules, wherein the target operations include inserting, deleting and / or updating the rendering data in the front-end database.
[0058] Rendering data in the front-end database is inserted, deleted, and / or updated according to the updated configuration rules. Specifically, after obtaining new rendering data from the back-end according to the updated configuration rules, the new rendering data can be inserted or updated into the front-end database based on the page access time. To effectively avoid front-end database memory overload, rendering data in the front-end database can be deleted based on various methods, such as the writing time of the rendering data in the front-end data, a preset validity period, etc. An exemplary solution is provided below.
[0059] In an optional embodiment, the configuration rule includes a storage threshold of the front-end database; Figure 3 As shown, step S206 may include: Step S300, determine whether the number of the plurality of rendering data in the front-end database exceeds the storage threshold.
[0060] Step S302, in the case of exceeding the storage threshold, obtain the write time of the plurality of rendering data.
[0061] Step S304, according to the write time, select target rendering data from the plurality of rendering data in the front-end database.
[0062] Step S306, delete the target rendering data.
[0063] Exemplarily, the configuration rule includes a storage threshold of the front-end database, and if the number of rendering data in the front-end database exceeds the storage threshold during the process of updating new rendering data to the front-end database according to the configuration rule, the target rendering data is selected from the plurality of rendering data in the front-end database according to the write time of each rendering data and the target rendering data is deleted (such as the rendering data with the earliest write time).
[0064] In this embodiment, in the case that the number of rendering data in the front-end database exceeds the storage threshold, the target rendering data is selected from the plurality of rendering data in the front-end database according to the write time and is deleted, thereby reducing the possibility of overloading of the front-end database, further improving the page loading speed, and reducing the case of page loading failure.
[0065] In an optional embodiment, the rendering data processing method can further include: In response to first accessing a first page of the plurality of pages, determine whether the initial configuration rule exists in the front-end database.
[0066] In the case that the initial configuration rule exists in the front-end database, obtain the initial configuration rule from the front-end database.
[0067] In the case that the initial configuration rule does not exist in the front-end database, obtain the initial configuration rule from the back-end database.
[0068] It should be noted that the loading of the configuration rule (or the initial configuration rule) from the front-end database and the reading of all component rendering data from the back-end database are asynchronous tasks which are not dependent on each other in result and are not in the same order in execution time.
[0069] When a user first visits the first of multiple pages, the front-end database is queried to see if there are initial configuration rules. If so, the rules are retrieved from the database. If not, a loading animation is displayed on the front-end page, and the rules are retrieved from the back-end database.
[0070] In this embodiment, when accessing the first page among multiple pages for the first time, the front-end database is first queried to see whether the initial configuration rules exist. If they exist, they are obtained from the front-end database first; if they do not exist, they are obtained from the back-end, thereby reducing access to the back-end database, reducing back-end pressure, improving data acquisition efficiency, and optimizing overall performance.
[0071] In an optional embodiment, when the initial configuration rule is obtained, the method for processing rendering data may further include: Rendering data of some components corresponding to some pages are obtained from the backend database according to the initial configuration rule.
[0072] The rendering data of the partial components corresponding to the partial pages and the initial configuration rules are written into the front-end database.
[0073] For example, when the initial configuration rules are obtained, the rendering data of some components corresponding to some pages can be obtained from the backend database according to the initial configuration rules. The rendering data of some components corresponding to the page identifiers are associated and written into the frontend database in a Map or other data format.
[0074] In this embodiment, the rendering data of some components of some pages are obtained from the back-end database according to the initial configuration rules, and are written into the front-end database together with the initial configuration rules. Subsequent access can be obtained from the front-end database first, reducing back-end data requests, improving page loading speed and responsiveness, and enhancing user experience.
[0075] In order to make this application easier to understand, the following Figure 6 An exemplary application is provided.
[0076] Step S1, when a user visits a certain page, all gift data is requested from the server and it is determined whether there is a preloaded configuration in the front-end database.
[0077] Step S2A: In the absence of pre-load configuration, a loading animation is displayed on the front end (e.g. Figure 4 As shown, Figure 4The red arrows in the figure are marked for easy understanding later), and preload configuration is requested from the server to be written into the front-end database, and all gift panels are displayed based on all gift data requested from the server.
[0078] Specifically, (1) determine whether all gift data is successfully requested from the server. If all gift data is successfully requested, hide the loading animation and display all gift panels based on all gift data. If all gift data is not successfully requested, display a fallback panel (such as loading failure) and request again until the request is successful. (2) determine whether the preload configuration is successfully requested from the server. If the preload configuration is successfully requested, write the preload configuration into the front-end database, and at the same time, obtain part of the gift data corresponding to each of the multiple pages from the back-end database according to the preload configuration and write it into the front-end database, so that the gift data corresponding to the page will exist in the front-end database when the page is visited next time, thereby improving the component loading speed.
[0079] Step S2B: if there is a preload configuration, load the preload configuration from the front-end database, and determine whether there is partial gift data corresponding to the page in the front-end database based on the preload configuration.
[0080] Specifically, (1) if there is partial gift data corresponding to the page, load the corresponding partial gift data (corresponding to the room cache), and display the partial gift panel according to the partial gift data (such as Figure 5 As shown, Figure 5 The red arrows in the figure are added for easy understanding. (2) If the corresponding gift data for the page does not exist, the loading animation is displayed on the front end. If all the gift data is successfully requested from the server, the entire gift panel is displayed based on the entire gift data.
[0081] In step S3, the front end obtains the loading time of multiple pages by embedding points, and calculates the average loading time based on the multiple loading times.
[0082] Step S4: reporting the average loading time to the backend so that the backend can update the preloading configuration according to the average loading time.
[0083] It should be noted that this embodiment of the application obtains multiple loading times for loading portions of the gift panel when all users access different pages within a certain period (e.g., 5 days). Based on these multiple loading times, the average loading time is determined and reported to the backend, which then updates the preloading configuration based on the average loading time, thereby more accurately evaluating the efficiency of cached data usage.
[0084] Step S5: Update some gift data in the front-end database (update the corresponding room cache) according to the updated preload configuration.
[0085] Example 2 Figure 8 The block diagram of the rendering data processing device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 8 As shown, the apparatus 1000 may include: a first acquisition module 1100, a determination module 1200, an upload module 1300, and an execution module 1400, wherein: A first acquisition module 1100 is configured to acquire a rendering duration of a component corresponding to each page; wherein the component is rendered by loading rendering data from a preset front-end database or a back-end database, and the front-end database caches rendering data of some components corresponding to some pages; A determination module 1200 is configured to determine a target rendering duration based on the plurality of rendering durations; An uploading module 1300 is configured to upload the target rendering time to a backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns the updated information. An execution module 1400 is configured to execute a corresponding target operation on the front-end database according to the configuration rule; The target operation includes inserting, deleting and / or updating the rendering data in the front-end database.
[0086] In an optional embodiment, the backend database stores rendering data of all components corresponding to all pages; the first acquisition module 1100 is further configured to: For each page, if the rendering data of some components corresponding to the page are cached in the front-end database, the rendering data of some components corresponding to the page are loaded from the front-end database for rendering; if the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering data of all components corresponding to the page are loaded from the back-end database for rendering.
[0087] In an optional embodiment, the first obtaining module 1100 is further configured to: For each page, if the rendering data of the partial component corresponding to the page is cached in the front-end database, the rendering time of the partial component corresponding to the page is determined as the rendering time of the component corresponding to the page; if the rendering data of the partial component corresponding to the page is not cached in the front-end database, the rendering time of the whole component corresponding to the page is determined as the rendering time of the component corresponding to the page.
[0088] In an optional embodiment, the rendering data processing apparatus further comprises a second acquisition module configured to: In response to first accessing a first page in the plurality of pages, determine whether an initial configuration rule exists in the front-end database; If the initial configuration rule exists in the front-end database, acquire the initial configuration rule from the front-end database; If the initial configuration rule does not exist in the front-end database, acquire the initial configuration rule from the back-end database.
[0089] In an optional embodiment, if the initial configuration rule is acquired, the rendering data processing apparatus further comprises a writing module configured to: acquire, according to the initial configuration rule, rendering data of a partial component corresponding to a partial page from the back-end database; write the rendering data of the partial component corresponding to the partial page and the initial configuration rule into the front-end database.
[0090] In an optional embodiment, the configuration rule comprises a storage threshold of the front-end database; and the execution module 1400 is further configured to: determine whether the number of the plurality of rendering data in the front-end database exceeds the storage threshold; if the storage threshold is exceeded, acquire a writing time of the plurality of rendering data; according to the writing time, select target rendering data from the plurality of rendering data in the front-end database; delete the target rendering data.
[0091] Embodiment Three Figure 9A hardware architecture schematic diagram of a computer device 10000 suitable for implementing the method for processing rendering data according to Embodiment Three of the present application is shown schematically. In some embodiments, the computer device 10000 can be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workstation, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 can be a rack-mounted server, a blade server, a tower server, or a rack server (including a standalone server, or a server cluster composed of multiple servers), etc. As shown in Figure 9 The computer device 10000 includes, but is not limited to, a memory 10010, a processor 10020, and a network interface 10030 that are communicatively linked via a system bus. The memory 10010 includes at least one type of computer-readable storage media, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external storage device of the computer device 10000, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. of the computer device 10000. Of course, the memory 10010 can include both an internal storage module and an external storage device of the computer device 10000. In this embodiment, the memory 10010 is generally used to store an operating system and various application software installed in the computer device 10000, such as program codes of the method for processing rendering data, etc. In addition, the memory 10010 can also be used to temporarily store various rendering data that has been output or will be output.
[0092] The processor 10020 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips in some embodiments. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to rendering data interaction or communication of the computer device 10000, etc. In this embodiment, the processor 10020 is used to run program codes or process rendering data stored in the memory 10010.
[0093] Network interface 10030 may include a wireless network interface or a wired network interface. Network interface 10030 is typically used to establish a communication link between computer device 10000 and other computer devices. For example, network interface 10030 is used to connect computer device 10000 to an external terminal via a network, establishing a rendering data transmission channel and a communication link between computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or Wi-Fi.
[0094] It should be pointed out that Figure 9 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementing all of the shown components is not a requirement, and greater or fewer components may alternatively be implemented.
[0095] In this embodiment, the processing method of the rendering data stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0096] Example 4 An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for processing rendering data in the embodiment are implemented.
[0097] In this embodiment, computer-readable storage media include flash memory, hard disks, multimedia cards, card-type memories (e.g., SD or DX memories), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, magnetic disks, optical disks, and the like. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as the computer device's hard disk or memory. In other embodiments, the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, and the like. Of course, the computer-readable storage medium may also include both the internal storage unit and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device, such as the program code of the rendering data processing method described in the embodiment. In addition, the computer-readable storage medium may also be used to temporarily store various types of rendering data that have been output or are about to be output.
[0098] Example 5 An embodiment of the present application further provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0099] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented using general-purpose computer devices. They can be concentrated on a single computer device or distributed on a network composed of multiple computer devices. Alternatively, they can be implemented using program codes executable by the computer device, so that they can be stored in a storage device and executed by the computer device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0100] It should be noted that the above are only preferred embodiments of the present application and do not limit the scope of patent protection of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the scope of patent protection of the present application.
Claims
1. A method for processing rendering data, characterized in that: For a client, the method includes: Obtaining the rendering time of the component corresponding to each page; wherein the component is rendered by loading rendering data from a preset front-end database or back-end database, and the front-end database caches the rendering data of some components corresponding to some pages; Determining a target rendering duration according to the plurality of rendering durations; Uploading the target rendering time to the backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns it; Execute corresponding target operations on the front-end database according to the configuration rules; The target operation includes inserting, deleting and / or updating the rendering data in the front-end database.
2. The method according to claim 1, characterized in that The backend database stores rendering data of all components corresponding to all pages; Rendering data loaded from a preset front-end database or back-end database, including: For each page, if rendering data of some components corresponding to the page are cached in the front-end database, the rendering data of some components corresponding to the page are loaded from the front-end database for rendering; In a case where the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering data of all components corresponding to the page are loaded from the back-end database for rendering.
3. The method according to claim 2, characterized in that Get the rendering time of each component on each page, including: For each page, if the rendering data of some components corresponding to the page are cached in the front-end database, the rendering time of the some components corresponding to the page is determined as the rendering time of the components corresponding to the page; if the rendering data of some components corresponding to the page are not cached in the front-end database, the rendering time of all components corresponding to the page is determined as the rendering time of the components corresponding to the page.
4. The method according to claim 1, wherein The method further comprises: In response to a first visit to a first page of the plurality of pages, determining whether an initial configuration rule exists in the front-end database; If the initial configuration rule exists in the front-end database, obtaining the initial configuration rule from the front-end database; In the case that the initial configuration rule does not exist in the front-end database, the initial configuration rule is obtained from the back-end database.
5. The method according to claim 4, characterized in that When the initial configuration rule is obtained, the method further includes: Obtaining rendering data of some components corresponding to some pages from the backend database according to the initial configuration rule; The rendering data of the partial components corresponding to the partial pages and the initial configuration rules are written into the front-end database.
6. The method according to claim 1, characterized in that The configuration rule includes a storage threshold of the front-end database; performing corresponding target operations on the front-end database according to the configuration rule includes: determining whether the number of the plurality of rendering data in the front-end database exceeds the storage threshold; When the storage threshold is exceeded, obtaining the writing time of the plurality of rendering data; selecting target rendering data from a plurality of rendering data in the front-end database according to the writing time; Delete the target rendering data.
7. A rendering data processing device, characterized in that: For a client, the device includes: A first acquisition module is configured to acquire the rendering duration of a component corresponding to each page; wherein the component is rendered by loading rendering data from a preset front-end database or a back-end database, and the front-end database caches rendering data of some components corresponding to some pages; A determination module, configured to determine a target rendering duration based on the plurality of rendering durations; An uploading module, configured to upload the target rendering time to a backend, so that the backend updates the configuration rules for the frontend database according to the target rendering time and returns the updated information; An execution module, configured to execute corresponding target operations on the front-end database according to the configuration rules; The target operation includes inserting, deleting and / or updating the rendering data in the front-end database.
8. A computer device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claims 1 to 6 are implemented.
Citation Information
Cited By
Self-adaptive graphic cache management method and device for cloud game
CN121437250A
Adaptive graphics cache management method and apparatus for cloud gaming
CN121437250B