A three-dimensional scene loading method, device, electronic device and readable medium

By deduplication of the three-dimensional model file collection, the data transmission amount and memory usage problems caused by repeated pictures in three-dimensional scenes are solved, and more efficient three-dimensional scene loading is achieved.

CN118470197BActive Publication Date: 2025-08-05GUANGZHOU TIEKE INTELLIGENT CONTROL CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410565989.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-09
Publication Date
2025-08-05
Estimated Expiration
2044-05-09

AI Technical Summary

Technical Problem

When the prior art combines different models into different three-dimensional scenes, it is easy to cause duplicate pictures in the three-dimensional model file to increase the data transmission volume and run memory usage.

Method used

By obtaining the three-dimensional model file collection, performing picture deduplication processing, deleting duplicate pictures and pointing to the unique picture, forming a target three-dimensional model file collection, and loading and displaying the three-dimensional scene.

Benefits of technology

Reduces the amount of data transmission during 3D scene loading and saves running memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470197B_ABST
    Figure CN118470197B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a three-dimensional scene loading method, device, electronic device, and readable medium. The method includes: obtaining at least one three-dimensional model file required for loading a first three-dimensional scene, merging the three-dimensional model files to obtain a three-dimensional model file set, performing first image deduplication processing on the three-dimensional model file set to obtain a target three-dimensional model file set, loading the target three-dimensional model file set, and displaying the first three-dimensional scene. Using the three-dimensional scene loading method of the present invention, before loading and displaying the three-dimensional scene, duplicate judgment and deduplication processing can be performed on the images in all three-dimensional model files, so that there are no duplicate images in the target three-dimensional model file set ultimately used for loading, thereby reducing the amount of data transmitted when loading the three-dimensional scene and saving running memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional modeling, and in particular to a three-dimensional scene loading method, a three-dimensional scene loading device, an electronic device and a computer-readable medium. Background Art

[0002] To display a 3D scene, an application can generate simple 3D models using code. However, most complex 3D models are drawn using specialized 3D software, exported as 3D files, and then loaded into the application for display. The 3D files exported by 3D software contain several 3D scenes, each of which contains several 3D models. Each 3D model includes data such as vertices, textures, and motions. If a material uses an image as its texture, the image data will also be included. 3D scenes typically consume a large amount of RAM, so managing this memory usage is crucial. Loading images used for textures requires a significant amount of RAM. For example, if an application loads a 1024x1024 pixel PNG file (32-bit image), each pixel uses 32 bits. The required RAM is calculated as 1024x1024x32 bits, which translates to a total of 4MB of RAM.

[0003] When 3D software draws a 3D scene, if different 3D models within the software reuse the same image as a texture, the same image will ultimately be referenced, rather than loaded multiple times. When the 3D file is exported, only one image will be included, without duplicates. When the software loads this 3D file, since the texture data all points to the same image, only the data for that single image will be loaded. However, this approach only works for 3D scenes displaying fixed content and is not suitable for scenarios where the application needs to combine different models to create different 3D scenes based on specific circumstances.

[0004] This approach addresses situations where applications need to combine different models to create different 3D scenes based on specific circumstances. The typical approach is to create each 3D model separately and dynamically load and display it based on the application's needs. However, when creating separate 3D models, each with its own image, duplicate images may be loaded within a single 3D scene. For example, if two 3D models are exported separately and the 3D software uses the same image as its texture, each exported model file will contain the image data. When the application loads these two models, it will need to load the data for both images. Obviously, the two images loaded by the application are essentially the same, resulting in duplicate images being loaded during the 3D scene loading process. This not only increases data transmission volume but also increases the memory usage during the 3D scene display. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a three-dimensional scene loading method and a corresponding three-dimensional scene loading device, an electronic device, and a computer-readable medium that overcome the above problems.

[0006] An embodiment of the present invention discloses a three-dimensional scene loading method, comprising:

[0007] Obtaining at least one 3D model file required to load the first 3D scene;

[0008] Merging the three-dimensional model files to obtain a three-dimensional model file set;

[0009] performing a first image deduplication process on the three-dimensional model file set to obtain a target three-dimensional model file set;

[0010] The target three-dimensional model file set is loaded to display the first three-dimensional scene.

[0011] Optionally, the method further includes:

[0012] During the display of the first three-dimensional scene, dynamically loading a new three-dimensional model file;

[0013] Performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file;

[0014] The target three-dimensional model file is loaded to display a second three-dimensional scene.

[0015] Optionally, the step of performing a first image deduplication process on the three-dimensional model file set to obtain a target three-dimensional model file set includes:

[0016] Determining whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images;

[0017] If there is at least one set of duplicate images in the three-dimensional model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images;

[0018] All pictures deleted from each group of duplicate pictures are pointed to and referenced by the corresponding unique picture to obtain the target three-dimensional model file set.

[0019] Optionally, the step of determining whether there is at least one set of duplicate images in the three-dimensional model file set includes:

[0020] Calculating a summary value of each image in the three-dimensional model file set;

[0021] Comparing the digest values; the pictures with the same digest value are the same group of repeated pictures; the same group of repeated pictures includes at least two pictures;

[0022] If there are at least two identical summary values, it is determined that there is at least one set of duplicate images in the three-dimensional model file set;

[0023] If all the summary values are different, it is determined that there is no at least one set of repeated images in the three-dimensional model file set.

[0024] Optionally, the step of pointing all deleted pictures in each group of duplicate pictures to reference the corresponding unique picture to obtain the target three-dimensional model file set includes:

[0025] Adding the picture redirection mark value corresponding to the corresponding unique picture to all pictures deleted from each group of duplicate pictures to obtain the target three-dimensional model file set;

[0026] The step of loading the target three-dimensional model file set and displaying the first three-dimensional scene includes:

[0027] Extracting data from the target three-dimensional model file set;

[0028] Determining whether the data includes the image redirection flag value;

[0029] If included, all pictures deleted from each group of repeated pictures are loaded as the corresponding unique pictures according to the picture redirection mark value, and the first three-dimensional scene is displayed.

[0030] Optionally, the step of performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file includes:

[0031] Detecting and loading the image in the new three-dimensional model file;

[0032] Determine whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene;

[0033] If the new 3D model file contains images identical to all images in the first 3D scene, releasing the images in the new 3D model file that are duplicated with the first 3D scene, and pointing the released images to the identical images in the loaded first 3D scene, thereby obtaining a target 3D model file;

[0034] If the new 3D model file does not contain any pictures identical to all the pictures in the first 3D scene, all the pictures in the new 3D model file are retained and the new 3D model file is used as the target 3D model file.

[0035] Optionally, the step of determining whether the new three-dimensional model file contains pictures that are identical to all pictures in the first three-dimensional scene includes:

[0036] Calculating a summary value of the image in the new three-dimensional model file;

[0037] Comparing the summary value of the picture in the new three-dimensional model file with the summary values of all pictures in the first three-dimensional scene;

[0038] If there is a picture with the same digest value as all the pictures of the first three-dimensional scene, determining that there is a picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene;

[0039] If there is no picture with the same digest value as all the pictures of the first three-dimensional scene, it is determined that there is no picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene.

[0040] The embodiment of the present invention further discloses a three-dimensional scene loading device, comprising:

[0041] An acquisition module, configured to acquire at least one 3D model file required to load the first 3D scene;

[0042] a merging module, configured to merge the three-dimensional model files to obtain a three-dimensional model file set;

[0043] a first deduplication module, configured to perform a first image deduplication process on the three-dimensional model file set to obtain a target three-dimensional model file set;

[0044] The first three-dimensional scene loading module is used to load the target three-dimensional model file set and display the first three-dimensional scene.

[0045] Optionally, the device further comprises:

[0046] A dynamic loading module, configured to dynamically load a new three-dimensional model file during the display of the first three-dimensional scene;

[0047] a second deduplication module, configured to perform a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file;

[0048] The second three-dimensional scene loading module is used to load the target three-dimensional model file and display the second three-dimensional scene.

[0049] Optionally, the first deduplication module includes:

[0050] A first determination submodule is configured to determine whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images;

[0051] a deletion submodule, configured to, if there is at least one set of duplicate images in the three-dimensional model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images;

[0052] The pointing submodule is used to point all the pictures deleted from each group of repeated pictures to the corresponding unique picture to obtain the target three-dimensional model file set.

[0053] Optionally, the first judgment submodule includes:

[0054] A first calculation unit, configured to calculate a summary value of each image in the three-dimensional model file set;

[0055] A first comparison unit is configured to compare the digest values; the pictures with the same digest value are a group of repeated pictures; the group of repeated pictures includes at least two pictures;

[0056] a first determining unit, configured to determine that at least one set of duplicate images exists in the three-dimensional model file set if at least two digest values are the same;

[0057] The second determining unit is configured to determine that at least one set of duplicate images does not exist in the three-dimensional model file set if all the summary values are different.

[0058] Optionally, the pointing submodule includes:

[0059] An adding unit, configured to add a picture redirection mark value corresponding to the corresponding unique picture to all pictures deleted from each group of duplicate pictures, to obtain the target three-dimensional model file set;

[0060] The first three-dimensional scene loading module includes:

[0061] A data loading submodule, configured to extract data from the target three-dimensional model file set;

[0062] A second judgment submodule is used to judge whether the data contains the image redirection flag value;

[0063] The display submodule is configured to load all pictures deleted from each group of repeated pictures as the corresponding unique pictures according to the picture redirection mark value if the picture redirection mark value is included, and display the first three-dimensional scene.

[0064] Optionally, the second deduplication module includes:

[0065] An image detection submodule, configured to detect and load images in the new three-dimensional model file;

[0066] A third judgment submodule is used to judge whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene;

[0067] a release submodule configured to release, if the new 3D model file contains images identical to all images in the first 3D scene, images in the new 3D model file that are duplicated with images in the first 3D scene, and point the released images to the identical images in the loaded first 3D scene, thereby obtaining a target 3D model file;

[0068] The retaining submodule is configured to retain all the pictures in the new 3D model file if there are no pictures identical to all the pictures in the first 3D scene in the new 3D model file, and use the new 3D model file as the target 3D model file.

[0069] Optionally, the third judgment submodule includes:

[0070] a second calculation unit, configured to calculate a summary value of the image in the new three-dimensional model file;

[0071] a second comparing unit, configured to compare the summary value of the picture in the new 3D model file with the summary values of all pictures in the first 3D scene;

[0072] a third determining unit, configured to determine whether there exists an image in the new 3D model file that is identical to all the images in the first 3D scene if there exists an image with the same digest value as all the images in the first 3D scene;

[0073] The fourth determining unit is configured to determine that no picture identical to all pictures of the first 3D scene exists in the new 3D model file if no picture has the same digest value as all pictures of the first 3D scene.

[0074] An embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0075] The memory is used to store computer programs;

[0076] The processor is configured to implement the three-dimensional scene loading method described in the embodiment of the present invention when executing the program stored in the memory.

[0077] The embodiment of the present invention further discloses one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the three-dimensional scene loading method as described in the embodiment of the present invention.

[0078] The embodiments of the present invention include the following advantages:

[0079] The 3D scene loading method of an embodiment of the present invention obtains at least one 3D model file required for loading a first 3D scene, merges the 3D model files to obtain a 3D model file set, performs a first image deduplication process on the 3D model file set to obtain a target 3D model file set, loads the target 3D model file set, and displays the first 3D scene. Using the 3D scene loading method of the present invention, duplicate determination and deduplication processing can be performed on the images in all 3D model files before loading and displaying the 3D scene, so that no duplicate images exist in the target 3D model file set ultimately used for loading, thereby reducing the amount of data transmitted when loading the 3D scene and saving running memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 This is a flowchart of a three-dimensional scene loading method provided in an embodiment of the present invention;

[0081] Figure 2 is a flowchart of another three-dimensional scene loading method provided in an embodiment of the present invention;

[0082] Figure 3 This is a schematic diagram of a loading process of a three-dimensional equipment room for texture image deduplication provided in an embodiment of the present invention;

[0083] Figure 4 This is a schematic diagram of a process for loading a new cabinet model with texture image deduplication provided in an embodiment of the present invention;

[0084] Figure 5 This is a structural block diagram of a three-dimensional scene loading device provided in an embodiment of the present invention;

[0085] Figure 6 is a block diagram of an electronic device provided in an embodiment of the present invention;

[0086] Figure 7 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0087] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0088] Reference Figure 1 , shows a flowchart of a three-dimensional scene loading method provided in an embodiment of the present invention, which may specifically include the following steps:

[0089] Step 101: Obtain at least one 3D model file required for loading a first 3D scene;

[0090] In the embodiment of the present invention, a 3D scene is generated by loading a 3D model file. Therefore, before loading the 3D scene, the 3D model file can be obtained. A 3D scene can include at least one 3D model. Therefore, loading a 3D scene can obtain at least one 3D model file.

[0091] Specifically, for loading the first 3D scene, a 3D model file list required for loading the first 3D scene may be obtained first, and then all 3D model files in the 3D model file list may be loaded. These 3D model files may be derived from 3D models drawn by 3D software.

[0092] Step 102: merging the three-dimensional model files to obtain a three-dimensional model file set;

[0093] After obtaining the 3D model files required to load the first 3D scene, these 3D model files can be preliminarily aggregated, that is, the obtained 3D model files are merged to obtain a complete 3D model file set so that the data of the 3D model files can be uniformly processed next.

[0094] Step 103: performing a first image deduplication process on the 3D model file set to obtain a target 3D model file set;

[0095] The merged 3D model file collection may include duplicate images, which increases the data transmission volume and causes invalid usage of running memory when loading these duplicate images when loading the 3D scene. Therefore, before loading the 3D scene, the 3D model file collection can be subjected to a first image deduplication process, so that each image in the target 3D model file collection obtained after the deduplication process is unique, thereby eliminating the need to load invalid duplicate images when loading the 3D scene.

[0096] Step 104: load the target 3D model file set and display the first 3D scene.

[0097] After obtaining the deduplicated target 3D model file set, you can load the target 3D model file set to generate and display the first 3D scene in the application. Because the deduplicated target 3D model file set is used, each loaded image is unique and valid, reducing data transmission and conserving runtime memory space during display.

[0098] In an embodiment of the present invention, at least one 3D model file required for loading a first 3D scene is obtained, the 3D model files are merged to obtain a 3D model file set, a first image deduplication process is performed on the 3D model file set to obtain a target 3D model file set, the target 3D model file set is loaded, and the first 3D scene is displayed. Using the 3D scene loading method of the present invention, duplicate determination and deduplication processing can be performed on the images in all 3D model files before loading and displaying the 3D scene, so that no duplicate images are included in the target 3D model file set ultimately used for loading, thereby reducing the amount of data transmitted when loading the 3D scene and saving runtime memory.

[0099] Reference Figure 2 , shows a flowchart of another three-dimensional scene loading method provided in an embodiment of the present invention, which may specifically include the following steps:

[0100] Step 201: Obtain at least one 3D model file required for loading a first 3D scene;

[0101] Step 202: merging the three-dimensional model files to obtain a three-dimensional model file set;

[0102] Step 203: determining whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images;

[0103] Before deduplication is performed on the merged 3D model file set, it may be determined whether there is at least one set of duplicate images in the 3D model file set, so as to determine whether further deduplication of the images is required.

[0104] The three-dimensional model file set may include at least one group of repeated images; each group of repeated images may include at least two images.

[0105] In one embodiment of the present invention, the step of determining whether there is at least one set of duplicate images in the three-dimensional model file set includes:

[0106] S11, calculating a summary value of each image in the three-dimensional model file set;

[0107] S12, comparing the digest values; the pictures with the same digest value are in the same group of repeated pictures; the same group of repeated pictures includes at least two pictures;

[0108] S13, if there are at least two identical summary values, determining that there is at least one set of duplicate images in the three-dimensional model file set;

[0109] S14: If all the summary values are different, it is determined that there is no at least one set of duplicate images in the three-dimensional model file set.

[0110] In an embodiment of the present invention, a summary algorithm can be used to calculate the summary value of each image, and images with the same summary value can be determined as duplicate images. Therefore, to determine duplicate images, the summary value of each image in the three-dimensional model file set can be calculated first, and then the summary values of these images can be further compared to determine duplicate images.

[0111] Specifically, if there are at least two identical summary values, it can be considered that at least two images are duplicated, and it can be determined that there is at least one set of duplicate images in the 3D model file set; if all the summary values are different, it can be considered that all the images are completely different, and it can be determined that there is no at least one set of duplicate images in the 3D model file set.

[0112] Step 204: If there is at least one set of duplicate images in the 3D model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images;

[0113] After judging the duplicate images, if it is determined that there are no duplicate images in the 3D model file set, the 3D model file set is directly loaded to obtain the first 3D scene; if it is determined that there is at least one group of duplicate images in the 3D model file set, the duplicate images are deduplicated, and each group of duplicate images is deleted until only one is left to obtain the corresponding unique image of each group of duplicate images.

[0114] Step 205 : Point all deleted pictures in each group of duplicate pictures to reference the corresponding unique picture to obtain the target three-dimensional model file set.

[0115] These deleted images originally belonged to separate 3D model files and were the images required to construct the 3D model corresponding to the separate 3D model file. Therefore, in order to ensure that the 3D model finally loaded is correct, after deleting them, all deleted images in each group of duplicate images can be pointed to reference the corresponding unique image to obtain the target 3D model file set, so that the 3D scene obtained by loading the target 3D model file set is exactly the same as the 3D scene obtained by loading all the original separate 3D model files.

[0116] In one embodiment of the present invention, the step of referencing all images deleted from each group of duplicate images to the corresponding unique image to obtain the target three-dimensional model file set includes:

[0117] S21, adding a picture redirection mark value corresponding to the corresponding unique picture to all pictures deleted from each group of duplicate pictures, to obtain the target three-dimensional model file set;

[0118] Redirecting deleted images can be achieved by adding image redirection tags corresponding to the unique images to these images. The target 3D model file set obtained after redirection can be loaded to obtain the correct 3D scene. The image redirection tag value can be the digest value of the corresponding unique image.

[0119] Step 206: load the target 3D model file set and display the first 3D scene.

[0120] In one embodiment of the present invention, the step of loading the target 3D model file set and displaying the first 3D scene includes:

[0121] S31, extracting data from the target three-dimensional model file set;

[0122] S32, determining whether the data includes the image redirection flag value;

[0123] S33: If the picture redirection mark value is included, all pictures deleted from each group of repeated pictures are loaded as the corresponding unique pictures according to the picture redirection mark value, and the first three-dimensional scene is displayed.

[0124] After obtaining the redirected target 3D model file set, the target 3D model file set may be loaded, so that the first 3D scene may be generated and displayed in the application.

[0125] Specifically, first, the data in the target three-dimensional model file set can be extracted to determine whether the data contains an image redirection mark value. If the data contains an image redirection mark value, all images deleted from each group of duplicate images are loaded as corresponding unique images according to the image redirection mark value to display the first three-dimensional scene.

[0126] In one embodiment of the present invention, the method further comprises:

[0127] S41, dynamically loading a new 3D model file during the display of the first 3D scene;

[0128] When the first three-dimensional scene is displayed, there may be a situation where one wants to add a three-dimensional model to the first three-dimensional scene, thereby obtaining a second three-dimensional scene including the first three-dimensional scene and the new three-dimensional model.

[0129] Therefore, when displaying the first 3D scene, a new 3D model file can be dynamically selected and loaded for display, so as to update the 3D scene displayed in the application.

[0130] S42, performing a second image deduplication process on the new 3D model file to obtain a target 3D model file;

[0131] The new 3D model file may also include duplicate images. These duplicate images may be identical to existing images in the first 3D scene, or they may be duplicate images that exist only in the new 3D model file. For duplicate images that exist only in the new 3D model file, the same image deduplication method as used in the first 3D scene, i.e., the first image deduplication process, may be used.

[0132] In the case where there are pictures that are identical to repeated pictures of the first three-dimensional scene, a second picture deduplication process may be performed on the new three-dimensional model file to obtain a target three-dimensional model file, thereby achieving deduplication of the repeated pictures.

[0133] In one embodiment of the present invention, the step of performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file includes:

[0134] S51, detecting and loading the image in the new three-dimensional model file;

[0135] S52, determining whether there are pictures in the new 3D model file that are identical to all pictures in the first 3D scene;

[0136] When performing deduplication processing on a new 3D model file, it is possible to first determine whether there are duplicate images in the new 3D model file. Specifically, the images in the new 3D model file can be detected and loaded first, and then it is determined whether there are images in the new 3D model file that are identical to the corresponding unique image.

[0137] In one embodiment of the present invention, the step of determining whether the new three-dimensional model file contains pictures that are identical to all pictures in the first three-dimensional scene includes:

[0138] S61, calculating the summary value of the picture in the new three-dimensional model file;

[0139] S62, comparing the summary value of the picture in the new 3D model file with the summary values of all pictures in the first 3D scene;

[0140] S63: If there is a picture with the same digest value as all the pictures of the first three-dimensional scene, determining that there is a picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene;

[0141] S64: If there is no picture with the same digest value as all the pictures of the first three-dimensional scene, determine that there is no picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene.

[0142] To determine whether there are duplicate images in the new three-dimensional model file, you can first calculate the summary values of all images in the new three-dimensional model file, and then compare the summary values of the images in the new three-dimensional model file with the summary values of the images in the first three-dimensional scene. If there is a summary value that is the same as the summary value of the image in the first three-dimensional scene, it is determined that there is a picture in the new three-dimensional model file that is the same as the picture in the first three-dimensional scene. If there is no summary value that is the same as the summary value of the image in the first three-dimensional scene, it is determined that there is no picture in the new three-dimensional model file that is the same as the picture in the first three-dimensional scene.

[0143] S53: If the new 3D model file contains images identical to all images in the first 3D scene, releasing the images in the new 3D model file that are duplicated with the images in the first 3D scene, and pointing the released images to the identical images in the loaded first 3D scene, thereby obtaining a target 3D model file.

[0144] S54: If the new 3D model file does not contain any pictures identical to all the pictures in the first 3D scene, retain all the pictures in the new 3D model file and use the new 3D model file as the target 3D model file.

[0145] After performing duplicate image judgment on the new 3D model file, if it is determined that the new 3D model file contains an image that is identical to the image in the first 3D scene, the image in the new 3D model file that is identical to the image in the first 3D scene is released, and the released image is pointed to the same image in the loaded first 3D scene to obtain the target 3D model file; if it is determined that the new 3D model file does not contain an image that is identical to the image in the first 3D scene, all images in the new 3D model file are retained, and the new 3D model file can be directly used as the target 3D model file.

[0146] S43, loading the target 3D model file and displaying the second 3D scene;

[0147] If you want to display the combination of the new 3D model and the first 3D scene, you can load the target 3D model file and the target 3D model file collection at the same time. At this time, you can determine whether to update the first 3D scene displayed in the application to a 3D scene that includes the first 3D scene, that is, the second 3D scene.

[0148] Specifically, the target 3D model file and the target 3D model file set may be merged to obtain a new 3D model file set, and then the new 3D model file set may be loaded, so that the second 3D scene may be displayed in the application.

[0149] As an example of the present invention, refer to Figure 3, shows a schematic diagram of a three-dimensional equipment room loading process for texture image deduplication provided in an embodiment of the present invention.

[0150] In an actual 3D scenario, an equipment room contains 24 different types of cabinets. The texture images used for their exteriors are identical, but the internal equipment boards are different. Through cache optimization, only the duplicate exterior cabinet texture image is calculated, saving the memory used by the 23 duplicate images. Furthermore, some of the internal equipment boards of each cabinet are of the same type, and the texture images of these boards can also be cached and optimized, further saving memory used by duplicate images.

[0151] The application loads and displays a 3D equipment room containing 24 types of cabinets, all using the same exterior texture image. When loading, the application reads the data from each of the 24 model files, applies a digest algorithm to the texture images, compares and detects duplicate textures, retains only one image, removes the duplicate data, redirects to that image, and then merges the data into a new 3D model file based on the scene. The new file then loads and displays the 3D scene. This process saves data transmission and runtime memory space for 23 images.

[0152] As another example of the present invention, refer to Figure 4 , shows a schematic diagram of a new cabinet model loading process for texture image deduplication provided in an embodiment of the present invention.

[0153] To add a cabinet of a different type (e.g., cabinet 25), the application first reads the model file and runs a digest algorithm on the texture image. After comparing, it detects that the texture image for the exterior cabinet already exists in the 3D scene. The application then deletes the image data and uses the digest value as the image redirection tag. The application then loads the 3D model data and, based on the image redirection tag, redirects the exterior cabinet texture image to the existing exterior cabinet image. This process saves the data transmission and runtime memory of one image.

[0154] In an embodiment of the present invention, at least one 3D model file required for loading a first 3D scene is obtained, the 3D model files are merged to obtain a 3D model file set, a first image deduplication process is performed on the 3D model file set to obtain a target 3D model file set, the target 3D model file set is loaded, and the first 3D scene is displayed. Using the 3D scene loading method of the present invention, duplicate determination and deduplication processing can be performed on the images in all 3D model files before loading and displaying the 3D scene, so that no duplicate images are included in the target 3D model file set ultimately used for loading, thereby reducing the amount of data transmitted when loading the 3D scene and saving runtime memory.

[0155] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0156] Reference Figure 5 , shows a structural block diagram of a three-dimensional scene loading device provided in an embodiment of the present invention, which may specifically include the following modules:

[0157] An acquisition module 501 is configured to acquire at least one 3D model file required for loading a first 3D scene;

[0158] A merging module 502 is configured to merge the three-dimensional model files to obtain a three-dimensional model file set;

[0159] A first deduplication module 503 is configured to perform a first image deduplication process on the 3D model file set to obtain a target 3D model file set;

[0160] The first 3D scene loading module 504 is configured to load the target 3D model file set and display the first 3D scene.

[0161] Optionally, the device further comprises:

[0162] A dynamic loading module, configured to dynamically load a new three-dimensional model file during the display of the first three-dimensional scene;

[0163] a second deduplication module, configured to perform a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file;

[0164] The second three-dimensional scene loading module is used to load the target three-dimensional model file and display the second three-dimensional scene.

[0165] Optionally, the first deduplication module includes:

[0166] A first determination submodule is configured to determine whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images;

[0167] a deletion submodule, configured to, if there is at least one set of duplicate images in the three-dimensional model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images;

[0168] The pointing submodule is used to point all the pictures deleted from each group of repeated pictures to the corresponding unique picture to obtain the target three-dimensional model file set.

[0169] Optionally, the first judgment submodule includes:

[0170] A first calculation unit, configured to calculate a summary value of each image in the three-dimensional model file set;

[0171] A first comparison unit is configured to compare the digest values; the pictures with the same digest value are a group of repeated pictures; the group of repeated pictures includes at least two pictures;

[0172] a first determining unit, configured to determine that at least one set of duplicate images exists in the three-dimensional model file set if at least two digest values are the same;

[0173] The second determining unit is configured to determine that at least one set of duplicate images does not exist in the three-dimensional model file set if all the summary values are different.

[0174] Optionally, the pointing submodule includes:

[0175] An adding unit, configured to add a picture redirection mark value corresponding to the corresponding unique picture to all pictures deleted from each group of duplicate pictures, to obtain the target three-dimensional model file set;

[0176] The first three-dimensional scene loading module includes:

[0177] A data loading submodule, configured to extract data from the target three-dimensional model file set;

[0178] A second judgment submodule is used to judge whether the data contains the image redirection flag value;

[0179] The display submodule is configured to load all pictures deleted from each group of repeated pictures as the corresponding unique pictures according to the picture redirection mark value if the picture redirection mark value is included, and display the first three-dimensional scene.

[0180] Optionally, the second deduplication module includes:

[0181] An image detection submodule, configured to detect and load images in the new three-dimensional model file;

[0182] A third judgment submodule is used to judge whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene;

[0183] a release submodule configured to release, if the new 3D model file contains images identical to all images in the first 3D scene, images in the new 3D model file that are duplicated with images in the first 3D scene, and point the released images to the identical images in the loaded first 3D scene, thereby obtaining a target 3D model file;

[0184] The retaining submodule is configured to retain all the pictures in the new 3D model file if there are no pictures identical to all the pictures in the first 3D scene in the new 3D model file, and use the new 3D model file as the target 3D model file.

[0185] Optionally, the third judgment submodule includes:

[0186] a second calculation unit, configured to calculate a summary value of the image in the new three-dimensional model file;

[0187] a second comparing unit, configured to compare the summary value of the picture in the new 3D model file with the summary values of all pictures in the first 3D scene;

[0188] a third determining unit, configured to determine whether there exists an image in the new 3D model file that is identical to all the images in the first 3D scene if there exists an image with the same digest value as all the images in the first 3D scene;

[0189] The fourth determining unit is configured to determine that no picture identical to all pictures of the first 3D scene exists in the new 3D model file if no picture has the same digest value as all pictures of the first 3D scene.

[0190] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0191] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0192] Memory 603, used for storing computer programs;

[0193] The processor 601 is configured to execute the program stored in the memory 603 by performing the following steps:

[0194] Obtaining at least one 3D model file required to load the first 3D scene;

[0195] Merging the three-dimensional model files to obtain a three-dimensional model file set;

[0196] performing a first image deduplication process on the three-dimensional model file set to obtain a target three-dimensional model file set;

[0197] The target three-dimensional model file set is loaded to display the first three-dimensional scene.

[0198] Optionally, the method further includes:

[0199] During the display of the first three-dimensional scene, dynamically loading a new three-dimensional model file;

[0200] Performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file;

[0201] The target three-dimensional model file is loaded to display a second three-dimensional scene.

[0202] Optionally, the step of performing a first image deduplication process on the three-dimensional model file set to obtain a target three-dimensional model file set includes:

[0203] Determining whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images;

[0204] If there is at least one set of duplicate images in the three-dimensional model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images;

[0205] All pictures deleted from each group of duplicate pictures are pointed to and referenced by the corresponding unique picture to obtain the target three-dimensional model file set.

[0206] Optionally, the step of determining whether there is at least one set of duplicate images in the three-dimensional model file set includes:

[0207] Calculating a summary value of each image in the three-dimensional model file set;

[0208] Comparing the digest values; the pictures with the same digest value are the same group of repeated pictures; the same group of repeated pictures includes at least two pictures;

[0209] If there are at least two identical summary values, it is determined that there is at least one set of duplicate images in the three-dimensional model file set;

[0210] If all the summary values are different, it is determined that there is no at least one set of repeated images in the three-dimensional model file set.

[0211] Optionally, the step of pointing all deleted pictures in each group of duplicate pictures to reference the corresponding unique picture to obtain the target three-dimensional model file set includes:

[0212] Adding the picture redirection mark value corresponding to the corresponding unique picture to all pictures deleted from each group of duplicate pictures to obtain the target three-dimensional model file set;

[0213] The step of loading the target three-dimensional model file set and displaying the first three-dimensional scene includes:

[0214] Extracting data from the target three-dimensional model file set;

[0215] Determining whether the data includes the image redirection flag value;

[0216] If the picture redirection mark value is included, all pictures deleted from each group of repeated pictures are loaded as the corresponding unique pictures according to the picture redirection mark value, and the first three-dimensional scene is displayed.

[0217] Optionally, the step of performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file includes:

[0218] Detecting and loading the image in the new three-dimensional model file;

[0219] Determine whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene;

[0220] If the new 3D model file contains images identical to all images in the first 3D scene, releasing the images in the new 3D model file that are duplicated with the first 3D scene, and pointing the released images to the identical images in the loaded first 3D scene, thereby obtaining a target 3D model file;

[0221] If the new 3D model file does not contain any pictures identical to all the pictures in the first 3D scene, all the pictures in the new 3D model file are retained and the new 3D model file is used as the target 3D model file.

[0222] Optionally, the step of determining whether the new three-dimensional model file contains pictures that are identical to all pictures in the first three-dimensional scene includes:

[0223] Calculating a summary value of the image in the new three-dimensional model file;

[0224] Comparing the summary value of the picture in the new three-dimensional model file with the summary values of all pictures in the first three-dimensional scene;

[0225] If there is a picture with the same digest value as all the pictures of the first three-dimensional scene, determining that there is a picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene;

[0226] If there is no picture with the same digest value as all the pictures of the first three-dimensional scene, it is determined that there is no picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene.

[0227] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0228] The communication interface is used for communication between the above terminal and other devices.

[0229] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0230] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0231] like Figure 7 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 701 is further provided, in which instructions are stored. When the computer-readable storage medium 701 is run on a computer, the computer executes the three-dimensional scene loading method described in the above embodiment.

[0232] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the three-dimensional scene loading method described in the above embodiment.

[0233] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0234] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0235] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.

[0236] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A three-dimensional scene loading method, characterized in that: include: Obtaining at least one 3D model file required to load the first 3D scene; Merging the three-dimensional model files to obtain a three-dimensional model file set; Determining whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images; If there is at least one set of duplicate images in the three-dimensional model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images; Point all pictures deleted from each group of duplicate pictures to the corresponding unique picture to obtain a target three-dimensional model file set; Loading the target three-dimensional model file set to display the first three-dimensional scene; The method further comprises: During the display of the first three-dimensional scene, dynamically loading a new three-dimensional model file; Performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file; Loading the target three-dimensional model file to display a second three-dimensional scene; The step of performing a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file includes: Detecting and loading the image in the new three-dimensional model file; Determine whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene; If the new 3D model file contains images identical to all images in the first 3D scene, then releasing the images in the new 3D model file that are duplicated with the first 3D scene, and pointing the released images to the identical images in the loaded first 3D scene to obtain a target 3D model file; If the new 3D model file does not contain any pictures identical to all the pictures in the first 3D scene, all the pictures in the new 3D model file are retained and the new 3D model file is used as the target 3D model file.

2. The method according to claim 1, characterized in that The step of determining whether there is at least one set of duplicate images in the three-dimensional model file set includes: Calculating a summary value of each image in the three-dimensional model file set; Comparing the digest values; the pictures with the same digest value are the same group of repeated pictures; the same group of repeated pictures includes at least two pictures; If there are at least two identical summary values, it is determined that there is at least one set of duplicate images in the three-dimensional model file set; If all the summary values are different, it is determined that there is no at least one set of repeated images in the three-dimensional model file set.

3. The method according to claim 1, characterized in that The step of referencing all images deleted from each group of duplicate images to the corresponding unique image to obtain the target three-dimensional model file set includes: Adding the picture redirection mark value corresponding to the corresponding unique picture to all pictures deleted from each group of duplicate pictures to obtain the target three-dimensional model file set; The step of loading the target three-dimensional model file set and displaying the first three-dimensional scene includes: Extracting data from the target three-dimensional model file set; Determining whether the data includes the image redirection flag value; If the picture redirection mark value is included, all pictures deleted from each group of repeated pictures are loaded as the corresponding unique pictures according to the picture redirection mark value, and the first three-dimensional scene is displayed.

4. The method according to claim 1, wherein The step of determining whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene includes: Calculating a summary value of the image in the new three-dimensional model file; Comparing the summary value of the picture in the new three-dimensional model file with the summary values of all pictures in the first three-dimensional scene; If there is a picture with the same digest value as all the pictures of the first three-dimensional scene, determining that there is a picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene; If there is no picture with the same digest value as all the pictures of the first three-dimensional scene, it is determined that there is no picture in the new three-dimensional model file that is the same as all the pictures of the first three-dimensional scene.

5. A three-dimensional scene loading device, characterized in that: include: An acquisition module, configured to acquire at least one 3D model file required to load the first 3D scene; a merging module, configured to merge the three-dimensional model files to obtain a three-dimensional model file set; a first deduplication module, configured to perform a first image deduplication process on the three-dimensional model file set to obtain a target three-dimensional model file set; The first deduplication module includes: A first determination submodule is configured to determine whether there is at least one set of duplicate images in the three-dimensional model file set; each set of duplicate images includes at least two images; a deletion submodule, configured to, if there is at least one set of duplicate images in the three-dimensional model file set, delete each set of duplicate images until only one remains, and obtain a unique image corresponding to each set of duplicate images; a pointing submodule, configured to point all pictures deleted from each group of duplicate pictures to the corresponding unique picture to obtain the target three-dimensional model file set; A first three-dimensional scene loading module, configured to load the target three-dimensional model file set and display the first three-dimensional scene; The device further comprises: A dynamic loading module, configured to dynamically load a new three-dimensional model file during the display of the first three-dimensional scene; a second deduplication module, configured to perform a second image deduplication process on the new three-dimensional model file to obtain a target three-dimensional model file; A second three-dimensional scene loading module, used to load the target three-dimensional model file and display a second three-dimensional scene; The second deduplication module includes: An image detection submodule, configured to detect and load images in the new three-dimensional model file; A third judgment submodule is used to judge whether there are pictures in the new three-dimensional model file that are identical to all pictures in the first three-dimensional scene; a release submodule configured to release, if the new 3D model file contains images identical to all images in the first 3D scene, images in the new 3D model file that are duplicated with images in the first 3D scene, and point the released images to the identical images in the loaded first 3D scene, thereby obtaining a target 3D model file; The retaining submodule is configured to retain all the pictures in the new 3D model file if there are no pictures identical to all the pictures in the first 3D scene in the new 3D model file, and use the new 3D model file as the target 3D model file.

6. An electronic device, characterized in that: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is configured to implement the three-dimensional scene loading method according to any one of claims 1 to 5 when executing the program stored in the memory.

7. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the three-dimensional scene loading method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Three-dimensional model image generating method and apparatus

    CN101364310A

  • Three-dimensional scene construction method, device and equipment and medium

    CN109920044A

  • Visual scene memory processing method

    CN114511686A