Data Processing Method, Device, Equipment and Medium Based on Multiple Rendering Engines
By obtaining and storing state data in the cooperation of multi-rendering engines, the data inconsistency problem during rendering engine switching is solved, the accuracy and efficiency of image rendering are improved, and the continuity of rendering data is ensured.
Patent Information
- Application Number
- CN202210302246.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In the prior art, the accuracy and correctness of graphics rendering cannot be ensured when multiple rendering engines cooperate, especially due to the inconsistency of image rendering caused by the inability to effectively share WebGL Context state values.
By obtaining the status data in the tag table, sending a data update request to the graphics processor, storing the data to be saved to the status cache table, and restoring the rendering data of the external rendering engine when the rendering engine switches to ensure data consistency.
It improves image rendering accuracy and efficiency during multi-rendering engine collaboration, solves the problem of data inconsistency during rendering engine switching, and realizes the accurate recovery of the rendering scene after engine switching.
Smart Images

Figure CN114708376B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a data processing method, apparatus, device, and medium based on multiple rendering engines. Background Art
[0002] The 3D drawing protocol (Web Graphics Library, WebGL) provides a graphics rendering interface for operating the GPU on the browser side, and this drawing protocol further expands the application scenarios of graphics rendering technology. Since the graphics interface is too low-level to be directly developed, some relatively easy-to-use graphics rendering engines have been developed, and the existence of graphics rendering engines has greatly improved the development efficiency.
[0003] Existing graphics rendering engines have different advantages. Therefore, when rendering the same canvas, multiple rendering engines may be used in cooperation. When multiple rendering engines cooperate, it is necessary to access the GPU through the WebGL Context, and different rendering engines must share the same WebGL Context. When multiple rendering engines cooperate, the current rendering engine cannot determine the modifications of other rendering engines to the Context, and this situation cannot ensure the correctness of graphics rendering.
[0004] Furthermore, to solve the above problems, it is possible to consider backing up the status values of the WebGL Context to improve the drawing performance when switching states. However, this method is mainly a CPU-virtualized status backup and does not directly back up the actual status of the GPU. Therefore, for the rendering engine, it is still impossible to achieve cooperation between multiple rendering engines, and thus the problem of ensuring the accuracy and correctness of image rendering cannot be solved. Summary of the Invention
[0005] The present invention provides a data processing method, apparatus, device, and medium based on multiple rendering engines to achieve the technical effect of improving the rendering accuracy and efficiency when performing image rendering based on multiple rendering engines.
[0006] In a first aspect, an embodiment of the present invention provides a data processing method based on multiple rendering engines, and the method includes:
[0007] When it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, obtain the status data corresponding to the target identifier in the tag table;
[0008] When the status data is inconsistent with the preset data, send a data update request corresponding to the target identifier to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request;
[0009] Receive the data to be saved fed back by the graphics processor, associate and store the data to be saved with the target identifier in the status cache table, and modify the data to be saved to the target data in the graphics processor; wherein, the status cache table corresponds to an external rendering engine;
[0010] When it is detected that the internal rendering engine is switched to the external rendering engine, perform a recovery process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table, so that the external rendering engine continues to render an image based on the recovered data.
[0011] In a second aspect, an embodiment of the present invention further provides a data processing device based on a multi-rendering engine. The device includes:
[0012] A status data acquisition module, configured to acquire status data corresponding to the target identifier in a tag table when it is detected that data corresponding to the target identifier is updated to target data based on an internal rendering engine;
[0013] A data update request sending module, configured to send a data update request for retrieving data corresponding to the target identifier to a graphics processor when the status data is inconsistent with preset data, so that the graphics processor acquires the data to be saved corresponding to the target identifier based on the data update request;
[0014] A data to be saved receiving module, configured to receive the data to be saved fed back by the graphics processor, associate and store the data to be saved with the target identifier in a status cache table, and modify the data to be saved to the target data in the graphics processor; wherein, the status cache table corresponds to an external rendering engine;
[0015] A rendering data recovery module, configured to perform a recovery process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table when it is detected that the internal rendering engine is switched to the external rendering engine, so that the external rendering engine continues to render an image based on the recovered data.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, and the electronic device includes:
[0017] One or more processors;
[0018] A storage device, configured to store one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on a multi-rendering engine according to any one of the embodiments of the present disclosure.
[0020] Fourthly, an embodiment of the present disclosure further provides a storage medium including computer-executable instructions, which are used to execute any data processing method based on multiple rendering engines in the embodiments of the present disclosure when executed by a computer processor.
[0021] In the technical solution of the embodiment of the present disclosure, when it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, the status data corresponding to the target identifier in the tag table is obtained, and the status data is matched with the preset status data. When the status data is inconsistent with the preset data, a data update request corresponding to the target identifier is sent to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request, and then receives the data to be saved fed back by the graphics processor, associates and stores the data to be saved and the target identifier in the status cache table, and modifies the data to be saved to the target data in the graphics processor, so that when it is detected that the switch is made from the internal rendering engine to the external rendering engine, the rendering data corresponding to the external rendering engine is restored based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the restored data, solving the problem in the prior art that the cooperation between multiple rendering engines cannot be realized. Further, when rendering in cooperation based on multiple rendering engines, the accuracy and accuracy of image rendering cannot be guaranteed. The technical effect is achieved that when the rendering engine is switched, the rendering data of the rendering engine before the switch can be recorded, and then when switching again, the scene can be restored based on the recorded rendering data, and data rendering can continue based on the restored scene, improving the accuracy and effectiveness of data rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the embodiments of the present disclosure will become more obvious. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale.
[0023] Figure 1 It is a schematic flowchart of a data processing method based on multiple rendering engines provided by Embodiment 1 of the present disclosure;
[0024] Figure 2 It is a schematic flowchart of a data processing method based on multiple rendering engines provided by Embodiment 1 of the present disclosure;
[0025] Figure 3 It is a schematic structural diagram of a data processing device based on multiple rendering engines provided by Embodiment 2 of the present disclosure;
[0026] Figure 4 It is a schematic structural diagram of an electronic device provided by Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] Before introducing the technical solution, an exemplary description of the application scenario can be given. The technical solution disclosed in the present disclosure can be applied to any scenario that requires collaborative rendering by multiple rendering engines. For example, the rendering of a virtual display scene can be based on the device's own rendering engine and the rendering engine unique to the AR scene to perform special effects rendering on the AR screen. At this time, multiple rendering engines are required to collaborate, that is, multiple rendering engines are required to render images on the same canvas. .
[0034] Embodiment 1
[0035] Figure 1This is a flow chart of a data processing method based on multiple rendering engines provided in the first embodiment of the present disclosure. The embodiment of the present disclosure is applicable to any scenario requiring collaborative rendering by multiple rendering engines. The method can be executed by a data processing device based on multiple rendering engines. The device can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server. Any scenario of data processing of multiple rendering engines is usually implemented by the cooperation of a server. The method provided in this embodiment can be executed by the server.
[0036] like Figure 1 As shown, the method includes:
[0037] S110: When it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, the state data corresponding to the target identifier in the mark table is obtained.
[0038] Among them, the internal rendering engine can be the rendering engine that comes with the application. It can be understood that when multiple rendering engines collaborate, the rendering engine corresponding to the terminal device to which the application belongs can be used as the internal rendering engine. The target identifier can be understood as a name or keyword used to mark the rendering project, or it can be a unique identifier. The target data may require the rendering data corresponding to the current target identifier to be modified. The marking table can be understood as whether the internal rendering engine has modified the data corresponding to a certain identifier when the external rendering engine ends rendering after switching to the internal rendering engine. When the external rendering engine switches to the internal rendering engine, the marking table is a table after initialization, that is, when switching from the external engine to the internal engine, the values corresponding to the multiple keys stored in the marking table are mostly default values, which are used to represent: the internal rendering engine has not read and modified the data corresponding to each rendering item when the external rendering engine ends rendering.
[0039] It should be noted that the data stored in the mark table is used to indicate whether the data corresponding to the current identifier has been modified by the internal rendering engine. If the data corresponding to the current identifier has been modified by the internal rendering engine, it is necessary to change the status data corresponding to the current identifier, that is, to change the status data corresponding to the current identifier to a "dirty mark" to indicate that the data has been modified. The table after the mark table is modified based on the above method can be used as a dirty mark table.
[0040] Specifically, when it is detected that the internal rendering engine needs to update the data corresponding to the target identifier to the target data, the status data corresponding to the target identifier in the tag table is obtained. For example, when multiple rendering engines are required to collaborate to complete the rendering of the page image, when the external rendering engine switches to the internal rendering engine for rendering, the corresponding data of the rendering project can be updated. At this time, the status data corresponding to the target identifier in the tag table can be obtained before the internal rendering engine updates the corresponding rendering data.
[0041] On the basis of the above technical solution, when it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, the status data corresponding to the target identifier in the tag table is obtained, including: when it is detected that the external rendering engine is switched to the internal rendering engine, and it is detected that the data corresponding to the target identifier is updated based on the internal rendering engine, the status data corresponding to the target identifier in the tag table is read; wherein, the status data is used to indicate whether the data to be saved when the external rendering engine ends rendering has been read when the external rendering engine rendering is switched to the internal rendering engine.
[0042] Among them, the external rendering engine can be a rendering engine used to realize the drawing of corresponding special effects. It is understandable that when special effects drawing is required, the rendering engine that comes with the application cannot efficiently complete the rendering work of all rendering projects. For example, cumbersome program code is required, there is no ready-made API, etc., all of which cause the rendering to be inefficiently completed. Based on this, the corresponding external rendering engine can be introduced, and different rendering projects need to be rendered using different rendering engines. Taking augmented reality special effects as an example here, when the internal rendering engine cannot efficiently complete the corresponding rendering work, it is necessary to introduce the corresponding augmented reality rendering engine, and when rendering special effects, different special effects projects may require the internal rendering engine and the external rendering engine to work together to complete the rendering. The data to be saved can be the data corresponding to the target identifier when the external rendering engine finishes rendering before switching to the internal rendering engine.
[0043] Exemplarily, when it is necessary to render corresponding special effects for the user, taking the augmented reality special effects as an example, the internal rendering engine built into the application cannot efficiently complete the special effect rendering work, and it is necessary to introduce an external rendering engine, that is, the augmented reality rendering engine, to jointly complete the rendering of the special effects. Therefore, when the external rendering engine has completed the rendering work of the current rendering project, it is necessary to switch to the internal rendering engine to complete the rendering work of the next rendering project. When switching the rendering engine, by detecting whether the internal rendering engine needs to update the data of the rendering project corresponding to the target identifier, when it is necessary to update the corresponding data, by reading the status data in the tag table corresponding to the target identifier, it can then be known from the status data whether the corresponding data to be saved has been read when the external rendering engine finishes rendering.
[0044] In the above technical solution, by reading the status data in the tag table when switching the rendering engine, and then obtaining the effect of whether the corresponding data to be saved has been read according to the status data, it is possible to avoid repeated reading of data and improve the data reading efficiency.
[0045] S120. When the status data is inconsistent with the preset data, send a data update request corresponding to the target identifier to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request.
[0046] Among them, the preset data can be data set in advance for judging whether the data to be saved has been read. The image processor can be a microprocessor in the terminal device for processing image and graphics operation work. The data update request can be understood as a request for instructing the graphics processor to perform data update.
[0047] Specifically, after obtaining the corresponding status data in the tag table, if the obtained status data is inconsistent with the preset data, it means that the rendering data corresponding to this identifier has not been saved yet. At this time, send a data update request corresponding to the target identifier to the image processor. The graphics processor can obtain the data to be retained corresponding to the target identifier according to the received data update request, store the data to be retained, and at the same time, after storage, update the data to be retained to the target data.
[0048] For example, when switching from an external rendering engine to an internal rendering engine, if the data to be saved corresponding to target identifier 1 is Y and the status data corresponding to identifier 1 in the tag table is FALSE, it indicates that the data to be saved corresponding to the current target identifier 1 has not been read. Then, a corresponding data update request is sent to the graphics processor, causing the graphics processor to return the data Y to be saved corresponding to identifier 1 according to the data update request. When the status data corresponding to identifier 1 in the tag table is TRUE, that is, it conforms to the preset status data, it indicates that the data to be saved corresponding to identifier 1 has been read. It is realized that whether the data corresponding to the target identifier has been read can be determined through the status data in the dirty data table. If it has not been read, the data to be saved corresponding to the target identifier can be retrieved from the device.
[0049] Based on the above technical solution, when the status data is consistent with the preset data, the data to be saved corresponding to the target identifier is updated based on the target data.
[0050] Specifically, if the status data is consistent with the preset data, it means that the internal rendering engine has already changed the data corresponding to the target identifier, and at the same time, the data to be saved corresponding to this target identifier has been stored in the status cache table. Therefore, when the status data is consistent with the preset data, the internal rendering engine can directly update the data to be saved corresponding to the target identifier to the target data.
[0051] S130. Receive the data to be saved fed back by the graphics processor, associatively store the data to be saved and the target identifier in the status cache table, and modify the data to be saved in the graphics processor to the target data; wherein, the status cache table corresponds to the external rendering engine.
[0052] Among them, the status cache table can be a table used to store the data to be retained by the external rendering engine when it ends the rendering work.
[0053] Specifically, after the graphics processor feeds back the data to be saved corresponding to the target identifier according to the data update request, receive the corresponding data to be saved, store the data to be saved at the corresponding position in the status cache table according to the target identifier, and after the storage is completed, modify the data to be saved in the graphics processor to the target data according to the target data of the internal rendering engine.
[0054] In the above technical solution, by correspondingly storing the obtained data to be saved and the target identifier at the corresponding positions in the status cache table, the working status of the external rendering engine is stored corresponding to the identifier of the rendering project. First, it avoids duplicate storage of data. Second, it can determine the rendering data corresponding to the end of the external rendering engine, so that when the internal rendering engine switches to the external rendering engine, the rendering scene can be restored based on the data stored in the status cache table, improving the technical effect of the rendering drawing accuracy.
[0055] Based on the above technical solution, after associatively storing the data to be saved and the target identifier in the status cache table, it further includes: updating the status data corresponding to the target identifier in the marker table to the preset data, so as to determine that the data to be saved corresponding to the target identifier at the end of the external rendering engine has been saved based on the updated status data.
[0056] Specifically, after receiving the data to be saved fed back by the graphics processor and associatively storing the data to be saved in the status cache table based on the target identifier, the corresponding status data in the marker table is changed to the preset data based on the target identifier, so that the data to be saved corresponding to each target identifier at the end of the external rendering engine can be determined based on the updated status data. For example, after receiving the data to be saved fed back by the graphics processor, the data to be saved is stored at the corresponding position in the status cache table based on the corresponding target identifier. After the caching is completed, the status data at the corresponding position in the marker table is changed to the preset data according to the target identifier, which can be changing the status data from FALSE to TURE.
[0057] In the technical solution of this embodiment, when switching the rendering engine, the data of the external engine is cached at the corresponding position in the status cache table based on the target identifier, and the status identifier in the marker table is synchronously modified when the caching is completed, so that the data of the rendering engine can be cached in time and its reading status can be synchronously recorded, avoiding duplicate reading of data.
[0058] S140. When it is detected that the internal rendering engine switches to the external rendering engine, perform a recovery process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the recovered data.
[0059] Among them, the rendering data can be understood as the data corresponding to the rendering project. When switching the rendering engine, for example, from an external rendering engine to an internal rendering engine, since the external rendering engine has not fully completed the rendering work of the picture, it is necessary to save the rendering data of the external rendering engine when switching the rendering engine. Furthermore, when switching from the internal rendering engine to the external rendering engine, the corresponding rendering scene can be restored based on the saved rendering data, so that the external rendering engine can continue to complete the rendering work of the project.
[0060] Specifically, when it is detected that it is necessary to switch from the internal rendering engine to the external rendering engine, the rendering data of the external rendering engine can be restored according to the data to be saved stored in the status cache table, so that the rendering status of the rendering project is restored to the original state, and then the external rendering engine continues to complete the image rendering according to the restored data. It can be understood that when switching from the internal rendering engine to the external rendering engine, the rendering data corresponding to the external engine is restored to the state when the external rendering engine ended rendering last time according to the data to be saved stored in the status cache table, ensuring the effect of the consistency of the external rendering engine state.
[0061] Based on the above technical solution, the restoration process of the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table includes: determining a rendering data set when switching from the internal rendering engine to the external rendering engine based on the data to be saved corresponding to each target identifier stored in the status cache table and the data to be saved not retrieved by the image processor; performing a restoration process on the rendering data corresponding to the external rendering engine based on the rendering data set.
[0062] Among them, the rendering data set can be understood as the rendering data that needs to be restored. It can be understood that different rendering engines need to process different rendering projects, and all the rendering projects that need to be rendered are recorded in the status cache table. Therefore, when switching the rendering engine, it is necessary to determine the corresponding rendering data set according to the data to be saved corresponding to each target identifier in the status cache table and the data to be saved not retrieved by the image processor, and then perform a restoration process on the rendering data corresponding to the external rendering engine based on the rendering data set. It should be emphasized that when switching from the external rendering engine to the internal rendering engine, the internal rendering engine may not modify the data to be saved of all rendering projects during the rendering process, that is, the internal rendering engine does not change the corresponding parameters during the rendering work, and its rendering data is the same as the rendering data when the external rendering engine ended rendering. Therefore, it is not necessary to perform a restoration process on this part of the data.
[0063] Based on the above technical solution, when it is detected that the internal rendering engine is switched to the external rendering engine, after processing the rendering data corresponding to the external rendering engine based on the status cache table, it further includes: clearing the data to be saved in the status cache table, and setting the status data corresponding to each identifier in the marker table to the default value, so as to obtain the status data corresponding to the target identifier in the marker table when it is detected that the external rendering engine is switched to the internal rendering engine and it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine; wherein, the default value is different from the preset data.
[0064] It can be understood that during the process of switching the rendering engine, the table needs to be initialized each time it is switched. The reason is that there may be many useless data in the uninitialized marker table and status cache table. In order to avoid affecting the correct data, the table needs to be initialized each time it is switched, so as to ensure the correctness of the data stored in the table. Exemplarily, after the rendering data of the external rendering engine is restored based on the status cache table, all the data to be saved in the status cache table is cleared, and the status data corresponding to each identifier in the marker table is set to the default value. For example, it can be to traverse the data to be saved of each identifier in the status cache table and set the data to be saved corresponding to each identifier to undefined; correspondingly, traverse each identifier in the marker table and set the status value corresponding to each identifier to the default value. After the initialization of the marker table and the status cache table is completed, when it is necessary to switch between the internal rendering engine and the external rendering engine again, the corresponding data in the status cache table can be modified based on the target marker, and the status data in the marker table can be changed.
[0065] The above technical solution initializes the data recorded in the status cache table and the marker table after the data recovery of the external rendering engine, so that the data in the table can be correctly modified according to the target identifier when the rendering engine is switched next time, ensuring the correct storage of the rendering data.
[0066] Based on the above technical solution, it is necessary to further explain the technical solution in this embodiment. The data processing method of multiple rendering engines in this embodiment is to store the rendering data of the external rendering engine in the status cache table when it is necessary to switch the rendering engine, and correspondingly change the status data in the marker table, so as to correctly save the working status of the external rendering engine. Figure 2 The following is a schematic flowchart of a data processing method based on multiple rendering engines provided by Embodiment 1 of the present disclosure, as Figure 2 shown:
[0067] When the external rendering engine is working, the device can record the rendering data corresponding to each rendering item. Optionally, each rendering item can be represented by a key. When it is detected that the external rendering engine is switched to the internal rendering engine, this technical solution can be executed to record the rendering data of the external rendering engine.
[0068] Meanwhile, when the rendering engine is switched, the tag table and the cache status table are initialized. That is, before saving the working state of the external rendering engine, the data in the tag table and the cache status data table needs to be initialized to ensure the accuracy of the stored data. It can be understood that due to the different supported rendering items on different devices, the corresponding rendering items need to be queried at system startup, and then the corresponding tag table and cache status table are generated. As shown in Table 1, the tag table can be denoted as the flag table, and the status cache table can be denoted as the cache table. The key in the table refers to the tag corresponding to each rendering item, and the key values in the two tables are in one-to-one correspondence. All the values of the rendering items in the flag table are reset to FALSE, that is, the default value, and all the values of the rendering items in the cache table are reset to undefined, that is, the default value.
[0069] Table 1
[0070]
[0071] After switching from the external engine to the internal rendering engine, when the internal rendering engine needs to change the rendering value corresponding to a certain rendering item, before the change, the status value corresponding to the key in the flag table can be queried first. For example, when the internal rendering engine needs to change the data of program to PROGRAM1, based on the identifier program of this rendering item, program in the flag table is queried, and the query result is FALSE, which means that the data of program of the external engine is not cached at this time.
[0072] When the status value of program in the flag table is FALSE, it means that the data of program is not stored in the cache table. Therefore, a corresponding query request needs to be sent to the graphics processor to query the data of program, and the corresponding data obtained is PROGRAM0, and this data is stored in the position corresponding to program in the cache table.
[0073] After storing the data of program in the cache table, the status value in the flag table needs to be modified correspondingly. The status value corresponding to program in the flag table is modified from FALSE to TURE. The modified flag table and cache table are as shown.
[0074] Table 2
[0075]
[0076] It can be understood that when the internal rendering engine performs rendering work, the same rendering item may be rendered multiple times. Therefore, when the internal rendering engine needs to repeatedly modify the parameters of the program, it queries the status value corresponding to the program in the flag table. It can be seen that the status value of the program at this time is TURE, indicating that the rendering data of the program has been cached in the cache table. Therefore, there is no need to modify the data in the cache table, and the corresponding parameters in the graphics processor can be directly modified.
[0077] In the above solution, before the internal rendering engine modifies the rendering data, it obtains the status value corresponding to the corresponding rendering item in the marker table, and judges whether the rendering data corresponding to the external rendering engine is stored in the status cache table according to the status value. If it is not stored, it queries the corresponding data from the graphics processor and stores it in the status cache table, and modifies the status value in the marker table. If the storage has been completed, the internal rendering engine can directly modify the corresponding parameters in the graphics processor. Furthermore, incremental query can be performed when saving the working state of the external rendering engine, avoiding repeated queries for the same rendering item, improving the query efficiency, and reducing performance waste.
[0078] Based on the above steps, when the internal rendering engine modifies the rendering data of the rendering item, the rendering data of the external rendering engine can be correctly saved based on the rendering item. Furthermore, when switching from the internal rendering engine to the external rendering engine, the working state of the external rendering engine can be restored based on the saved rendering data, so that the external rendering engine can continue to complete the rendering work.
[0079] In the technical solution of the embodiment of the present disclosure, when it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, the status data corresponding to the target identifier in the tag table is obtained, and the status data is matched with the preset status data. When the status data is inconsistent with the preset data, a data update request for retrieving the data corresponding to the target identifier is sent to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request. Furthermore, the data to be saved fed back by the graphics processor is received, the data to be saved and the target identifier are associated and stored in the status cache table, and the data to be saved is modified to the target data in the graphics processor, so that when it is detected that the switch is made from the internal rendering engine to the external rendering engine, the rendering data corresponding to the external rendering engine is restored based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the restored data, solving the problem in the prior art that the cooperation between multiple rendering engines cannot be realized. Further, when rendering in cooperation based on multiple rendering engines, the problem that the accuracy and precision of image rendering cannot be guaranteed is solved. The technical effect of recording the rendering data of the rendering engine before the switch when the rendering engine is switched, and then, when switching again, being able to restore the scene based on the recorded rendering data and continue data rendering based on the restored scene, improving the accuracy and effectiveness of data rendering is achieved.
[0080] Embodiment 2
[0081] Figure 3 FIG. 7 is a schematic structural diagram of a data processing device based on multiple rendering engines provided by the second embodiment of the present disclosure. The device includes: a status data acquisition module 310, a data update request sending module 320, a data to be saved receiving module 330, and a rendering data restoration module 340.
[0082] The status data acquisition module 310 is configured to obtain the status data corresponding to the target identifier in the tag table when it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine;
[0083] The data update request sending module 320 is configured to send a data update request for retrieving the data corresponding to the target identifier to the graphics processor when the status data is inconsistent with the preset data, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request;
[0084] The data to be saved receiving module 330 is configured to receive the data to be saved fed back by the graphics processor, associate and store the data to be saved and the target identifier in the status cache table, and modify the data to be saved to the target data in the graphics processor; wherein, the status cache table corresponds to the external rendering engine;
[0085] A rendering data recovery module 340, configured to, when detecting a switch from an internal rendering engine to the external rendering engine, recover the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table, so that the external rendering engine continues to render an image based on the recovered data.
[0086] Based on the above technical solution, the device further includes:
[0087] A data initialization module, configured to, when detecting a switch from an internal rendering engine to the external rendering engine, after recovering the rendering data corresponding to the external rendering engine based on the status cache table, clear the data to be saved in the status cache table, and set the status data corresponding to each identifier in the marker table to a default value, so as to, when detecting a switch from the external rendering engine to the internal rendering engine and detecting that the data corresponding to the target identifier is updated to target data based on the internal rendering engine, obtain the status data corresponding to the target identifier in the marker table; wherein, the default value is different from the preset data.
[0088] Based on the above technical solution, the status data acquisition module is specifically configured to: when detecting a switch from the external rendering engine to the internal rendering engine and detecting an update of the data corresponding to the target identifier based on the internal rendering engine, read the status data corresponding to the target identifier in the marker table; wherein, the status data is used to indicate whether the data to be saved at the end of the external engine rendering has been read when switching from the external engine rendering to the internal rendering engine.
[0089] Based on the above technical solution, the data to be saved receiving module further includes:
[0090] A status data modification unit, configured to, after associatively storing the data to be saved and the target identifier into the status cache table, update the status data corresponding to the target identifier in the marker table to the preset data, so as to determine that the data to be saved corresponding to the target identifier at the end of the external rendering engine rendering has been saved based on the updated status data.
[0091] Based on the above technical solution, the data update request sending module is further configured to: when the status data is consistent with the preset data, update the data to be saved corresponding to the target identifier based on the target data.
[0092] Based on the above technical solution, the rendering data recovery module further includes:
[0093] A rendering data set determination unit, configured to determine a rendering data set when switching from the internal rendering engine to the external rendering engine based on the data to be saved corresponding to each target identifier stored in the status cache table and the data to be saved not retrieved by the image processor; and perform a rendering data recovery process on the rendering data corresponding to the external rendering engine based on the rendering data set.
[0094] In the technical solution of the embodiment of the present disclosure, when it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, the status data corresponding to the target identifier in the tag table is obtained, and the status data is matched with the preset status data. If the status data is inconsistent with the preset data, a data update request for retrieving the data corresponding to the target identifier is sent to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request. Then, the data to be saved fed back by the graphics processor is received, and the data to be saved and the target identifier are associated and stored in the status cache table, and the data to be saved is modified to the target data in the graphics processor. When it is detected that the internal rendering engine is switched to the external rendering engine, the rendering data corresponding to the external rendering engine is restored based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the restored data, solving the problem in the prior art that the cooperation between multiple rendering engines cannot be realized. Further, when rendering is performed based on the cooperation of multiple rendering engines, the accuracy and accuracy of image rendering cannot be guaranteed. The technical effect of recording the rendering data of the rendering engine before switching when the rendering engine is switched is achieved. Furthermore, when switching again, the scene can be restored based on the recorded rendering data, and data rendering can continue based on the restored scene, improving the accuracy and effectiveness of data rendering.
[0095] The data processing device based on multiple rendering engines provided by the embodiment of the present disclosure can execute the data processing method based on multiple rendering engines provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.
[0096] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiment of the present disclosure.
[0097] Embodiment III
[0098] Figure 4 It is a schematic structural diagram of an electronic device provided by Embodiment III of the present disclosure. Referring below Figure 4 , which shows an electronic device suitable for implementing the embodiment of the present disclosure (for example Figure 4Schematic diagram of the structure of the terminal device or server) 400 therein. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0099] As Figure 4 shown, the electronic device 400 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 401, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage device 406 into the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. The editing / output (I / O) interface 405 is also connected to the bus 404.
[0100] Generally, the following devices may be connected to the I / O interface 405: an editing device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 406 including, for example, magnetic tapes, hard disks, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 4 the electronic device 400 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0101] Particularly, according to the embodiments of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 409, or installed from the storage device 406, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiments of the present disclosure are executed.
[0102] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0103] The electronic device provided in the embodiments of the present disclosure and the image processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be referred to in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0104] Embodiment IV
[0105] The embodiments of the present disclosure provide a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the data processing method based on multiple rendering engines provided in the above embodiments.
[0106] It should be noted that the computer-readable medium in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0107] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0108] The above computer-readable medium can be included in the above electronic device; it can also exist separately without being assembled into the electronic device.
[0109] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:
[0110] When it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, obtain the status data corresponding to the target identifier in the tag table;
[0111] When the status data is inconsistent with the preset data, send a data update request corresponding to the target identifier to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request;
[0112] Receive the data to be saved fed back by the graphics processor, associate and store the data to be saved and the target identifier in the status cache table, and modify the data to be saved to the target data in the graphics processor; wherein, the status cache table corresponds to the external rendering engine;
[0113] When it is detected that the internal rendering engine is switched to the external rendering engine, perform a recovery process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the recovered data.
[0114] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0116] The units described in the embodiments of the present disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation on the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".
[0117] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, by way of non-limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0118] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0119] According to one or more embodiments of the present disclosure, [Example 1] provides a data processing method based on multiple rendering engines. The method includes:
[0120] When it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, obtain the status data corresponding to the target identifier in the tag table;
[0121] When the status data is inconsistent with the preset data, send a data update request corresponding to the target identifier to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request;
[0122] Receive the data to be saved fed back by the graphics processor, associate and store the data to be saved and the target identifier in the status cache table, and modify the data to be saved to the target data in the graphics processor; wherein, the status cache table corresponds to the external rendering engine;
[0123] When it is detected that the internal rendering engine is switched to the external rendering engine, perform a recovery process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the recovered data.
[0124] According to one or more embodiments of the present disclosure, [Example 2] provides a data processing method based on multiple rendering engines. The method further includes:
[0125] When it is detected that the internal rendering engine is switched to the external rendering engine, after performing a recovery process on the rendering data corresponding to the external rendering engine based on the status cache table, it further includes:
[0126] Clear the data to be saved in the status cache table, and set the status data corresponding to each identifier in the marker table to the default value, so as to obtain the status data corresponding to the target identifier in the marker table when it is detected that the external rendering engine is switched to the internal rendering engine and it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine;
[0127] Among them, the default value is different from the preset data.
[0128] According to one or more embodiments of the present disclosure, [Example Three] provides a data processing method based on multiple rendering engines. The method further includes:
[0129] When it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, obtaining the status data corresponding to the target identifier in the marker table includes:
[0130] When it is detected that the external rendering engine is switched to the internal rendering engine and it is detected that the data corresponding to the target identifier is updated based on the internal rendering engine, read the status data corresponding to the target identifier in the marker table;
[0131] Among them, the status data is used to represent whether the data to be saved at the end of the external engine rendering has been read when the external engine rendering is switched to the internal rendering engine.
[0132] According to one or more embodiments of the present disclosure, [Example Four] provides a data processing method based on multiple rendering engines. The method further includes:
[0133] After the data to be saved and the target identifier are associated and stored in the status cache table, it further includes:
[0134] Update the status data corresponding to the target identifier in the marker table to the preset data, so as to determine that the data to be saved corresponding to the target identifier at the end of the external rendering engine has been saved based on the updated status data.
[0135] According to one or more embodiments of the present disclosure, [Example Five] provides a data processing method based on multiple rendering engines, which further includes:
[0136] When the status data is consistent with the preset data, update the data to be saved corresponding to the target identifier based on the target data.
[0137] According to one or more embodiments of the present disclosure, [Example Six] provides a data processing method based on multiple rendering engines. The method further includes:
[0138] Performing a restoration process on the rendering data corresponding to the external rendering engine based on the data to be saved in the state cache table includes:
[0139] Determining a set of rendering data when switching from the internal rendering engine to the external rendering engine based on the data to be saved corresponding to each target identifier stored in the state cache table and the data to be saved not retrieved by the image processor;
[0140] Performing a restoration process on the rendering data corresponding to the external rendering engine based on the set of rendering data.
[0141] According to one or more embodiments of the present disclosure, [Example Seven] provides a data processing device based on multiple rendering engines. The device includes:
[0142] A state data acquisition module, configured to acquire the state data corresponding to the target identifier in the tag table when it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine;
[0143] A data update request sending module, configured to send a data update request corresponding to the target identifier to the graphics processor when the state data is inconsistent with the preset data, so that the graphics processor acquires the data to be saved corresponding to the target identifier based on the data update request;
[0144] A data to be saved receiving module, configured to receive the data to be saved fed back by the graphics processor, associate and store the data to be saved and the target identifier in the state cache table, and modify the data to be saved to the target data in the graphics processor; wherein, the state cache table corresponds to the external rendering engine;
[0145] A rendering data restoration module, configured to perform a restoration process on the rendering data corresponding to the external rendering engine based on the data to be saved in the state cache table when it is detected that the internal rendering engine switches to the external rendering engine, so that the external rendering engine continues to render the image based on the restored data.
[0146] According to one or more embodiments of the present disclosure, [Example Eight] provides a data processing device based on multiple rendering engines. The device further includes:
[0147] A data initialization module is configured to, when it is detected that the internal rendering engine is switched to the external rendering engine, after processing the rendering data corresponding to the external rendering engine based on the status cache table, clear the data to be saved in the status cache table, and set the status data corresponding to each identifier in the marker table to a default value, so as to obtain the status data corresponding to the target identifier in the marker table when it is detected that the external rendering engine is switched to the internal rendering engine and it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine; wherein, the default value is different from the preset data.
[0148] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0149] In addition, although the operations are depicted in a specific order, this should not be construed as requiring that the operations be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0150] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A data processing method based on multiple rendering engines, characterized in that, Including: When it is detected that the rendering is switched from an external rendering engine to an internal rendering engine, and when it is detected that based on the internal rendering engine, the data corresponding to the target identifier is updated to target data, obtain the status data corresponding to the target identifier in the mark table, where the data stored in the mark table is used to represent whether the data corresponding to the current identifier has been modified by the internal rendering engine; When the status data is inconsistent with the preset data, send a data update request corresponding to the target identifier to the graphics processor, so that the graphics processor obtains the data to be saved corresponding to the target identifier based on the data update request, where the status data is used to represent whether the data to be saved at the end of the external rendering engine has been read when the external rendering engine is switched to the internal rendering engine, and the preset data is pre-set data for determining whether the data to be saved has been read; Receive the data to be saved fed back by the graphics processor, associate and store the data to be saved and the target identifier in the status cache table, and modify the data to be saved to the target data in the graphics processor; where the status cache table corresponds to the external rendering engine; When it is detected that the rendering is switched from the internal rendering engine to the external rendering engine, perform a restoration process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table, so that the external rendering engine continues to render the image based on the restored data.
2. The method according to claim 1, characterized in that When it is detected that the rendering is switched from the internal rendering engine to the external rendering engine, after performing the restoration process on the rendering data corresponding to the external rendering engine based on the status cache table, further including: Empty the data to be saved in the status cache table, and set the status data corresponding to each identifier in the mark table to the default value, so as to obtain the status data corresponding to the target identifier in the mark table when it is detected that the rendering is switched from the external rendering engine to the internal rendering engine and it is detected that based on the internal rendering engine, the data corresponding to the target identifier is updated to the target data; Wherein, the default value is different from the preset data, and the default value is used to represent that the internal rendering engine has not read and modified the data corresponding to each rendering item at the end of the external rendering engine.
3. The method according to claim 1, characterized in that, The step of when it is detected that the rendering is switched from the external rendering engine to the internal rendering engine, and when it is detected that based on the internal rendering engine, the data corresponding to the target identifier is updated to the target data, obtain the status data corresponding to the target identifier in the mark table, includes: When it is detected that the rendering is switched from the external rendering engine to the internal rendering engine, and it is detected that the data corresponding to the target identifier is updated based on the internal rendering engine, read the status data corresponding to the target identifier in the mark table; Wherein, the status data is used to represent whether the data to be saved at the end of the external rendering engine has been read when the external rendering engine is switched to the internal rendering engine.
4. The method according to claim 1, wherein After associating and storing the data to be saved and the target identifier in the status cache table, further including: Update the status data corresponding to the target identifier in the mark table to the preset data, so as to determine the data to be saved corresponding to the target identifier when the external rendering engine finishes rendering based on the updated status data.
5. The method according to claim 1, characterized in that, It further includes: When the status data is consistent with the preset data, update the data to be saved corresponding to the target identifier based on the target data.
6. The method according to claim 1, wherein The restoring process of the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table includes: Determine a set of rendering data when switching from the internal rendering engine to the external rendering engine based on the data to be saved corresponding to each target identifier stored in the status cache table and the data to be saved not retrieved by the image processor; Perform a restoring process on the rendering data corresponding to the external rendering engine based on the set of rendering data.
7. A data processing device based on multiple rendering engines, characterized in that, The device includes: A status data acquisition module, configured to acquire the status data corresponding to the target identifier in the mark table when detecting a switch from an external rendering engine to an internal rendering engine and detecting that the data corresponding to the target identifier is updated to target data based on the internal rendering engine, where the data stored in the mark table is used to represent whether the data corresponding to the current identifier has been modified by the internal rendering engine; A data update request sending module, configured to send a data update request for retrieving the data corresponding to the target identifier to the graphics processor when the status data is inconsistent with the preset data, so that the graphics processor acquires the data to be saved corresponding to the target identifier based on the data update request, where the status data is used to represent whether the data to be saved when the external rendering engine finishes rendering has been read when switching from the external rendering engine to the internal rendering engine, and the preset data is pre-set data for determining whether the data to be saved has been read; A data to be saved receiving module, configured to receive the data to be saved fed back by the graphics processor, associate and store the data to be saved and the target identifier in the status cache table, and modify the data to be saved to the target data in the graphics processor; where the status cache table corresponds to the external rendering engine; A rendering data restoration module, configured to perform a restoration process on the rendering data corresponding to the external rendering engine based on the data to be saved in the status cache table when detecting a switch from the internal rendering engine to the external rendering engine, so that the external rendering engine continues to render the image based on the restored data.
8. The device according to claim 7, characterized in that, The device further includes: A data initialization module, configured to, when it is detected that the switch is made from the internal rendering engine to the external rendering engine, after processing the rendering data corresponding to the external rendering engine based on the status cache table, clear the data to be saved in the status cache table, and set the status data corresponding to each identifier in the marker table to a default value, so as to, when it is detected that the switch is made from the external rendering engine to the internal rendering engine and it is detected that the data corresponding to the target identifier is updated to the target data based on the internal rendering engine, obtain the status data corresponding to the target identifier in the marker table; wherein, the default value is different from the preset data, and the default value is used to represent that the internal rendering engine has not read and modified the data corresponding to each rendering item when the external rendering engine finishes rendering.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on multiple rendering engines according to any one of claims 1-6.
10. A storage medium containing computer-executable instructions, the computer-executable instructions being used to execute the data processing method based on multiple rendering engines according to any one of claims 1-6 when executed by a computer processor.
Citation Information
Patent Citations
Image rendering method and device, computer equipment and storage medium
CN112381918A
Browser engine switching method and device and equipment
CN113591000A