Search

CN-121988042-A - Picture generation method and device

CN121988042ACN 121988042 ACN121988042 ACN 121988042ACN-121988042-A

Abstract

The application provides a picture generation method and device. The method comprises the steps of obtaining a resource release time interval, periodically releasing resources in a resource pool based on the resource release time interval, wherein the resources are used for generating a picture, and generating a target picture requested to be generated by the picture generation request by utilizing the target resources released from the resource pool when the picture generation request is received. The method can avoid or reduce picture blocking while avoiding picture tearing.

Inventors

  • CAI CHANGLI
  • Ma haichuan
  • DING WENPENG
  • LEI GANG
  • HU BIN

Assignees

  • 华为云计算技术有限公司

Dates

Publication Date
20260508
Application Date
20241108

Claims (17)

  1. 1. A picture generation method, the method being applied to a picture generation apparatus, the method comprising: Acquiring a resource release time interval; Periodically releasing resources in a resource pool based on the resource release time interval, wherein the resources are used for generating pictures; when a screen generation request is received, generating a target screen requested to be generated by the screen generation request by using target resources released from the resource pool.
  2. 2. The method of claim 1, wherein the picture generation device is in communication with a storage space for storing pictures generated by the picture generation device and the pictures in the storage space are read and displayed by a picture display device, wherein the acquiring the resource release time interval comprises: And based on the interval duration of the two adjacent pictures read from the storage space by the picture display device, obtaining the resource release time interval.
  3. 3. The method of claim 2, wherein the storage space is located at a remote end of the picture generation device, the method further comprising transmitting the target picture to the storage space over a network.
  4. 4. A method according to claim 2 or 3, wherein said periodically releasing resources in a resource pool based on said resource release time interval comprises: Acquiring a first time length required by the picture generation device to generate a picture historically; Obtaining a resource release time based on the first time and a refresh time, wherein the refresh time is a time when the picture display device reads pictures from the storage space, the resource release time is earlier than the refresh time by a second time, the second time is longer than or equal to the first time, and the second time is shorter than the time of the resource release time interval; And periodically releasing the resources in the resource pool according to the resource release time interval by taking the resource release time as the starting time.
  5. 5. The method of any of claims 1-4, wherein the screen generation request is user-triggered; the generating, when receiving a screen generation request, a target screen requested to be generated by the screen generation request using a target resource released from the resource pool, including: And if all the resources released from the resource pool at the receiving moment of the picture generation request are in a non-idle state and the receiving moment is between two adjacent resource release moments, reducing the time interval between the two adjacent resource release moments.
  6. 6. The method of claim 5, wherein the narrowing the time interval between the two adjacent resource release times comprises: When the time difference between the receiving time and the subsequent resource release time of the two adjacent resource release times is greater than or equal to a first duration, updating the subsequent resource release time to the receiving time; Wherein the first time period is a time period historically required by the picture generation device to generate a picture.
  7. 7. The method according to any one of claims 1-6, wherein generating the target picture requested to be generated by the picture generation request by using the target resource released from the resource pool comprises rendering and/or synthesizing by using the target resource to obtain the target picture.
  8. 8. A picture generation apparatus, characterized in that the apparatus comprises: the acquisition module is used for acquiring the resource release time interval; the release module is used for periodically releasing the resources in the resource pool based on the resource release time interval, wherein the resources are used for generating pictures; And the generation module is used for generating a target picture requested to be generated by the picture generation request by utilizing the target resources released from the resource pool when the picture generation request is received.
  9. 9. The apparatus of claim 8, wherein the picture generation means is in communication with a storage space for storing pictures generated by the picture generation means and the pictures in the storage space are for reading and display by a picture display means, the acquisition module being configured to: And based on the interval duration of the two adjacent pictures read from the storage space by the picture display device, obtaining the resource release time interval.
  10. 10. The apparatus of claim 9, wherein the storage space is located at a remote end of the frame generation means, and wherein the generation module is further configured to send the target frame to the storage space over a network.
  11. 11. The apparatus of claim 9 or 10, wherein the release module is configured to: Acquiring a first time length required by the picture generation device to generate a picture historically; Obtaining a resource release time based on the first time and a refresh time, wherein the refresh time is a time when the picture display device reads pictures from the storage space, the resource release time is earlier than the refresh time by a second time, the second time is longer than or equal to the first time, and the second time is shorter than the time of the resource release time interval; And periodically releasing the resources in the resource pool according to the resource release time interval by taking the resource release time as the starting time.
  12. 12. The apparatus according to any one of claims 8-11, wherein the screen generation request is user-triggered; The generating module is used for: And if all the resources released from the resource pool at the receiving moment of the picture generation request are in a non-idle state and the receiving moment is between two adjacent resource release moments, reducing the time interval between the two adjacent resource release moments.
  13. 13. The apparatus of claim 12, wherein the generating module is configured to: When the time difference between the receiving time and the subsequent resource release time of the two adjacent resource release times is greater than or equal to a first duration, updating the subsequent resource release time to the receiving time; Wherein the first time period is a time period historically required by the picture generation device to generate a picture.
  14. 14. The apparatus according to any one of claims 8-13, wherein the generating module is configured to render and/or synthesize the target frame using the target resource.
  15. 15. A cluster of computing devices, comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in a memory of the at least one computing device to cause the cluster of computing devices to perform the method of any of claims 1-7.
  16. 16. A computer readable storage medium comprising computer program instructions which, when executed by a cluster of computing devices, perform the method of any of claims 1-7.
  17. 17. A computer program product comprising instructions which, when executed by a cluster of computer devices, cause the cluster of computer devices to perform the method of any of claims 1-7.

Description

Picture generation method and device Technical Field The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a picture. Background In real-time interactive scenes, the picture display of the display screen is affected by the stability of picture generation. With increasing abundance of computing resources, the picture generation rate is faster and faster, resulting in a picture generation rate that may be greater than the refresh rate of the display screen. The picture generation rate is larger than the refresh rate of the display screen, which causes problems such as picture tearing. In the related art, in order to avoid tearing of a screen, generation of the screen is controlled by a control signal. In this technique, the generation of a screen is started every time a control signal is issued. The sending frequency of the control signal is not greater than the refreshing frequency of the display screen, so that the frame generation rate is not greater than the refreshing rate of the display screen, and frame tearing is avoided. But this technique increases the latency of picture generation. For example, when the reception timing of the screen generation request is between the emission timings of the two control signals, it is necessary to wait until the next control signal of the two control signals is emitted, and then start generating the screen requested to be generated by the screen generation request, which increases the delay of screen generation. When the receiving rate of the picture generation request is low, the delay may cause problems such as picture jamming. Disclosure of Invention The application provides a picture generation method and a picture generation device, which can avoid or reduce picture blocking while avoiding picture tearing. In a first aspect, a method for generating a picture is provided, and the method is applied to a picture generation device, and comprises the steps of acquiring a resource release time interval, periodically releasing resources in a resource pool based on the resource release time interval, wherein the resources are used for generating a picture, and generating a target picture requested to be generated by the picture generation request by using target resources released from the resource pool when the picture generation request is received. Wherein the resource release time interval may reflect an upper limit of the picture generation rate. The smaller the resource release time interval, the higher the upper limit of the picture generation rate. The larger the resource release time interval, the lower the upper limit of the generation rate of the picture. The method controls the release rate of resources required by the picture generation through the resource release time interval, and realizes the control of the picture generation rate, wherein the control ensures that the picture generation rate is not higher than the upper limit of the picture generation rate, thereby, even when the picture generation request receiving rate is too high, the picture generation rate is not too high, and the picture tearing caused by that the picture generation rate is larger than the refresh rate of the display device can be avoided. Meanwhile, the resources released from the resource pool are used for generating the picture, and if the receiving rate of the picture generation request is lower than the release rate of the resources, the released resources are in an idle state and can be used for generating the picture at any time. In this case, the generation of the picture can be started immediately every time the picture generation request is received, thereby reducing the time delay of picture generation and avoiding or reducing picture jamming. In short, the method provided by the application can avoid or reduce picture blocking while avoiding picture tearing. In one possible implementation, the picture generation device is in communication with a storage space, the storage space is used for storing pictures generated by the picture generation device, the pictures in the storage space are read and displayed by a picture display device, and the resource release time interval is obtained by reading interval duration of two adjacent pictures from the storage space based on the picture display device. The resource release time interval is consistent with the interval duration of two adjacent pictures read from the storage space by the picture display device. Illustratively, the resource release time interval is equal to the interval duration of the picture display device reading two adjacent pictures from the memory space. The interval duration of the picture display device reading two adjacent pictures from the memory space represents the refresh rate of the picture display device. In the implementation manner, the resource release time interval is obtained based on the interval duration of two