Dynamic Partitioning-Based Virtual Space Streaming Loading Method, System, and Storage Medium
Through the method of dynamically dividing virtual space, collision balls and tree hierarchical structures are used to automatically allocate loading priorities, and generate virtual node recording hierarchical information, solving the problems of low loading efficiency and stability of large virtual scenes, and achieving fast and stable resource loading.
Patent Information
- Application Number
- CN202510326160.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-03-19
AI Technical Summary
The prior art is inefficient and not stable enough when loading large virtual scenes, and the manual division is inefficient, which can easily cause loading order errors or omissions, affecting the user experience.
The virtual space stream loading method based on dynamic division is adopted. By generating collision balls and tree hierarchical structures, loading priority is automatically allocated, and virtual node record hierarchical information is generated during the loading process to ensure the integrity of scene resources.
It improves the loading rate and experience effect of large virtual scenes, reduces loading errors, and ensures the stability and integrity of scene resources.
Smart Images

Figure CN119863595B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual and real technologies, and particularly to a method, system and storage medium for streaming loading of virtual space based on dynamic partitioning. Background Art
[0002] With the popularization of virtual reality (VR) and augmented reality (AR) applications, users have put forward higher requirements for the loading speed and experience comfort of large virtual scenes. Completely downloading and loading the entire scene usually takes a long time, resulting in too long waiting time for users, thus affecting the experience satisfaction.
[0003] Currently, the common solution is to manually divide the scene into multiple small pieces and load them on demand. However, this method mainly relies on manual operation, which is time-consuming and error-prone. When the scene is huge and complex, the manual partitioning is inefficient and may cause errors or omissions in the loading order. There are also some solutions that adopt loading strategies based on regions or fields of view, and achieve streaming loading by manually dividing different priority loading regions. For example, the scene manager provided in some game engines allows developers to set multi-level scene loading strategies, but it still depends on the manually specified region boundaries and loading order, and during the loading process, the loaded object models are detached from the entire scene resources, which will damage the stability of the original scene resources, resulting in loading errors and affecting the normal use of the virtual space. Summary of the Invention
[0004] The purpose of the present invention is to solve the problems of low efficiency and instability in loading large virtual scenes, and propose a method, system and storage medium for streaming loading of virtual space based on dynamic partitioning, which has the advantages of intelligent allocation of loading priorities, reduction of manual workload, maintenance of scene resource integrity by virtual nodes, and higher running stability.
[0005] In the first aspect, the present invention realizes the above object through the following technical solutions. A method for streaming loading of virtual space based on dynamic partitioning, the method includes the following steps:
[0006] Pre-configure the object models in the virtual space according to a tree-like hierarchical structure to form scene resources;
[0007] Generate a collision sphere surrounding the virtual character, and set the radius of the collision sphere to increase dynamically with time;
[0008] Divide the scene hierarchy according to a preset distance rule, and the scene hierarchy is used to allocate scene resources to different loading priorities according to the distance from the collision sphere;
[0009] When loading an object model in the current scene hierarchy, split the object model from the scene resources, and generate a virtual node at the split position of the original scene resources. The virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information such as hierarchical relationship, position, rotation, and scaling.
[0010] After loading the scene resources, traverse all virtual nodes, search for the object model corresponding to the virtual node in the scene, and use the object model to replace the virtual node according to the hierarchical information.
[0011] Preferably, the method for pre-configuring the object models in the virtual space according to the tree hierarchical structure to form scene resources includes:
[0012] Establish a root node, child nodes, and leaf nodes, and sequentially set the leaf nodes as the next level of the child nodes, and the child nodes as the next level of the root node;
[0013] Establish the connection relationship of each node;
[0014] Read all object models, customize the object models as different nodes, and establish connections between the models according to the connection relationship.
[0015] Preferably, the generation of the collision sphere surrounding the virtual character further includes: setting the center coordinate of the collision sphere to be the same as the position coordinate of the virtual character, and setting the collision sphere to be activated when the virtual character enters the virtual space.
[0016] Preferably, the division of the scene hierarchy according to the preset distance rule includes setting the center point of the collision sphere as the origin, setting the scene space with a distance of 0 - 30m from the origin as the first loading layer, the scene space with a distance of 30 - 60m as the second loading layer, and the scene space with a distance of 60 - 100m as the third loading layer, and setting the loading priority of the object models within the same loading layer to decrease layer by layer from near to far from the origin.
[0017] Preferably, the method further includes setting up a temporary data structure for saving the hierarchical information of the recorded object models.
[0018] Preferably, the loading of the object models in the current scene hierarchy includes loading the basic data of the object models, and the basic data includes the shape, behavior, and function of the model.
[0019] In a second aspect, the present invention achieves the above object through the following technical solutions. A virtual space streaming loading system based on dynamic division, the system includes:
[0020] A resource configuration unit for pre-configuring the object models in the virtual space according to the tree hierarchical structure to form scene resources;
[0021] A collision ball unit, configured to generate a collision ball that encloses a virtual character, and set the radius of the collision ball to increase dynamically over time;
[0022] A scene hierarchical division unit, configured to divide the scene into hierarchies according to a preset distance rule, where the scene hierarchies are used to allocate scene resources to different loading priorities according to their distances from the collision ball;
[0023] A streaming loading unit, configured to, when loading an object model in the current scene hierarchy, split the object model from the scene resources, and generate a virtual node at the splitting position of the original scene resources, where the virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information on hierarchical relationships, positions, rotations, and scalings;
[0024] A resource reset unit, configured to, after loading the scene resources, traverse all virtual nodes, search for the object models corresponding to the virtual nodes in the scene, and replace the virtual nodes with the object models according to the hierarchical information.
[0025] Preferably, the method for pre-configuring the object models in the virtual space to form scene resources in the resource configuration unit according to a tree-like hierarchical structure includes:
[0026] Establish a root node, child nodes, and leaf nodes, and sequentially set the leaf nodes as the next level of the child nodes, and the child nodes as the next level of the root node;
[0027] Establish the connection relationships of each node;
[0028] Read all object models, customize the object models as different nodes, and establish connections between the models according to the connection relationships.
[0029] Preferably, the system further includes a temporary storage unit, configured to set up a temporary data structure for saving the hierarchical information of the recorded object models.
[0030] In a third aspect, the present invention achieves the above object through the following technical solution. A storage medium has a computer program stored thereon, and when the computer program is executed by a processor, it implements the virtual space streaming loading method based on dynamic division as described in the first aspect.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] By adopting the method of spatially partitioning the scene, different priorities are assigned to the loading and allocation of scene resources. The allocation rule adopts automatic allocation according to the distance from the virtual character to reduce the generation of errors. Therefore, this method of streaming loading the virtual space meets the loading rate and experience effect of large virtual scenes. During the process of loading resources, virtual nodes are created to fill the gaps in the original scene resources without damaging the structure of the entire scene resources. After all resources are loaded, the virtual nodes are reset, greatly improving the stability of the loading process. Brief Description of the Drawings
[0033] Figure 1 It is a flowchart of the virtual space streaming loading method based on dynamic partitioning of the present invention.
[0034] Figure 2 It is a schematic diagram of the virtual space streaming loading system based on dynamic partitioning of the present invention. Detailed Embodiments
[0035] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0036] Embodiment 1
[0037] As Figure 1 shown, a virtual space streaming loading method based on dynamic partitioning, the method includes the following steps:
[0038] Step S1, pre-configure the object models in the virtual space according to the tree hierarchy structure to form scene resources. The tree hierarchy structure is a common scene management method that can effectively organize and manage complex virtual scenes.
[0039] The tree hierarchy structure mainly includes:
[0040] Root node: As the entry of the entire scene, the root node is responsible for managing the loading logic of all child nodes. For example, in a virtual city scene, the root node may represent an abstract container of the entire city map;
[0041] Child node: The direct subordinate of the root node, usually corresponding to the main areas in the scene. For example, the child node can be different administrative regions or functional blocks in the city, such as commercial areas and residential areas;
[0042] Leaf node: The last-level node of the child node, directly associated with the specific object model. For example, the leaf node can be a certain building, a tree or a street lamp model.
[0043] The tree - shaped hierarchical structure realizes the logical isolation of scene resources through the parent - child hierarchical relationship, avoiding the performance pressure brought by full - volume loading, and also providing support for subsequent hierarchical loading.
[0044] Step S2: Generate a collision sphere that encloses the virtual character, and set the radius of the collision sphere to increase dynamically over time; the collision sphere can accurately reflect the scene space around the virtual character, and by setting the radius of the collision sphere to a dynamically increasing state, its coverage range of the scene space is updated at all times. In this way, during the loading process, the scene resources within the range of the collision sphere can be preferentially loaded, improving the loading efficiency and user experience.
[0045] The generation of the collision sphere that encloses the virtual character further includes: setting the center coordinate of the collision sphere to be the same as the position coordinate of the virtual character, and setting the collision sphere to start when the virtual character enters the virtual space. Making the center coordinate the same as the position coordinate of the virtual character is to ensure that the collision sphere can accurately enclose the virtual character, and it is also necessary to ensure the synchronization between the collision sphere and the virtual character. When the virtual character enters the virtual space, the collision sphere is started, and its initial radius also needs to be set. The initial radius can be set according to factors such as the scene size and the movement speed of the virtual character to ensure that the collision sphere can effectively cover the scene space around the virtual character. The dynamic increase in the radius of the collision sphere needs to meet a preset rule or algorithm to achieve dynamic adjustment of the radius of the collision sphere. For example: the initial radius is the visible range of the virtual character (such as 10 meters), and it gradually expands to the maximum value (such as 100 meters) according to an exponential function over time. The radius of the collision sphere is calculated using the following formula:
[0046]
[0047] where k is the attenuation coefficient used to control the radius growth rate. Exponential growth can avoid the lag caused by excessive resource loading in the initial stage and ensure the smoothness of gradual loading of distant resources.
[0048] Step S3: Divide the scene into levels according to a preset distance rule. The scene levels are used to allocate scene resources to different loading priorities according to their distances from the collision sphere; hierarchical loading conforms to the characteristics of human visual perception (sensitive to details at close range and blurred at long range), which can significantly reduce the GPU rendering pressure. Dividing the scene into levels according to the preset distance rule includes setting the center point of the collision sphere as the origin, setting the scene space within 0 - 30m from the origin as the first loading layer, the scene space within 30 - 60m as the second loading layer, the scene space within 60 - 100m as the third loading layer, and setting the loading priority of the object models within the same loading layer to decrease gradually from near to far from the origin.
[0049] Within the same loading layer, set the loading priority according to the distance of the object model from the origin. The closer the object model is to the origin, the higher its loading priority; the farther the object model is from the origin, the lower its loading priority. This can ensure that during the loading process, the scene resources closer to the virtual character are loaded first, improving the user experience.
[0050] Step S4: When loading the object model in the current scene hierarchy, split the object model from the scene resources, and generate a virtual node at the splitting position of the original scene resources. The virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information such as hierarchical relationship, position, rotation, and scaling.
[0051] Loading the object model according to the scene hierarchy is divided into three steps:
[0052] Step 4.1: Split the object model. When loading the object model in the current scene hierarchy, split out the object models at this level from the scene resources. These object models include all object models within this level, such as scene elements, props, characters, etc.;
[0053] Step 4.2: Generate a virtual node. Generate a virtual node at the splitting position of the original scene resources to record the hierarchical information of the split object model. These hierarchical information includes information such as hierarchical relationship, position, rotation, and scaling, to ensure that the original state of the object model can be correctly restored after loading is completed
[0054] Step 4.3: Load the basic data of the object model. Load the basic data of the object model in the current scene hierarchy, including the shape, behavior, and function of the model, etc. These data are the basis for the presentation and operation of the object model in the virtual space. In this step, in order to avoid involving other unloaded object models existing in the node where the loaded object model is located, the loaded object model only loads the basic data and does not load the hierarchical information, also aiming to ensure that the object model can be used normally. Only after all scene resources are completely loaded and then reset, the object model is reset to each node to form a complete scene resource structure. Such a design can complete the streaming loading of the virtual space without damaging the integrity of the scene resources.
[0055] Step S5: After loading the scene resources, traverse all virtual nodes, search for the object models corresponding to the virtual nodes in the scene, and replace the virtual nodes with the object models according to the hierarchical information.
[0056] In this step, traversing all virtual nodes can use breadth-first search to traverse the tree structure to ensure that the nodes are processed in hierarchical order. The replacement operation is also to ensure the consistency of the metadata and the integrity of the scene resources.
[0057] In step S1, the method of pre-configuring object models in the virtual space according to the tree - shaped hierarchical structure to form scene resources includes:
[0058] Establish a root node, child nodes, and leaf nodes. Set the leaf nodes as the next level of the child nodes in sequence, and the child nodes as the next level of the root node. The functions of the nodes have been described in detail above and will not be elaborated here.
[0059] Establish the connection relationships of each node. Each node is associated with its parent node through a pointer or a unique identifier to form a hierarchical chain. A two - way binding is used between the leaf nodes and the child nodes to ensure the dependency relationship during loading. For example, all street - lamp models under a certain child node need to be activated after the loading of its parent node (road block) is completed.
[0060] Read all object models, customize the object models as different nodes, and establish the connections between the models according to the connection relationships. This step is mainly the mapping between the object models and the nodes. The method is as follows: Parse all object models in the scene into the attributes of each node, and record the physical attributes (such as collision volume, lighting parameters) and logical attributes (such as interaction scripts) of the models through metadata, so that they can be used as the corresponding nodes.
[0061] During the above - mentioned loading process, the method further includes setting up a temporary data structure for saving the hierarchical information of the recorded object models. Setting up the temporary data structure is to further improve the flexibility and scalability of the method of the present invention. By saving the hierarchical information of the recorded object models, these information can be updated and managed in real - time during the loading process, avoiding problems such as loading errors or resource omissions.
[0062] Embodiment 2
[0063] As Figure 2 shown, a virtual - space streaming loading system based on dynamic partitioning, the system includes:
[0064] A resource configuration unit, which is used to pre - configure object models in the virtual space according to the tree - shaped hierarchical structure to form scene resources;
[0065] A collision - sphere unit, which is used to generate a collision sphere surrounding the virtual character, and set the radius of the collision sphere to increase dynamically with time. The generation of the collision sphere surrounding the virtual character further includes: setting the center coordinates of the collision sphere to be the same as the position coordinates of the virtual character, and setting the collision sphere to start when the virtual character enters the virtual space;
[0066] A scene hierarchy division unit, which is used to divide the scene hierarchy according to a preset distance rule. The scene hierarchy is used to allocate scene resources to different loading priorities according to the distance from the collision ball. The division of the scene hierarchy according to the preset distance rule includes setting the center point of the collision ball as the origin, setting the scene space with a distance of 0 - 30m from the origin as the first loading layer, the scene space with a distance of 30 - 60m as the second loading layer, and the scene space with a distance of 60 - 100m as the third loading layer, and setting the loading priority of the object models within the same loading layer to decrease layer by layer from near to far from the origin;
[0067] A streaming loading unit, which is used to split the object model from the scene resources when loading the object model in the current scene hierarchy, and generate a virtual node at the splitting position of the original scene resources. The virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information such as hierarchical relationship, position, rotation, and scaling; The loading of the object model in the current scene hierarchy includes loading the basic data of the object model, and the basic data includes the shape, behavior, and function of the model;
[0068] A resource reset unit, which is used to traverse all virtual nodes after loading the scene resources, find the object model corresponding to the virtual node in the scene, and use the object model to replace the virtual node according to the hierarchical information.
[0069] The method of pre-configuring the object models in the virtual space into scene resources in the resource configuration unit according to a tree - shaped hierarchical structure includes:
[0070] Establish a root node, child nodes, and leaf nodes, and sequentially set the leaf nodes as the next level of the child nodes, and the child nodes as the next level of the root node;
[0071] Establish the connection relationship of each node;
[0072] Read all object models, customize the object models as different nodes, and establish the connection between the models according to the connection relationship.
[0073] The system further includes a temporary storage unit, which is used to set a temporary data structure for saving the hierarchical information of the recorded object models.
[0074] The essence of Example 2 is the same as that of Example 1, so the specific working principles of each unit will not be elaborated here.
[0075] Example 3
[0076] This embodiment provides a storage medium, which includes a program storage area and a data storage area. The program storage area can store an operating system, programs required to run the instant messaging function, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc. The computer program is stored in the program storage area, and when the computer program is executed by a processor, the virtual space streaming loading method based on dynamic partitioning as described in Embodiment 1 is implemented. The processor may include one or more central processing units, or be a digital processing unit, etc.
[0077] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-described exemplary embodiments, and without departing from the spirit or basic characteristics of the present invention, the present invention can be implemented in other specific forms. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention.
[0078] In addition, it should be understood that although this specification is described according to embodiments, not every embodiment only includes an independent technical solution. This narrative way of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A virtual space streaming loading method based on dynamic partitioning, characterized in that, The method includes the following steps: Pre-configure object models in the virtual space according to a tree - shaped hierarchical structure to form scene resources; Generate a collision sphere surrounding the virtual character, and set the radius of the collision sphere to increase dynamically over time; Divide the scene hierarchy according to a preset distance rule. The scene hierarchy is used to allocate scene resources to different loading priorities according to the distance from the collision sphere. Dividing the scene hierarchy according to the preset distance rule includes setting the center point of the collision sphere as the origin, setting the scene space within 0 - 30m from the origin as the first loading layer, the scene space from 30 - 60m as the second loading layer, and the scene space from 60 - 100m as the third loading layer, and setting the loading priority of object models within the same loading layer to decrease layer by layer from near to far from the origin; When loading the object model in the current scene hierarchy, split the object model from the scene resources, and generate a virtual node at the split position of the original scene resources. The virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes hierarchical relationship, position, rotation, and scaling information; After loading the scene resources, traverse all virtual nodes, search for the object model corresponding to the virtual node in the scene, and use the object model to replace the virtual node according to the hierarchical information; 2. The virtual space streaming loading method based on dynamic partitioning according to claim 1, wherein The method of pre - configuring object models in the virtual space according to a tree - shaped hierarchical structure to form scene resources includes: Establish a root node, child nodes, and leaf nodes, and sequentially set the leaf nodes as the next level of the child nodes, and the child nodes as the next level of the root node; Establish the connection relationships of each node; Read all object models, customize the object models as different nodes, and establish connections between the models according to the connection relationships; 3. The virtual space streaming loading method based on dynamic partitioning according to claim 1, wherein Generating the collision sphere surrounding the virtual character further includes: setting the center coordinate of the collision sphere to be the same as the position coordinate of the virtual character, and setting the collision sphere to start when the virtual character enters the virtual space; 4. The virtual space streaming loading method based on dynamic partitioning according to claim 1, wherein The method further includes setting up a temporary data structure for saving the hierarchical information of the recorded object models; 5. The virtual space streaming loading method based on dynamic partitioning according to claim 1, wherein Loading the object model in the current scene hierarchy includes loading the basic data of the object model, and the basic data includes the shape, behavior, and function of the model; 6. A virtual space streaming loading system based on dynamic partitioning, characterized in that, The system includes: A resource configuration unit for pre - configuring object models in the virtual space according to a tree - shaped hierarchical structure to form scene resources; A collision sphere unit for generating a collision sphere surrounding the virtual character, and setting the radius of the collision sphere to increase dynamically over time; A scene hierarchy division unit for dividing the scene hierarchy according to a preset distance rule. The scene hierarchy is used to allocate scene resources to different loading priorities according to the distance from the collision sphere. Dividing the scene hierarchy according to the preset distance rule includes setting the center point of the collision sphere as the origin, setting the scene space within 0 - 30m from the origin as the first loading layer, the scene space from 30 - 60m as the second loading layer, and the scene space from 60 - 100m as the third loading layer, and setting the loading priority of object models within the same loading layer to decrease layer by layer from near to far from the origin; A streaming loading unit, which is used to split the object model from the scene resources when loading the object model in the current scene hierarchy, and generate a virtual node at the splitting position of the original scene resources. The virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes hierarchical relationship, position, rotation and scaling information; A resource reset unit, which is used to traverse all virtual nodes after loading the scene resources, find the object model corresponding to the virtual node in the scene, and replace the virtual node with the object model according to the hierarchical information.
7. The virtual space streaming loading system based on dynamic partitioning according to claim 6, characterized in that, The method for configuring the object models in the virtual space according to the tree-like hierarchical structure in the resource configuration unit in advance includes: Establishing a root node, child nodes and leaf nodes, and sequentially setting the leaf nodes as the next level of the child nodes, and the child nodes as the next level of the root node; Establishing the connection relationship of each node; Reading all object models, customizing the object models as different nodes, and establishing the connection between the models according to the connection relationship.
8. The virtual space streaming loading system based on dynamic partitioning according to claim 6, characterized in that, The system further includes a temporary storage unit, which is used to set up a temporary data structure for saving the hierarchical information of the recorded object models.
9. A storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a processor, it implements the virtual space streaming loading method based on dynamic partitioning according to any one of claims 1-5.
Citation Information
Patent Citations
Method and device for hierarchically loading and unloading objects in three-dimensional virtual reality scene
CN102722912A
Virtual space method and device
CN108805985A