Virtual space streaming loading method and system based on dynamic division and storage medium
Through the streaming loading method of dynamically dividing virtual spaces, using tree hierarchical structure and dynamic collision balls, the problems of low and unstable loading efficiency of virtual scenes in the existing technology are solved, intelligent priority allocation and resource integrity are achieved, and loading efficiency and stability are improved.
Patent Information
- Application Number
- CN202510326160.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-03-19
AI Technical Summary
The prior art is inefficient and not stable enough when loading large virtual scenes. It relies on manual division of areas and loading order, which can easily lead to errors or omissions in loading orders, destroying the stability of scene resources.
The virtual space stream loading method based on dynamic division is adopted to configure the object model through a tree hierarchical structure, generate dynamically changing collision balls, divide the scene hierarchy information according to the distance, and generate virtual node recording hierarchical information during the loading process to ensure the integrity and stability of scene resources.
It realizes intelligent allocation of loading priority, reduces manual workload, improves loading efficiency and stability, and ensures fast loading and high-quality experience in large virtual scenes.
Smart Images

Figure CN119863595A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual and reality technology, and in particular to a virtual space streaming loading method, system and storage medium based on dynamic division. Background Art
[0002] With the popularity of virtual reality (VR) and augmented reality (AR) applications, users have higher requirements for the loading speed and experience comfort of large virtual scenes. It usually takes a long time to fully download and load the entire scene, causing users to wait too long, thus affecting their experience satisfaction.
[0003] The common solution at present is to manually divide the scene into multiple small blocks and load them on demand. However, this method mainly relies on manual operation, which is time-consuming and error-prone. When the scene is large and complex, manual division is inefficient and may cause errors or omissions in the loading order. Some solutions also adopt area or field-of-view based loading strategies to achieve streaming loading by manually dividing loading areas with different priorities. For example, the scene manager provided in some game engines allows developers to set multi-level scene loading strategies, but it still relies on manually specified area boundaries and loading order, and during the loading process, the loaded object model is separated from the entire scene resource, which will destroy 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 above-mentioned problems of low efficiency and instability in loading large virtual scenes and propose a virtual space streaming loading method, system and storage medium based on dynamic division. It has the advantages of intelligent allocation of loading priority, reduction of manual workload, use of virtual nodes to maintain the integrity of scene resources, and higher operation stability.
[0005] In a first aspect, the present invention achieves the above-mentioned purpose through the following technical solutions, a virtual space streaming loading method based on dynamic division, the method comprising the following steps: Pre-configure the object models in the virtual space according to the tree-like 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 as time changes; Divide the scene hierarchy according to a preset distance rule, wherein the scene hierarchy is used to allocate scene resources to different loading priorities according to their distance from the collision ball; When loading an object model in the current scene hierarchy, the object model is split from the scene resource, and a virtual node is generated at the split position of the original scene resource, wherein the virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information of hierarchical relationship, position, rotation and scaling; After the scene resources are loaded, all virtual nodes are traversed, and object models corresponding to the virtual nodes are searched in the scene, and the virtual nodes are replaced with the object models according to the hierarchical information.
[0006] Preferably, the method of configuring the object models in the virtual space to form scene resources in advance according to the tree-like hierarchical structure includes: Establish root nodes, child nodes, and leaf nodes, and set leaf nodes as the next level of child nodes, and child nodes as the next level of root nodes; Establish the connection relationship between each node; Read all object models, customize the object models into different nodes, and establish connections between models based on connection relationships.
[0007] Preferably, generating a collision ball surrounding the virtual character further comprises: setting the center coordinates of the collision ball to be consistent with the position coordinates of the virtual character, and activating the collision ball when the virtual character enters the virtual space.
[0008] Preferably, dividing the scene levels according to preset distance rules includes setting the center point of the collision ball as the origin, setting the scene space 0-30m away from the origin as the first loading layer, the scene space 30-60m away from the origin as the second loading layer, and the scene space 60-100m away from the origin as the third loading layer, and setting the loading priority of object models in the same loading layer to decrease layer by layer from near to far away from the origin.
[0009] Preferably, the method further comprises setting a temporary data structure for storing the recorded hierarchical information of the object model.
[0010] Preferably, the loading of the object model in the current scene hierarchy includes loading basic data of the object model, and the basic data includes the appearance, behavior and function of the model.
[0011] In a second aspect, the present invention achieves the above-mentioned purpose through the following technical solutions: a virtual space streaming loading system based on dynamic partitioning, the system comprising: A resource configuration unit, used to configure object models in the virtual space in advance according to a tree-like hierarchical structure to form scene resources; A collision ball unit, used for generating a collision ball surrounding the virtual character, and setting the radius of the collision ball to increase dynamically with time; A scene hierarchy division unit, used to divide the scene hierarchy according to a preset distance rule, wherein the scene hierarchy is used to allocate scene resources to different loading priorities according to their distance from the collision ball; A streaming loading unit, used for splitting the object model from the scene resource when loading the object model in the current scene hierarchy, and generating a virtual node at the split position of the original scene resource, wherein the virtual node is used to record the hierarchical information of the split object model, wherein the hierarchical information includes information of hierarchical relationship, position, rotation and scaling; The resource resetting unit is used to traverse all virtual nodes after loading the scene resources, search for 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.
[0012] Preferably, the method for configuring the object models in the virtual space to form scene resources in advance according to the tree-like hierarchical structure in the resource configuration unit includes: Establish root nodes, child nodes, and leaf nodes, and set leaf nodes as the next level of child nodes, and child nodes as the next level of root nodes; Establish the connection relationship between each node; Read all object models, customize the object models into different nodes, and establish connections between models based on connection relationships.
[0013] Preferably, the system further comprises a temporary storage unit for setting a temporary data structure for storing the recorded hierarchical information of the object model.
[0014] In a third aspect, the present invention achieves the above-mentioned purpose through the following technical scheme: a storage medium having a computer program stored thereon, which, when the computer program is executed by a processor, implements the virtual space streaming loading method based on dynamic partitioning as described in the first aspect.
[0015] Compared with the prior art, the present invention has the following beneficial effects: By adopting the method of spatially dividing the scene, different priorities are assigned to the loading of scene resources. The allocation rule adopts automatic allocation according to the distance of virtual characters to reduce the occurrence of errors. Therefore, this streaming loading method of virtual space meets the loading rate and experience effect of large virtual scenes. In the process of loading resources, virtual nodes are created to fill the gaps in the original scene resources, which will not destroy the structure of the entire scene resources. After all resources are loaded, the virtual nodes are reset, which greatly improves the stability of the loading process. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flow chart of the virtual space streaming loading method based on dynamic partitioning of the present invention.
[0017] Figure 2 It is a schematic diagram of a virtual space streaming loading system based on dynamic partitioning of the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Example 1 like Figure 1 As shown, a virtual space streaming loading method based on dynamic partitioning includes the following steps: Step S1: pre-configure object models in a virtual space according to a tree-like hierarchical structure to form scene resources. The tree-like hierarchical structure is a common scene management method that can effectively organize and manage complex virtual scenes.
[0020] The tree hierarchy mainly includes: Root node: As the entrance to 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 for the entire city map; Subnode: The direct subordinate of the root node, usually corresponding to the main area in the scene. For example, the subnode can be different administrative districts or functional blocks in a city, such as commercial areas and residential areas; Leaf node: The last node of a subnode, directly associated with a specific object model. For example, a leaf node can be a building, a tree, or a street lamp model.
[0021] The tree-like hierarchical structure achieves logical isolation of scene resources through parent-child hierarchical relationships, avoiding the performance pressure caused by full loading and providing support for subsequent hierarchical loading.
[0022] Step S2, generating a collision ball surrounding the virtual character, and setting the radius of the collision ball to increase dynamically with time; the collision ball can accurately reflect the scene space around the virtual character, and as the radius of the collision ball is set to a dynamically increasing state, the range of the scene space covered is updated every moment. In this way, during the loading process, scene resources within the range of the collision ball can be loaded first, improving loading efficiency and user experience.
[0023] The generation of a collision ball surrounding the virtual character also includes: setting the center coordinates of the collision ball to be consistent with the position coordinates of the virtual character, and setting the collision ball to be started when the virtual character enters the virtual space. The consistency of the center coordinates with the position coordinates of the virtual character is to ensure that the collision ball can accurately surround the virtual character, and it is also necessary to ensure that the collision ball is synchronized with the virtual character. When the virtual character enters the virtual space, the collision ball is started, and its initial radius 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 ball can effectively cover the scene space around the virtual character, and the dynamic increase in the radius of the collision ball needs to meet preset rules or algorithms to dynamically adjust the radius of the collision ball. For example: the initial radius is the visual range of the virtual character (such as 10 meters), and gradually expands to a maximum value (such as 100 meters) according to an exponential function over time. The radius of the collision ball is calculated using the following formula:
[0024] Where k is the attenuation coefficient, which is used to control the radius growth rate. Exponential growth can avoid the lag caused by excessive initial loading of resources, while ensuring the smoothness of gradual loading of long-distance resources.
[0025] Step S3, dividing the scene hierarchy according to a preset distance rule, the scene hierarchy is used to assign scene resources to different loading priorities according to the distance from the collision ball; layered loading is in line with human visual perception characteristics (sensitive to details near and blurred far), and can significantly reduce GPU rendering pressure, and the scene hierarchy divided according to the preset distance rule includes setting the center point of the collision ball as the origin, setting the scene space 0-30m away from the origin as the first loading layer, the scene space 30-60m away from the origin as the second loading layer, and the scene space 60-100m away from the origin as the third loading layer, and setting the loading priority of object models in the same loading layer to decrease layer by layer from near to far from the origin.
[0026] In 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 the loading priority, and the farther the object model is from the origin, the lower the loading priority. This ensures that during the loading process, scene resources closer to the virtual character are loaded first, improving the user experience.
[0027] Step S4: When loading an object model in the current scene hierarchy, split the object model from the scene resource, and generate a virtual node at the split position of the original scene resource. The virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information on hierarchical relationship, position, rotation and scaling.
[0028] Loading object models according to the scene hierarchy is divided into three steps: Step 4.1: Split object models. When loading object models in the current scene hierarchy, split the object models of this hierarchy from the scene resources. These object models include all object models in this hierarchy, such as scene elements, props, characters, etc. Step 4.2: Generate virtual nodes at the split position of the original scene resource to record the hierarchical information of the split object model. This hierarchical information includes hierarchical relationship, position, rotation, and scaling information to ensure that the original state of the object model can be correctly restored after loading. 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 model's appearance, behavior, and function. 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 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. It also aims to ensure that the object model can be used normally. Only after all scene resources are completely loaded, after reset, the object model is reset to each node to form a complete scene resource structure. This design can complete the streaming loading of the virtual space without destroying the integrity of the scene resources.
[0029] Step S5: After the scene resources are loaded, all virtual nodes are traversed, and object models corresponding to the virtual nodes are searched in the scene, and the virtual nodes are replaced with the object models according to the hierarchical information.
[0030] In this step, all virtual nodes can be traversed using a 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 metadata and the integrity of scene resources.
[0031] In step S1, the method of configuring the object models in the virtual space to form scene resources in advance according to the tree hierarchy structure includes: Establish the root node, child nodes and leaf nodes, and set the leaf nodes as the next level of the child nodes, and the child nodes as the next level of the root nodes. The role of the nodes has been described in detail above, so I will not go into details here. Establish the connection relationship of each node. Each node is associated with the parent node through a pointer or unique identifier to form a hierarchical chain. The leaf node and the child node are bound bidirectionally to ensure the dependency relationship during loading. For example, all street light models under a child node must be activated after the parent node (road block) is loaded. Read all object models, customize the object models into different nodes, and establish connections between models based on the connection relationship. This step is mainly the mapping of object models and nodes. The method is: parse all object models in the scene into various node attributes, and record the physical properties (such as collision volume, lighting parameters) and logical properties (such as interactive scripts) of the models through metadata to complete their use as corresponding nodes.
[0032] In the above-mentioned loading process, the method further includes setting a temporary data structure for saving the hierarchical information of the recorded object model. The temporary data structure is set to further improve the flexibility and scalability of the method of the present invention. By saving the hierarchical information of the recorded object model, the information can be updated and managed in real time during the loading process to avoid loading errors or resource omissions.
[0033] Example 2 like Figure 2 As shown, a virtual space streaming loading system based on dynamic partitioning includes: A resource configuration unit, used to configure object models in the virtual space in advance according to a tree-like hierarchical structure to form scene resources; A collision ball unit, used for generating a collision ball surrounding the virtual character, and setting the radius of the collision ball to increase dynamically with time, wherein the generating of the collision ball surrounding the virtual character further comprises: setting the center coordinates of the collision ball to be consistent with the position coordinates of the virtual character, and setting to start the collision ball when the virtual character enters the virtual space; A scene hierarchy division unit, used to divide the scene hierarchy according to a preset distance rule, wherein the scene hierarchy is used to allocate scene resources to different loading priorities according to the distance from the collision ball, wherein the scene hierarchy division according to the preset distance rule includes setting the center point of the collision ball as the origin, setting the scene space of 0-30m from the origin as the first loading layer, the scene space of 30-60m as the second loading layer, and the scene space of 60-100m as the third loading layer, and setting the loading priority of object models in the same loading layer to decrease layer by layer from near to far from the origin; A streaming loading unit, used for, when loading an object model in the current scene hierarchy, splitting the object model from the scene resource, and generating a virtual node at the split position of the original scene resource, wherein the virtual node is used to record the hierarchical information of the split object model, wherein the hierarchical information includes information of hierarchical relationship, position, rotation and scaling; the loading of the object model in the current scene hierarchy includes loading basic data of the object model, wherein the basic data includes the appearance, behavior and function of the model; The resource resetting unit is used to traverse all virtual nodes after loading the scene resources, search for 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.
[0034] The method for pre-configuring object models in a virtual space according to a tree-like hierarchical structure to form scene resources in a resource configuration unit includes: Establish root nodes, child nodes, and leaf nodes, and set leaf nodes as the next level of child nodes, and child nodes as the next level of root nodes; Establish the connection relationship between each node; Read all object models, customize the object models into different nodes, and establish connections between models based on connection relationships.
[0035] The system also includes a temporary storage unit for setting a temporary data structure for storing the recorded hierarchical information of the object model.
[0036] Embodiment 2 is essentially the same as Embodiment 1, so the specific working principles of each unit will not be described in detail.
[0037] Example 3 This embodiment proposes a storage medium, which includes a program storage area and a data storage area, wherein the program storage area can store an operating system and programs required for running an 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 the processor, the virtual space streaming loading method based on dynamic partitioning as described in Example 1 is implemented. The processor may include one or more central processing units, or a digital processing unit, etc.
[0038] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.
[0039] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes 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 comprises the following steps: Pre-configure the object models in the virtual space according to the tree-like 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 as time changes; Divide the scene hierarchy according to a preset distance rule, wherein the scene hierarchy is used to allocate scene resources to different loading priorities according to their distance from the collision ball; When loading an object model in the current scene hierarchy, the object model is split from the scene resource, and a virtual node is generated at the split position of the original scene resource, wherein the virtual node is used to record the hierarchical information of the split object model, and the hierarchical information includes information of hierarchical relationship, position, rotation and scaling; After the scene resources are loaded, all virtual nodes are traversed, and object models corresponding to the virtual nodes are searched in the scene, and the virtual nodes are replaced with the object models according to the hierarchical information.
2. The virtual space streaming loading method based on dynamic partitioning according to claim 1 is characterized in that: The method of pre-configuring object models in a virtual space according to a tree-like hierarchical structure to form scene resources includes: Establish root nodes, child nodes, and leaf nodes, and set leaf nodes as the next level of child nodes, and child nodes as the next level of root nodes; Establish the connection relationship between each node; Read all object models, customize the object models into different nodes, and establish connections between models based on connection relationships.
3. The virtual space streaming loading method based on dynamic partitioning according to claim 1 is characterized in that: The generating of the collision ball surrounding the virtual character further includes: setting the center coordinates of the collision ball to be consistent with the position coordinates of the virtual character, and setting the collision ball to be started when the virtual character enters the virtual space.
4. The virtual space streaming loading method based on dynamic partitioning according to claim 1 is characterized in that: The method of dividing the scene layers according to the preset distance rule includes setting the center point of the collision ball as the origin, setting the scene space of 0-30m from the origin as the first loading layer, the scene space of 30-60m as the second loading layer, and the scene space of 60-100m as the third loading layer, and setting the loading priority of object models in the same loading layer to decrease layer by layer from near to far from the origin.
5. The virtual space streaming loading method based on dynamic partitioning according to claim 1 is characterized in that: The method also includes setting a temporary data structure for storing the recorded hierarchical information of the object model.
6. The virtual space streaming loading method based on dynamic partitioning according to claim 1 is characterized in that: The loading of the object model in the current scene hierarchy includes loading basic data of the object model, and the basic data includes the appearance, behavior and function of the model.
7. A virtual space streaming loading system based on dynamic partitioning, characterized in that: The system includes: A resource configuration unit, used to configure object models in the virtual space in advance according to a tree-like hierarchical structure to form scene resources; A collision ball unit, used for generating a collision ball surrounding the virtual character, and setting the radius of the collision ball to increase dynamically with time; A scene hierarchy division unit, used to divide the scene hierarchy according to a preset distance rule, wherein the scene hierarchy is used to allocate scene resources to different loading priorities according to their distance from the collision ball; A streaming loading unit, used for splitting the object model from the scene resource when loading the object model in the current scene hierarchy, and generating a virtual node at the split position of the original scene resource, wherein the virtual node is used to record the hierarchical information of the split object model, wherein the hierarchical information includes information of hierarchical relationship, position, rotation and scaling; The resource resetting unit is used to traverse all virtual nodes after loading the scene resources, search for 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.
8. The virtual space streaming loading system based on dynamic partitioning according to claim 7, characterized in that: The method for pre-configuring object models in a virtual space according to a tree-like hierarchical structure to form scene resources in a resource configuration unit includes: Establish root nodes, child nodes, and leaf nodes, and set leaf nodes as the next level of child nodes, and child nodes as the next level of root nodes; Establish the connection relationship between each node; Read all object models, customize the object models into different nodes, and establish connections between models based on connection relationships.
9. The virtual space streaming loading system based on dynamic partitioning according to claim 7, characterized in that: The system also includes a temporary storage unit for setting a temporary data structure for storing the recorded hierarchical information of the object model.
10. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the virtual space streaming loading method based on dynamic partitioning as described in any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Method and device for hierarchically loading and unloading objects in three-dimensional virtual reality scene
CN102722912A
Three-dimensional virtual roaming scene construction platform based on Internet
CN104933753A
Virtual reality interactive experience method and device
CN107219926A
Virtual space method and device
CN108805985A
Method and system for moving among point locations in stepping panoramic roaming, and storage medium
CN116385273A