IFC component parsing method and system based on multi-thread and trie tree

By combining multithreading with Trie trees, the IFC component parsing method solves the problems of long component loading time and high memory consumption in the existing technology, and achieves efficient IFC component parsing and data exchange.

CN122363772APending Publication Date: 2026-07-10
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610476693.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Priority Date
2025-12-31
Filing Date
2026-04-10
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing IFC component parsing methods lack component type classification optimization and attribute fast retrieval capabilities when dealing with large-scale components, resulting in long component loading times, high memory consumption, and difficulty in supporting real-time engineering applications and high-frequency data interaction.

Method used

A multi-threaded approach combined with a Trie tree is adopted. The Trie tree matching index is constructed by initializing the IfcParseThread multi-threaded parser, concurrent parsing threads are created, the unique type identifier of the component entity is identified, geometric information processing and attribute set association are performed, and a JSON description file is generated.

Benefits of technology

It achieves efficient parsing of IFC components, reduces redundant calculations and storage overhead, improves the efficiency of component classification and geometric data reuse, and supports lightweight applications and data exchange.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363772A_ABST
    Figure CN122363772A_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer modeling technology in architectural engineering, and discloses a method and system for parsing IFC components based on multithreading and Trie trees. The method includes: initializing an IfcParseThread multithreaded parser and constructing a Trie tree matching index during the initialization process; creating concurrent parsing threads within the initialized IfcParseThread multithreaded parser to identify component entities in the IFC file; performing geometric information processing on the component entities within the initialized IfcParseThread multithreaded parser based on the unique type identifier determined by the Trie tree matching index; and instantiating and associating the geometric information processing results with the attribute set of the component entities, outputting a JSON description file of the component instance. This invention can improve the overall parsing efficiency of IFC components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an IFC component parsing method and system based on multithreading and Trie trees, belonging to the field of computer modeling technology for architectural engineering. Background Technology

[0002] With the widespread application of Building Information Modeling (BIM) technology in engineering design, construction, and operation and maintenance, IFC (Industry Foundation Classes), as an open building data exchange standard, has become an important carrier for industry data integration and collaboration. In order to transform the component information in IFC into structured data that can be directly used by applications, the IFCPartParse class parsing component has emerged. Its core task is to efficiently extract the geometric and attribute information of building components from IFC files and convert it into structured formats such as JSON to support subsequent applications.

[0003] Existing parsing methods mostly use a single-threaded, item-by-item traversal approach to process component data. Although this method is simple to implement and easy to deploy, it lacks the ability to classify and optimize component types and quickly retrieve attributes when processing large-scale IFC components. This results in long component loading times, high memory consumption, and difficulty in supporting real-time engineering applications and high-frequency data interaction. Summary of the Invention

[0004] This invention provides a method and system for parsing IFC components based on multithreading and Trie trees, the main purpose of which is to improve the overall parsing efficiency of IFC components.

[0005] To achieve the above objectives, the present invention provides an IFC component parsing method based on multithreading and Trie trees, comprising: Initialize the IfcParseThread multithreaded parser and construct the Trie tree matching index during the initialization process of the IfcParseThread multithreaded parser. In the initialized IfcParseThread multi-threaded parser, a concurrent parsing thread is created. The concurrent parsing thread identifies the component entity from the IFC file to be parsed and determines the unique type identifier of the component entity based on the Trie tree matching index. In the initialized IfcParseThread multi-threaded parser, the geometric information processing of the component entity is performed based on the unique type identifier to obtain the geometric information processing result; The geometric information processing result is instantiated and associated with the attribute set of the component entity to generate a component instance. Based on the unique type identifier, a JSON description file of the component instance is output.

[0006] Optionally, during the initialization of the IfcParseThread multi-threaded parser, a Trie tree matching index is constructed, including: After the IfcParseThread multi-threaded parser completes the parsing environment configuration, it reads the predefined IFC attribute configuration file. Extract the key attribute names from the IFC attribute configuration file; Based on preset attribute classification rules, assign type identifiers corresponding to the key attribute names; Based on the type identifier, construct a multi-way tree index structure for the key attribute name; The multi-way tree index structure is stored in the shared memory of the IfcParseThread multi-threaded parser to complete the construction of the Trie tree matching index.

[0007] Optionally, based on the type identifier, a multi-way tree index structure for the key attribute name is constructed, including: Based on the type identifier, the key attribute names are grouped and mapped to obtain the grouping mapping results; Based on the grouping mapping results, the character node hierarchy of the key attribute names is divided; After injecting the type identifier into the end storage node of the character node level, the character node level is merged into the multi-branch tree index structure according to the preset tree structure integration rules.

[0008] Optionally, injecting the type identifier into the end storage node of the character node hierarchy includes: Read the individual characters in the key attribute names sequentially; Match the character node corresponding to the independent character in the current level of the multi-way tree index structure; Based on the character node, the type identifier is injected into the end storage node of the character node level.

[0009] Optionally, a concurrent parsing thread is created in the initialized IfcParseThread multi-threaded parser, including: Obtain the total available resources and the total number of components to be processed of the initialized IfcParseThread multithreaded parser, so as to determine the number of thread instantiations corresponding to the initialized IfcParseThread multithreaded parser; A shared task queue is established in the initialized IfcParseThread multithreaded parser; Determine the concurrency control parameters for each queue in the shared task queue; Based on the number of thread instantiations, the shared task queue, and the concurrency control parameters, a concurrent parsing thread is created in the initialized IfcParseThread multi-threaded parser.

[0010] Optionally, determining the concurrency control parameters for each queue in the shared task queue includes: Identify the data dependencies between the queues in the shared task queue; Based on the aforementioned data dependencies, a data synchronization path is established between each queue; Based on the preset concurrency access control protocol, set data access locks for each queue; Based on the data synchronization path and the data access lock, determine the concurrency control parameters of each queue in the shared task queue.

[0011] Optionally, in the initialized IfcParseThread multi-threaded parser, based on the unique type identifier, geometric information processing of the component entity is performed to obtain the geometric information processing result, including: Invoke the geometry data cache pool of the initialized IfcParseThread multi-threaded parser; Identify the geometric data reuse status corresponding to the unique type identifier from the geometric data cache pool; Based on the geometric data reuse status, a standardized geometric dataset of the component entity is generated; Based on the geometric dataset to be processed, the geometric construction and coordinate transformation of the component entity are performed to obtain the geometric information processing result.

[0012] Optionally, the geometry construction and coordinate transformation processing includes: performing coordinate transformation processing when the geometric dataset to be processed is reused geometric data, and performing triangle mesh construction and coordinate transformation processing when the geometric dataset to be processed is newly generated geometric data.

[0013] Optionally, the JSON description file includes a part type information file, a vertex information file, a part information file, and a bolt information file.

[0014] To address the aforementioned problems, this invention also provides an IFC component parsing system based on multithreading and Trie trees, the system comprising: The parser initialization module is used to initialize the IfcParseThread multi-threaded parser and build a Trie tree matching index during the initialization process of the IfcParseThread multi-threaded parser. The parallel parsing module is used to create concurrent parsing threads in the initialized IfcParseThread multi-threaded parser, identify component entities from the IFC file to be parsed through the concurrent parsing threads, and determine the unique type identifier of the component entity according to the Trie tree matching index. The geometry processing module is used to perform geometry information processing on the component entity based on the unique type identifier in the initialized IfcParseThread multi-threaded parser, and obtain the geometry information processing result. The result output module is used to instantiate and associate the geometric information processing result with the attribute set of the component entity to generate a component instance, and output the JSON description file of the component instance based on the unique type identifier.

[0015] Compared to the problems described in the background art, this embodiment of the invention, by initializing the IfcParseThread multi-threaded parser, creates a core parsing engine with global Trie tree indexing and multi-threaded management capabilities, providing an executable runtime environment for subsequent efficient attribute classification and parallel geometric processing based on the index. Furthermore, by creating concurrent parsing threads within the initialized IfcParseThread multi-threaded parser, this embodiment of the invention enables parallel processing of massive component entities in the IFC file, ensuring efficient and coordinated execution of subsequent component attribute classification and geometric data reuse. This embodiment of the invention, by using the unique type identifier within the initialized IfcParseThread multi-threaded parser... By performing geometric information processing on the component entities, geometric data of similar components can be reused and merged, significantly reducing redundant calculations and storage overhead, and improving the overall parsing efficiency of IFC components. Furthermore, by instantiating and associating the geometric information processing results with the attribute set of the component entities to generate component instances, this embodiment of the invention achieves complete binding of component geometric information and attribute information, providing structured and independently operable data units for subsequent JSON format output and BIM applications. Finally, by outputting a JSON description file of the component instance based on the unique type identifier, this embodiment of the invention enables the categorized storage and structured output of different types of components, providing a standardized interface for lightweight applications and data exchange of Building Information Modeling. Therefore, this invention can improve the overall parsing efficiency of IFC components. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating an IFC component parsing method based on multithreading and a Trie tree, provided in an embodiment of the present invention. Figure 2This is a schematic diagram of a module for implementing the IFC component parsing system based on multithreading and Trie tree according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a computer device for an IFC component parsing method based on multithreading and Trie tree, as provided in an embodiment of the present invention.

[0017] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0018] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0019] This application provides an IFC component parsing method based on multithreading and Trie trees. The execution entity of this multithreaded and Trie-tree-based IFC component parsing method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the multithreaded and Trie-tree-based IFC component parsing method can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster.

[0020] Reference Figure 1 The diagram shown is a flowchart illustrating an IFC component parsing method based on multithreading and a Trie tree according to an embodiment of the present invention. In this embodiment, the IFC component parsing method based on multithreading and a Trie tree includes: S1. Initialize the IfcParseThread multi-threaded parser and build the Trie tree matching index during the initialization process of the IfcParseThread multi-threaded parser.

[0021] This invention initializes the IfcParseThread multi-threaded parser, creating a core parsing engine with global Trie tree indexing and multi-threaded management capabilities. This provides an executable runtime environment for subsequent implementation of efficient attribute classification and parallel geometric processing based on indexes. The IfcParseThread multi-threaded parser is a computational module specifically designed for concurrent parsing of IFC format building information model files. Based on a multi-threaded programming architecture, this parser can start multiple parsing subtasks simultaneously, thereby enabling synchronous reading and processing of a large number of component entities contained in the file.

[0022] As an embodiment of the present invention, initializing the IfcParseThread multi-threaded parser includes: Receive the instance creation request corresponding to the IfcParseThread multi-threaded parser, and extract the geometry kernel parameters and parsing configuration parameters from the instance creation request; Based on the geometric kernel parameters and the parsing configuration parameters, an instance object of the IfcParseThread multi-threaded parser is constructed; Set the start callback function and the completion callback function for the instance object; The thread scheduling framework and concurrent resource pool of the instance object are initialized using the start callback function, and the initialization status of the thread scheduling framework and concurrent resource pool is verified through the completion callback function. Once the initialization state meets the preset availability criteria, the IfcParseThread multi-threaded parser that has completed initialization is obtained.

[0023] The instance creation request refers to an instruction issued by an upper-level application or system module, requesting the instantiation of an IfcParseThread multi-threaded parser module. The geometry kernel parameter is a key configuration item specifying the type or identifier of the underlying geometry calculation library used by the parser. Specifically, the value of the geometry kernel parameter can be "opencascade," indicating that the parser should initialize and use the specific geometry modeling kernel, Open CASCADE Technology, to process all component geometry. The parsing configuration parameter is a set of configurable options used to control the behavior and output of the IFC file parsing process. For example, the parsing configuration parameter may include three Boolean options: "Do not use world coordinate system," "Generate UV coordinates," and "Calculate normals," which respectively control whether coordinate transformation, texture coordinate generation, and normal vector calculation functions are enabled or disabled. The instance object refers to a specific and runnable instance of the IfcParseThread multi-threaded parser module successfully created in computer memory according to the parameters in the instance creation request. The start callback function is a user-defined or system-preset function that is registered to the parser instance and is scheduled to be automatically called by the parser before the parsing task officially begins. The specific implementation of the number of worker threads can include creating a specified number of worker threads, allocating a shared memory pool, and initializing a global task queue. The completion callback function is a user-defined or system-preset function registered with the parser instance and scheduled to be automatically invoked by the parser after all threads in the parsing task have completed execution. This completion callback function can be used to check whether all worker threads have safely exited, verify whether the concurrent resource pool has been completely released, and generate a parsing process summary report. The thread scheduling framework is a software submodule integrated within the parser instance, specifically responsible for managing the lifecycle and execution scheduling of all worker threads in the parsing task. For example, a thread pool based on a work-stealing algorithm can be specifically implemented as this thread scheduling framework. The concurrent resource pool refers to a set of reusable system resources pre-allocated and managed by the parser instance, typically including memory blocks, file handles, or database connections. For example, the parser can initialize a memory pool containing 100 fixed-size memory blocks for all parsing threads to request when they need to temporarily store geometric data, in order to avoid frequent system memory allocation calls; the initialization state refers to the general term for the running status and resource readiness of the thread scheduling framework and concurrent resource pool after the startup configuration is completed.For example, the initialization state may include information such as "the number of ready threads in the thread pool", "the remaining capacity of the concurrent memory pool", and "the current depth of the task queue". The availability criterion refers to a set of predefined technical conditions used to determine whether the initialization state of the thread scheduling framework and the concurrent resource pool meets the normal working requirements. Specifically, the availability criterion may stipulate that the number of successfully created threads in the thread pool must be no less than 90% of the number of requests, and the initial allocation success rate of the concurrent memory pool must be 100%. Only when the initialization state meets all these conditions will the verification pass.

[0024] Optionally, the start callback function of the instance object can be implemented by binding a custom JavaScript function during instance initialization, which is automatically triggered when the instance begins to perform a specific operation; the completion callback function can be set by calling the .then() method on the Promise object returned by the asynchronous operation to ensure that subsequent processing logic is executed when the operation is completed.

[0025] Furthermore, based on the geometric kernel parameters and the parsing configuration parameters, an instance object of the IfcParseThread multi-threaded parser is constructed, including: When the geometric kernel parameter is the preset opencascade identifier, the kernel initialization process is triggered; When the parsed configuration parameters indicate that local coordinate system processing is required, the coordinate setting process is triggered; When the parsed configuration parameters indicate that UV coordinates need to be generated, the texture generation process is triggered; When the parsed configuration parameters indicate that normal data needs to be retained, the normal calculation process is triggered; Based on the execution results of the kernel initialization process, the coordinate setting process, the texture generation process, and the normal calculation process, an instance object of the IfcParseThread multi-threaded parser is constructed.

[0026] The `opencascade` identifier is a string or enumeration value that uniquely identifies the Open CASCADE Technology geometry modeling kernel. When the geometry kernel parameter is assigned this identifier, the system will select and load the corresponding Open CASCADE library as the geometry processing engine. For example, in the system's configuration mapping table, the string "OCC" or the numerical constant 1 is defined as the `opencascade` identifier. The kernel initialization process refers to a series of initialization operations performed during the parser construction process to start and configure the selected geometry modeling kernel based on the geometry kernel parameters. For example, when the geometry kernel parameter is the opencascade identifier, the kernel initialization process will dynamically load the Open CASCADE shared library, create its core handle object, and set the basic modeling tolerance; the local coordinate system processing refers to a parsing configuration option. When this option is enabled, the system is required to maintain the local coordinates relative to the origin of the component when extracting the component's geometric information, instead of automatically transforming to the global world coordinate system; the coordinate setting process refers to the configuration operation performed on the internal coordinate transformation module during the parser construction process according to the coordinate system processing option in the parsing configuration parameters; the UV coordinates refer to a set of two-dimensional parameter coordinates used to map a two-dimensional texture image to the surface of a three-dimensional geometric model. They are usually used for texturing during rendering. In the IFC parsing context, generating UV coordinates means calculating the corresponding texture coordinates for each triangle vertex that constitutes the surface of the component. For example, generating UV coordinates for the triangular mesh of a rectangular steel plate component ensures correct display of the rust texture map. The texture generation process refers to the configuration and initialization operations performed on the internal texture coordinate calculation module during the resolver construction process, based on the UV coordinate generation options in the resolver configuration parameters. Normal data refers to the vector information describing the orientation of each vertex on the surface of a 3D model. In the IFC resolver context, preserving normal data means calculating and storing the normal vector for each triangular face or vertex. For example, when resolving a curved roof component, the normal of each vertex needs to be calculated to achieve accurate lighting effects in the 3D view. The normal calculation process refers to the configuration and initialization operations performed on the internal normal vector calculation module during the resolver construction process, based on the normal data options in the resolver configuration parameters. The execution result refers to the collection of states, configuration objects, and resource handles output after the completion of the kernel initialization process, coordinate setting process, texture generation process, and normal calculation process. For example, the execution result of the kernel initialization process might be an initialized Open CASCADE geometry service handle; the execution result of the coordinate setting process might be an enumeration value identifying the coordinate system processing mode.

[0027] This invention, through the construction of a Trie tree matching index during the initialization of the IfcParseThread multi-threaded parser, provides a shared and efficient attribute name query structure for all subsequently constructed concurrent parsing threads. This eliminates the performance competition and query latency that may occur in a multi-threaded environment by traditional linear traversal or hash comparison, laying a crucial data classification foundation for subsequent geometric reuse and parallel processing based on type identifiers.

[0028] The Trie tree matching index refers to a global data structure built during the initialization phase of the IfcParseThread multi-threaded parser, based on the principle of string prefix matching. It inserts predefined component attribute name keywords (such as "OuterSurfaceArea" and "BoltDiameter") as character paths into the tree and associates the corresponding component type identifier with the path endpoint node, thereby providing a read-only shared index for all concurrent parsing threads to perform high-speed retrieval and classification of attribute names.

[0029] As an embodiment of the present invention, the construction of a Trie tree matching index during the initialization process of the IfcParseThread multi-threaded parser includes: After the IfcParseThread multi-threaded parser completes the parsing environment configuration, it reads the predefined IFC attribute configuration file. Extract the key attribute names from the IFC attribute configuration file; Based on preset attribute classification rules, assign type identifiers corresponding to the key attribute names; Based on the type identifier, construct a multi-way tree index structure for the key attribute name; The multi-way tree index structure is stored in the shared memory of the IfcParseThread multi-threaded parser to complete the construction of the Trie tree matching index.

[0030] The parsing environment configuration refers to the set of basic operating parameters set for the IfcParseThread multi-threaded parser, including geometry kernel selection, coordinate system setting, normal processing flags, and callback function binding. The IFC attribute configuration file is a list file stored in a structured format containing the names of building component attributes that need to be identified and classified according to the IFC standard. The key attribute name refers to the attribute field name selected from the above configuration file that plays a decisive role in component classification or information extraction. For example, in the component classification process, "Part mark" is identified as a key attribute name to distinguish different component types; "Bolt size" is identified as another key attribute name to determine bolt size classification. The attribute classification rule refers to predefined logical criteria used to divide different attribute names into different categories based on component type and parsing target. Specifically, the attribute classification rule includes: if the attribute name is 'Part...'... If the attribute name contains 'mark', then the type attribute identifier 0x0000 is assigned; if the attribute name contains 'Bolt' and is a specification parameter, then the bolt type attribute identifier 0x4000 is assigned; otherwise, the information attribute identifier 0x8000 is assigned. The type identifier refers to a unique symbol code assigned to each key attribute name according to the attribute classification rules, used to identify its category in the index. The multi-branch tree index structure refers to a tree data structure based on prefix matching, with characters as nodes and attribute name strings as paths. For example, for the attribute name "NetWeight", its corresponding tree path is root node → 'N' → 'e' → 't' → 'W' → 'e' → 'i' → 'g' → 'h' → 't', and its type identifier is stored at the leaf nodes. The shared memory refers to the memory area accessed by all concurrently executing parsing threads in the IfcParseThread multi-threaded parser and used to store common index data.

[0031] Optionally, the IFC attribute configuration file can be read using Python's json module to parse the file content into a structured data object; the type identifier can be mapped and assigned using predefined enumeration types, such as mapping the attribute name "Part mark" to the enumeration value PROPERTY_TYPE_MARK.

[0032] As an optional embodiment of the present invention, based on the type identifier, a multi-way tree index structure for the key attribute name is constructed, including: Based on the type identifier, the key attribute names are grouped and mapped to obtain the grouping mapping results; Based on the grouping mapping results, the character node hierarchy of the key attribute names is divided; After injecting the type identifier into the end storage node of the character node level, the character node level is merged into the multi-branch tree index structure according to the preset tree structure integration rules.

[0033] The grouping mapping refers to the process of classifying and grouping key attribute names according to different attribute categories based on the type identifier. For example, all key attribute names with type identifier 0x0000 are grouped into the type attribute group, and all key attribute names with type identifier 0x4000 are grouped into the bolt type attribute group. The character node hierarchy refers to the hierarchical node relationship formed in the multi-branch tree index structure by mapping each character to a level position in the tree structure according to the order of the characters in the attribute name string. The terminal storage node refers to the final tree node reached after all characters of a key attribute name have been matched or created. This node is used to store the type identifier corresponding to the attribute name. For example, for the attribute name "NetWeight", the node located after processing the last character "t" is the terminal storage node, which stores the type identifier that identifies its category. The tree structure integration rule refers to the logical criteria for merging multiple character node hierarchy fragments formed under different grouping mappings into a single, complete multi-branch tree index structure based on the parent-child relationship and path sharing principle between character nodes. For example, if the attribute names “Part” and “PartMark” share the common prefix “Part”, they share the first four character nodes during merging and only form branches at subsequent character nodes, thus forming an integrated multi-way tree that avoids redundant nodes.

[0034] Specifically, according to the preset tree structure integration rules, merging the character node levels into the multi-branch tree index structure means merging different character node levels with the same starting character sequence and reusing nodes based on the common prefix path between character nodes; for character node levels that do not share prefixes, independent branch paths are formed with the root node of the multi-branch tree as the common starting point; finally, all branch paths and merged paths are organized into a complete multi-branch tree with a single root node as the starting point, so that each key attribute name corresponds to a unique character path from the root node to a certain leaf node, and its type identifier is stored at the leaf node of the path, thereby completing the construction of the multi-branch tree index structure.

[0035] As another optional embodiment of the present invention, injecting the type identifier into the end storage node of the character node level includes: Read the individual characters in the key attribute names sequentially; Match the character node corresponding to the independent character in the current level of the multi-way tree index structure; Based on the character node, the type identifier is injected into the end storage node of the character node level.

[0036] Here, the independent character refers to each single letter, number, or symbol element that constitutes the string of the key attribute name; the current level refers to the depth position of the character node currently being processed in the multi-way tree index structure. This level is determined by the path length from the root node to the current node and is dynamically updated as character processing progresses. For example, when processing "NetWeight", after processing the first three characters "Net", the current level is at a node with a depth of 3, and the next character to be processed, "W", should be matched in the child node level of this node; the character node refers to a storage unit representing an independent character in the multi-way tree index structure. Each character node contains a character identifier, a reference pointer to a child node, and optional additional data fields. Optionally, matching character nodes in the current level of the Trie tree can be achieved by maintaining a hash lookup table (such as std::unordered_map) with characters as keys and child node pointers as values ​​in the current node.

[0037] Further, based on the character node, injecting the type identifier into the end storage node of the character node hierarchy includes: When a character node corresponding to the independent character is matched in the current level, the character node is used as the starting node of the new current level; When no character node corresponding to the independent character is matched in the current level, the independent character is set as a new character node under the current starting node, and the new character node is used as the new starting node of the current level; After all the independent characters have been matched, the final determined current level start node is identified as the end storage node, and the type identifier is injected into the end storage node.

[0038] S2. Create a concurrent parsing thread in the initialized IfcParseThread multi-threaded parser, identify the component entity from the IFC file to be parsed through the concurrent parsing thread, and determine the unique type identifier of the component entity according to the Trie tree matching index.

[0039] This invention enables parallel processing of massive component entities in IFC files by creating concurrent parsing threads in the initialized IfcParseThread multi-threaded parser, ensuring efficient and coordinated execution of subsequent component attribute classification and geometric data reuse.

[0040] The concurrent parsing threads refer to multiple independent parsing execution units that are started and run simultaneously under the unified scheduling and management of the multi-threaded parser. They mainly consist of entity recognition threads, attribute extraction threads, and geometry processing threads connected through a shared task queue. Each parsing thread is responsible for processing a subset of component data in the IFC file. The threads share memory resources but their execution processes are independent of each other. Synchronous or asynchronous component parsing task processing is achieved through time-slice rotation or parallel computing mechanisms.

[0041] As an embodiment of the present invention, creating concurrent parsing threads in the initialized IfcParseThread multi-threaded parser includes: Obtain the total available resources and the total number of components to be processed of the initialized IfcParseThread multithreaded parser, so as to determine the number of thread instantiations corresponding to the initialized IfcParseThread multithreaded parser; A shared task queue is established in the initialized IfcParseThread multithreaded parser; Determine the concurrency control parameters for each queue in the shared task queue; Based on the number of thread instantiations, the shared task queue, and the concurrency control parameters, a concurrent parsing thread is created in the initialized IfcParseThread multi-threaded parser.

[0042] Wherein, the total available resources refer to the sum of the number of processor cores, memory capacity, and number of computing threads that can be called when the IfcParseThread multi-threaded parser runs; the total number of components to be processed refers to the total number of component entities contained in the IFC file to be parsed; the number of thread instantiations refers to the number of threads that need to be created and can be executed in parallel, calculated based on resources and task scale; the shared task queue refers to the set of data structures used to store parsing tasks of components to be processed, which are accessed by multiple parsing threads; and the concurrency control parameters refer to the set of synchronization configuration parameters used to coordinate the safe access of multiple threads to the shared queue.

[0043] Optionally, the total available resources of the initialized IfcParseThread multi-threaded parser can be obtained through the system performance monitoring interface, and the total number of components to be processed can be determined through the file parser.

[0044] As an optional embodiment of the present invention, a shared task queue is established in the initialized IfcParseThread multi-threaded parser, including: The component processing flow and task classification rules of the initialized IfcParseThread multi-threaded parser are analyzed. Based on the component processing flow and the task classification rules, the task division boundaries, data interface specifications and thread synchronization requirements of the initialized IfcParseThread multi-threaded parser are identified. Based on the task partitioning boundaries, the data interface specifications, and the thread synchronization requirements, a shared task queue is established in the initialized IfcParseThread multi-threaded parser.

[0045] The component processing flow refers to the sequence of steps followed when parsing IFC components, including three stages: entity recognition, attribute extraction, and geometric processing. The task classification rule refers to the criteria for dividing parsing tasks into different categories based on component type, data characteristics, or processing priority. The task division boundary refers to the separation of responsibilities and data handover interface between different categories of parsing tasks. The data interface specification refers to the structured format and communication protocol followed when data is transferred between task queues. The thread synchronization requirement refers to the coordination requirements for data consistency, sequential execution, and resource mutual exclusion when multiple threads execute concurrently.

[0046] Optionally, the component processing flow of the initialized IfcParseThread multi-threaded parser can be parsed using a finite state machine model, and the task classification rules can be determined using a decision tree model.

[0047] As another optional embodiment of the present invention, determining the concurrency control parameters of each queue in the shared task queue includes: Identify the data dependencies between the queues in the shared task queue; Based on the aforementioned data dependencies, a data synchronization path is established between each queue; Based on the preset concurrency access control protocol, set data access locks for each queue; Based on the data synchronization path and the data access lock, determine the concurrency control parameters of each queue in the shared task queue.

[0048] The data dependency refers to the input-output association between different task queues due to the data processing order. Optionally, a directed acyclic graph can be used to identify the data dependency. The data synchronization path refers to a data channel or message queue used to transmit processing results between queues with dependencies. The data access lock refers to a synchronization control unit based on a spin lock mechanism, used to control the serialized access of multiple concurrent threads in the IfcParseThread multi-threaded parser to the same shared task queue. For example, when the attribute extraction thread and the geometry processing thread access the attribute extraction task queue simultaneously, the data access lock can ensure that only one thread performs read and write operations on the queue at any given time, thereby preventing data contention and maintaining the consistency of the queue state.

[0049] Optionally, the data synchronization path can be implemented by allocating a shared memory buffer among multiple threads. For example, the entity recognition thread writes the recognition results to a fixed-size circular buffer, while the attribute extraction thread reads from this buffer, thereby achieving efficient zero-copy data transfer; spin locks can be used to set data access locks for each queue.

[0050] Furthermore, in this embodiment of the invention, the component entities are identified from the IFC file to be parsed through the concurrent parsing thread, which can provide a structured entity foundation for subsequent attribute classification and geometric data reuse. The IFC file refers to a building information model data file that conforms to the industrial basic class standard format and contains geometric information, attribute information and relational information of building components. The component entity refers to the data object in the IFC file that represents a specific building element, including large components, small components and bolts, etc. Each component entity contains a type identifier, geometric expression and attribute set.

[0051] This invention, through the Trie tree matching index, determines the unique type identifier of the component entity, enabling rapid classification and standardized identification of components in IFC files. This provides accurate type basis for subsequent geometric reuse and data output. The unique type identifier refers to a unique code assigned to each component entity to distinguish its type category after matching component attributes according to the Trie tree matching index. For example, a type identifier "BEAM-001" can be assigned to a general steel beam component, and a type identifier "BOLT-M16-002" can be assigned to a bolt component of a specific specification.

[0052] Specifically, determining the unique type identifier of the component entity based on the Trie tree matching index includes: first, extracting attribute set definitions from IfcTypeObject and IfcObject associated with the component entity; then, using a breadth-first search (BFS) strategy to traverse all relevant attribute sets and attribute definitions to obtain a complete list of attribute names; further, comparing each attribute name obtained through traversal with the Trie tree matching index to identify the matching attribute name and its associated type identifier; finally, generating a unique type identifier corresponding to the component entity based on a combination of one or more matched type identifiers according to a preset type determination rule.

[0053] S3. In the initialized IfcParseThread multi-threaded parser, based on the unique type identifier, perform geometric information processing on the component entity to obtain the geometric information processing result.

[0054] In this embodiment of the invention, by performing geometric information processing of the component entity based on the unique type identifier in the initialized IfcParseThread multi-threaded parser, geometric data of similar components can be reused and merged, significantly reducing redundant calculation and storage overhead, and improving the overall parsing efficiency of IFC components.

[0055] As an embodiment of the present invention, in the initialized IfcParseThread multi-threaded parser, based on the unique type identifier, geometric information processing of the component entity is performed to obtain the geometric information processing result, including: Invoke the geometry data cache pool of the initialized IfcParseThread multi-threaded parser; Identify the geometric data reuse status corresponding to the unique type identifier from the geometric data cache pool; Based on the geometric data reuse status, a standardized geometric dataset of the component entity is generated; Based on the geometric dataset to be processed, the geometric construction and coordinate transformation of the component entity are performed to obtain the geometric information processing result.

[0056] Further, based on the geometric data reuse status, a standardized geometric dataset of the component entity is generated, including: Check whether the reuse status of the geometric data meets the preset reuse conditions; When the geometric data reuse status is found to meet the reuse conditions, the stored geometric data associated with the unique type identifier is retrieved from the geometric data cache pool as a standardized geometric dataset. When it is found that the geometric data reuse status does not meet the reuse conditions, the original geometric information is read from the geometric representation of the component entity, and the mesh normalization process of the original geometric information is performed to generate a normalized geometric dataset.

[0057] The geometric data cache pool refers to a shared memory area in the IfcParseThread multi-threaded parser used to store processed component geometric data, such as a key-value pair storage area with type identifier as the key and geometric mesh data as the value. The geometric data reuse status refers to a status flag indicating whether geometric data for a certain type of component already exists in the cache pool; for example, a boolean value "true" indicates cached and reusable, and "false" indicates not cached and needs to be generated. The standardized geometric dataset refers to a complete set of geometric data containing vertex coordinates, triangle face indices, normal vectors, and UV coordinates after being processed in a unified format. The reuse condition refers to the logical judgment criteria for triggering geometric reuse; for example, the geometric data reuse status is "cached" and the version of the corresponding geometric data is compatible with the current parsing requirements. The stored geometric data refers to data that has been previously processed and stored in the geometric data cache pool. The standardized geometric dataset corresponding to the unique type identifier; the geometric representation refers to the original data format describing the shape of the component in the IFC file, including boundary representation, scan volume, or geometric representation of the constructed entity; the original geometric information refers to the basic geometric element data such as vertices, edges, and faces directly parsed from the geometric representation without standardization processing; the mesh standardization processing refers to the process of converting the original geometric information into a unified format triangular mesh, including triangulation, vertex deduplication, normal calculation, and UV mapping; the geometric construction refers to the process of generating a triangular mesh based on the geometric dataset of the component entity, where the triangular mesh refers to a standardized geometric model used for rendering and calculation, represented by a vertex list and a triangular face index list; the coordinate transformation processing refers to the matrix operation process of converting the geometric data of the component from local coordinates to world coordinates according to the local coordinate system and placement information in the IFC file.

[0058] Optionally, the triangular mesh of the component entity can be constructed using the Delaunay triangulation method; the coordinate transformation of the component entity can be achieved using an affine transformation matrix.

[0059] S4. Instantiate and associate the geometric information processing result with the attribute set of the component entity to generate a component instance. Based on the unique type identifier, output the JSON description file of the component instance.

[0060] This invention generates a component instance by instantiating and associating the geometric information processing result with the attribute set of the component entity. This enables the complete binding of component geometric information and attribute information, providing structured and independently operable data units for subsequent JSON format output and BIM applications.

[0061] The attribute set refers to the set of attribute key-value pairs extracted from the IFC file and associated with a specific component entity, including type attributes, bolt attributes, and information attributes; the instantiation association refers to the process of establishing a one-to-one data binding relationship between the processed geometric information and the attribute set of the component, forming a complete data object with a unique identifier; the component instance refers to an independent data entity generated after completing the association of geometric information and attribute information, which can be directly used for storage, transmission, or application processing.

[0062] Optionally, the instantiation association can be accomplished by creating an entry with the globally unique ID of the component instance as the key and a composite data structure that integrates the geometric information processing results and attribute set of the component as the value, and storing it in a global instance hash map table.

[0063] Furthermore, by outputting a JSON description file of the component instance based on the unique type identifier, this embodiment of the invention can realize the classified storage and structured output of different types of components, providing a standardized interface for the lightweight application and data exchange of building information models.

[0064] The JSON description file refers to a data file that organizes and outputs the parsed component information according to a predefined JSON format based on the IFC component type and data category, including part type information file, vertex information file, part information file, and bolt information file.

[0065] Specifically, based on the unique type identifier, a JSON description file for the component instance is output, including: Based on the unique type identifier, the component instance is classified into the corresponding component type group; Extract the common attribute set of the component type group to generate a part type information file; Extract the geometric mesh data of the component instance to generate a vertex information file; Extract the identifier, location, and instance attributes of the component instance to generate a part information file; Identify bolt-type component instances among the component instances, extract the specification parameters of the bolt-type component instances, and generate a bolt information file; By integrating the part type information file, the vertex information file, the part information file, and the bolt information file, a JSON description file of the component instance is output.

[0066] Wherein, the component type group refers to a set of component instances with the same unique type identifier; the common attribute set refers to a set of type attributes shared by all component instances in the same component type group; the part type information file refers to a JSON format file that records the definitions of each component type group and its common attributes; the geometric mesh data refers to standardized geometric information containing vertices, triangle faces, normals, and UV coordinates; the vertex information file refers to a JSON format file that stores the geometric mesh data of all component instances; the part information file refers to a JSON format file that records the unique identifier, spatial location, and instance-specific attributes of each component instance; the bolt-type component instance refers to a component instance whose type identifier belongs to the bolt category; the specification parameters refer to the diameter, length, standard type, and quantity attributes of the bolt-type component instance; and the bolt information file refers to a JSON format file that specifically stores the bolt-type component instances and their specification parameters.

[0067] like Figure 2 The diagram shown is a schematic of the IFC component parsing system based on multithreading and Trie tree according to the present invention.

[0068] The IFC component parsing system 200 based on multithreading and Trie trees described in this invention can be installed in an electronic device. Depending on the functions implemented, the IFC component parsing system includes a parser initialization module 201, a parallel parsing module 202, a geometry processing module 203, and a result output module 204. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.

[0069] In this embodiment of the invention, the functions of each module / unit are as follows: The parser initialization module 201 is used to initialize the IfcParseThread multi-threaded parser and construct a Trie tree matching index during the initialization process of the IfcParseThread multi-threaded parser. The parallel parsing module 202 is used to create concurrent parsing threads in the initialized IfcParseThread multi-threaded parser, identify component entities from the IFC file to be parsed through the concurrent parsing threads, and determine the unique type identifier of the component entity according to the Trie tree matching index. The geometry processing module 203 is used to perform geometry information processing on the component entity based on the unique type identifier in the initialized IfcParseThread multi-threaded parser, and obtain the geometry information processing result. The result output module 204 is used to instantiate and associate the geometric information processing result with the attribute set of the component entity to generate a component instance, and output a JSON description file of the component instance based on the unique type identifier.

[0070] In detail, the modules in the IFC component parsing system 200 based on multithreading and Trie trees described in this embodiment of the invention employ the same methods as described above. Figure 1 The technique used is the same as the multi-threaded and Trie tree-based IFC component parsing method described above, and it can produce the same technical effect, so it will not be repeated here.

[0071] In one embodiment, a computer device is provided, which may be a server or a client, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements functions or steps on the server or client side of a multi-threaded IFC component resolution method based on Trie trees.

[0072] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Initialize the IfcParseThread multithreaded parser and construct the Trie tree matching index during the initialization process of the IfcParseThread multithreaded parser. In the initialized IfcParseThread multi-threaded parser, a concurrent parsing thread is created. The concurrent parsing thread identifies the component entity from the IFC file to be parsed and determines the unique type identifier of the component entity based on the Trie tree matching index. In the initialized IfcParseThread multi-threaded parser, the geometric information processing of the component entity is performed based on the unique type identifier to obtain the geometric information processing result; The geometric information processing result is instantiated and associated with the attribute set of the component entity to generate a component instance. Based on the unique type identifier, a JSON description file of the component instance is output.

[0073] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Initialize the IfcParseThread multithreaded parser and construct the Trie tree matching index during the initialization process of the IfcParseThread multithreaded parser. In the initialized IfcParseThread multi-threaded parser, a concurrent parsing thread is created. The concurrent parsing thread identifies the component entity from the IFC file to be parsed and determines the unique type identifier of the component entity based on the Trie tree matching index. In the initialized IfcParseThread multi-threaded parser, the geometric information processing of the component entity is performed based on the unique type identifier to obtain the geometric information processing result; The geometric information processing result is instantiated and associated with the attribute set of the component entity to generate a component instance. Based on the unique type identifier, a JSON description file of the component instance is output.

[0074] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0075] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0076] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0077] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0078] Finally, it should be noted that in the above embodiments, each embodiment can be combined with each other or independent. Deleting any one of them will not affect the technical implementation of other embodiments. The above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for parsing IFC components based on multithreading and Trie trees, characterized in that, The method includes: Initialize the IfcParseThread multithreaded parser and construct the Trie tree matching index during the initialization process of the IfcParseThread multithreaded parser. In the initialized IfcParseThread multi-threaded parser, a concurrent parsing thread is created. The concurrent parsing thread identifies the component entity from the IFC file to be parsed and determines the unique type identifier of the component entity based on the Trie tree matching index. In the initialized IfcParseThread multi-threaded parser, the geometric information processing of the component entity is performed based on the unique type identifier to obtain the geometric information processing result; The geometric information processing result is instantiated and associated with the attribute set of the component entity to generate a component instance. Based on the unique type identifier, a JSON description file of the component instance is output.

2. The IFC component parsing method based on multi-threading and Trie trees as described in claim 1, characterized in that, The construction of the Trie tree matching index during the initialization process of the IfcParseThread multi-threaded parser includes: After the IfcParseThread multi-threaded parser completes the parsing environment configuration, it reads the predefined IFC attribute configuration file. Extract the key attribute names from the IFC attribute configuration file; Based on preset attribute classification rules, assign type identifiers corresponding to the key attribute names; Based on the type identifier, construct a multi-way tree index structure for the key attribute name; The multi-way tree index structure is stored in the shared memory of the IfcParseThread multi-threaded parser to complete the construction of the Trie tree matching index.

3. The IFC component parsing method based on multi-threading and Trie trees as described in claim 2, characterized in that, Based on the type identifier, a multi-way tree index structure for the key attribute name is constructed, including: Based on the type identifier, the key attribute names are grouped and mapped to obtain the grouping mapping results; Based on the grouping mapping results, the character node hierarchy of the key attribute names is divided; After injecting the type identifier into the end storage node of the character node level, the character node level is merged into the multi-branch tree index structure according to the preset tree structure integration rules.

4. The IFC component parsing method based on multi-threading and Trie trees as described in claim 3, characterized in that, Injecting the type identifier into the end storage node of the character node hierarchy includes: Read the individual characters in the key attribute names sequentially; Match the character node corresponding to the independent character in the current level of the multi-way tree index structure; Based on the character node, the type identifier is injected into the end storage node of the character node level.

5. The IFC component parsing method based on multi-threading and Trie trees as described in claim 1, characterized in that, Creating concurrent parsing threads in the initialized IfcParseThread multi-threaded parser includes: Obtain the total available resources and the total number of components to be processed of the initialized IfcParseThread multithreaded parser, so as to determine the number of thread instantiations corresponding to the initialized IfcParseThread multithreaded parser; A shared task queue is established in the initialized IfcParseThread multithreaded parser; Determine the concurrency control parameters for each queue in the shared task queue; Based on the number of thread instantiations, the shared task queue, and the concurrency control parameters, a concurrent parsing thread is created in the initialized IfcParseThread multi-threaded parser.

6. The IFC component parsing method based on multi-threading and Trie trees as described in claim 5, characterized in that, Determine the concurrency control parameters for each queue in the shared task queue, including: Identify the data dependencies between queues in the shared task queue; Based on the aforementioned data dependencies, a data synchronization path is established between each queue; Based on the preset concurrency access control protocol, set data access locks for each queue; Based on the data synchronization path and the data access lock, determine the concurrency control parameters of each queue in the shared task queue.

7. The IFC component parsing method based on multi-threading and Trie trees as described in claim 1, characterized in that, In the initialized IfcParseThread multi-threaded parser, based on the unique type identifier, the geometric information processing of the component entity is performed to obtain the geometric information processing result, including: Invoke the geometry data cache pool of the initialized IfcParseThread multi-threaded parser; Identify the geometric data reuse status corresponding to the unique type identifier from the geometric data cache pool; Based on the geometric data reuse status, a standardized geometric dataset of the component entity is generated; Based on the geometric dataset to be processed, the geometric construction and coordinate transformation of the component entity are performed to obtain the geometric information processing result.

8. The IFC component parsing method based on multi-threading and Trie trees as described in claim 7, characterized in that, The geometric construction and coordinate transformation process includes: performing coordinate transformation processing when the geometric dataset to be processed is reused geometric data, and performing triangle mesh construction and coordinate transformation processing when the geometric dataset to be processed is newly generated geometric data.

9. The IFC component parsing method based on multi-threading and Trie trees as described in claim 1, characterized in that, The JSON description file includes a part type information file, a vertex information file, a part information file, and a bolt information file.

10. An IFC component parsing system based on multithreading and Trie trees, characterized in that, The system is used to execute the IFC component parsing method based on multithreading and Trie trees as described in any one of claims 1-9, the system comprising: The parser initialization module is used to initialize the IfcParseThread multi-threaded parser and build the Trie tree matching index during the initialization process of the IfcParseThread multi-threaded parser. The parallel parsing module is used to create concurrent parsing threads in the initialized IfcParseThread multi-threaded parser, identify component entities from the IFC file to be parsed through the concurrent parsing threads, and determine the unique type identifier of the component entity according to the Trie tree matching index. The geometry processing module is used to perform geometry information processing on the component entity based on the unique type identifier in the initialized IfcParseThread multi-threaded parser, and obtain the geometry information processing result. The result output module is used to instantiate and associate the geometric information processing result with the attribute set of the component entity to generate a component instance, and output the JSON description file of the component instance based on the unique type identifier.