A rendering method and related apparatus
By using distributed rendering between light and rich devices, leveraging the high-performance rendering capabilities of rich devices and combining them with local rendering on light devices, the stuttering problem of light devices when rendering complex images is solved, achieving efficient image display.
Patent Information
- Application Number
- CN202110596022.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-29
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2041-05-29
AI Technical Summary
Lightweight devices may experience stuttering or failure to display complex images due to hardware limitations, especially when the network connection with richer devices is weak, making it impossible to achieve high frame rate rendering.
By using distributed rendering between light and rich devices, the rendering capabilities of rich devices are utilized while the same scene is rendered locally on light devices. A competition mechanism is used to write the rendering data to the display module, ensuring that the rendering data is displayed on light devices first.
It enables high-performance rendering of complex images on lightweight devices, solves the lag problem, and improves display efficiency and reliability.
Smart Images

Figure CN115409681B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a rendering method and related apparatus. Background Technology
[0002] In computer graphics processing, rendering refers to the process of generating images from models using software. A model is a description of a three-dimensional object using a strictly defined language or data structure, including information such as geometry, viewpoint, texture, and lighting. Image rendering places high demands on the performance of the devices performing the rendering operation, especially for complex images, requiring devices with hardware acceleration capabilities of a Graphics Processing Unit (GPU) and high computing power. Such high-performance devices are called rich devices.
[0003] Devices with lower hardware specifications typically lack multi-core hardware acceleration capabilities and high computing power; these devices are called lightweight devices, or simply light devices. When rendering complex images, light devices, limited by their hardware capabilities, often cannot render and display complex images as expected, leading to rendering stutters or even complete display failures.
[0004] Therefore, how to solve the problem of complex image rendering stuttering or even failure to display on lightweight devices has become a key research topic in the field. Summary of the Invention
[0005] This application provides a rendering method and related apparatus. Through distributed rendering based on the connection between a light device and a rich device, the rendering capability of the rich device replaces the rendering of the light device. At the same time, the light device itself is also rendering the same scene. The rendering data of the two are written to the display module through a competition mechanism, thereby solving the problem of complex image rendering stuttering or even failure to display on the light device, and realizing high-performance rendering of the light device.
[0006] In a first aspect, embodiments of this application provide a rendering method, the method comprising:
[0007] The first device sends a rendering command to the second device; the rendering command instructs the second device to render the target image.
[0008] The first device renders the target image;
[0009] The first device sends the target rendering data to the display; the target rendering data is either the rendering data of the second device obtained by the first device first, or the rendering data of the first device obtained first.
[0010] In this embodiment, based on the connection between the first device and the second device, the first device sends a rendering command to the second device, instructing the second device to render the target image. This connection includes various possible connection methods such as Bluetooth or wireless network connection between the first and second devices, used for data communication between them. After completing rendering, the second device returns the obtained rendering data to the first device. Simultaneously, the first device itself is also rendering the second image. The first device sends the target rendering data it obtains first, displaying the rendered target image. This target rendering data may be the rendering data obtained first locally on the first device, or it may be the rendering data obtained second on the second device.
[0011] Currently, a commonly used rendering method relies on a strong connection between a first device and a second device. The first device depends on the powerful computing and distributed capabilities of the second device to render the target image, while the first device itself only handles the display, thus achieving high frame rate rendering of the target image. This method depends on a strong connection between the first and second devices. If the network connection between the two devices is weak, it can cause display stuttering when rendering complex images on the first device. Furthermore, if the network connection between the two devices is interrupted, the first device will be unable to display complex images at all.
[0012] Compared to commonly used rendering methods, the rendering method provided in this application embodiment utilizes distributed rendering based on a connection between a first device and a second device. This allows the rendering capability of the second device to replace that of the first device, thereby achieving the rendering purpose of the first device for high frame rate target images. Furthermore, this method does not rely on a strong connection between the first and second devices. When the first and second devices have a network connection, the rendering capability of the second device replaces that of the first device. When the first and second devices do not have a network connection, the first device completes the rendering locally. This solves the problem of lag or even failure to display complex images on the first device, achieving high-performance rendering on the first device.
[0013] In one possible implementation, sending the target rendering data to the display includes:
[0014] If the first device completes rendering and obtains the first rendering data, but does not receive the second rendering data sent by the second device, the first rendering data is sent as the target rendering data for display; the first rendering data is the data obtained by the first device rendering the target image, and the second rendering data is the data obtained by the second device rendering the target image;
[0015] Alternatively, if the second rendering data is received from the second device and the first device has not received the first rendering data, the second rendering data may be sent as the target rendering data for display.
[0016] This application provides a possible implementation for displaying target rendering data. Specifically, when a first device completes rendering and obtains first rendering data, but has not received second rendering data from a second device, the first device displays the locally rendered first rendering data as target rendering data to display the rendered target image. When the second rendering data is received from the second device, but the first device has not received its locally rendered first rendering data, the second rendering data rendered by the second device is displayed as target rendering data to display the rendered target image.
[0017] The rendering method in this application embodiment uses a mechanism where the rendering data of the first device and the rendering data of the second device compete to be written to the display of the first device. The rendering data obtained by the first device is written to the display first, thereby solving the problem of complex image rendering lag or even failure to display on the first device. This enables the display of target images in different application scenarios and improves the display efficiency and reliability of the first device.
[0018] In one possible implementation, before sending the rendering command to the second device, the method further includes:
[0019] Send a synchronization request to the second device, the synchronization request being used to request that the second device be in a synchronized state with the first device;
[0020] Sending rendering instructions to the second device includes:
[0021] Upon receiving synchronization feedback from the second device, the rendering command is sent to the second device; the synchronization feedback indicates that the second device and the first device are in a synchronized state.
[0022] This application provides a possible implementation for synchronizing the states of a first device and a second device. Specifically, before the first device sends a rendering command to the second device, it is necessary to ensure that the first device and the second device are in a synchronized state. The first device first sends a synchronization request to the second device to request that the states of the second device and the first device be synchronized. The second device responds to the synchronization request, completes the state synchronization, and issues a synchronization feedback indicating that the second device and the first device are in a synchronized state. Upon receiving the synchronization feedback, the first device then sends a rendering command to the second device to complete the subsequent rendering of the target image. The state synchronization mechanism in this application embodiment can keep the states of the first device and the second device synchronized before performing the rendering operation. Specifically, this can be achieved by synchronizing the device's rendering environment or synchronizing the display of the previous frame of the target image. This state synchronization mechanism can make the subsequent rendering results of the target image more accurate, improving the rendering efficiency and performance of the first device.
[0023] In one possible implementation, the synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the second device begin synchronization, and the current page information of the first device is used to indicate the state of the second device synchronizing to the first device.
[0024] This application provides a possible implementation of a synchronization request. Specifically, the synchronization request includes a first timestamp and current page information of the first device. The first timestamp records the time when the first device and the second device begin synchronization. The current page information of the first device includes the display information of the previous frame of the target image rendered by the first device, used for the second device to synchronize with the state of the first device. The synchronization request in this application embodiment can effectively synchronize the states of the first device and the second device.
[0025] In one possible implementation, the rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the first device; the rendering information includes information for rendering the target image, and is used by the second device to render the target image.
[0026] This application provides a possible implementation of a rendering instruction. Specifically, the rendering instruction includes verification information and rendering information. After the second device completes state synchronization with the first device, it verifies and confirms that the second device and the first device are in a synchronized state again based on the verification information received from the first device. The second device then renders the target image according to the received rendering information to obtain the aforementioned second rendering data. This application embodiment ensures state synchronization between the second device and the first device through verification information, and then renders the target image according to the rendering information, which can improve the accuracy of the rendering result of the target image, and improve rendering efficiency and performance.
[0027] In one possible implementation, the computing power of the second device is higher than that of the first device.
[0028] In this embodiment, by using the rendering capability of a second device instead of the first device, the problem of lag or even failure to display complex images in the first device is solved, thus achieving high-performance rendering on the first device. For the application scenarios to achieve the above objective, the computing power of the second device must be higher than that of the first device, and the first and second devices must have a network connection. The second device includes devices with GPU hardware acceleration capabilities and high computing power, such as smartphones and tablets; the first device includes devices without multi-core hardware acceleration capabilities and high computing power, such as wearable devices like fitness trackers and smartwatches.
[0029] In one possible implementation, the method further includes:
[0030] If the first device completes rendering and obtains the first rendering data, but has not received the second rendering data sent by the second device, then the second rendering data will not be received.
[0031] In this embodiment, the first device prioritizes obtaining the first rendering data. That is, if the first device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the first device will not only send the first rendering data as the target rendering data, but will also refuse to receive any subsequent second rendering data sent by the second device. The method in this embodiment can save network resources for the first device and improve the utilization rate of network resources for target image rendering.
[0032] In one possible implementation, the method further includes:
[0033] If the first device receives the second rendering data sent by the second device but does not receive the first rendering data, the rendering of the target image by the first device is interrupted.
[0034] In this embodiment, the first device prioritizes obtaining the second rendering data. That is, the second device completes rendering to obtain the second rendering data and sends it to the first device. If the first device receives the second rendering data from the second device but its local rendering is not yet complete and it has not obtained the first rendering data, the first device will not only send the second rendering data as the target rendering data but will also interrupt the local rendering of the target image. The method in this embodiment can save network resources for the first device and improve the effective utilization rate of network resources for target image rendering.
[0035] Secondly, embodiments of this application provide a rendering method, the method comprising:
[0036] The second device receives a rendering instruction sent by the first device, the rendering instruction being used to instruct the second device to render the target image;
[0037] The target virtual machine of the second device renders the target image according to the rendering instructions to obtain second rendering data; the rendering environment of the target virtual machine is the same as that of the first device.
[0038] The second device sends the second rendering data to the first device; the second rendering data is used by the first device to send the second rendering data as target rendering data when it receives the second rendering data but does not receive the first rendering data, and the first rendering data is the data obtained by the first device rendering the target image.
[0039] In this embodiment, based on the connection between the first device and the second device, the second device receives a rendering instruction sent by the first device, renders the target image according to the rendering instruction, obtains second rendering data, and then sends the second rendering data back to the first device. The connection includes various possible connection methods such as Bluetooth connection and wireless network connection between the first and second devices, used for data communication between them. When the first device receives the second rendering data but has not yet obtained the first rendering data rendered locally, it sends the second rendering data as target rendering data to display the rendered target image. Specifically, the second device renders the target image according to the rendering instruction by constructing a target virtual machine based on a synchronization request sent by the first device. The rendering environment of this target virtual machine is the same as that of the first device, so that the rendering capability of the second device can replace the rendering of the first device. Then, the target virtual machine renders the target image according to the rendering instruction to obtain the second rendering data.
[0040] Currently, a commonly used rendering method is based on a strong connection between a first device and a second device. The second device uses its powerful computing and distributed capabilities to unidirectionally render the target image, and then outputs the rendering result to the first device for display, thus enabling the first device to render the target image and achieve the goal of high frame rate target image rendering. This method relies on the strong connection between the first and second devices to send the rendering result from the second device, and it is entirely dependent on the rendering capabilities of the second device. The first device does not participate in the rendering process of the target image by the second device, resulting in the rendering result from the second device not being well adapted to the display environment of the first device.
[0041] Compared to commonly used rendering methods, the rendering method provided in this application embodiment utilizes distributed rendering based on a connection between a first device and a second device. This allows the rendering capability of the second device to replace that of the first device, thereby achieving the rendering purpose of the first device for high frame rate target images. Furthermore, this method does not rely on a strong connection between the first and second devices. The first device participates in the second device's rendering process of the target image, ensuring that the rendering environment of the target virtual machine built by the second device is identical to that of the first device. This allows the rendering results obtained by the second device to better adapt to the display environment of the first device, resolving the problem of lag or even failure to display complex images in the first device, and achieving high-performance rendering by the first device.
[0042] In one possible implementation, before receiving the rendering instructions sent by the first device, the method further includes:
[0043] Receive a synchronization request sent by the first device; the synchronization request is used to request the second device to be in a synchronized state with the first device;
[0044] Based on the synchronization request, construct the target virtual machine;
[0045] Synchronize the target virtual machine to the state of the first device;
[0046] A synchronization feedback is sent to the first device, the synchronization feedback being used to indicate that the second device is in a synchronized state with the first device.
[0047] This application provides a possible implementation for synchronizing the states of a second device and a first device. Specifically, before receiving rendering instructions from the first device, the state of the second device needs to be consistent with that of the first device. The first device sends a synchronization request to the second device, requesting that the second device be in a synchronized state with the first device. The second device receives the synchronization request from the first device and responds to it. Based on the synchronization request, it constructs a target virtual machine and synchronizes the target virtual machine to the state of the first device. After completing the state synchronization, the second device sends a synchronization feedback to the first device, indicating that the second device and the first device are now in a synchronized state. The state synchronization mechanism in this application allows the second device to maintain state synchronization with the first device before performing rendering operations. Specifically, this can be through device rendering environment synchronization, synchronization of the previous frame display of the target image being rendered, etc. Device state synchronization under this state synchronization mechanism can make the subsequent rendering results of the target image more accurate, improving the rendering efficiency and performance of the second device.
[0048] In one possible implementation, the synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the second device begin synchronization, and the current page information of the first device is used to indicate the state of the second device synchronizing to the first device;
[0049] The process of synchronizing the target virtual machine to the state of the first device includes:
[0050] Based on the current page information of the first device, the target virtual machine is synchronized to the state of the first device.
[0051] This application provides a possible implementation of a synchronization request. Specifically, the synchronization request includes a first timestamp and current page information of a first device. The first timestamp records the time when the first device and a second device begin synchronization. The current page information of the first device includes the display information of the previous frame of the target image rendered by the first device, used by the second device to synchronize the target virtual machine to the state of the first device. After receiving the synchronization request, the second device synchronizes the target virtual machine to the state of the first device according to the current page information of the first device included in the synchronization request. The synchronization request in this application embodiment can effectively synchronize the states of the first device and the second device.
[0052] In one possible implementation, the rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the first device; the rendering information includes information for rendering the target image, which is used by the second device to render the target image.
[0053] The step of rendering the target image according to the rendering instruction to obtain the second rendering data includes:
[0054] Based on the verification information, verify that the second device and the first device are in a synchronized state;
[0055] The target image is rendered based on the rendering information to obtain the second rendering data.
[0056] This application provides a possible implementation of a rendering instruction. Specifically, the rendering instruction includes verification information and rendering information. After the second device completes state synchronization with the first device, it verifies and confirms that the second device and the first device are in a synchronized state again based on the verification information received from the first device. The second device then renders the target image according to the received rendering information to obtain the aforementioned second rendering data. This application embodiment ensures state synchronization between the second device and the first device through verification information, and then renders the target image according to the rendering information, which can improve the accuracy of the rendering result of the target image, and improve rendering efficiency and performance.
[0057] In one possible implementation, the computing power of the second device is higher than that of the first device.
[0058] In this embodiment, by using the rendering capability of a second device instead of the first device, the problem of lag or even failure to display complex images in the first device is solved, thus achieving high-performance rendering on the first device. For the application scenarios to achieve the above objective, the computing power of the second device must be higher than that of the first device, and the first and second devices must have a network connection. The second device includes devices with GPU hardware acceleration capabilities and high computing power, such as smartphones and tablets; the first device includes devices without multi-core hardware acceleration capabilities and high computing power, such as wearable devices like fitness trackers and smartwatches.
[0059] In one possible implementation, the method further includes:
[0060] If the second device has not finished sending the second rendering data and the first device has completed rendering and obtained the first rendering data, then the sending of the second rendering data to the first device shall be stopped.
[0061] In this embodiment, the first device prioritizes obtaining the first rendering data. That is, if the first device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the first device not only sends the first rendering data as the target rendering data, but also refuses to receive any subsequent second rendering data sent by the second device. Consequently, the second device will stop sending the rendered second rendering data to the first device. The method in this embodiment can save network resources for the second device and improve the utilization rate of network resources for target image rendering.
[0062] Thirdly, embodiments of this application provide a rendering apparatus, the apparatus comprising:
[0063] A sending unit is used to send a rendering instruction to a second device; the rendering instruction is used to instruct the second device to render a target image;
[0064] A rendering unit is used to render the target image;
[0065] The display unit is used to display the target rendering data; the target rendering data is the rendering data of the second device obtained by the rendering device first, or the rendering data of the rendering device obtained by the rendering device first.
[0066] In this embodiment, based on the connection between the rendering device and the second device, the rendering device sends a rendering command to the second device, instructing the second device to render the target image. This connection includes various possible connection methods such as Bluetooth or wireless network connection between the rendering device and the second device, used for data communication between them. After completing rendering, the second device returns the obtained rendering data to the rendering device. Simultaneously, the rendering device itself is also rendering the second device. The rendering device sends the priority target rendering data to the display, showing the rendered target image. This target rendering data may be the priority rendering data from the rendering device's local rendering data or the priority rendering data from the second device.
[0067] Currently, a commonly used rendering method relies on a strong connection between the rendering device and a second device. The rendering device depends on the powerful computing and distributed capabilities of the second device to render the target image, while the rendering device itself only handles the display, thus achieving high frame rate rendering of the target image. This method depends on a strong connection between the rendering device and the second device. If the network connection between the rendering device and the second device is weak, it will cause display stuttering when rendering complex images. If the network connection between the rendering device and the second device is interrupted, it will also prevent the rendering device from displaying complex images.
[0068] Compared to commonly used rendering methods, the rendering method provided in this application embodiment achieves the rendering of high frame rate target images by using distributed rendering based on the connection between the rendering device and the second device. This is achieved by enabling the rendering capability of the second device to replace the rendering of the rendering device, and the method does not rely on a strong connection between the rendering device and the second device. When the rendering device and the second device have a network connection, the rendering capability of the second device replaces the rendering of the rendering device. When the rendering device and the second device do not have a network connection, the rendering device completes the rendering locally. This solves the problem of rendering complex images with stuttering or even failure to display, and achieves high-performance rendering by the rendering device.
[0069] In one possible implementation, the display unit is specifically configured to display the first rendering data as the target rendering data when the rendering device completes rendering and obtains the first rendering data, but has not received the second rendering data sent by the second device; the first rendering data is the data obtained by the rendering device rendering the target image, and the second rendering data is the data obtained by the second device rendering the target image;
[0070] Alternatively, the display unit may be further configured to display the second rendering data as the target rendering data when it receives the second rendering data sent by the second device and the rendering device has not obtained the first rendering data.
[0071] This application provides a possible implementation for displaying target rendering data. Specifically, when the rendering device completes rendering and obtains first rendering data, but has not received second rendering data from the second device, the rendering device displays the locally rendered first rendering data as target rendering data to display the rendered target image. When the second rendering data is received from the second device, but the rendering device has not obtained the locally rendered first rendering data, the second rendering data rendered by the second device is displayed as target rendering data to display the rendered target image.
[0072] The rendering method in this application embodiment uses a mechanism where the rendering data from the rendering device and the rendering data from the second device compete to be written to the display of the rendering device. This mechanism prioritizes the rendering data obtained by the rendering device and writes it to the display, thereby solving the problem of rendering complex images in the rendering device being stuck or even unable to be displayed. This enables the display of target images in different application scenarios and improves the display efficiency and reliability of the rendering device.
[0073] In one possible implementation, the device further includes:
[0074] A receiving unit is used to receive the second rendering data sent by the second device.
[0075] In one possible implementation, the sending unit is further configured to send a synchronization request to the second device, the synchronization request being used to request the second device to be in a synchronized state with the rendering device;
[0076] The sending unit is specifically used to send the rendering command to the second device upon receiving the synchronization feedback sent by the second device; the synchronization feedback is used to indicate that the second device and the rendering device are in a synchronized state.
[0077] This application provides a possible implementation for synchronizing the states of a rendering device and a second device. Specifically, before the rendering device sends a rendering command to the second device, it is necessary to ensure that the rendering device and the second device are in a synchronized state. The rendering device first sends a synchronization request to the second device, requesting that the states of the second device and the rendering device be synchronized. The second device responds to the synchronization request, completes the state synchronization, and sends a synchronization feedback, indicating that the second device and the rendering device are in a synchronized state. Upon receiving the synchronization feedback, the rendering device then sends a rendering command to the second device to complete the subsequent rendering of the target image. The state synchronization mechanism in this application embodiment can keep the states of the rendering device and the second device synchronized before performing the rendering operation. Specifically, this can be synchronization of the device's rendering environment, synchronization of the previous frame display of the target image, etc. Device state synchronization under this state synchronization mechanism can make the subsequent rendering results of the target image more accurate, improving the rendering efficiency and rendering performance of the rendering device.
[0078] In one possible implementation, the synchronization request includes a first timestamp and the current page information of the rendering device; the first timestamp is used to indicate the time when the rendering device and the second device begin synchronization, and the current page information of the rendering device is used to indicate the state of the second device synchronizing with the rendering device.
[0079] This application provides a possible implementation of a synchronization request. Specifically, the synchronization request includes a first timestamp and current page information of the rendering device. The first timestamp records the time when the rendering device and the second device begin synchronization. The current page information of the rendering device includes the display information of the previous frame of the target image rendered by the rendering device, used by the second device to synchronize with the state of the rendering device. The synchronization request in this application embodiment can effectively synchronize the states of the rendering device and the second device.
[0080] In one possible implementation, the rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the rendering device; the rendering information includes information for rendering the target image, which is used by the second device to render the target image.
[0081] This application provides a possible implementation of a rendering instruction. Specifically, the rendering instruction includes verification information and rendering information. After the second device completes state synchronization with the rendering device, it verifies again that the second device and the rendering device are in a synchronized state based on the verification information received from the rendering device. The second device then renders the target image according to the received rendering information to obtain the aforementioned second rendering data. This application ensures state synchronization between the second device and the rendering device through verification information, and then renders the target image according to the rendering information, which can improve the accuracy of the rendering result of the target image, and improve rendering efficiency and performance.
[0082] In one possible implementation, the computing power of the second device is higher than that of the rendering device.
[0083] In this embodiment, by using the rendering capability of a second device instead of a rendering device, the problem of rendering complex images with lag or even failure to display is solved, thus achieving high-performance rendering by the rendering device. For the application scenarios to achieve the above objective, the computing power of the second device must be higher than that of the rendering device, and the rendering device and the second device must have a network connection. The second device includes devices with GPU hardware acceleration capabilities and high computing power, such as smartphones and tablets; the rendering device includes devices without multi-core hardware acceleration capabilities and high computing power, such as wearable devices like fitness trackers and smartwatches.
[0084] In one possible implementation, the receiving unit is further configured to refuse to receive the second rendering data when the rendering device has completed rendering and obtained the first rendering data, but has not received the second rendering data sent by the second device.
[0085] In this embodiment, the rendering device prioritizes obtaining the first rendering data. That is, if the rendering device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the rendering device will not only send the first rendering data as the target rendering data, but will also refuse to receive any subsequent second rendering data sent by the second device. The method in this embodiment can save network resources for the rendering device and improve the utilization rate of network resources for target image rendering.
[0086] In one possible implementation, the rendering unit is further configured to interrupt the rendering of the target image by the rendering device when it receives the second rendering data sent by the second device and the rendering device has not obtained the first rendering data.
[0087] In this embodiment, the rendering device prioritizes obtaining the first rendering data. That is, if the rendering device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the rendering device will not only send the first rendering data as the target rendering data, but will also refuse to receive any subsequent second rendering data sent by the second device. The method in this embodiment can save network resources for the rendering device and improve the utilization rate of network resources for target image rendering.
[0088] Fourthly, embodiments of this application provide a rendering apparatus, the apparatus comprising:
[0089] A receiving unit is configured to receive a rendering instruction sent by a first device, the rendering instruction being used to instruct the rendering device to render a target image;
[0090] A rendering unit is used to render the target image according to the rendering instructions to obtain second rendering data; the rendering environment of the rendering unit is the same as the rendering environment of the first device.
[0091] The sending unit is used to send the second rendering data to the first device; the second rendering data is used by the first device to send the second rendering data as target rendering data when it receives the second rendering data but does not obtain the first rendering data, and the first rendering data is the data obtained by the first device rendering the target image.
[0092] In this embodiment, based on the connection between the first device and the rendering device, the rendering device receives a rendering instruction sent by the first device, renders the target image according to the rendering instruction, obtains second rendering data, and then sends the second rendering data back to the first device. The aforementioned connection includes various possible connection methods such as Bluetooth connection and wireless network connection between the first device and the rendering device, used for data communication between the first device and the rendering device. When the first device receives the second rendering data but has not yet obtained the first rendering data rendered locally by the first device, it sends the second rendering data as target rendering data to display the rendered target image. Specifically, the rendering device renders the target image according to the rendering instruction by constructing a target virtual machine based on a synchronization request sent by the first device. The rendering environment of the target virtual machine is the same as that of the first device, so that the rendering capability of the rendering device can replace the rendering of the first device. Then, the target virtual machine renders the target image according to the rendering instruction to obtain the aforementioned second rendering data.
[0093] Currently, the more commonly used rendering method is based on a strong connection between the first device and the rendering device. The rendering device uses its powerful computing and distributed capabilities to unidirectionally render the target image, and then outputs the rendering result to the first device for display, thus enabling the first device to render the target image and achieve the goal of high frame rate target image rendering. This method relies on a strong connection between the first device and the rendering device to send the rendering result to the display, and it is entirely dependent on the rendering device's rendering capabilities. The first device does not participate in the rendering process of the target image, leading to a problem where the rendering result from the rendering device may not be well adapted to the display environment of the first device.
[0094] Compared to commonly used rendering methods, the rendering method provided in this application embodiment achieves the rendering purpose of the first device for high frame rate target images by using distributed rendering based on the connection between the first device and the rendering device, allowing the rendering capability of the rendering device to replace the rendering of the first device. Furthermore, this method does not rely on a strong connection between the first device and the rendering device. The first device participates in the rendering process of the target image by the rendering device, ensuring that the rendering environment of the target virtual machine constructed by the rendering device is the same as the rendering environment of the first device. This allows the rendering results obtained by the rendering device to better adapt to the display environment of the first device, solving the problem of lag or even failure to display complex images in the first device, and achieving high-performance rendering by the first device.
[0095] In one possible implementation, the device further includes:
[0096] The receiving unit is further configured to receive a synchronization request sent by the first device; the synchronization request is used to request that the rendering device be in a synchronized state with the first device;
[0097] A construction unit is used to construct the target virtual machine according to the synchronization request;
[0098] A synchronization unit is used to synchronize the target virtual machine to the state of the first device;
[0099] The sending unit is further configured to send synchronization feedback to the first device, the synchronization feedback indicating that the rendering device and the first device are in a synchronized state.
[0100] This application provides a possible implementation for synchronizing the state of a rendering device with that of a first device. Specifically, before receiving rendering instructions from the first device, the state of the rendering device needs to be consistent with the state of the first device. The first device sends a synchronization request to the rendering device, requesting that the rendering device be in a synchronized state with the first device. The rendering device receives the synchronization request from the first device and responds to it, constructs a target virtual machine based on the synchronization request, and synchronizes the target virtual machine to the state of the first device. After completing the state synchronization, the rendering device sends a synchronization feedback to the first device, indicating that the rendering device and the first device are now in a synchronized state. The state synchronization mechanism in this application allows the rendering device to maintain synchronization with the state of the first device before performing rendering operations. Specifically, this can be synchronization of the device's rendering environment, synchronization of the previous frame display of the target image being rendered, etc. Device state synchronization under this state synchronization mechanism can make the subsequent rendering results of the target image more accurate, improving the rendering efficiency and performance of the rendering device.
[0101] In one possible implementation, the synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the rendering device begin synchronization, and the current page information of the first device is used to indicate the state of the rendering device synchronizing with the first device;
[0102] The synchronization unit is specifically used to synchronize the target virtual machine to the state of the first device based on the current page information of the first device.
[0103] This application provides a possible implementation of a synchronization request. Specifically, the synchronization request includes a first timestamp and current page information of the first device. The first timestamp records the time when the first device and the rendering device begin synchronization. The current page information of the first device includes the display information of the previous frame of the target image rendered by the first device, used to synchronize the state of the target virtual machine of the rendering device to the state of the first device. After receiving the synchronization request, the rendering device synchronizes the target virtual machine to the state of the first device according to the current page information of the first device included in the synchronization request. The synchronization request in this application embodiment can effectively synchronize the states of the first device and the rendering device.
[0104] In one possible implementation, the rendering instruction includes verification information and rendering information; the verification information is used by the rendering device to verify that it is in a synchronized state with the first device; the rendering information includes information for rendering the target image, used by the rendering device to render the target image; the device further includes:
[0105] A verification unit is used to verify, based on the verification information, that the rendering device and the first device are in a synchronized state.
[0106] The rendering unit is specifically used to render the target image according to the rendering information to obtain the second rendering data.
[0107] This application provides a possible implementation of a rendering instruction. Specifically, the rendering instruction includes verification information and rendering information. After the rendering device completes state synchronization with the first device, it verifies and confirms that the rendering device and the first device are in a synchronized state based on the verification information received from the first device. The rendering device then renders the target image according to the received rendering information to obtain the aforementioned second rendering data. This application ensures that the rendering device and the first device are synchronized through verification information, and then renders the target image according to the rendering information, which can improve the accuracy of the rendering result of the target image, and improve rendering efficiency and performance.
[0108] In one possible implementation, the computing power of the rendering device is higher than that of the first device.
[0109] In this embodiment, by using the rendering capability of a rendering device instead of the rendering capability of a first device, the problem of lag or even failure to display complex images in the first device is solved, thus achieving high-performance rendering on the first device. For the application scenarios to achieve the above objective, the computing power of the rendering device must be higher than that of the first device, and the first device and the rendering device must have a network connection. The rendering device includes devices with GPU hardware acceleration capabilities and high computing power, such as smartphones and tablets; the first device includes devices without multi-core hardware acceleration capabilities and high computing power, such as wearable devices like fitness trackers and smartwatches.
[0110] In one possible implementation, the sending unit is further configured to stop sending the second rendering data to the first device when the rendering device has not finished sending the second rendering data and the first device has completed rendering and obtained the first rendering data.
[0111] In this embodiment, the first device prioritizes obtaining the first rendering data. That is, if the first device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the rendering device, the first device not only sends the first rendering data as the target rendering data, but also refuses to receive any subsequent second rendering data sent by the rendering device. Consequently, the rendering device will stop sending the rendered second rendering data to the first device. The method in this embodiment can save network resources of the rendering device and improve the utilization rate of network resources for target image rendering.
[0112] Fifthly, embodiments of this application provide a rendering apparatus, the rendering apparatus including a processor and a memory; the memory is used to store computer execution instructions; the processor is used to execute the computer execution instructions stored in the memory to cause the rendering apparatus to perform the method as described in the first aspect and any possible implementation thereof, or the method as described in the second aspect and any possible implementation thereof. Optionally, the rendering apparatus further includes a transceiver, the transceiver being used to receive signals or transmit signals.
[0113] In a sixth aspect, embodiments of this application provide a computer-readable storage medium for storing instructions or a computer program; when the instructions or the computer program are executed, the method described in the first aspect and any possible implementation is implemented, or the method described in the second aspect and any possible implementation is implemented.
[0114] In a seventh aspect, embodiments of this application provide a computer program product, the computer program product including instructions or a computer program; when the instructions or the computer program are executed, the method described in the first aspect and any possible implementation is implemented, or the method described in the second aspect and any possible implementation is implemented.
[0115] Eighthly, embodiments of this application provide a chip including a processor configured to execute instructions that, when executed, cause the chip to perform the method described in the first aspect and any possible implementation, or the method described in the second aspect and any possible implementation. Optionally, the chip further includes a communication interface configured to receive or transmit signals.
[0116] Ninthly, embodiments of this application provide a system comprising at least one rendering apparatus as described in the third aspect, or the fourth aspect, or the fifth aspect, or the eighth aspect.
[0117] Furthermore, in the process of performing the method described in the first aspect and any possible implementation thereof, or in the process of performing the method described in the second aspect and any possible implementation thereof, the processes in the above methods relating to sending and / or receiving information (e.g., sending rendering instructions / synchronization requests, or receiving rendering instructions / synchronization requests), can be understood as the process of the processor outputting information, and / or the process of the processor receiving input information. When outputting information, the processor can output the information to a transceiver (or communication interface, or transmitting module) so that the transceiver can transmit it. After the information is output by the processor, it may need to undergo other processing before reaching the transceiver. Similarly, when the processor receives input information, the transceiver (or communication interface, or transmitting module) receives the information and inputs it to the processor. Furthermore, after the transceiver receives the information, the information may need to undergo other processing before being input to the processor.
[0118] Based on the above principles, for example, the information sent mentioned in the aforementioned method can be understood as information output by the processor. Similarly, the information received can be understood as information received by the processor from input.
[0119] Optionally, unless otherwise specified, or unless they contradict their actual function or internal logic in the relevant description, the operations of the processor, such as transmitting, sending, and receiving, can be more generally understood as processor output and receiving, input, and other operations.
[0120] Optionally, in the process of performing the methods described in the first aspect and any possible implementation above, or in the process of performing the methods described in the second aspect and any possible implementation above, the processor may be a processor specifically designed to perform these methods, or a processor that performs these methods by executing computer instructions stored in memory, such as a general-purpose processor. The memory may be a non-transitory memory, such as read-only memory (ROM), which may be integrated with the processor on the same chip or disposed on separate chips. This application does not limit the type of memory or the arrangement of the memory and processor.
[0121] In one possible implementation, at least one of the aforementioned memories is located outside the device.
[0122] In yet another possible implementation, at least one of the aforementioned memories is located within the device.
[0123] In another possible implementation, a portion of the memory of the at least one memory is located inside the device, while another portion is located outside the device.
[0124] In this application, the processor and memory may also be integrated into a single device, that is, the processor and memory can be integrated together.
[0125] In this embodiment, distributed rendering based on the connection between light devices and rich devices allows the rendering capability of rich devices to replace that of light devices. At the same time, the light devices themselves are also rendering the same scene. The rendering data of the two devices are written to the display module through a competition mechanism, thereby solving the problem of complex image rendering stuttering or even failure to display on light devices and achieving high-performance rendering of light devices. Attached Figure Description
[0126] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0127] Figure 1 This is a schematic diagram illustrating the effect of image rendering provided in an embodiment of this application;
[0128] Figure 2 A schematic diagram of an image rendering architecture provided in an embodiment of this application;
[0129] Figure 3A scene illustration of image rendering provided in an embodiment of this application;
[0130] Figure 4 A flowchart illustrating an image rendering method provided in an embodiment of this application;
[0131] Figure 5 A schematic diagram of the architecture of a state synchronization mechanism provided in an embodiment of this application;
[0132] Figure 6a This is a schematic diagram illustrating the effect of a rendering data contention writing mechanism provided in an embodiment of this application.
[0133] Figure 6b A schematic diagram illustrating the effect of another rendering data contention writing mechanism provided in this application embodiment;
[0134] Figure 6c A schematic diagram illustrating the effect of another rendering data contention writing mechanism provided in this application embodiment;
[0135] Figure 7 A schematic diagram of the architecture of a rendering mechanism provided in an embodiment of this application;
[0136] Figure 8 A flowchart illustrating another image rendering method provided in an embodiment of this application;
[0137] Figure 9 A schematic flowchart illustrating another image rendering method provided in an embodiment of this application;
[0138] Figure 10 A schematic flowchart illustrating another image rendering method provided in an embodiment of this application;
[0139] Figure 11 This is a schematic diagram of the structure of a rendering device provided in an embodiment of this application;
[0140] Figure 12 This is a schematic diagram of the structure of a rendering device provided in an embodiment of this application;
[0141] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0142] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described below with reference to the accompanying drawings.
[0143] The terms "first" and "second," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0144] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0145] It should be understood that in this application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three or more, and "and / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0146] This application provides a rendering method. To more clearly describe the solution of this application, some knowledge related to image rendering will be introduced below.
[0147] Image rendering: In computer graphics processing, this refers to the process of generating images from models using software. A model is a description of a three-dimensional object using a rigorously defined language or data structure, including information such as geometry, viewpoint, texture, and lighting. Rendering is one of the most important research topics in 3D computer graphics and is closely related to other technologies in practical applications. In the graphics pipeline, rendering is the final and crucial step, through which the final display effect of the model and animation is obtained. Applications of rendering include computer and video games, simulations, film or television special effects, and visualization design, each requiring a comprehensive consideration of characteristics and technologies.
[0148] Image rendering places high demands on the performance of the devices performing the rendering operations, especially for the rendering of complex images, which requires the devices to have GPU hardware acceleration capabilities and high computing power.
[0149] Lightweight devices, often simply called light devices, refer to devices with lower hardware specifications and poorer hardware capabilities. These devices typically have relatively weaker computing and processing power, lack multi-process, multi-tasking concurrent processing capabilities, and may not even include a dedicated hardware rendering acceleration module.
[0150] Rich devices: Devices with high hardware specifications, including GPUs and other hardware acceleration capabilities, as well as high computing power.
[0151] Display sending: Writing data obtained through software or hardware rendering to the display module for display.
[0152] The embodiments of this application are described below with reference to the accompanying drawings.
[0153] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the effect of image rendering provided in an embodiment of this application.
[0154] like Figure 1 As shown, three square wave graphs compare the rendering time under three different image rendering scenarios. Square wave (a) represents the rendering time of a complex image, square wave (b) represents the rendering time of a simple image, and square wave (c) represents the rendering time of a combined image composed of the complex and simple images. It can be seen that rendering a complex image alone takes significantly longer than rendering a simple image alone. Therefore, when no complex image is involved in the rendering, the image display is relatively smooth. When a complex image is involved in the rendering, the rendering of the current simple image requires waiting for the complex image to be completed before writing it to the display module.
[0155] For simple image rendering and display, lightweight devices typically rely on software rendering algorithms. However, for more complex scenarios, such as those involving the simultaneous rendering of multiple complex animations, relying solely on software rendering algorithms can easily lead to rendering and display stuttering on lightweight devices. This is because image rendering is a serial process; it waits for all rendering logic to complete before writing data to the display module. Limited by the single-core CPU of lightweight devices, which cannot handle concurrent processing, rendering and display stuttering occurs. In practical applications, scenarios requiring the combined rendering of complex and simple images can significantly improve the user experience. However, lightweight devices, constrained by their hardware limitations, often cannot achieve the desired results in such scenarios. Therefore, industry practice typically involves avoiding rendering and displaying such scenarios, reducing the occurrence of complex scenarios through development specifications, or achieving high-performance rendering by increasing hardware costs. Taking a common long-standby smartwatch (or smart band) as an example, these watches typically have limited hardware. Therefore, pre-installed or third-party developed watch faces usually only include an analog rotating dial or a digital dial with animations. In scenarios where both analog and animations are displayed simultaneously, the rendering time for the analog dial is long, while the animation rendering cycle is short. This results in noticeable stuttering when both rendering scenarios are running concurrently. The solution for smartwatches is to reduce user push notifications for such complex watch faces and to address this through product iterations that increase CPU processing speed and expand hardware acceleration modules.
[0156] Furthermore, to achieve display of complex images on lightweight devices, the commonly used rendering method is a client-server based approach. In scenarios with a strong connection between the client and server, the server handles all image rendering, while the client only sends the images for display and may not even participate in layer compositing. Therefore, this rendering method relies on the server's powerful computing and distributed capabilities to achieve the client's goal of rendering high frame rates. However, this method is not suitable for lightweight device rendering scenarios. Lightweight devices, limited by their hardware specifications and power consumption requirements, often lack the conditions for high-performance network connectivity. A typical connection method for lightweight devices is Bluetooth Low Energy (BLE), which makes establishing a network connection between the server and client for display impractical. The low-performance network connection would lead to slow data transmission during rendering, resulting in rendering stuttering or even failure to display.
[0157] To address the issues of rendering complex images at high frame rates under limited conditions using lightweight devices, which can cause stuttering or even complete failure to display, this application provides an image rendering architecture and proposes a novel image rendering method. This method utilizes distributed rendering based on connections between lightweight and rich devices, allowing the rich device's rendering capabilities to replace those of the lightweight device. Simultaneously, the lightweight device itself is also rendering the same scene. The rendering data from both devices is written to the display module through a competition mechanism, thereby resolving the stuttering or even complete failure to display complex images on lightweight devices and achieving high-performance rendering on lightweight devices.
[0158] The image rendering architecture provided in this application, the application scenarios applicable to this image rendering architecture, and the image rendering method based on this image rendering architecture will be described below.
[0159] Please see Figure 2 , Figure 2 This is a schematic diagram of an image rendering architecture provided in an embodiment of this application.
[0160] like Figure 2 As shown, the first device and the second device are connected via Bluetooth, wireless network, or other means. The first device is the aforementioned lightweight device, and the second device is the aforementioned rich device. The purpose of this image rendering architecture is to utilize the computing power of the second device to render complex scenes, and then send the rendered data back to the first device after rendering is complete. Simultaneously, the first device itself is also rendering the same scene, obtaining corresponding rendered data. The rendered data obtained through these two methods is written to the display module of the first device through a contention mechanism to display the image corresponding to the rendered scene.
[0161] The specific process is as follows: When the first device needs image rendering, it sends a synchronization request to the second device, requesting the second device to synchronize its initialization state. Upon receiving the synchronization request, the second device constructs a virtual machine with the same rendering environment as the first device to achieve state synchronization. After completing state synchronization, the second device sends synchronization feedback to the first device, notifying it that the rendering environment synchronization is complete, allowing the first device to send rendering commands promptly. Upon receiving the synchronization feedback, the first device checks the connection status between the two devices. If a network connection is established, the first device sends rendering commands to the second device, instructing it to render the target image. Simultaneously, the first device itself performs local rendering and drawing of the target image within the same scene. Upon receiving the rendering commands from the first device, the second device, through its state-synchronized virtual machine, executes the rendering and drawing of the target image according to the commands, and after completing the rendering and drawing, sends the resulting rendering data back to the first device. The first device will send the rendering data obtained from its own local rendering and the rendering data received from the second device as the final target rendering data to display the rendered target image.
[0162] This architecture is based on distributed rendering connected to the first and second devices. By writing rendering data to the display module through a competition mechanism, it can solve the problem of complex image rendering stuttering or even failure to display on the first device, and achieve high-performance rendering on the first device.
[0163] Please see Figure 3 , Figure 3 This is a schematic diagram of an image rendering scene provided in an embodiment of this application.
[0164] like Figure 3 As shown, the smart bracelet 201 and smartwatch 202 communicate with the smartphone 203 via Bluetooth. The smart bracelet 201 and smartwatch 202 are devices with lower hardware specifications and weaker hardware capabilities, generally lacking multi-process, multi-tasking concurrent processing capabilities, and having relatively poor computing and processing power, equivalent to the aforementioned... Figure 2 The first device (light device) in the rendering architecture shown. Smartphone 203 is a device with higher hardware specifications, possessing hardware acceleration capabilities such as a GPU and higher computing power, equivalent to the aforementioned... Figure 2 The second device (rich device) in the rendering architecture shown.
[0165] In this application scenario, distributed rendering based on the Bluetooth connection between the smart bracelet 201, smartwatch 202, and smartphone 203 allows the stronger rendering capabilities of the smartphone 203 to replace the weaker rendering capabilities of the smart bracelet 201 and smartwatch 202. At the same time, the smart bracelet 201 and smartwatch 202 are also rendering the same scene themselves. By writing rendering data to the display modules of the smart bracelet 201 and smartwatch 202 through a competition mechanism, the problem of complex image rendering stuttering or even failure to display in the smart bracelet 201 and smartwatch 202 can be solved, thus achieving high-performance rendering of the smart bracelet 201 and smartwatch 202. For example, if the smart bracelet 201 and smartwatch 202 need to display a dynamic clock face, real-time weather conditions, and real-time heart rate index simultaneously in several consecutive frames of images, the smart bracelet 201 and smartwatch 202 will request the smartphone 203 to render the image in the scene and return the rendering result. At the same time, the smart bracelet 201 and smartwatch 202 will also perform local rendering of the image in the scene, and the rendering result obtained by the smart bracelet 201 and smartwatch 202 first will be sent as the final rendering result for display.
[0166] It is understandable that the aforementioned smart bracelet 201 and smartwatch 202 are merely examples of the first device (light device) in a specific application scenario, and should not be limited to smart bracelet 201 and smartwatch 202. Similarly, the aforementioned smartphone 203 is merely an example of the second device (rich device) in a specific application scenario, and should not be limited to smartphone 203. Furthermore, smart bracelet 201 and smartwatch 202 should not be limited to being only light devices, and smartphone 203 should not be limited to being only a rich device. Light devices and rich devices are concepts defined based on their computing power, and are not inherent attributes of the devices themselves. In different application scenarios, the aforementioned smart bracelet 201, smartwatch 202, and smartphone 203 may be light devices, rich devices, or both, depending on the specific application scenario.
[0167] Please see Figure 4 , Figure 4 This is a flowchart illustrating an image rendering method provided in an embodiment of this application. The method includes, but is not limited to, the following steps:
[0168] Step 401: The first device sends rendering instructions to the second device.
[0169] In this step, the first device sends a rendering instruction to the second device, which instructs the second device to render the target image.
[0170] In this embodiment, the first and second devices are devices equipped with processors capable of executing computer instructions. The second device has a higher computing power than the first device, and the first and second devices are connected via Bluetooth, wireless networks, or other means. Specifically, the first device can be a wearable device with a screen, as described above. Figure 3 The smart bracelet 201 and smartwatch 202 mentioned above, the second device can be a terminal device such as a computer or server, as described above. Figure 3 The smartphone 203 in the example uses distributed rendering based on the connection between the first and second devices. This allows the rendering capabilities of the second device to replace those of the first device. At the same time, the first device itself is also rendering the same scene. The rendering data of both devices is written to the display module through a competition mechanism, thereby solving the problem of lag or even failure to display complex images on the first device and achieving high-performance rendering on the first device.
[0171] In one possible embodiment, before the first device sends a rendering command to the second device, the first device also sends a synchronization request to the second device to request that the second device synchronize its state with the first device. In response to the synchronization request, the second device completes state synchronization and sends a synchronization feedback indicating that the second device and the first device are in a synchronized state. Upon receiving this synchronization feedback, the first device then sends a rendering command to the second device to complete the subsequent rendering of the target image.
[0172] Specifically, the aforementioned synchronization request may include a first timestamp and the current page information of the first device. The first timestamp is used to record the time when the first device and the second device begin synchronization. The current page information of the first device includes the display information of the previous frame of the target image rendered by the first device, mainly including page encoding information, page component attribute information, and current page common constant information, which is used for the second device to synchronize its state to the first device.
[0173] For details regarding the state synchronization mechanism in this embodiment, please refer to [the relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of the architecture of a state synchronization mechanism provided in an embodiment of this application.
[0174] like Figure 5The diagram illustrates the state synchronization mechanism established between the first and second devices via a network connection. The first device sends a synchronization request signal to the second device. Upon receiving this signal, the second device sends a synchronization preparation signal. At this point, the first device sends a synchronization start signal and its page view information to the second device, initiating state synchronization between them. After receiving the page view information from the first device, the second device reconstructs the virtual machine's page information to ensure its rendering environment matches that of the first device, achieving state synchronization. Once state synchronization is complete, the second device sends synchronization information back to the first device, notifying it that the rendering environment synchronization is complete and allowing the first device to send rendering commands promptly.
[0175] The state synchronization mechanism in this application embodiment is mainly manifested in the following aspects of state synchronization:
[0176] First: Synchronize the virtual machine initialization state of the second device. The main purpose of the virtual machine on the second device is to simulate the rendering environment of the first device, thereby facilitating subsequent target image rendering operations.
[0177] Second: Synchronization state before the second device performs rendering operations. When the first device performs complex image rendering operations, it sends rendering commands to the second device. After receiving the commands, the second device needs to synchronize the virtual machine state with the state of the previous frame of the rendering target before it can perform subsequent rendering operations.
[0178] Third: Synchronization of scene switching status on the second device. In scenarios with significant changes such as page switching or application switching, the first device needs to notify the second device that a scene switch has occurred, and the second device will execute the switching operation according to the switching status command.
[0179] Fourth: Reconnection and state synchronization after disconnection. When the connection between the first device and the second device is disconnected and reconnected, the first device needs to synchronize its current state with the second device to facilitate the second device's recovery of the virtual machine state.
[0180] The state synchronization mechanism in this embodiment allows the first device and the second device to maintain state synchronization before rendering operations. Specifically, this can include synchronization of the device's rendering environment and synchronization of the previous frame display of the target image. This state synchronization mechanism enables more accurate rendering of the target image, improving the rendering efficiency and performance of the first device.
[0181] In one possible embodiment, the rendering instructions sent to the second device may include verification information and rendering information. After completing state synchronization with the first device, the second device verifies and confirms that it is in a synchronized state with the first device based on the verification information received from the first device. The second device then renders the target image based on the received rendering information to obtain the second rendering data.
[0182] This application embodiment ensures that the state of the second device is synchronized with that of the first device by verifying the information, and then renders the target image according to the rendering information, which can make the rendering result of the target image more accurate and improve rendering efficiency and rendering performance.
[0183] Step 402: The first device renders the target image.
[0184] While the first device sends a rendering command to the second device to instruct the second device to render the target image to obtain the corresponding second rendering data, the first device itself is also performing local rendering on the target image of the same scene to obtain the corresponding first rendering data.
[0185] It is understandable that, since the computing power of the second device in this embodiment is higher than that of the first device, the second device can render the target image of the same scene faster and take less time.
[0186] Step 403: The first device sends the target rendering data to the display.
[0187] As can be seen from step 401 above, the first device sends a rendering command to the second device, instructing the second device to render the target image, and waits for the second device to complete rendering before sending the obtained second rendering data back to the first device. As can be seen from step 402 above, while instructing the second device to render the target image, the first device is also performing local rendering of the target image in the same scene, and accordingly obtaining the first rendering data.
[0188] In this step, the first device sends the target rendering data it has obtained first to display the rendered target image. This target rendering data may be the first rendering data that the first device renders locally first, or it may be the second rendering data that the second device sends back first.
[0189] Specifically, if the first device completes rendering and obtains first rendering data, but has not received second rendering data from the second device, the first device sends the locally rendered first rendering data as the target rendering data to display the rendered target image. If the first device receives second rendering data from the second device, but has not obtained the locally rendered first rendering data from the first device, the second rendering data rendered by the second device is sent as the target rendering data to display the rendered target image.
[0190] The rendering method in this application embodiment uses a mechanism where the rendering data of the first device and the rendering data of the second device compete to be written to the display of the first device. The rendering data obtained by the first device is written to the display first, thereby solving the problem of complex image rendering lag or even failure to display on the first device. This enables the display of target images in different application scenarios and improves the display efficiency and reliability of the first device.
[0191] For details regarding the rendering data contention writing mechanism in this embodiment, please refer to [link / reference needed]. Figures 6a to 6c , Figure 6a , Figure 6b as well as Figure 6c These are schematic diagrams illustrating the effects of three different rendering data contention writing mechanisms provided in the embodiments of this application.
[0192] Due to fluctuations in the Bluetooth or wireless network connection between the first and second devices, there may be instances of low transmission rates or even disconnection between them. Therefore, relying solely on the second device for rendering will not allow for single-device rendering operations. The rendering method based on contention-based writing of rendering data proposed in this application can effectively solve this problem.
[0193] Figure 6a This describes the single-device rendering operation of the original rendering scheme, such as... Figure 6a As shown, the first device renders the target image entirely on its own without relying on the rendering capabilities of other devices, and then displays the rendering results.
[0194] Figure 6b and Figure 6c The description covers two different image rendering scenarios based on a distributed rendering architecture that connects a first device and a second device. Regardless of the scenario, the first device will trigger local rendering when sending rendering instructions. After receiving the rendering instructions, the second device will perform the rendering operation and send the rendering data to the first device after the rendering is completed.
[0195] like Figure 6bAs shown, due to the good connection between the first and second devices, the data transmission efficiency is high. When the second device transmits data to the first device, the first device's local rendering has not yet finished. At this time, the first device interrupts its local rendering operation and writes the received rendering data from the second device into the display module.
[0196] like Figure 6c As shown, due to poor connectivity between the first and second devices, data transmission efficiency is low, or even impossible. When the first device finishes local rendering but has not yet received rendering data from the second device, it directly writes the local rendering data into the display module.
[0197] Through the above-mentioned rendering data contention writing mechanism, the data that has been rendered first can be written to the display, thereby improving the reliability of the first device's display in different scenarios.
[0198] In one possible embodiment, the first device prioritizes obtaining the first rendering data. That is, if the first device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the first device will not only send the first rendering data as the target rendering data, but will also refuse to receive the second rendering data subsequently sent by the second device.
[0199] The method in this embodiment can save network resources of the first device and improve the utilization rate of network resources for target image rendering.
[0200] In one possible embodiment, the first device obtains the second rendering data first, that is, the second device completes rendering to obtain the second rendering data and sends the second rendering data to the first device. If the first device receives the second rendering data sent by the second device, but the first device's local rendering is not completed and the first rendering data is not obtained, the first device will not only send the second rendering data as the target rendering data, but also interrupt the local rendering of the target image.
[0201] The method in this application embodiment can save network resources of the first device and improve the effective utilization rate of network resources for target image rendering.
[0202] Please see Figure 8 , Figure 8 A flowchart illustrating another image rendering method provided in this application embodiment, the method including but not limited to the following steps:
[0203] Step 801: The second device receives the rendering instructions sent by the first device.
[0204] In this step, the second device receives a rendering instruction sent by the first device, which instructs the second device to render the target image.
[0205] In this embodiment, the first and second devices are devices equipped with processors capable of executing computer instructions. The second device has a higher computing power than the first device, and the first and second devices are connected via Bluetooth, wireless networks, or other means. Specifically, the first device can be a wearable device with a screen, as described above. Figure 3 The smart bracelet 201 and smartwatch 202 mentioned above, the second device can be a terminal device such as a computer or server, as described above. Figure 3 The smartphone 203 in the example uses distributed rendering based on the connection between the first and second devices. This allows the rendering capabilities of the second device to replace those of the first device. At the same time, the first device itself is also rendering the same scene. The rendering data of both devices is written to the display module through a competition mechanism, thereby solving the problem of lag or even failure to display complex images on the first device and achieving high-performance rendering on the first device.
[0206] In one possible embodiment, before receiving rendering instructions from the first device, the state of the second device needs to be consistent with that of the first device. The second device will also receive a synchronization request from the first device, requesting that it be in a synchronized state with the first device. Upon receiving the synchronization request, the second device responds to it and, based on the request, constructs the target virtual machine and synchronizes it to the state of the first device. After completing state synchronization, the second device sends a synchronization feedback to the first device, indicating that it is now in a synchronized state with the first device.
[0207] Specifically, the aforementioned synchronization request may include a first timestamp and the current page information of the first device. The first timestamp is used to record the time when the first device and the second device begin synchronization. The current page information of the first device includes the display information of the previous frame of the target image rendered by the first device, mainly including page encoding information, page component attribute information, and current page common constant information, which is used for the second device to synchronize its state to the first device.
[0208] For details regarding the state synchronization mechanism in this application embodiment, please refer to the above. Figure 5 This will not be elaborated upon here.
[0209] The state synchronization mechanism in this embodiment allows the second device to maintain state synchronization with the first device before performing rendering operations. Specifically, this can include synchronization of the device's rendering environment or synchronization of the previous frame display of the target image. This state synchronization mechanism enables more accurate rendering of the target image, improving the rendering efficiency and performance of the second device.
[0210] In one possible embodiment, the rendering instructions received from the first device may include verification information and rendering information. After completing state synchronization with the first device, the second device verifies and confirms that it is in a synchronized state with the first device based on the verification information received from the first device. The second device then renders the target image based on the received rendering information to obtain the second rendering data.
[0211] This application embodiment ensures that the state of the second device is synchronized with that of the first device by verifying the information, and then renders the target image according to the rendering information, which can make the rendering result of the target image more accurate and improve rendering efficiency and rendering performance.
[0212] Step 802: The target virtual machine of the second device renders the target image according to the rendering instructions to obtain the second rendering data.
[0213] After receiving the rendering instructions, the second device's target virtual machine renders the target image according to the instructions, obtaining second rendering data. The rendering environment of the target virtual machine is the same as that of the first device. Simultaneously, while the target virtual machine renders the target image, the first device itself is also locally rendering the target image of the same scene, obtaining corresponding first rendering data.
[0214] It is understandable that, since the computing power of the second device in this embodiment is higher than that of the first device, the second device can render the target image of the same scene faster and take less time.
[0215] Step 803: The second device sends the second rendering data to the first device.
[0216] The second device sends second rendering data to the first device. This second rendering data is used by the first device as target rendering data when it receives the second rendering data but does not receive the first rendering data.
[0217] In one possible embodiment, the first device prioritizes obtaining the first rendering data. That is, if the first device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the first device will not only send the first rendering data as the target rendering data, but will also refuse to receive the second rendering data subsequently sent by the second device. Accordingly, the second device will stop sending the second rendering data obtained from rendering to the first device.
[0218] The method in this application embodiment can save network resources of the second device and improve the utilization rate of network resources for target image rendering.
[0219] For details regarding the rendering mechanism described in this application's embodiments, please refer to [the relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of the architecture of a rendering mechanism provided in an embodiment of this application.
[0220] In the first device, rendering mainly includes three steps: rendering instruction invocation, rendering execution, and writing to the display module cache. Corresponding to the first device is a target virtual machine with the same rendering environment built on the second device side. This virtual machine is essentially identical to the image logic running on the first device, differing only in the adaptation layer interface and the accelerated computation of the complex image logic running on the first device using multi-processing and hardware acceleration. Furthermore, this application embodiment also provides instruction-based rendering operations, the specific instruction format of which can be as follows:
[0221] Check bit Page ID Number of instructions Command 1id parameter Command 2id parameter ……
[0222] The checksum is 1 byte long, the page ID is 2 bytes long, the instruction count is 1 byte long, the instruction 1 ID and its parameters are 128 bytes long, and the instruction 2 ID and its parameters are 128 bytes long. The optional values for the page ID and instruction ID are configured during virtual machine initialization on the second device side. The rendering instructions sent by the first device are specified from the page ID set and the instruction ID set; these instructions include operations such as rotation, scaling, and complex mathematical operations.
[0223] like Figure 7 The diagram illustrates a processing mechanism for a second device to generate rendering data when it receives rendering instructions from a first device. The process of generating rendering data by executing rendering instructions mainly includes instruction parsing and verification, and instruction execution. Instruction parsing and verification primarily involves decomposing the instruction set information and parsing out the page requiring the operation. This is mainly to verify whether it matches the page after state synchronization, preventing mismatches. The instruction execution process involves calling the relevant interfaces of the relevant instances based on the parsed instructions and passing in parameters for complex calculations. Because the second device has stronger computing power than the first device, the implementation of these calculation-related operations differs from that of the first device.
[0224] Please see Figure 9 , Figure 9 This is a flowchart illustrating another image rendering method provided in the embodiments of this application, and can also be understood as the above. Figure 4 as well as Figure 8 This is a supplement to the flowchart of the image rendering method in [the document / platform].
[0225] like Figure 9 As shown, a distributed rendering method is given in scenarios such as user intervention, in which the rendering operation needs to be initiated after the user triggers a specific command.
[0226] First, the first device's imaging system needs to perform system initialization operations after startup. These initialization operations include starting image rendering tasks, starting user input event tasks, and loading business logic.
[0227] After system initialization, the connection status of the first device needs to be confirmed. If it is not connected to the second device, the system waits for user intervention to change the page state before performing local rendering directly on the first device. After rendering is complete, the rendered data is written to the screen, thus completing the local rendering logic.
[0228] If a connection to the second device is already established, virtual machine initialization needs to be performed on the second device. This initialization process is essentially the same as on the first device, except that the rendering operation here is based on multi-process and hardware-accelerated rendering, resulting in higher rendering performance.
[0229] After the second device completes the virtual machine initialization, it needs to wait for user intervention to trigger the first device's operation, thus initiating the page rendering process. At this time, the first device sends a rendering instruction to the second device, which includes the target view to be executed and the specific execution parameters.
[0230] After receiving the rendering instructions from the first device, the second device first parses the rendering instruction set and then executes the rendering instructions. When executing the rendering instructions, it is necessary to determine whether concurrent processing is possible based on the relationships between the rendering instructions. Instructions that can be processed concurrently will be executed simultaneously, and data layers will be composited before data encapsulation.
[0231] The encapsulated data will be sent to the first device. The first device determines whether to interrupt the current local rendering based on whether the local rendering operation has been completed. If the local rendering is complete, it will refuse to receive or discard the rendering data from the second device and write the rendered data obtained from the local rendering to the screen. Otherwise, it will interrupt the local rendering of the first device and write the received rendering data from the second device to the screen.
[0232] This application's embodiments can achieve distributed rendering effects under user intervention. Through this distributed rendering, the originally time-consuming page rendering operation can be transferred to a second device with strong computing power, reducing computational costs and improving rendering performance. Furthermore, for some image effects that cannot be implemented on the first device (such as complex 3D image rendering), this method can also be used to achieve image rendering and display.
[0233] Please see Figure 10 , Figure 10 This is a flowchart illustrating another image rendering method provided in the embodiments of this application, and can also be understood as the above. Figure 4 as well as Figure 8 This is a supplement to the flowchart of the image rendering method in [the document / platform].
[0234] like Figure 10 As shown, a distributed rendering method for intervention-free scenarios is presented. An intervention-free scenario refers to a scenario where rendering can begin on a second device without requiring the user to trigger a specific operation page. Such scenarios typically involve pages that only need to be displayed and do not require user interaction; for example, the display of a sports watch face does not require user intervention.
[0235] With the above Figure 9 Similar to the rendering methods in other applications, the rendering method provided in this embodiment also requires system initialization. The difference lies in that, in this embodiment, after system initialization, the virtual machine of the second device directly begins rendering based on the page information, and the rendered content is a complete refresh of the target page. This process does not require the execution of a series of operations such as sending rendering instructions from the first device to the second device and parsing instructions from the second device.
[0236] After rendering the current frame, the second device sends the rendered data to the first device. Simultaneously, the second device continues rendering the next frame. Because a user might intervene at some point, triggering changes to the page information, the second device's cyclic rendering process determines whether to continue rendering each time. Once a change in page information occurs, the second device's rendering process ends, and it synchronizes the current state of the first device.
[0237] Meanwhile, the first device continues to perform local rendering operations on images within the same scene. When the connection between the first and second devices is strong, the first device's local rendering operations will be significantly interrupted. Even when the connection between the first and second devices is weak, it ensures that the first device's screen will not experience display issues.
[0238] The rendering method in this embodiment can achieve high frame rate rendering and display in complex scenes. This rendering method is primarily aimed at scenarios with little or no user intervention. In scenarios without user intervention, the business logic executed each time is usually fixed or regular. Therefore, the second device does not need to receive rendering instructions from the first device every time. The second device only needs to synchronize its state with the first device once during initialization in a specified page or scene to achieve the goal of executing rendering according to preset rendering instructions. This rendering method can reduce the time spent repeatedly sending rendering instructions from the first device to the second device, further improving rendering performance.
[0239] The methods of the embodiments of this application have been described in detail above. The apparatus of the embodiments of this application is provided below.
[0240] Please see Figure 11 , Figure 11 This is a schematic diagram of a rendering apparatus provided in an embodiment of this application. The rendering apparatus 110 may include a sending unit 1101, a rendering unit 1102, and a display unit 1103, wherein the descriptions of each unit are as follows:
[0241] The sending unit 1101 is used to send a rendering instruction to the second device; the rendering instruction is used to instruct the second device to render the target image;
[0242] Rendering unit 1102 is used to render the target image;
[0243] The display unit 1103 is used to display the target rendering data; the target rendering data is the rendering data of the second device obtained by the rendering device first, or the rendering data of the rendering device obtained by the rendering device first.
[0244] In this embodiment, based on the connection between the rendering device and the second device, the rendering device sends a rendering command to the second device, instructing the second device to render the target image. This connection includes various possible connection methods such as Bluetooth or wireless network connection between the rendering device and the second device, used for data communication between them. After completing rendering, the second device returns the obtained rendering data to the rendering device. Simultaneously, the rendering device itself is also rendering the second device. The rendering device then displays the rendered target image by sending the target rendering data it obtains first. This target rendering data may be the rendering data obtained locally by the rendering device first, or it may be the rendering data obtained first from the second device.
[0245] Currently, a commonly used rendering method relies on a strong connection between the rendering device and a second device. The rendering device depends on the powerful computing and distributed capabilities of the second device to render the target image, while the rendering device itself only handles the display, thus achieving high frame rate rendering of the target image. This method depends on a strong connection between the rendering device and the second device. If the network connection between the rendering device and the second device is weak, it will cause display stuttering when rendering complex images. If the network connection between the rendering device and the second device is interrupted, it will also prevent the rendering device from displaying complex images.
[0246] Compared to commonly used rendering methods, the rendering method provided in this application embodiment achieves the rendering of high frame rate target images by using distributed rendering based on the connection between the rendering device and the second device. This is achieved by enabling the rendering capability of the second device to replace the rendering of the rendering device, and the method does not rely on a strong connection between the rendering device and the second device. When the rendering device and the second device have a network connection, the rendering capability of the second device replaces the rendering of the rendering device. When the rendering device and the second device do not have a network connection, the rendering device completes the rendering locally. This solves the problem of rendering complex images with stuttering or even failure to display, and achieves high-performance rendering by the rendering device.
[0247] In one possible implementation, the display unit 1103 is specifically used to display the first rendering data as the target rendering data when the rendering device completes rendering and obtains the first rendering data, but has not received the second rendering data sent by the second device; the first rendering data is the data obtained by the rendering device rendering the target image, and the second rendering data is the data obtained by the second device rendering the target image.
[0248] Alternatively, the display unit 1103 is further configured to display the second rendering data as the target rendering data when it receives the second rendering data sent by the second device and the rendering device has not obtained the first rendering data.
[0249] This application provides a possible implementation for displaying target rendering data. Specifically, when the rendering device completes rendering and obtains first rendering data, but has not received second rendering data from the second device, the rendering device displays the locally rendered first rendering data as target rendering data to display the rendered target image. When the second rendering data is received from the second device, but the rendering device has not obtained the locally rendered first rendering data, the second rendering data rendered by the second device is displayed as target rendering data to display the rendered target image.
[0250] The rendering method in this application embodiment uses a mechanism where the rendering data from the rendering device and the rendering data from the second device compete to be written to the display of the rendering device. This mechanism prioritizes the rendering data obtained by the rendering device and writes it to the display, thereby solving the problem of rendering complex images in the rendering device being stuck or even unable to be displayed. This enables the display of target images in different application scenarios and improves the display efficiency and reliability of the rendering device.
[0251] In one possible implementation, the device further includes:
[0252] The receiving unit 1104 is used to receive the second rendering data sent by the second device.
[0253] In one possible implementation, the sending unit is further configured to send a synchronization request to the second device, the synchronization request being used to request the second device to be in a synchronized state with the rendering device;
[0254] The sending unit 1101 is specifically used to send the rendering command to the second device upon receiving the synchronization feedback sent by the second device; the synchronization feedback is used to indicate that the second device and the rendering device are in a synchronized state.
[0255] This application provides a possible implementation for synchronizing the states of a rendering device and a second device. Specifically, before the rendering device sends a rendering command to the second device, it is necessary to ensure that the rendering device and the second device are in a synchronized state. The rendering device first sends a synchronization request to the second device, requesting that the states of the second device and the rendering device be synchronized. The second device responds to the synchronization request, completes the state synchronization, and sends a synchronization feedback, indicating that the second device and the rendering device are in a synchronized state. Upon receiving the synchronization feedback, the rendering device then sends a rendering command to the second device to complete the subsequent rendering of the target image. The state synchronization mechanism in this application embodiment can keep the states of the rendering device and the second device synchronized before performing the rendering operation. Specifically, this can be synchronization of the device's rendering environment, synchronization of the previous frame display of the target image, etc. Device state synchronization under this state synchronization mechanism can make the subsequent rendering results of the target image more accurate, improving the rendering efficiency and rendering performance of the rendering device.
[0256] In one possible implementation, the synchronization request includes a first timestamp and the current page information of the rendering device; the first timestamp is used to indicate the time when the rendering device and the second device begin synchronization, and the current page information of the rendering device is used to indicate the state of the second device synchronizing with the rendering device.
[0257] This application provides a possible implementation of a synchronization request. Specifically, the synchronization request includes a first timestamp and current page information of the rendering device. The first timestamp records the time when the rendering device and the second device begin synchronization. The current page information of the rendering device includes the display information of the previous frame of the target image rendered by the rendering device, used by the second device to synchronize with the state of the rendering device. The synchronization request in this application embodiment can effectively synchronize the states of the rendering device and the second device.
[0258] In one possible implementation, the rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the rendering device; the rendering information includes information for rendering the target image, which is used by the second device to render the target image.
[0259] This application provides a possible implementation of a rendering instruction. Specifically, the rendering instruction includes verification information and rendering information. After the second device completes state synchronization with the rendering device, it verifies again that the second device and the rendering device are in a synchronized state based on the verification information received from the rendering device. The second device then renders the target image according to the received rendering information to obtain the aforementioned second rendering data. This application ensures state synchronization between the second device and the rendering device through verification information, and then renders the target image according to the rendering information, which can improve the accuracy of the rendering result of the target image, and improve rendering efficiency and performance.
[0260] In one possible implementation, the computing power of the second device is higher than that of the rendering device.
[0261] In this embodiment, by using the rendering capability of a second device instead of a rendering device, the problem of rendering complex images with lag or even failure to display is solved, thus achieving high-performance rendering by the rendering device. For the application scenarios to achieve the above objective, the computing power of the second device must be higher than that of the rendering device, and the rendering device and the second device must have a network connection. The second device includes devices with GPU hardware acceleration capabilities and high computing power, such as smartphones and tablets; the rendering device includes devices without multi-core hardware acceleration capabilities and high computing power, such as wearable devices like fitness trackers and smartwatches.
[0262] In one possible implementation, the receiving unit 1104 is further configured to refuse to receive the second rendering data when the rendering device has completed rendering and obtained the first rendering data, but has not received the second rendering data sent by the second device.
[0263] In this embodiment, the rendering device prioritizes obtaining the first rendering data. That is, if the rendering device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the rendering device will not only send the first rendering data as the target rendering data, but will also refuse to receive any subsequent second rendering data sent by the second device. The method in this embodiment can save network resources for the rendering device and improve the utilization rate of network resources for target image rendering.
[0264] In one possible implementation, the rendering unit 1102 is further configured to interrupt the rendering of the target image by the rendering device when it receives the second rendering data sent by the second device and the rendering device has not obtained the first rendering data.
[0265] In this embodiment, the rendering device prioritizes obtaining the first rendering data. That is, if the rendering device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the second device, the rendering device will not only send the first rendering data as the target rendering data, but will also refuse to receive any subsequent second rendering data sent by the second device. The method in this embodiment can save network resources for the rendering device and improve the utilization rate of network resources for target image rendering.
[0266] According to the embodiments of this application, Figure 11 The various units in the illustrated device can be individually or entirely combined into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the network device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0267] It should be noted that the implementation of each unit can also refer to the above. Figure 4 , Figure 9 , Figure 10 The corresponding description of the method embodiments shown.
[0268] The rendering device in this embodiment is the one described above. Figure 4 , Figure 9 , Figure 10 The first device in the method embodiment shown.
[0269] exist Figure 11 In the described rendering apparatus 110, distributed rendering based on the connection between light devices and rich devices allows the rendering capability of rich devices to replace that of light devices. At the same time, the light devices themselves are also rendering the same scene. The rendering data of the two devices are written to the display module through a competition mechanism, thereby solving the problem of complex image rendering stuttering or even failure to display on the light devices, and realizing high-performance rendering of the light devices.
[0270] Please see Figure 12 , Figure 12This is a schematic diagram of a rendering apparatus provided in an embodiment of this application. The rendering apparatus 120 may include a receiving unit 1201, a rendering unit 1202, and a transmitting unit 1203, wherein the descriptions of each unit are as follows:
[0271] The receiving unit 1201 is used to receive a rendering instruction sent by the first device, the rendering instruction being used to instruct the rendering device to render the target image;
[0272] The rendering unit 1202 is used to render the target image according to the rendering instructions to obtain second rendering data; the rendering environment of the rendering unit is the same as the rendering environment of the first device.
[0273] The sending unit 1203 is used to send the second rendering data to the first device; the second rendering data is used by the first device to send the second rendering data as target rendering data when it receives the second rendering data but does not obtain the first rendering data, and the first rendering data is the data obtained by the first device rendering the target image.
[0274] In this embodiment, based on the connection between the first device and the rendering device, the rendering device receives a rendering instruction sent by the first device, renders the target image according to the rendering instruction, obtains second rendering data, and then sends the second rendering data back to the first device. The connection includes various possible connection methods such as Bluetooth connection and wireless network connection between the first device and the rendering device, used for data communication between them. When the first device receives the second rendering data but has not yet obtained the first rendering data rendered locally, it sends the second rendering data as target rendering data to display the rendered target image. Specifically, the rendering device renders the target image according to the rendering instruction by constructing a target virtual machine based on a synchronization request sent by the first device. The rendering environment of this target virtual machine is the same as that of the first device, so that the rendering capability of the rendering device can replace the rendering of the first device. Then, the target virtual machine renders the target image according to the rendering instruction to obtain the second rendering data.
[0275] Currently, the more commonly used rendering method is based on a strong connection between the first device and the rendering device. The rendering device uses its powerful computing and distributed capabilities to unidirectionally render the target image, and then outputs the rendering result to the first device for display, thus enabling the first device to render the target image and achieve the goal of high frame rate target image rendering. This method relies on a strong connection between the first device and the rendering device to send the rendering result to the display, and it is entirely dependent on the rendering device's rendering capabilities. The first device does not participate in the rendering process of the target image, leading to a problem where the rendering result from the rendering device may not be well adapted to the display environment of the first device.
[0276] Compared to commonly used rendering methods, the rendering method provided in this application embodiment achieves the rendering purpose of the first device for high frame rate target images by using distributed rendering based on the connection between the first device and the rendering device, allowing the rendering capability of the rendering device to replace the rendering of the first device. Furthermore, this method does not rely on a strong connection between the first device and the rendering device. The first device participates in the rendering process of the target image by the rendering device, ensuring that the rendering environment of the target virtual machine constructed by the rendering device is the same as the rendering environment of the first device. This allows the rendering results obtained by the rendering device to better adapt to the display environment of the first device, solving the problem of lag or even failure to display complex images in the first device, and achieving high-performance rendering by the first device.
[0277] In one possible implementation, the device further includes:
[0278] The receiving unit 1201 is further configured to receive a synchronization request sent by the first device; the synchronization request is used to request that the rendering device be in a synchronized state with the first device;
[0279] Construction unit 1204 is used to construct the target virtual machine according to the synchronization request;
[0280] Synchronization unit 1205 is used to synchronize the target virtual machine to the state of the first device;
[0281] The sending unit 1203 is further configured to send synchronization feedback to the first device, the synchronization feedback being used to indicate that the rendering device and the first device are in a synchronized state.
[0282] This application provides a possible implementation for synchronizing the state of a rendering device with that of a first device. Specifically, before receiving rendering instructions from the first device, the state of the rendering device needs to be consistent with the state of the first device. The first device sends a synchronization request to the rendering device, requesting that the rendering device be in a synchronized state with the first device. The rendering device receives the synchronization request from the first device and responds to it, constructs a target virtual machine based on the synchronization request, and synchronizes the target virtual machine to the state of the first device. After completing the state synchronization, the rendering device sends a synchronization feedback to the first device, indicating that the rendering device and the first device are now in a synchronized state. The state synchronization mechanism in this application allows the rendering device to maintain synchronization with the state of the first device before performing rendering operations. Specifically, this can be synchronization of the device's rendering environment, synchronization of the previous frame display of the target image being rendered, etc. Device state synchronization under this state synchronization mechanism can make the subsequent rendering results of the target image more accurate, improving the rendering efficiency and performance of the rendering device.
[0283] In one possible implementation, the synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the rendering device begin synchronization, and the current page information of the first device is used to indicate the state of the rendering device synchronizing with the first device;
[0284] The synchronization unit 1205 is specifically used to synchronize the target virtual machine to the state of the first device based on the current page information of the first device.
[0285] This application provides a possible implementation of a synchronization request. Specifically, the synchronization request includes a first timestamp and current page information of the first device. The first timestamp records the time when the first device and the rendering device begin synchronization. The current page information of the first device includes the display information of the previous frame of the target image rendered by the first device, used to synchronize the state of the target virtual machine of the rendering device to the state of the first device. After receiving the synchronization request, the rendering device synchronizes the target virtual machine to the state of the first device according to the current page information of the first device included in the synchronization request. The synchronization request in this application embodiment can effectively synchronize the states of the first device and the rendering device.
[0286] In one possible implementation, the rendering instruction includes verification information and rendering information; the verification information is used by the rendering device to verify that it is in a synchronized state with the first device; the rendering information includes information for rendering the target image, used by the rendering device to render the target image; the device further includes:
[0287] The verification unit 1206 is used to verify, based on the verification information, that the rendering device and the first device are in a synchronized state.
[0288] The rendering unit 1202 is specifically used to render the target image according to the rendering information to obtain the second rendering data.
[0289] This application provides a possible implementation of a rendering instruction. Specifically, the rendering instruction includes verification information and rendering information. After the rendering device completes state synchronization with the first device, it verifies and confirms that the rendering device and the first device are in a synchronized state based on the verification information received from the first device. The rendering device then renders the target image according to the received rendering information to obtain the aforementioned second rendering data. This application ensures that the rendering device and the first device are synchronized through verification information, and then renders the target image according to the rendering information, which can improve the accuracy of the rendering result of the target image, and improve rendering efficiency and performance.
[0290] In one possible implementation, the computing power of the rendering device is higher than that of the first device.
[0291] In this embodiment, by using the rendering capability of a rendering device instead of the rendering capability of a first device, the problem of lag or even failure to display complex images in the first device is solved, thus achieving high-performance rendering on the first device. For the application scenarios to achieve the above objective, the computing power of the rendering device must be higher than that of the first device, and the first device and the rendering device must have a network connection. The rendering device includes devices with GPU hardware acceleration capabilities and high computing power, such as smartphones and tablets; the first device includes devices without multi-core hardware acceleration capabilities and high computing power, such as wearable devices like fitness trackers and smartwatches.
[0292] In one possible implementation, the sending unit 1203 is further configured to stop sending the second rendering data to the first device when the rendering device has not finished sending the second rendering data and the first device has completed rendering and obtained the first rendering data.
[0293] In this embodiment, the first device prioritizes obtaining the first rendering data. That is, if the first device completes rendering and obtains the first rendering data, and has not received the second rendering data sent by the rendering device, the first device not only sends the first rendering data as the target rendering data, but also refuses to receive any subsequent second rendering data sent by the rendering device. Consequently, the rendering device will stop sending the rendered second rendering data to the first device. The method in this embodiment can save network resources of the rendering device and improve the utilization rate of network resources for target image rendering.
[0294] According to the embodiments of this application, Figure 12 The various units in the illustrated device can be individually or entirely combined into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the network device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0295] It should be noted that the implementation of each unit can also refer to the above. Figure 8 , Figure 9 , Figure 10 The corresponding description of the method embodiments shown.
[0296] The rendering device in this embodiment is the one described above. Figure 8 , Figure 9 , Figure 10 The second device in the method embodiment shown.
[0297] exist Figure 12 In the described rendering apparatus 120, distributed rendering based on the connection between light devices and rich devices allows the rendering capability of rich devices to replace that of light devices. At the same time, the light devices themselves are also rendering the same scene. The rendering data of the two devices are written to the display module through a competition mechanism, thereby solving the problem of complex image rendering stuttering or even failure to display on the light devices, and achieving high-performance rendering of the light devices.
[0298] Please see Figure 13 , Figure 13This is a schematic diagram of the structure of an electronic device 130 provided in an embodiment of this application. The electronic device 130 may include a memory 1301 and a processor 1302. Optionally, it may also include a communication interface 1303 and a bus 1304, wherein the memory 1301, processor 1302, and communication interface 1303 are interconnected via the bus 1304. The communication interface 1303 is used for data interaction with the rendering device 110 or rendering device 120 described above.
[0299] The memory 1301 provides storage space, which can store data such as the operating system and computer programs. The memory 1301 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).
[0300] Processor 1302 is a module that performs arithmetic and logical operations. It can be one or a combination of processing modules such as a central processing unit (CPU), a graphics processing unit (GPU), or a microprocessor unit (MPU).
[0301] The memory 1301 stores a computer program, and the processor 1302 calls the computer program stored in the memory 1301 to execute the above-mentioned... Figure 4 , Figure 9 , Figure 10 The rendering method shown:
[0302] The first device sends a rendering command to the second device; the rendering command instructs the second device to render the target image.
[0303] The first device renders the target image;
[0304] The first device sends the target rendering data to the display; the target rendering data is either the rendering data of the second device obtained by the first device first, or the rendering data of the first device obtained first.
[0305] For details regarding the execution method of the processor 1302, please refer to the above. Figure 4 , Figure 9 , Figure 10This will not be elaborated upon here.
[0306] The electronic device 130 in this embodiment is as described above. Figure 4 , Figure 9 , Figure 10 The first device in the method embodiment shown.
[0307] Correspondingly, the processor 1302 can call the computer program stored in the memory 1301, and can also be used to execute the above-mentioned... Figure 11 The specific details of the method steps performed by each unit in the rendering apparatus 110 shown can be found in the above description. Figure 11 This will not be elaborated upon here.
[0308] On the other hand, processor 1302 calls the computer program stored in memory 1301 to execute the above-mentioned... Figure 8 , Figure 9 , Figure 10 The rendering method shown:
[0309] The second device receives a rendering instruction sent by the first device, the rendering instruction being used to instruct the second device to render the target image;
[0310] The target virtual machine of the second device renders the target image according to the rendering instructions to obtain second rendering data; the rendering environment of the target virtual machine is the same as that of the first device.
[0311] The second device sends the second rendering data to the first device; the second rendering data is used by the first device to send the second rendering data as target rendering data when it receives the second rendering data but does not receive the first rendering data, and the first rendering data is the data obtained by the first device rendering the target image.
[0312] For details regarding the execution method of the processor 1302, please refer to the above. Figure 8 , Figure 9 , Figure 10 This will not be elaborated upon here.
[0313] The electronic device 130 in this embodiment is as described above. Figure 8 , Figure 9 , Figure 10 The second device in the method embodiment shown.
[0314] Correspondingly, the processor 1302 can call the computer program stored in the memory 1301, and can also be used to execute the above-mentioned... Figure 12 The specific details of the method steps performed by each unit in the rendering apparatus 120 shown can be found in the above description. Figure 12 This will not be elaborated upon here.
[0315] exist Figure 13 In the described electronic device 130, distributed rendering based on the connection between the light device and the rich device allows the rendering capability of the rich device to replace the rendering of the light device. At the same time, the light device itself is also rendering the same scene. The rendering data of the two are written to the display module through a competition mechanism, thereby solving the problem of complex image rendering stuttering or even failure to display on the light device, and realizing high-performance rendering of the light device.
[0316] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run on one or more processors, it can perform the above-mentioned tasks. Figure 4 , Figure 8 , Figure 9 , Figure 10 The method shown.
[0317] This application also provides a computer program product, which includes a computer program. When the computer program product runs on a processor, it can achieve the above-mentioned... Figure 4 , Figure 8 , Figure 9 , Figure 10 The method shown.
[0318] This application also provides a chip, which includes a processor for executing instructions. When the processor executes the instructions, it can achieve the above-mentioned... Figure 4 , Figure 8 , Figure 9 , Figure 10 The method shown. Optionally, the chip also includes a communication interface for inputting or outputting signals.
[0319] This application also provides a system that includes at least one rendering device 110, rendering device 120, electronic device 130, or chip as described above.
[0320] In summary, this application achieves high-performance rendering of light devices by using distributed rendering based on the connection between light and rich devices, where the rendering capabilities of rich devices replace those of light devices. At the same time, the light devices themselves are also rendering the same scene. The rendering data of both devices is written to the display module through a competition mechanism, thereby solving the problem of lag or even failure to display complex images on light devices and achieving high-performance rendering of light devices.
[0321] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by hardware related to a computer program. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing computer program code, such as read-only memory (ROM) or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A rendering method, characterized in that, include: The first device sends rendering instructions to the second device; The rendering command is used to instruct the second device to render the target image; The first device renders the target image; The first device sends the target rendering data to the display. The target rendering data is either the rendering data of the second device obtained preferentially by the first device, or the rendering data of the first device obtained preferentially. Sending the target rendering data to the display includes: If the first device completes rendering and obtains the first rendering data, but does not receive the second rendering data sent by the second device, the first rendering data is sent as the target rendering data for display; the first rendering data is the data obtained by the first device rendering the target image, and the second rendering data is the data obtained by the second device rendering the target image; Alternatively, if the second rendering data is received from the second device and the first device has not received the first rendering data, the second rendering data may be sent as the target rendering data for display.
2. The method according to claim 1, characterized in that, Before sending the rendering command to the second device, the method further includes: Send a synchronization request to the second device, the synchronization request being used to request that the second device be in a synchronized state with the first device; Sending rendering instructions to the second device includes: Upon receiving synchronization feedback from the second device, the rendering command is sent to the second device; the synchronization feedback indicates that the second device and the first device are in a synchronized state.
3. The method according to claim 2, characterized in that, The synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the second device start synchronizing, and the current page information of the first device is used to indicate the state of the second device synchronizing to the first device.
4. The method according to any one of claims 1 to 3, characterized in that, The rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the first device; the rendering information includes information for rendering the target image, which is used by the second device to render the target image.
5. The method according to any one of claims 1 to 4, characterized in that, The computing power of the second device is higher than that of the first device.
6. A rendering method, characterized in that, include: The second device receives a rendering instruction sent by the first device, the rendering instruction being used to instruct the second device to render the target image; The target virtual machine of the second device renders the target image according to the rendering instructions to obtain second rendering data; the rendering environment of the target virtual machine is the same as that of the first device. The second device sends the second rendering data to the first device; The second rendering data is used by the first device to send the second rendering data as target rendering data when the first device receives the second rendering data but does not obtain the first rendering data. The first rendering data is the data obtained by the first device rendering the target image.
7. The method according to claim 6, characterized in that, Before receiving the rendering instructions sent by the first device, the method further includes: Receive a synchronization request sent by the first device; the synchronization request is used to request the second device to be in a synchronized state with the first device; Based on the synchronization request, construct the target virtual machine; Synchronize the target virtual machine to the state of the first device; A synchronization feedback is sent to the first device, the synchronization feedback being used to indicate that the second device is in a synchronized state with the first device.
8. The method according to claim 7, characterized in that, The synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the second device start synchronizing, and the current page information of the first device is used to indicate the state of the second device synchronizing to the first device; The process of synchronizing the target virtual machine to the state of the first device includes: Based on the current page information of the first device, the target virtual machine is synchronized to the state of the first device.
9. The method according to any one of claims 6 to 8, characterized in that, The rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the first device; the rendering information includes information for rendering the target image, which is used by the second device to render the target image. The step of rendering the target image according to the rendering instruction to obtain the second rendering data includes: Based on the verification information, verify that the second device and the first device are in a synchronized state; The target image is rendered based on the rendering information to obtain the second rendering data.
10. A rendering apparatus, characterized in that, include: The sending unit is used to send rendering instructions to the second device; The rendering command is used to instruct the second device to render the target image; A rendering unit is used to render the target image; The display unit is used to display the target rendering data; The target rendering data is either the rendering data of the second device obtained preferentially by the rendering device, or the rendering data of the rendering device obtained preferentially. The display unit is specifically used to display the first rendering data as the target rendering data when the rendering device completes rendering and obtains the first rendering data, but has not received the second rendering data sent by the second device. The first rendering data is the data obtained by the rendering device rendering the target image, and the second rendering data is the data obtained by the second device rendering the target image; Alternatively, the display unit may be further configured to display the second rendering data as the target rendering data when it receives the second rendering data sent by the second device and the rendering device has not obtained the first rendering data.
11. The apparatus according to claim 10, characterized in that, The sending unit is further configured to send a synchronization request to the second device, the synchronization request being used to request the second device to be in a synchronized state with the rendering device; The sending unit is specifically used to send the rendering command to the second device upon receiving the synchronization feedback sent by the second device; the synchronization feedback is used to indicate that the second device and the rendering device are in a synchronized state.
12. The apparatus according to claim 11, characterized in that, The synchronization request includes a first timestamp and the current page information of the rendering device; the first timestamp is used to indicate the time when the rendering device and the second device start synchronizing, and the current page information of the rendering device is used to indicate the state of the second device synchronizing to the rendering device.
13. The apparatus according to any one of claims 10 to 12, characterized in that, The rendering instruction includes verification information and rendering information; the verification information is used by the second device to verify that it is in a synchronized state with the rendering device; the rendering information includes information for rendering the target image, which is used by the second device to render the target image.
14. The apparatus according to any one of claims 10 to 13, characterized in that, The computing power of the second device is higher than that of the rendering device.
15. A rendering apparatus, characterized in that, include: A receiving unit is configured to receive a rendering instruction sent by a first device, the rendering instruction being used to instruct the rendering device to render a target image; A rendering unit is used to render the target image according to the rendering instructions to obtain second rendering data; The rendering environment of the rendering unit is the same as that of the first device. A sending unit is configured to send the second rendering data to the first device; The second rendering data is used by the first device to send the second rendering data as target rendering data when the first device receives the second rendering data but does not obtain the first rendering data. The first rendering data is the data obtained by the first device rendering the target image.
16. The apparatus according to claim 15, characterized in that, The device further includes: The receiving unit is further configured to receive a synchronization request sent by the first device; the synchronization request is used to request that the rendering device be in a synchronized state with the first device; A construction unit is used to construct the target virtual machine according to the synchronization request; A synchronization unit is used to synchronize the target virtual machine to the state of the first device; The sending unit is further configured to send synchronization feedback to the first device, the synchronization feedback being used to indicate that the rendering device and the first device are in a synchronized state.
17. The apparatus according to claim 16, characterized in that, The synchronization request includes a first timestamp and the current page information of the first device; the first timestamp is used to indicate the time when the first device and the rendering device start synchronizing, and the current page information of the first device is used to indicate the state of the rendering device synchronizing to the first device. The synchronization unit is specifically used to synchronize the target virtual machine to the state of the first device based on the current page information of the first device.
18. The apparatus according to any one of claims 15 to 17, characterized in that, The rendering instruction includes verification information and rendering information; the verification information is used by the rendering device to verify that it is in a synchronized state with the first device. The rendering information includes information for rendering the target image, used by the rendering device to render the target image; the device further includes: A verification unit is used to verify, based on the verification information, that the rendering device and the first device are in a synchronized state. The rendering unit is specifically used to render the target image according to the rendering information to obtain the second rendering data.
19. A rendering apparatus, characterized in that, include: Processor and memory; The memory is used to store computer-executed instructions; The processor is configured to execute computer execution instructions stored in the memory to cause the rendering apparatus to perform the method as described in any one of claims 1 to 5 or the method as described in any one of claims 6 to 9.
20. A computer-readable storage medium, characterized in that, include: The computer-readable storage medium is used to store instructions or computer programs; When the instructions or the computer program are executed, the method as described in any one of claims 1 to 5 or the method as described in any one of claims 6 to 9 is implemented.
21. A computer program product, characterized in that, include: Instructions or computer programs; When the instructions or the computer program are executed, the method as described in any one of claims 1 to 5 or the method as described in any one of claims 6 to 9 is implemented.
22. A rendering system, characterized in that, The rendering apparatus includes any one of claims 10 to 14, or any one of claims 15 to 18, or the rendering apparatus of claim 19.
Citation Information
Patent Citations
Three-dimensional figure and image multi-screen synchronous broadcasting method, device and system
CN103491317A
GUI rendering display method, terminal, server, electronic equipment and storage medium
CN112614202A
