Resource management method and device

By managing resources in target containers in ray tracing technology and sharing object resources in resource fields, frame rate and stability problems in complex scenes are solved, and more efficient rendering and resource utilization are achieved.

CN119201465APending Publication Date: 2024-12-27VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411362264.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing ray tracing technology leads to reduced picture frame rate and poor application stability in complex scenarios, mainly due to the repeated creation of accelerated structures and excessive memory usage.

Method used

By managing objects with created and uncreated resources in the target container, using objects with the same resource fields to share resources, avoiding repeated creation of accelerated structures, and improving resource utilization and rendering efficiency.

Benefits of technology

Improves the frame rate and application stability of the rendered picture of the ray tracing method, reducing the risk of memory overflow and the time consumption of repeatedly creating accelerated structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201465A_ABST
    Figure CN119201465A_ABST
Patent Text Reader

Abstract

The invention discloses a resource management method and device, and belongs to the technical field of electronics. The method comprises the steps of obtaining a to-be-rendered first object and a first resource field in a first scene, wherein the first resource field is used for indicating resources required for rendering the first object; based on the first resource field, a second object is obtained from at least one object in the first target container, the first object is added to a second target container, each object in the at least one object corresponds to one resource field, and the resource field corresponding to the second object is the same as the first resource field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electronic technology, and specifically relates to a resource management method and device thereof. Background Art

[0002] With the development of technology, users have higher and higher requirements for the authenticity of electronic device images. For example, in many fields such as games, videos, virtual reality (VR) or augmented reality (AR), design visualization, etc., the pursuit of higher authenticity to improve display effects has become an inevitable trend. Electronic devices can improve the authenticity of the image through ray tracing technology to improve the display effect of the electronic device image.

[0003] The acceleration structure (AS) used in the current commonly used ray tracing technology is the bounding volume hierarchy (BVH), which divides the scene into a bounding box tree structure, including two levels: the top-level acceleration structure (TLAS) and the bottom-level acceleration structure (BLAS). Among them, BLAS is used to store the information of the triangular facets corresponding to the geometric model in the local space. TLAS is the organizational structure of the entire scene in world coordinates, which contains instances of all objects in the entire scene. Each instance consists of BLAS and the corresponding world coordinate transformation matrix.

[0004] However, TLAS contains instances of all objects in the entire scene. When there are many objects in the scene, it will take up a lot of memory, which can easily lead to a decrease in the frame rate or application crash. And as the perspective moves or the animation of the object changes, AS needs to be created repeatedly, which takes a lot of time and reduces the frame rate. As a result, the existing ray tracing method leads to a low frame rate and poor application stability. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a resource management method and device thereof, which can improve the frame rate and application stability of the image rendered by the ray tracing method.

[0006] In a first aspect, an embodiment of the present application provides a resource management method, the method comprising: obtaining a first object to be rendered in a first scene and a first resource field, the first resource field being used to indicate resources required for rendering the first object; based on the first resource field, obtaining a second object from at least one object in a first target container, and adding the first object to the second target container, each object in the at least one object corresponds to a resource field, and the resource field corresponding to the second object is the same as the first resource field; wherein the first target container is the first container, and the second target container is the second container; or, the first target container is the third container, and the second target container is the first container; the first container includes at least one object for which resources have been created and rendered in the first scene, the second container includes objects for which resources have not been created and rendered in the first scene, and the third container includes at least one object for which resources have been created and removed in the first scene.

[0007] In a second aspect, an embodiment of the present application provides a resource management device, which includes: an acquisition module. The acquisition module is used to acquire a first object to be rendered in a first scene and a first resource field, and the first resource field is used to indicate the resources required for rendering the first object. The acquisition module is also used to acquire a second object from at least one object in a first target container based on the first resource field, and add the first object to the second target container, each object in the at least one object corresponds to a resource field, and the resource field corresponding to the second object is the same as the first resource field. Wherein, the above-mentioned first target container is a first container, and the above-mentioned second target container is a second container; or, the first target container is a third container, and the above-mentioned second target container is a first container; the above-mentioned first container includes the at least one object that has created resources and has been rendered in the first scene, the above-mentioned second container includes the object that has not created resources and has been rendered in the first scene, and the above-mentioned third container includes the at least one object that has created resources and has been removed in the first scene.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0012] In an embodiment of the present application, a first object to be rendered in a first scene and a first resource field for indicating resources required for rendering the first object can be obtained, and then based on the first resource field, a second object corresponding to the same resource field as the first resource field is obtained from at least one object in a first target container, and the first object is added to the second target container, wherein the first target container is a first container and the second target container is a second container, or the first target container is a third container and the second target container is the first container, the first container includes at least one object whose resources have been created and rendered in the first scene, the second container includes objects whose resources have not been created and rendered in the first scene, and the third container includes at least one object whose resources have been created and removed in the first scene. In this solution, all objects can be placed in three containers. Since the first target container is the first container or the third container, the first container and the third container respectively store at least one object of the created resource, and each object corresponds to a resource field. Therefore, based on the field corresponding to the resource required for the first object rendering, the second object corresponding to the same resource field as the field can be selected from the first target container, so that the first object can be directly rendered using the resources of the second object without creating resources for the first object, avoiding the consumption of more memory for creating resources, and reducing the risk of memory overflow leading to reduced frame rate or application crash. In addition, since the AS needs to be recreated during the object rendering process, and the first object and the second object use the same resource, when creating the BLAS in the AS for the first object, the BLAS of the second object can be used without creating the BLAS corresponding to the first object, reducing the time required to recreate the AS, so that more time can be used to render the picture to improve the picture frame rate. In this way, the frame rate of the picture rendered by the ray tracing method and the application stability can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is one of the flow charts of the resource management method provided in the embodiment of the present application;

[0014] Figure 2 This is the second flowchart of the resource management method provided in the embodiment of the present application;

[0015] Figure 3 This is the third flowchart of the resource management method provided in the embodiment of the present application;

[0016] Figure 4 is a schematic diagram of an example of an object being removed provided in an embodiment of the present application;

[0017] Figure 5 is a schematic diagram of the structure of a resource management device provided in an embodiment of the present application;

[0018] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0019] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0022] The terms "at least one (item)", "at least one of" and the like in this application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0023] The resource management method and device provided in the embodiment of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0024] The embodiments of the present application can be applied to a scene in which an electronic device uses a ray tracing method to render an object in a screen. Specifically, when an electronic device uses a ray tracing method to render an arbitrary screen, the object to be displayed in the screen changes due to reasons such as the movement of the viewing angle of the screen or the animation effect of the object in the screen, so that the electronic device re-renders the scene of the object to be displayed in the screen. For example, the scene can be a variety of scenes such as games, videos, VR or AR, and design visualization.

[0025] For example, taking a game scene as an example, an electronic device displays a game screen of a racing game, and the racing game uses ray tracing technology to enhance the authenticity of the game screen. The displayed content in the screen includes objects such as the player's vehicle, road scenery, dashboard, and operation controls. The user performs touch input on the operation controls, so that the player's vehicle, road scenery, dashboard, and other objects displayed in the screen need to change. The electronic device needs to re-render the objects in the screen to display the changed objects in the screen with a ray tracing effect.

[0026] Another example is to take a VR scene as an example. The electronic device displays a virtual room scene, and the room scene uses ray tracing technology to enhance the authenticity of the picture. The display content in the picture includes objects such as sofas, tables, and computers. The user uses somatosensory input to rotate the picture angle, and new objects such as bookshelves and beds need to be displayed. The electronic device needs to render new objects such as bookshelves and beds to display these objects in the picture using ray tracing technology.

[0027] The AS used in the current commonly used ray tracing technology is the BVH structure, including TLAS and BLAS. Among them, BLAS is used to store the information of the triangular facets corresponding to the geometric model in the local space. TLAS is the organizational structure of the entire scene in the world coordinate system, which contains instances of all objects in the entire scene. Each instance consists of BLAS and the corresponding world coordinate transformation matrix.

[0028] However, when there are many objects in the scene, a large amount of memory will be occupied, which may lead to a decrease in the frame rate or application crash. In addition, as the perspective moves or the animation of the object changes, the AS needs to be created repeatedly, which takes a lot of time and reduces the frame rate. As a result, the existing ray tracing method leads to a low frame rate and poor application stability.

[0029] The embodiment of the present application provides a resource management method and device thereof. Since at least one object of created resources is stored in the target container, and each object corresponds to a resource field, the electronic device can select a second object corresponding to the same resource field as the field from the target container based on the field corresponding to the resource required for rendering the first object, so that the electronic device can directly use the resources of the second object to render the first object without creating resources for the first object, thereby avoiding the consumption of more memory for creating resources and reducing the risk of reduced frame rate or application crash due to memory overflow. In addition, since the AS needs to be recreated during the object rendering process, and the first object and the second object use the same resource, when the electronic device creates the BLAS in the AS for the first object, the BLAS of the second object can be used without creating the BLAS corresponding to the first object, thereby reducing the time required to recreate the AS, so that more time can be used to render the picture to improve the picture frame rate. In this way, the frame rate and application stability of the picture rendered by the ray tracing method can be improved.

[0030] The resource management method provided in the embodiment of the present application may be executed by a resource management device, which may be an electronic device, or a functional module or functional entity in the electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0031] Figure 1 A flow chart of a resource management method provided by an embodiment of the present application is shown. Figure 1 As shown, the resource management method provided in the embodiment of the present application may include the following steps 201 to 202.

[0032] Step 201: The electronic device obtains a first object and a first resource field to be rendered in a first scene.

[0033] In the embodiment of the present application, the first resource field may be used to indicate the resources required for rendering the first object.

[0034] Optionally, in an embodiment of the present application, the above-mentioned first scene may include but is not limited to any of the following scenes: a game screen scene, a video screen scene, a VR screen scene or an AR screen scene, a design visualization screen scene, etc.

[0035] In the embodiment of the present application, the first scene includes one or more objects. For example, the first scene may be a screen scene in a game, and the screen scene includes one or more objects. It should be noted that the object may be understood as an entity contained in the scene.

[0036] It should be noted that in ray tracing rendering, each object is unique, and even if multiple objects look the same, they are treated independently in actual processing. For example, the models and textures of two objects are exactly the same, but their positions, rotations, and scale information in the scene can be different.

[0037] Optionally, in an embodiment of the present application, the first object to be rendered may be an object newly added to the scene that needs to be rendered by the electronic device due to reasons such as perspective rotation or animation effects of objects in the scene, or may be an object that has been rendered in the scene but has changed due to reasons such as animation effects, resulting in the need to re-render using new resources.

[0038] For example, taking a game scene as an example, an electronic device displays a game screen of a racing game, and the racing game uses ray tracing technology to enhance the authenticity of the game screen. The displayed content in the screen includes objects such as the player's vehicle, road scenery, dashboard, and operation controls. The user performs touch input on the operation controls, so that the player's vehicle, road scenery, dashboard, and other objects displayed in the screen need to change. The electronic device needs to re-render the player's vehicle, road scenery, dashboard, and other objects to display the changed objects in the screen with a ray tracing effect.

[0039] Another example is to take a VR scene as an example. The electronic device displays a virtual room scene, and the room scene uses ray tracing technology to enhance the authenticity of the picture. The display content in the picture includes objects such as sofas, tables, and computers. The user uses somatosensory input to rotate the picture perspective, and new objects such as bookshelves and beds need to be displayed. The electronic device needs to render the newly added objects such as bookshelves and beds to display them in the picture using ray tracing technology.

[0040] Optionally, in the embodiment of the present application, the first resource field may be a unique identifier assigned by the electronic device to the resource, or a hash value of the resource content, or a resource descriptor, resource metadata, etc. The specifics may be determined according to actual usage requirements, and the embodiment of the present application does not limit this.

[0041] Optionally, in an embodiment of the present application, the above-mentioned resources may include at least one of the following: model, mesh, material, texture, animation, skeleton, physical property, etc.

[0042] Step 202: The electronic device obtains a second object from at least one object in the first target container based on the first resource field, and adds the first object to the second target container.

[0043] In the embodiment of the present application, the target container includes at least one object of the created resource, each of the at least one object corresponds to a resource field. The resource field corresponding to the second object is the same as the first resource field.

[0044] In the embodiment of the present application, the first target container is the first container, and the second target container is the second container; or, the first target container is the third container, and the second target container is the first container.

[0045] In an embodiment of the present application, the first container includes resources that have been created and at least one object that has been rendered in the first scene, the second container includes resources that have not been created and objects that have been rendered in the first scene, and the third container includes resources that have been created and at least one object that has been removed in the first scene.

[0046] In the embodiment of the present application, the above-mentioned object with created resources can be understood as: the electronic device has allocated memory for it to store its data and has created a BLAS object for it, that is, the object has its own resources and acceleration structure. This object is independent and has its own copy of resources, so there will be performance consumption and memory usage when it is created and destroyed.

[0047] In the embodiment of the present application, the above-mentioned objects for which resources have been created and rendered in the first scene can be understood as: objects that have been rendered in the screen scene currently displayed by the electronic device and have resources.

[0048] In an embodiment of the present application, the above-mentioned objects that have not created resources and have been rendered in the first scene can be understood as: objects that have been rendered in the screen scene currently displayed by the electronic device and have not created resources, that is, objects that are rendered by sharing resources of other objects.

[0049] In the embodiment of the present application, the above-mentioned object for which resources have been created and removed in the first scene can be understood as: an object that has been displayed by the electronic device and is not currently displayed on the screen of the electronic device.

[0050] In the embodiment of the present application, the resource field corresponding to each of the above objects can be used to indicate the resources required for rendering each object.

[0051] Optionally, in an embodiment of the present application, the resource field corresponding to each of the above objects may be a unique identifier assigned to the resource by the electronic device, or may be a hash value of the resource content, or may be a resource descriptor, resource metadata, etc.

[0052] It should be noted that, in the process of ray tracing rendering by an electronic device, whenever an object is rendered, memory needs to be allocated for it to store its data, such as model mesh data, textures, material properties, animation status, etc. And it is also necessary to create a BLAS for the object, that is, to build an acceleration structure based on the geometric data of the object (such as vertices, triangles, etc.), so that the intersection test between the light and the scene can be performed more quickly, thereby improving the ray tracing performance. The resources described in the embodiments of the present application may include the above-mentioned data stored for the object and the created BLAS.

[0053] Optionally, in an embodiment of the present application, the electronic device may render the first object based on resources of the second object.

[0054] Optionally, in an embodiment of the present application, the electronic device may use a depth map to cull pixels in the scene that do not require ray tracing rendering, and may perform ray tracing calculations only on pixels in the scene that can reflect light, thereby reducing the number of rays emitted by ray tracing, optimizing ray tracing rendering performance, and improving rendering efficiency.

[0055] Optionally, in the embodiment of the present application, the electronic device can use the pixel point in the scene that needs to be rendered by ray tracing as the starting point of the light, and through the camera position, the reflection plane, and the normal at the pixel point, the direction of the reflected light can be obtained according to the law of reflection. Therefore, only one ray needs to be emitted to obtain the reflection result, and there is no need to use the camera as the starting point of the light, and then emit the reflected light after hitting the pixel point of the reflection plane, which can save one ray, thereby improving rendering efficiency.

[0056] In an embodiment of the present application, when the second object is obtained from the first container, the first object can share the resources of the second object, so that the electronic device can add the first object to the second container, that is, the object that shares the resources of other objects for rendering can be added to the second container. When the second object is obtained from the third container, the first object can obtain ownership of the resources of the second object, that is, the resources of the second object are used as resources created by the first object, so that the electronic device can add the first object to the first container, that is, the object that has been rendered by the created resources can be added to the first container. In this way, the classification of objects of created resources is achieved, and the flexibility of object management is improved.

[0057] The embodiment of the present application provides a resource management method, which can put all objects in three containers. Since the first target container is the first container or the third container, the first container and the third container respectively store at least one object of the created resource, and each object corresponds to a resource field, so the electronic device can select the second object corresponding to the resource field with the same field as the field from the first target container based on the field corresponding to the resource required for the first object rendering, so that the electronic device can directly use the resources of the second object to render the first object without creating resources for the first object, avoiding the consumption of more memory for creating resources, and reducing the risk of memory overflow leading to reduced frame rate or application crash. In addition, since the AS needs to be recreated during the object rendering process, and the first object and the second object use the same resource, when the electronic device creates the BLAS in the AS for the first object, the BLAS of the second object can be used, without creating the BLAS corresponding to the first object, reducing the time required to recreate the AS, so that more time can be used to render the picture to improve the picture frame rate. In this way, the frame rate and application stability of the picture rendered by the ray tracing method can be improved.

[0058] Optionally, in the embodiment of the present application, combined with Figure 1 ,like Figure 2 As shown, the "electronic device obtains the second object from at least one object in the first target container based on the first resource field" in the above step 202 can be implemented through the following step 202a, and before the "and adding the first object to the second target container" in the above step 202, the resource management method provided in the embodiment of the present application also includes the following step 202b.

[0059] Step 202a: The electronic device obtains the second object from the first container based on the first resource field.

[0060] In an embodiment of the present application, the electronic device can traverse all objects in the first container, compare whether the resource field corresponding to each object in the first container is the same as the first resource field, and determine the object whose corresponding resource field is the same as the first resource field as the second object.

[0061] Optionally, in an embodiment of the present application, when there are multiple resource fields that are the same as the first resource field in the first container, the electronic device may determine an object corresponding to any one of the multiple resource fields as the second object.

[0062] Step 202b: The electronic device sets the first pointer field of the first object to the first address.

[0063] In the embodiment of the present application, the first pointer field is used to point to the resource address for rendering the first object. The first address is the address of the resource for rendering the second object.

[0064] In the embodiment of the present application, the pointer field is used to point to the resource address of the object corresponding to the pointer field. When the pointer field of an object is empty, it indicates that the object has created resources. When the pointer field of an object is non-empty, it indicates that the object has not created resources, but shares resources of other objects (that is, the object shares resources from the resource address pointed to by the pointer field).

[0065] In this way, when the electronic device finds a second object corresponding to the same resource field as the first resource field from the first container, that is, when the electronic device finds a second object with the same resources as the first object and creates and renders the resources, the electronic device can set the first pointer field to the resource address for rendering the second object, so that the first object can share the resources of the second object without creating new resources, avoiding memory occupation caused by repeated storage of the same resources and time consumption for repeated creation of BLAS, reducing the risk of memory overflow leading to reduced frame rate or application crash, and improving the efficiency of creating resources, thereby improving the frame rate of the electronic device rendering the picture and the stability of the application.

[0066] Optionally, in the embodiment of the present application, when there is no resource field identical to the first resource field in the first container, the electronic device may obtain the second object from the third container.

[0067] It should be noted that the above step 202b is performed after the above step 202a.

[0068] Optionally, in the embodiment of the present application, combined with Figure 1 ,like Figure 3 As shown, the "electronic device obtains the second object from at least one object in the first target container based on the first resource field" in the above step 202 can be implemented through the following step 202c, and before the "and adding the first object to the second target container" in the above step 202, the resource management method provided in the embodiment of the present application also includes the following steps 202d and 202e.

[0069] Step 202c: The electronic device obtains the second object from the third container based on the first resource field.

[0070] In the embodiment of the present application, the electronic device can traverse all objects in the third container, compare whether the resource field corresponding to each object in the third container is the same as the first resource field, and determine the object whose corresponding resource field is the same as the first resource field as the second object.

[0071] Step 202d: The electronic device sets the resource address for rendering the first object to the first address, and sets the second pointer field of the second object to the first address.

[0072] In the embodiment of the present application, the first address is the address of the resource for rendering the second object, and the second pointer field is used to point to the resource address for rendering the second object.

[0073] In the embodiment of the present application, the above resource address is the address of the resource that the object corresponding to the resource address has created. When the resource address of an object is empty, it indicates that the object has not created a resource. When the resource address of an object is non-empty, it indicates that the object has created a resource, that is, the resource corresponding to the resource address.

[0074] In the embodiment of the present application, the electronic device can set the resource address for rendering the first object to the resource address for rendering the second object, so that the first object can use the resource of the second object as the resource created by the first object, that is, the first object obtains the ownership of the resource of the second object. Then the electronic device can set the second pointer field to the address of the resource of the second object.

[0075] It can be understood that before the electronic device sets the second pointer field to the address of the resource of the second object, since the second object is an object in the third container, that is, the second object is an object that has created resources, the second pointer field is empty, which is used to indicate that the second object has created resources. After the electronic device sets the second pointer field to the address of the resource of the second object, the second pointer field is non-empty, which indicates that the second object has not created resources, but shares resources of other objects (that is, resources of the first object that has acquired ownership of the resources of the second object).

[0076] It should be noted that the pointer field being empty means that the address of the resource is not written into the pointer field, which can be represented as null. The pointer field being non-empty means that the address of the resource is written into the pointer field.

[0077] Optionally, in the embodiment of the present application, when there is a pointer field of at least one object in the second container pointing to a resource address for rendering the second object, the pointer field of the at least one object is updated to point to the resource address for rendering the first object.

[0078] Step 202e: The electronic device deletes the second object from the third container.

[0079] In an embodiment of the present application, the electronic device can set the second pointer field of the second object to non-empty, so that when the electronic device deletes the second object, it can determine the second object as an object that does not create resources but shares resources of other objects, so that the electronic device can completely delete the second object.

[0080] In this way, when the electronic device finds a second object corresponding to the same resource field as the first resource field from the third container, that is, when the electronic device finds a second object that has the same resource as the first object and has created the resource but removed, the electronic device can set the resource address for rendering the first object to the address of the resource of the second object, so that the first object can obtain ownership of the resource of the second object without creating new resources, avoiding memory usage caused by repeated storage of the same resources and time consumption for repeated creation of BLAS, reducing the risk of memory overflow leading to reduced frame rate or application crash, and improving the efficiency of creating resources, thereby improving the frame rate of the electronic device rendering the screen and the stability of the application.

[0081] It should be noted that the above steps 202d and 202e are performed after the above step 202c.

[0082] Optionally, in an embodiment of the present application, the resource management method provided in the embodiment of the present application may further include the following steps 501 and 502, or may further include the following steps 501 and 503.

[0083] Step 501: The electronic device obtains a third object removed from a first scene and a third pointer field of the third object.

[0084] In the embodiment of the present application, the third pointer field is used to point to the resource address for rendering the third object.

[0085] Optionally, in an embodiment of the present application, the third object removed from the first scene may be an object that has been rendered in the first scene but is removed from the scene and does not need to be further rendered due to reasons such as viewing angle rotation or animation effects of objects in the scene.

[0086] For example, Figure 4 As shown in (a) of FIG. 1 , the first scene includes a ball 10, a cube 11, and a triangular pyramid 12. The user rotates the viewing angle of the virtual camera 13, as shown in FIG. Figure 4 As shown in (b) in the figure, the pyramid 12 is beyond the viewing angle of the virtual camera 13, and the pyramid 12 is no longer displayed in the screen of the electronic device, that is, the pyramid 12 is removed from the first scene, so that the electronic device does not need to continue to render the pyramid 12.

[0087] For example, in a game scene, the electronic device displays a game screen of a shooting game, and the shooting game uses ray tracing technology to enhance the realism of the game screen. The displayed content in the screen includes objects such as player characters, buildings, wooden boxes, and guns. The user inputs the electronic device to rotate the viewing angle of the screen display, and the wooden boxes and guns are no longer displayed in the screen, that is, the wooden boxes and guns are removed from the first scene, and the electronic device does not need to continue to render the wooden boxes and guns.

[0088] Step 502: When the third pointer field is empty, the electronic device adds the third object to the third container.

[0089] It can be understood that, when the third object is removed, if the third pointer field is empty, the electronic device can determine that the third object is an object of a created resource, so that the electronic device can add the third object to the third container.

[0090] In an embodiment of the present application, the electronic device can delay the destruction of ray tracing resources in the game, add the resources to be destroyed to a delayed destruction queue, and the corresponding resources are not actually destroyed. When the object is added again later, it can be directly restored from the delayed destruction queue to avoid repeated creation and destruction of object resources due to repeated movement of the perspective.

[0091] Step 503: When the third pointer field is not empty, the electronic device deletes the third object from the second container.

[0092] It can be understood that when the third object is removed, if the third pointer field is non-empty, the electronic device can determine that the third object is an object that shares resources of other objects, that is, the third object is in the second container, so the electronic device can delete the third object from the second container.

[0093] In this way, when a rendered object in the scene is removed, if the object is an object for which resources have been created, the electronic device may not delete the object, but add the object to a third container, so that when the object needs to be re-rendered, the resources of the object can be obtained from the third container, without the need to repeatedly create resources, thereby reducing the time and memory usage of creating resources, thereby improving the frame rate of the electronic device rendering screen and the stability of the application.

[0094] Optionally, in the embodiment of the present application, “adding the third object to the third container” in the above step 502 can be implemented by the following step 502a.

[0095] Step 502a: When the number of objects in the third container is greater than or equal to the first threshold, the electronic device deletes the object added earliest in the third container, and adds the third object to the third container.

[0096] Optionally, in the embodiment of the present application, the first threshold may be a default value of the electronic device or a preset value by the user. For example, the first threshold may be 50, 100, 200, etc. The specific value may be determined according to the actual memory size of the electronic device or the actual use requirements, and the embodiment of the present application does not limit this.

[0097] Exemplarily, taking the first threshold value of 100 as an example, when the electronic device adds the third object to the third container, assuming that the number of objects in the third container is 100, the electronic device can delete the object added earliest in the third container, so that the number of objects in the third container is 99, and the electronic device can add the third object to the third container.

[0098] It should be noted that the above steps 501 and 502 (or step 503) may be performed before the above step 201, or may be performed after the above step 203, and this embodiment of the present application does not limit this.

[0099] In this way, the electronic device can delete the object added earliest in the third container when the number in the third container reaches the first threshold, so that an appropriate number of objects can be stored in the third container according to the memory size of the electronic device, thereby avoiding the problem of memory occupation caused by too many objects in the third container. In addition, since the earliest added object has the lowest probability of re-rendering, the electronic device can delete the earliest added object, so that the third container retains objects with a high probability of re-rendering, thereby improving the reuse rate of resources.

[0100] Optionally, in the embodiment of the present application, the resource management method provided in the embodiment of the present application also includes the following step 601.

[0101] Step 601: When there is no second object in the target container, if the number of resources created in the first scene is greater than or equal to a second threshold, the electronic device creates resources for the first object in the second scene.

[0102] In the embodiment of the present application, the second scene is a scene after the first scene.

[0103] In the embodiment of the present application, when the second object does not exist in the target container, the electronic device can create resources for the first object. If the number of resources created in the first scene is greater than or equal to the second threshold, that is, the electronic device has created a large number of resources in this frame of the first scene, then the electronic device can create resources in the second scene after the first scene, that is, create resources for the first object in a frame of the scene after this frame.

[0104] In the embodiment of the present application, the second scene may be the next frame of the first scene. If, when creating resources for the first object in the second scene, the number of resources created in the second scene is still greater than or equal to the second threshold, the electronic device may create resources for the first object in the next frame of the second scene. Similarly, until a frame after the first scene creates resources for the first object, if the number of resources created is less than the second threshold, resources may be created for the first object in the frame.

[0105] Optionally, in the embodiment of the present application, the second threshold may be a default value of the electronic device or a preset value by the user. For example, the second threshold may be 20, 30, 50, etc. The specific value may be determined according to the actual use requirements of the electronic device, and the embodiment of the present application does not limit this.

[0106] In the embodiment of the present application, the electronic device can optimize the number of objects rendered by ray tracing in a single-frame scene to avoid performance fluctuations caused by too many objects rendered in a single frame. The rendered objects are added to the rendering queue, and the upper limit of the number of objects that can be rendered in a single frame is determined based on the number of geometric faces of the rendered objects and considering the performance requirements. Objects exceeding the number can be distributed to subsequent frames for processing.

[0107] In this way, when the electronic device needs to create resources for a large number of objects in a scene, the electronic device can create resources for a second threshold number of objects, thereby avoiding the problem of reduced frame rate caused by spending a lot of time creating resources in a scene.

[0108] It should be noted that the above step 601 is executed after the above step 201, and when the above step 202 and step 203 are executed, the above step 601 is not executed, or when the above step 601 is executed, the above step 202 and step 203 are not executed.

[0109] Each of the above-mentioned method embodiments, or various possible implementation methods in each method embodiment can be executed separately, or any two or more of them can be executed in combination with each other. The specific implementation method can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0110] The resource management method provided in the embodiment of the present application can be executed by a resource management device. In the embodiment of the present application, the resource management device provided in the embodiment of the present application is described by taking the resource management device executing the resource management method as an example.

[0111] Figure 5 FIG. 1 shows a possible structural diagram of a resource management device involved in some embodiments of the present application. Figure 5 As shown, the resource management device 70 may include: an acquisition module 71 and an execution module 72 .

[0112] The acquisition module 71 is used to acquire a first object to be rendered and a first resource field in the first scene, where the first resource field is used to indicate resources required for rendering the first object;

[0113] The execution module 71 is configured to obtain a second object from at least one object in the first target container based on the first resource field, and add the first object to the second target container, wherein each object in the at least one object corresponds to a resource field, and the resource field corresponding to the second object is the same as the first resource field;

[0114] Wherein, the first target container is the first container, and the second target container is the second container; or, the first target container is the third container, and the second target container is the first container;

[0115] The first container includes resources that have been created and at least one object that has been rendered in the first scene, the second container includes resources that have not been created and objects that have been rendered in the first scene, and the third container includes resources that have been created and at least one object that has been removed in the first scene.

[0116] In a possible implementation, the acquisition module 71 is specifically used to acquire the second object from the first container based on the first resource field, wherein the first container includes the at least one object that has been created and rendered in the first scene. The execution module 72 is also used to set the first pointer field of the first object to a first address before adding the first object to the second target container, wherein the first pointer field is used to point to the resource address for rendering the first object, and the first address is the address of the resource of the second object.

[0117] In a possible implementation, the acquisition module 71 is specifically used to acquire the second object from the third container based on the first resource field, and the third container includes the at least one object that has created resources and is removed in the first scene. The execution module 72 is also used to set the resource address of the first object to be rendered to the first address before adding the first object to the second target container, and set the second pointer field of the second object to the first address, the first address is the address of the resource of the second object, and the second pointer field is used to point to the resource address of the second object to be rendered; and delete the second object from the third container.

[0118] In a possible implementation, the acquisition module 71 is further used to acquire the third object removed from the first scene and the third pointer field of the third object, the third pointer field being used to point to the resource address for rendering the third object. The execution module 72 is further used to add the third object to a third container when the third pointer field acquired by the acquisition module 71 is empty, the third container including at least one object that has been created and removed from the first scene; or, when the third pointer field acquired by the acquisition module 71 is not empty, delete the third object from the second container, the second container including objects that have not been created and rendered in the first scene.

[0119] In a possible implementation, the execution module 72 is specifically configured to delete the object added earliest in the third container and add the third object to the third container when the number of objects in the third container is greater than or equal to the first threshold.

[0120] In the embodiment of the present application, a resource management device is provided, which can put all objects in three containers. Since the first target container is the first container or the third container, at least one object of the created resource is stored in the first container and the third container respectively, and each object corresponds to a resource field respectively, so the resource management device can select the second object corresponding to the resource field with the same field as the field from the first target container based on the field corresponding to the resource required for the first object rendering, so that the resource management device can directly use the resources of the second object to render the first object without creating resources for the first object, avoiding the consumption of more memory for creating resources, and reducing the risk of memory overflow leading to reduced frame rate or application crash. In addition, since the AS needs to be recreated during the object rendering process, and the first object and the second object use the same resource, when the resource management device creates the BLAS in the AS for the first object, the BLAS of the second object can be used, without creating the BLAS corresponding to the first object, reducing the time required to recreate the AS, so that more time can be used to render the picture to improve the picture frame rate. In this way, the frame rate and application stability of the picture rendered by the ray tracing method can be improved.

[0121] The resource management device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtualreality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personalcomputer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0122] The resource management device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0123] The resource management device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0124] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 1000, including a processor 1001 and a memory 1002, wherein the memory 1002 stores programs or instructions that can be executed on the processor 1001, and when the program or instructions are executed by the processor 1001, the various steps of the above-mentioned resource management method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0125] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0126] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0127] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0128] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0129] The processor 110 is used to obtain a first object to be rendered in a first scene and a first resource field, where the first resource field is used to indicate resources required for rendering the first object; and, based on the first resource field, obtain a second object from at least one object in a first target container, and add the first object to the second target container, where each object in the at least one object corresponds to a resource field, and the resource field corresponding to the second object is the same as the first resource field;

[0130] Wherein, the first target container is the first container, and the second target container is the second container; or, the first target container is the third container, and the second target container is the first container;

[0131] The first container includes resources that have been created and at least one object that has been rendered in the first scene, the second container includes resources that have not been created and objects that have been rendered in the first scene, and the third container includes resources that have been created and at least one object that has been removed in the first scene.

[0132] In a possible implementation, the processor 110 is specifically configured to obtain the second object from the first container based on the first resource field, wherein the first container includes the at least one object that has been created and rendered in the first scene. The processor 110 is also configured to set the first pointer field of the first object to a first address before adding the first object to the second target container, wherein the first pointer field is used to point to a resource address for rendering the first object, and the first address is an address of a resource for the second object.

[0133] In a possible implementation, the processor 110 is specifically configured to obtain the second object from a third container based on the first resource field, wherein the third container includes at least one object that has created resources and has been removed from the first scene. The processor 110 is also configured to set the resource address for rendering the first object to the first address before adding the first object to the second target container, and to set the second pointer field of the second object to the first address, wherein the first address is the address of the resource of the second object, and the second pointer field is used to point to the resource address for rendering the second object. The memory 109 is configured to delete the second object from the third container.

[0134] In a possible implementation, the processor 110 is further configured to obtain the third object removed from the first scene and a third pointer field of the third object, the third pointer field being used to point to a resource address for rendering the third object. The processor 110 is further configured to, when the third pointer field is empty, add the third object to a third container, the third container including at least one object that has been created and removed from the first scene; or, when the third pointer field is non-empty, delete the third object from a second container, the second container including objects that have not been created and rendered in the first scene.

[0135] In a possible implementation, the processor 110 is specifically configured to, when the number of objects in the third container is greater than or equal to a first threshold, delete the object added earliest in the third container and add the third object to the third container.

[0136] The embodiment of the present application provides an electronic device that can store all objects in three containers. Since the first target container is the first container or the third container, at least one object of the created resource is stored in the first container and the third container respectively, and each object corresponds to a resource field, so the electronic device can select the second object corresponding to the resource field with the same field as the field from the first target container based on the field corresponding to the resource required for the first object rendering, so that the electronic device can directly use the resources of the second object to render the first object without creating resources for the first object, avoiding the consumption of more memory for creating resources, and reducing the risk of memory overflow leading to reduced frame rate or application crash. In addition, since the AS needs to be recreated during the object rendering process, and the first object and the second object use the same resource, when the electronic device creates the BLAS in the AS for the first object, the BLAS of the second object can be used, without creating the BLAS corresponding to the first object, reducing the time required to recreate the AS, so that more time can be used to render the picture to improve the picture frame rate. In this way, the frame rate and application stability of the picture rendered by the ray tracing method can be improved.

[0137] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and can achieve the same technical effect. To avoid repetition, it is not repeated here. The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, it is not repeated here.

[0138] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0139] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0140] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0141] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned resource management method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0142] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0143] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned resource management method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0144] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0145] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned resource management method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0146] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0148] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A resource management method, characterized in that: include: Acquire a first object to be rendered in a first scene and a first resource field, where the first resource field is used to indicate resources required for rendering the first object; Based on the first resource field, obtain a second object from at least one object in the first target container, and add the first object to the second target container, wherein each object in the at least one object corresponds to a resource field, and the resource field corresponding to the second object is the same as the first resource field; Wherein, the first target container is the first container, and the second target container is the second container; or, the first target container is the third container, and the second target container is the first container; The first container includes resources that have been created and at least one object that has been rendered in the first scene, the second container includes resources that have not been created and objects that have been rendered in the first scene, and the third container includes resources that have been created and at least one object that has been removed in the first scene.

2. The method according to claim 1, characterized in that The acquiring the second object from at least one object in the first target container based on the first resource field includes: Based on the first resource field, obtaining the second object from the first container; Before adding the first object to the second target container, the method further includes: The first pointer field of the first object is set to a first address, where the first pointer field is used to point to a resource address for rendering the first object, and the first address is an address of a resource for rendering the second object.

3. The method according to claim 1, characterized in that: The acquiring the second object from at least one object in the first target container based on the first resource field includes: Based on the first resource field, obtaining the second object from a third container; Before adding the first object to the second target container, the method further includes: Setting a resource address for rendering the first object to a first address, and setting a second pointer field of the second object to the first address, wherein the first address is an address of a resource for rendering the second object, and the second pointer field is used to point to a resource address for rendering the second object; The second object is deleted from the third container.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Acquire the third object removed from the first scene and a third pointer field of the third object, where the third pointer field is used to point to a resource address for rendering the third object; When the third pointer field is empty, adding the third object to the third container; or, In a case where the third pointer field is non-null, the third object is deleted from the second container.

5. The method according to claim 4, characterized in that The adding the third object to the third container comprises: When the number of objects in the third container is greater than or equal to a first threshold, the object added earliest in the third container is deleted, and the third object is added to the third container.

6. A resource management device, characterized in that: include: Get module and execute module; The acquisition module is used to acquire a first object to be rendered and a first resource field in a first scene, wherein the first resource field is used to indicate a resource required for rendering the first object; The execution module is further configured to obtain a second object from at least one object in the first target container based on the first resource field, and add the first object to the second target container, wherein each object in the at least one object corresponds to a resource field, and the resource field corresponding to the second object is the same as the first resource field; Wherein, the first target container is the first container, and the second target container is the second container; or, the first target container is the third container, and the second target container is the first container; The first container includes resources that have been created and at least one object that has been rendered in the first scene, the second container includes resources that have not been created and objects that have been rendered in the first scene, and the third container includes resources that have been created and at least one object that has been removed in the first scene.

7. The device according to claim 6, characterized in that The acquisition module is specifically configured to acquire the second object from the first container based on the first resource field; The execution module is further used to set the first pointer field of the first object to a first address before adding the first object to the second target container, wherein the first pointer field is used to point to a resource address for rendering the first object, and the first address is an address of a resource for rendering the second object.

8. The device according to claim 6, characterized in that The acquisition module is specifically configured to acquire the second object from a third container based on the first resource field; The execution module is further used to set the resource address for rendering the first object to a first address and set the second pointer field of the second object to the first address before adding the first object to the second target container, wherein the first address is the address of the resource for rendering the second object, and the second pointer field is used to point to the resource address for rendering the second object; and delete the second object from the third container.

9. The device according to any one of claims 6 to 8, characterized in that The acquisition module is further used to acquire the third object removed from the first scene and a third pointer field of the third object, where the third pointer field is used to point to a resource address for rendering the third object; The execution module is further used for: When the third pointer field obtained by the obtaining module is empty, adding the third object to the third container; or, When the third pointer field obtained by the obtaining module is non-empty, the third object is deleted from the second container.

10. The device according to claim 9, characterized in that The execution module is specifically configured to delete the object added earliest in the third container and add the third object to the third container when the number of objects in the third container is greater than or equal to a first threshold.