3D model file analysis method and system and medium
By combining multi-threaded parallel parsing with cloud storage, the problems of low 3D model file parsing efficiency and insufficient data security in existing technologies are solved, and efficient and stable model file processing and data management are achieved.
Patent Information
- Application Number
- CN202510892136.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-26
AI Technical Summary
Existing technologies have problems such as low single-threaded parsing efficiency, lack of multi-threaded support, and reliance on local storage to increase the risk of data loss when processing massive 3D model files. This makes it difficult to meet the real-time and high availability requirements of industrial-grade applications.
It adopts a multi-threaded parallel parsing mechanism, dynamically creates a fixed thread pool to allocate the number of threads according to the number of server CPU cores, uses regular expressions to extract key information, and uploads the parsing results to cloud storage, combining the Spring Boot framework and AWS S3 to achieve efficient parsing and data security.
It significantly improves the parsing speed of 3D model files and system stability, reduces the risk of data loss, improves system performance and data availability in multi-core computing environments, and supports high concurrent access and scalability.
Smart Images

Figure CN120704895A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of model file parsing, and in particular to a 3D model file parsing method, system and medium. Background Art
[0002] In recent years, the field of industrial digital twins has made some progress in 3D model management. This primarily involves manually or through automated tools parsing model configuration files to record model file paths and types. While these solutions aim to simplify the maintenance process for model resources in industrial scenarios, their design still has significant limitations.
[0003] The above existing technical solutions are practical in certain scenarios, but they still have the following key defects: The single-threaded parsing approach was unable to rapidly process massive model files, resulting in excessively long parsing times and failing to meet the real-time requirements of industrial applications. The lack of support for multi-threading limited the system's performance potential in multi-core computing environments. Relying solely on local storage, without considering the high availability and disaster recovery capabilities of cloud storage (such as Amazon S3), increased the risk of data loss. The ability to parse complex JSON structures (such as nested resource paths) was limited, making parsing failures prone to changes in the configuration file format. Summary of the Invention
[0004] The present application provides a 3D model file parsing method, system and medium to solve the problems of low efficiency of single-threaded parsing, lack of support for multi-threaded technology, and reliance on local storage, which increases the risk of data loss in existing solutions.
[0005] In a first aspect, the present application provides a 3D model file parsing method, the method comprising: Receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, complete the decompression of the model compressed file, and obtain the model file; traverse the directory tree of the model file and locate the 3D model configuration file in the model file; create a fixed thread pool and determine the number of threads in the fixed thread pool based on the current number of CPU cores of the server; generate the parsing task corresponding to the 3D model configuration file, encapsulate the parsing task into an independent Callable task, and submit it to the fixed thread pool for execution; extract the parsing result of the 3D model configuration file by presetting a regular expression in the thread; the parsing result includes at least: 3D model type, main file path and resource file path; upload the parsing result and the corresponding 3D model configuration file to cloud storage.
[0006] In one implementation of the present application, receiving a model compressed file uploaded by a user, reading the file contents in the model compressed file one by one, and decompressing the model compressed file to obtain the model file specifically includes: Receive the model compressed file uploaded by the user through the file upload interface provided by the HTTP protocol; Use the MultipartFile class of the Spring Boot framework to process the file stream corresponding to the model compressed file and verify the model compressed file. If it does not meet the preset verification rules, stop receiving it and feedback the upload failure information. When the preset verification rules are met, the file is decompressed using the Java ZipInputStream class, and the file contents in the model compressed file are read one by one to complete the decompression of the model compressed file and obtain the model file.
[0007] In one implementation of the present application, traversing the directory tree of the model file and locating the 3D model configuration file in the model file specifically includes: The decompressed file directory tree is traversed through a recursive algorithm, and the 3D model configuration file in the model compression file is located based on the preset 3D model configuration file sample rules.
[0008] In one implementation of the present application, a fixed thread pool is created, and the number of threads in the fixed thread pool is determined according to the number of CPU cores of the current server, specifically including: Use ExecutorService to create a fixed thread pool; Get the number of CPU cores on the current server and determine the number of threads in the fixed thread pool based on the mapping between the number of cores and the number of threads.
[0009] In one implementation of the present application, a regular expression is preset in a thread to extract the parsing result of the 3D model configuration file, specifically including: Use BufferedReader to read the 3D model configuration file line by line, combine Pattern.compile() to compile the preset regular expression, and use the Matcher class to match the target field value in the 3D model configuration file; extract the parsing result of the 3D model configuration file from the target field value; in, Use the regular expression "modelType"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the 3D model type in the parsing node; Use the regular expression: \"([^:"]+)\":[\s| ]*\"([^:"*]+)\" to extract the target field value corresponding to the main file path in the parsing node; Use the regular expression: "([^"]+\\.(png|bin|gltf))"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the resource file path in the parsed node.
[0010] In a second aspect, the present application provides a 3D model file parsing system, the system comprising: The file decompression module is used to receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, complete the decompression of the model compressed file, and obtain the model file; The positioning text module is used to traverse the directory tree of the model file and locate the 3D model configuration file in the model file; The thread parsing module is used to create a fixed thread pool and determine the number of threads in the fixed thread pool based on the current number of server CPU cores; generate a parsing task corresponding to the 3D model configuration file, encapsulate the parsing task into an independent Callable task, and submit it to the fixed thread pool for execution; extract the parsing results of the 3D model configuration file by presetting a regular expression in the thread; the parsing results include at least: 3D model type, main file path, and resource file path; The result storage module is used to upload the analysis results and the corresponding 3D model configuration files to the cloud storage.
[0011] In one implementation of the present application, the file decompression module includes a file decompression unit, Used to receive model compressed files uploaded by users through the file upload interface provided by the HTTP protocol; Use the MultipartFile class of the Spring Boot framework to process the file stream corresponding to the model compressed file and verify the model compressed file. If it does not meet the preset verification rules, stop receiving it and feedback the upload failure information. When the preset verification rules are met, the file is decompressed using the Java ZipInputStream class, and the file contents in the model compressed file are read one by one to complete the decompression of the model compressed file and obtain the model file.
[0012] In one implementation of the present application, the text positioning module includes a text positioning unit. It is used to traverse the decompressed file directory tree through a recursive algorithm and locate the 3D model configuration file in the model compressed file based on the preset 3D model configuration file sample rules.
[0013] In one implementation of the present application, the thread parsing module includes a thread parsing unit, It is used to read the 3D model configuration file line by line using BufferedReader, compile the preset regular expression in combination with Pattern.compile(), and match the target field value in the 3D model configuration file through the Matcher class; extract the parsed result of the 3D model configuration file from the target field value; in, Use the regular expression "modelType"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the 3D model type in the parsing node; Use the regular expression: \"([^:"]+)\":[\s| ]*\"([^:"*]+)\" to extract the target field value corresponding to the main file path in the parsing node; Use the regular expression: "([^"]+\\.(png|bin|gltf))"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the resource file path in the parsed node.
[0014] In a third aspect, the present application provides a non-volatile computer storage medium having computer instructions stored thereon, which, when executed, implement a 3D model file parsing method as described above.
[0015] It can be seen from the above technical solutions that this application has the following advantages: This application implements multi-threaded parallel parsing of 3D model configuration files by dynamically creating a fixed thread pool and automatically allocating the number of threads based on the number of server CPU cores. Each parsing task is encapsulated as an independent Callable task and submitted to the thread pool, changing the inefficient mode of traditional single-threaded one-by-one processing. The thread pool mechanism enables operations such as model decompression, directory tree traversal, and configuration file positioning to be performed simultaneously. Especially when processing complex models containing a large number of nested files, the parsing speed increases linearly with the increase in the number of CPU cores. Presetting regular expressions within the thread for structured data extraction can not only ensure the accurate capture of key information such as 3D model type and main file path, but also avoid the conflict problem of text matching in a multi-threaded environment. This design enables the system to fully utilize the multi-core computing resources of modern servers while maintaining parsing accuracy, significantly shortening the end-to-end processing time from file upload to completion of parsing.
[0016] This application solves the risk of data loss in local storage through cloud storage integration. After the parsing is completed, the 3D model configuration file and its structured results (including resource file path mapping relationships) are automatically synchronized to the cloud, which not only ensures the high availability of the data, but also provides a basis for cross-device collaboration of subsequent digital twin applications. The version control function of cloud storage can trace historical model changes, and the distributed storage feature naturally supports concurrent access to massive model files. The elastic configuration mechanism of the thread pool enables the system to dynamically expand processing capabilities according to server hardware upgrades without modifying the core parsing logic. In addition, the pipeline design of decompression, parsing, and uploading makes the resource usage of each link controllable. In sudden high-traffic scenarios, service degradation can be achieved by adjusting the thread pool parameters to ensure the overall stability of the system.
[0017] In summary, this application solves the problems of existing solutions such as low efficiency of single-threaded parsing, lack of support for multi-threaded technology, and increased risk of data loss due to reliance solely on local storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 This is a flow chart of a 3D model file parsing method provided in an embodiment of the present application.
[0020] Figure 2 This is a schematic diagram of the internal structure of a 3D model file parsing system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.
[0022] It should be understood by those skilled in the art that the embodiments described below are merely preferred embodiments of the present disclosure and do not imply that the present disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely intended to explain the technical principles of the present disclosure and are not intended to limit the scope of protection of the present disclosure. Based on the preferred embodiments provided by the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present disclosure.
[0023] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0024] The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0025] The embodiment provides a 3D model file parsing method, such as Figure 1 As shown, the method provided in the embodiment of the present application mainly includes the following steps: Step 110: Receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, decompress the model compressed file, and obtain the model file.
[0026] In some embodiments, receiving a model compressed file uploaded by a user, reading the file contents in the model compressed file one by one, and decompressing the model compressed file to obtain the model file specifically includes: Receive the model compressed file uploaded by the user through the file upload interface provided by the HTTP protocol; Use the MultipartFile class of the Spring Boot framework to process the file stream corresponding to the model compressed file and verify the model compressed file. If it does not meet the preset verification rules, stop receiving it and feedback the upload failure information. When the preset verification rules are met, the file is decompressed using the Java ZipInputStream class, and the file contents in the model compressed file are read one by one to complete the decompression of the model compressed file and obtain the model file.
[0027] Those skilled in the art will appreciate that this step provides a file upload interface via the HTTP protocol, supporting uploading large files in chunks to avoid transmission failures caused by network interruptions. The model compressed file can be a JSON configuration file in the models directory.
[0028] In addition, this step may also include an exception handling mechanism, the specific contents of which may be: Add exception catching logic during file decompression to handle common problems (such as damaged compressed packages and files named with illegal characters).
[0029] Step 120: traverse the directory tree of the model file and locate the 3D model configuration file in the model file.
[0030] This step may specifically include: traversing the decompressed file directory tree through a recursive algorithm, and locating the 3D model configuration file in the model compression file based on a preset 3D model configuration file sample rule.
[0031] Those skilled in the art will appreciate that this step utilizes a recursive algorithm to traverse the decompressed file directory tree, enabling fully automated scanning of complex nested file structures. By using pre-set sample rules for 3D model configuration files (such as file extension matching and path keyword recognition), the system can accurately identify configuration files scattered across different hierarchical directories, ensuring that no files are missed, even if the model resource files are organized in a non-standard manner. This recursive traversal overcomes the limitations of traditional linear searches, which can only process flat directories, and is particularly well-suited for industrial-grade model files containing hundreds of nested folders. The algorithm simultaneously performs rule matching during the traversal process, and upon detecting a configuration file that meets the sample rules, its absolute path is immediately recorded. This integrated "scan-identify-locate" process effectively avoids the time-consuming process of fully decompressing and then searching again, as is typical with traditional solutions. The rule-based matching mechanism also supports dynamic loading of new configuration file features, enabling the system to adapt to the model format standards of different manufacturers.
[0032] Step 130: Create a fixed thread pool and determine the number of threads in the fixed thread pool based on the number of CPU cores in the current server; generate a parsing task corresponding to the 3D model configuration file, encapsulate the parsing task into an independent Callable task, and submit it to the fixed thread pool for execution; extract the parsing result of the 3D model configuration file by presetting a regular expression in the thread.
[0033] The parsing result includes at least: 3D model type, main file path and resource file path.
[0034] Among them, a fixed thread pool is created, and the number of threads in the fixed thread pool is determined according to the number of CPU cores of the current server. Specifically, it can be: Use ExecutorService to create a fixed thread pool; Get the number of CPU cores on the current server (for example, use Runtime.getRuntime().availableProcessors() to get the number of cores). Based on the mapping between the number of cores and the number of threads, determine the number of threads in the fixed thread pool.
[0035] Among them, by presetting a regular expression in the thread, the parsing result of the 3D model configuration file is extracted, which can be specifically: Use BufferedReader to read the 3D model configuration file line by line, combine Pattern.compile() to compile the preset regular expression, and use the Matcher class to match the target field value in the 3D model configuration file; extract the parsing result of the 3D model configuration file from the target field value; in, Use the regular expression "modelType"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the 3D model type in the parsing node; Use the regular expression: \"([^:"]+)\":[\s| ]*\"([^:"*]+)\" to extract the target field value corresponding to the main file path in the parsing node; Use the regular expression: "([^"]+\\.(png|bin|gltf))"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the resource file path in the parsed node.
[0036] It should be noted that this application can also adopt a recursive parsing strategy for nested resource paths (such as key-value pairs in the assetsURIMap field) to extract path information in the nested levels layer by layer.
[0037] Those skilled in the art will appreciate that this step achieves optimal allocation of hardware resources through a fixed thread pool created by the ExecutorService. The system automatically detects the number of CPU cores on the server (e.g., via Runtime.getRuntime().availableProcessors()) and dynamically adjusts the thread pool size based on the mapping between core and thread numbers. This design ensures that parsing tasks are always aligned with the current hardware computing power, avoiding idle CPU resources caused by too few threads and context switching overhead caused by too many threads. The parsing process for each 3D model configuration file is encapsulated as a separate Callable task and submitted to the thread pool, enabling true parallel parsing of multiple model files. Each thread independently maintains its own BufferedReader and regular expression matcher, ensuring that concurrent file reading avoids I / O blocking or regular expression matching conflicts. Specially optimized regular expressions are used for different parsing targets (e.g., model type, main file path, etc.). For example, "modelType"\s*:\s*"([^"]+)" accurately captures model type declarations with whitespace, enabling the system to maintain high throughput without sacrificing data extraction accuracy.
[0038] A pre-set regular expression system forms an efficient structured data extraction pipeline. Pre-compiled expressions via Pattern.compile() (such as "([^"]+\.(png|bin|gltf))"\s*:\s*"([^"]+)" for matching resource files) are optimized during thread initialization, enabling subsequent Matcher operations to achieve near-native code execution efficiency. Line-by-line reading combined with a multi-regex parallel matching strategy enables processing gigabyte-scale configuration files while extracting related fields scattered across different lines (such as the main file path and its dependent resource file paths). Regular expression design takes formatting into account; for example, "([^:"]+)":[\s| ]"([^:"]+)" accommodates variable spaces or tabs between key-value pairs. All parsing results (including model type, path information, and more) are output as structured objects, providing directly consumable data entities for subsequent cloud storage and digital twin modeling. The fixed size of the thread pool also ensures that the system can maintain a stable memory usage under sustained high load, avoiding the risk of OOM caused by a surge in temporary tasks.
[0039] Step 140: Upload the analysis results and the corresponding 3D model configuration file to cloud storage.
[0040] This application can also record model information to a MySQL database.
[0041] In some embodiments, the technical implementation process may be: Initialize the S3 client: Use the AWS SDK to create an S3 client and specify the bucket name and region.
[0042] File upload: Generate a unique object name (such as UUID + file name) for each file to ensure path uniqueness.
[0043] Use the PutObjectRequest method to upload files to the specified path and enable AES encryption transmission to ensure data security.
[0044] Database records: Design model information table to record model name, category, path, resource files used, texture files and other information.
[0045] Transaction consistency: The Spring transaction manager (@Transactional annotation) ensures the consistency of file uploads and database records, avoiding the situation where the file upload is successful but the database record fails.
[0046] Those skilled in the art will appreciate that this step, through a detailed description of the technical implementation of modules such as file upload and decompression, multi-threaded parsing, dynamic regular expression parsing, and cloud storage and database integration, demonstrates that this technical solution achieves a high level of functionality, performance optimization, and reliability. This technical implementation not only addresses the pain points of existing technologies (such as low efficiency, insufficient compatibility, and poor security), but also provides a comprehensive and efficient solution for data management in the field of industrial digital twins.
[0047] As described above, this embodiment implements a multi-threaded parallel parsing mechanism by introducing the ExecutorService. This allows the system to efficiently process large-scale 3D model configuration files without manual intervention, significantly improving the efficiency and accuracy of data acquisition and processing. Compared to traditional single-threaded or manual parsing methods, this reduces human resource consumption and improves system responsiveness.
[0048] Using Amazon S3 as the primary storage solution ensures data security during transmission, effectively preventing unauthorized access and protecting sensitive information from being leaked. Compared to unencrypted local storage solutions, this invention enhances data protection measures and provides cross-regional data redundancy, further reducing the risk of data loss.
[0049] By combining MySQL database and Redis caching technology, the system not only optimizes resource allocation and avoids repeated queries of invalid data, but also ensures the timeliness and accuracy of data synchronization, improving the stability and reliability of the entire system. Especially in high-concurrency scenarios, Redis caching can significantly reduce database pressure and improve query efficiency.
[0050] Using Amazon S3 as a cloud storage platform and leveraging its extensive application programming interface (API) allows the system to easily connect to various cloud services and IoT platforms, enhancing data transmission flexibility and system scalability. Compared with traditional closed storage solutions, S3's open interface reduces integration costs and promotes interoperability between different systems.
[0051] The microservices architecture, built on the Spring Boot framework, makes the system componentized and modular, making it easy to customize and expand according to different application scenarios. This simplifies deployment and ongoing maintenance, lowers the technical barriers to entry, and improves the overall solution's market adaptability. Furthermore, Spring Boot's automatic configuration features further accelerate development cycles and speed project launches.
[0052] In addition, this application Figure 2 A 3D model file parsing system is provided in the embodiment of the present application. Figure 2 As shown, the system provided in the embodiment of the present application mainly includes: The file decompression module 210 is used to receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, complete the decompression of the model compressed file, and obtain the model file.
[0053] The file decompression module 210 includes a file decompression unit, Used to receive model compressed files uploaded by users through the file upload interface provided by the HTTP protocol; Use the MultipartFile class of the Spring Boot framework to process the file stream corresponding to the model compressed file and verify the model compressed file. If it does not meet the preset verification rules, stop receiving it and feedback the upload failure information. When the preset verification rules are met, the file is decompressed using the Java ZipInputStream class, and the file contents in the model compressed file are read one by one to complete the decompression of the model compressed file and obtain the model file.
[0054] The text positioning module 220 is used to traverse the directory tree of the model file and locate the 3D model configuration file in the model file.
[0055] The positioning text module 220 includes a positioning text unit, It is used to traverse the decompressed file directory tree through a recursive algorithm and locate the 3D model configuration file in the model compressed file based on the preset 3D model configuration file sample rules.
[0056] The thread parsing module 230 is used to create a fixed thread pool and determine the number of threads in the fixed thread pool based on the number of CPU cores in the current server; generate a parsing task corresponding to the 3D model configuration file, encapsulate the parsing task into an independent Callable task, and submit it to the fixed thread pool for execution; extract the parsing result of the 3D model configuration file by presetting a regular expression in the thread; wherein the parsing result includes at least: 3D model type, main file path and resource file path.
[0057] The thread parsing module 230 includes a thread parsing unit, It is used to read the 3D model configuration file line by line using BufferedReader, compile the preset regular expression in combination with Pattern.compile(), and match the target field value in the 3D model configuration file through the Matcher class; extract the parsed result of the 3D model configuration file from the target field value; in, Use the regular expression "modelType"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the 3D model type in the parsing node; Use the regular expression: \"([^:"]+)\":[\s| ]*\"([^:"*]+)\" to extract the target field value corresponding to the main file path in the parsing node; Use the regular expression: "([^"]+\\.(png|bin|gltf))"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the resource file path in the parsed node.
[0058] The result storage module 240 is used to upload the analysis results and the corresponding 3D model configuration files to cloud storage.
[0059] In addition, an embodiment of the present application further provides a non-volatile computer storage medium on which executable instructions are stored. When the executable instructions are executed, a 3D model file parsing method as described above is implemented.
[0060] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A 3D model file parsing method, characterized in that: The method comprises: Receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, decompress the model compressed file, and obtain the model file; Traverse the directory tree of the model file and locate the 3D model configuration file in the model file; Create a fixed thread pool and determine the number of threads in the fixed thread pool based on the current number of server CPU cores; generate a parsing task corresponding to the 3D model configuration file, encapsulate the parsing task into an independent Callable task, and submit it to the fixed thread pool for execution; extract the parsing results of the 3D model configuration file by presetting a regular expression in the thread; the parsing results include at least: 3D model type, main file path, and resource file path; Upload the analysis results and the corresponding 3D model configuration files to cloud storage.
2. The 3D model file parsing method according to claim 1, characterized in that: Receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, decompress the model compressed file, and obtain the model file, which specifically includes: Receive the model compressed file uploaded by the user through the file upload interface provided by the HTTP protocol; Use the MultipartFile class of the Spring Boot framework to process the file stream corresponding to the model compressed file and verify the model compressed file. If it does not meet the preset verification rules, stop receiving it and feedback the upload failure information. When the preset verification rules are met, the file is decompressed using the Java ZipInputStream class, and the file contents in the model compressed file are read one by one to complete the decompression of the model compressed file and obtain the model file.
3. The 3D model file parsing method according to claim 1, characterized in that: Traverse the directory tree of the model file and locate the 3D model configuration file in the model file, including: The file directory tree of the model file is traversed through a recursive algorithm, and the 3D model configuration file in the model file is located based on a preset 3D model configuration file sample rule.
4. The 3D model file parsing method according to claim 1, characterized in that: Create a fixed thread pool and determine the number of threads in the fixed thread pool based on the current number of CPU cores on the server. Specifically: Use ExecutorService to create a fixed thread pool; Get the number of CPU cores on the current server and determine the number of threads in the fixed thread pool based on the mapping between the number of cores and the number of threads.
5. The 3D model file parsing method according to claim 1, characterized in that: By presetting regular expressions in the thread, the parsing results of the 3D model configuration file are extracted, including: Use BufferedReader to read the 3D model configuration file line by line, combine Pattern.compile() to compile the preset regular expression, and use the Matcher class to match the target field value in the 3D model configuration file; extract the parsing result of the 3D model configuration file from the target field value; in, Use the regular expression "modelType"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the 3D model type in the parsing node; Use the regular expression: \"([^:"]+)\":[\s| ]*\"([^:"*]+)\" to extract the target field value corresponding to the main file path in the parsing node; Use the regular expression: "([^"]+\\.(png|bin|gltf))"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the resource file path in the parsed node.
6. A 3D model file parsing system, characterized in that: The system comprises: The file decompression module is used to receive the model compressed file uploaded by the user, read the file contents in the model compressed file one by one, complete the decompression of the model compressed file, and obtain the model file; The positioning text module is used to traverse the directory tree of the model file and locate the 3D model configuration file in the model file; The thread parsing module is used to create a fixed thread pool and determine the number of threads in the fixed thread pool based on the current number of server CPU cores; generate a parsing task corresponding to the 3D model configuration file, encapsulate the parsing task into an independent Callable task, and submit it to the fixed thread pool for execution; extract the parsing results of the 3D model configuration file by presetting a regular expression in the thread; the parsing results include at least: 3D model type, main file path, and resource file path; The result storage module is used to upload the analysis results and the corresponding 3D model configuration files to the cloud storage.
7. The 3D model file parsing system according to claim 6, characterized in that: The file decompression module includes a file decompression unit, Used to receive model compressed files uploaded by users through the file upload interface provided by the HTTP protocol; Use the MultipartFile class of the Spring Boot framework to process the file stream corresponding to the model compressed file and verify the model compressed file. If it does not meet the preset verification rules, stop receiving it and feedback the upload failure information. When the preset verification rules are met, the file is decompressed using the Java ZipInputStream class, and the file contents in the model compressed file are read one by one to complete the decompression of the model compressed file and obtain the model file.
8. The 3D model file parsing system according to claim 6, characterized in that: The positioning text module includes the positioning text unit, It is used to traverse the decompressed file directory tree through a recursive algorithm and locate the 3D model configuration file in the model compressed file based on the preset 3D model configuration file sample rules.
9. The 3D model file parsing system according to claim 6, characterized in that: The thread parsing module includes a thread parsing unit, Used to read the 3D model configuration file line by line using BufferedReader, compile the preset regular expression in combination with Pattern.compile(), and match the target field value in the 3D model configuration file through the Matcher class; Extract the parsing result of the 3D model configuration file from the target field value; in, Use the regular expression "modelType"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the 3D model type in the parsing node; Use the regular expression: \"([^:"]+)\":[\s| ]*\"([^:"*]+)\" to extract the target field value corresponding to the main file path in the parsing node; Use the regular expression: "([^"]+\\.(png|bin|gltf))"\\s*:\\s*"([^"]+)" to extract the target field value corresponding to the resource file path in the parsed node.
10. A non-volatile computer storage medium, characterized in that Computer instructions are stored thereon, and when the computer instructions are executed, a 3D model file parsing method according to any one of claims 1 to 5 is implemented.