Parallel BIM model checking method and device
Through the parallel inspection method, the integrity and consistency tasks of BIM model inspection are split into independent tasks and processed in parallel, solving the problems of low CPU utilization and low efficiency in the existing technology, and achieving more efficient model inspection.
Patent Information
- Application Number
- CN202111415296.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-11-25
AI Technical Summary
The existing BIM model inspection tools have performance problems in operating efficiency, and the CPU utilization rate is low, resulting in low inspection efficiency, especially due to the performance problems caused by model scale and data storage transmission, and the inspection process is carried out in serial, resulting in CPU utilization. Inefficient rate and efficiency.
The parallel inspection method is adopted to obtain the integrity and consistency related fields in the SPARQL inspection statement, and they are added to the task queue as independent tasks, and parallel inspection is carried out through the thread pool to improve CPU utilization and inspection efficiency.
It improves the CPU utilization and efficiency of BIM model inspection, and can save 40%-60% of the model inspection runtime under the same conditions, and is suitable for large-scale models and complex rule base inspections.
Smart Images

Figure CN114138826B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of building technology, and in particular to a parallel BIM model checking method and device. Background Art
[0002] BIM (Building Information Model) is a technology for building information applications based on three-dimensional models. It can be effectively applied to the planning, design, construction, and management of buildings and infrastructure. It is one of the most promising technologies in the building, engineering, and construction stages. In the process of promoting and implementing BIM technology, implementing building specification review based on BIM models plays an important role in promoting the progress and development of the BIM industry.
[0003] In the related art, the building code review tool BIMChecker can be used to review the BIM model to determine whether the building corresponding to the BIM model complies with the code. Figure 1 As shown, the BIMChecker tool is mainly composed of a rule base construction sub-tool, a semantic model conversion module, a BIM model checking engine and an output display module. The rule base construction sub-tool is used to provide users with an interface for writing natural language building code clauses into SNL (Structural Natural Language, building code description language) rules that are easy for computers to parse and execute, so that users can write SNL rules (which can be written with reference to the domain database), and automatically convert the SNL rules written by users into SPARQL statements for query. The semantic model conversion module is used to perform semantic extraction on the BIM model and obtain an OWL (Web Ontology Language, network ontology language) model containing the semantic content of the model. The BIM model checking engine is used to query the OWL model through SPARQL statements to determine whether the building meets the specifications, and transmit it to the output display module to display the inspection results.
[0004] In actual review, there are often problems related to operational efficiency. There are generally two situations when there are major performance problems. On the one hand, there are specific problems with the compilation of individual SNL clauses or calculation rules, which often need to be handled in combination with the special model where the performance problem occurs. On the other hand, it is more common, due to various performance problems caused by model scale, data storage and transmission. Therefore, in addition to checking whether the building corresponding to the BIM model meets the specifications, the BIMChecker tool also needs to perform integrity and consistency checks. Among them, the integrity check is generally a consideration of modeling quality, such as the lack of components and attributes involved in the clause. In terms of operation, the components and attributes that need to be checked for integrity in the SNL are screened out, and SPARQL is constructed to check whether the components and attributes are missing; the consistency check is a "quantitative" check of the specific semantics, values, etc. of the clause. In terms of operation, the SPARQL used to check whether there are errors in the components is constructed for the semantics described in the SNL. However, in the current review process, the BIM model checking engine performs checks serially in the order of clauses. In general, in a 4-core CPU (central processing unit) machine, the checking process only occupies 10-20% of the CPU utilization, resulting in relatively low CPU utilization and inspection efficiency. Summary of the invention
[0005] The present invention provides a parallel BIM model checking method and device, which can improve CPU utilization and inspection efficiency by checking integrity and consistency in parallel. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a parallel BIM model checking method, the method comprising:
[0007] Obtain a SPARQL check statement generated based on a building rule description language SNL rule, wherein the SNL rule is a building code clause written based on SNL;
[0008] For each SNL rule, respectively obtain at least one first field and at least one second field in the SPARQL check statement, wherein the first field is a field related to the integrity check, and the second field is a field related to the consistency check;
[0009] Add each first field as an independent task to the first task queue, and add each second field as an independent task to the second task queue;
[0010] Submitting multiple tasks in the first task queue to the thread pool, and checking the integrity of the building semantic model in parallel, where the building semantic model is a model obtained by semantic extraction based on the building information model BIM; after the tasks in the first task queue are completed, submitting multiple tasks in the second task queue to the thread pool, and checking the consistency of the building semantic model with the SNL rules in parallel;
[0011] Alternatively, multiple tasks in the first task queue or the second task queue are submitted to the thread pool, and corresponding checks are performed in parallel, wherein the corresponding checks include an integrity check corresponding to the first task queue and a consistency check corresponding to the second task queue.
[0012] Optionally, the first field includes a CHECKVALID field, and the second field includes a CHECKSQL, CHECKCOMP, and CHECKREF field.
[0013] Optionally, adding each first field as an independent task to a first task queue, and adding each second field as an independent task to a second task queue, includes:
[0014] taking multiple sub-items in the first field containing multiple independent sub-items as independent tasks respectively, and taking the first field not containing multiple independent sub-items as an independent task, and adding them to the first task queue;
[0015] The multiple sub-items in the second field containing multiple independent sub-items are respectively taken as independent tasks, and the second field not containing multiple independent sub-items is taken as an independent task and added to the second task queue.
[0016] Optionally, the method further includes:
[0017] Integrity and consistency checks are performed in parallel for different SNL rules.
[0018] Optionally, adding each first field as an independent task to a first task queue, and adding each second field as an independent task to a second task queue, includes:
[0019] Generate a Callable instance based on each first field, and add the Callable instance of the first field to the first task queue as an independent task;
[0020] A Callable instance is generated based on each second field, and the Callable instance of the second field is added to the second task queue as an independent task.
[0021] Optionally, the method further includes:
[0022] Monitor whether the time for integrity and / or consistency check of each SNL rule has timed out;
[0023] If a timeout occurs, a timeout log is generated for the SNL rule where the timeout occurs.
[0024] In a second aspect, an embodiment of the present invention provides a parallel BIM model checking device, the device comprising:
[0025] A first acquisition unit is used to acquire a SPARQL check statement generated based on a building rule description language SNL rule, wherein the SNL rule is a building specification clause written based on SNL;
[0026] A second acquisition unit is used to acquire, for each SNL rule, at least one first field and at least one second field in the SPARQL check statement, wherein the first field is a field related to the integrity check, and the second field is a field related to the consistency check;
[0027] A queue generation unit, used for adding each first field as an independent task to a first task queue, and adding each second field as an independent task to a second task queue;
[0028] A parallel checking unit is used to submit multiple tasks in the first task queue to a thread pool, and to check the integrity of a building semantic model in parallel, wherein the building semantic model is a model obtained by semantic extraction based on a building information model BIM; after the tasks in the first task queue are completed, submit multiple tasks in the second task queue to the thread pool, and to check the consistency of the building semantic model with SNL rules in parallel; or submit multiple tasks in the first task queue or the second task queue to the thread pool, and perform corresponding checks in parallel, wherein the corresponding checks include an integrity check corresponding to the first task queue and a consistency check corresponding to the second task queue. .
[0029] Optionally, the first field includes a CHECKVALID field, and the second field includes a CHECKSQL, CHECKCOMP, and CHECKREF field.
[0030] Optionally, the queue generating unit includes:
[0031] A first queue generation module, used for treating multiple sub-items in a first field containing multiple independent sub-items as independent tasks respectively, and treating a first field that does not contain multiple independent sub-items as an independent task, and adding them to the first task queue;
[0032] The second queue generation module is used to treat multiple sub-items in the second field containing multiple independent sub-items as independent tasks respectively, and treat the second field not containing multiple independent sub-items as an independent task, and add them to the second task queue.
[0033] Optionally, the parallel checking unit is further used to perform integrity and consistency checks in parallel for different SNL rules.
[0034] Optionally, the queue generation unit is used to generate a Callable instance based on each first field, and add the Callable instance of the first field as an independent task to the first task queue; generate a Callable instance based on each second field, and add the Callable instance of the second field as an independent task to the second task queue.
[0035] Optionally, the device further comprises:
[0036] A monitoring unit, used to monitor whether a time for performing integrity and / or consistency check on each SNL rule has timed out;
[0037] The log generating unit is used to generate a timeout log for the SNL rule where the timeout occurs if a timeout occurs.
[0038] In a third aspect, an embodiment of the present invention provides a storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method described in the first aspect.
[0039] In a fourth aspect, an embodiment of the present invention provides an electronic device, including:
[0040] one or more processors;
[0041] a storage device for storing one or more programs,
[0042] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in the first aspect.
[0043] As can be seen from the above content, a parallel BIM model checking method and device provided by an embodiment of the present invention can obtain a SPARQL check statement generated based on an SNL rule, but not directly perform a sequential check, but first obtain at least one first field related to the integrity check and at least one second field related to the consistency check in the SPARQL check statement for each SNL rule, and then add each first field as an independent task to the first task queue, and add each second field as an independent task to the second task queue, and finally adopt different parallel checking strategies according to the inspection requirements, such as submitting the first task queue or the second task queue to the thread pool for parallel processing, or first submitting the first task queue to the thread pool for parallel processing, and then submitting the second task queue to the thread pool for parallel processing, thereby not only improving the CPU utilization, but also improving the efficiency of integrity and consistency inspection. Of course, any product or method implementing the present invention does not necessarily need to achieve all the advantages described above at the same time.
[0044] The innovative features of the embodiments of the present invention include:
[0045] 1. For each SNL rule, at least a first field related to the integrity check and at least a second field related to the consistency check in the SPARQL check statement can be obtained, and each field can be added to the queue as an independent task, and then different parallel check strategies can be adopted according to the check requirements to improve the check efficiency. Parallel processing can also be performed for different SNL rules.
[0046] 2. When the first field or the second field includes multiple independent sub-items, each independent sub-item can be split out and processed as an independent task, thereby further improving the inspection efficiency.
[0047] 3. By monitoring whether the time for integrity and / or consistency check of each SNL rule has timed out and recording the timeout log, users can improve the SNL rules that affect the inspection efficiency in a targeted and timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work.
[0049] Figure 1 A schematic diagram of the structure of a building code review tool provided for the prior art;
[0050] Figure 2 A flowchart of a parallel BIM model checking method provided by an embodiment of the present invention;
[0051] Figure 3 A schematic diagram of four types of classification inspections provided by an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of a computational rule parallel processing of nested tasks provided by an embodiment of the present invention;
[0053] Figure 5 A comprehensive flow chart of inspection results including a timeout solution provided by an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of the architecture of a BIM model intelligent inspection engine platform system provided by an embodiment of the present invention;
[0055] Figure 7 A block diagram of the functional modules of a BIM model intelligent inspection engine platform system provided by an embodiment of the present invention;
[0056] Figure 8 A schematic diagram of the structure of a parallel BIM model checking device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present invention and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0059] The present invention provides a parallel BIM model checking method and device, which can improve CPU utilization and inspection efficiency by checking integrity and consistency in parallel. The method provided in the embodiment of the present invention can be applied to any electronic device with computing power, which can be a terminal or a server. In one implementation, the functional software implementing the method can exist in the form of a separate client software, or in the form of a plug-in of currently related client software, which is all possible. The embodiments of the present invention are described in detail below.
[0060] Figure 2 A flow chart of a parallel BIM model checking method provided by an embodiment of the present invention. The method may include the following steps:
[0061] S100: Obtain a SPARQL check statement generated based on an SNL rule.
[0062] The SNL rules are building code clauses written based on SNL. SNL can be mainly divided into simple sentences, complex sentences and conditional sentences in terms of structure.
[0063] Simple sentence = (prefix noun phrase (suffix noun phrase ((<and>|<or>) suffix noun phrase)*)|(prefix noun verb phrase ((<and>|<or>) verb phrase)*))
[0064] Complex sentence = simple sentence (<and> simple sentence)*
[0065] Conditional Sentences <if>(compound conditional sentence | there is a conditional sentence)
[0066] <then>(compound conditional sentence | there is a conditional sentence)
[0067] For example, the following text is an example of an SNL rule. It can be observed from the example that SNL is easy to understand and can basically be read smoothly according to the word order of Chinese.
[0068]
[0069] In order to facilitate computer execution, it is necessary to convert the SNL-based rules into SPARQL check statements. Specifically, the BIMChecker tool can use the JavaCC tool when parsing SNL statements. JavaCC is one of the most widely used grammar generators on the Java platform. The above structured SNL can be converted into an instance of the SNLSentence class through JavaCC. The SNLSentence class basically stores each unit according to the SNL grammatical structure and can be used for subsequent construction of query statements. SNLSentence will subsequently construct SPARQL query statements through a series of complex algorithms.
[0070] S110: For each SNL rule, respectively obtain at least one first field and at least one second field in the SPARQL check statement.
[0071] Each SNL rule may include at least one first field and / or at least one second field. The first field is a field related to integrity check, and the second field is a field related to consistency check. The first field includes a CHECKVALID field, and the second field includes a CHECKSQL, CHECKCOMP, and CHECKREF field. The CHECKVALID field contains a SPARQL statement for checking the component content involved in the SNL compiled in the clause. CHECKSQL is a SPARQL query statement that has been pre-generated in the rule base management tool for the original SNL. As a computational rule, CHECKCOMP needs to extract relevant components from the OWL model in the engine according to the specific computational rule type, and dynamically generate SPARQL for query. In addition, the computational rule needs to post-process the query results to obtain the final result actually required. The CHECKREF field is a reference to other clauses, pointing to another clause, and does not contain check information itself. When the engine is running, it locates the clause it points to for inspection.
[0072] S120: adding each first field as an independent task to a first task queue, and adding each second field as an independent task to a second task queue.
[0073] During the specific implementation process, a Callable instance can be generated based on each first field, and the Callable instance of the first field can be added to the first task queue as an independent task; a Callable instance can be generated based on each second field, and the Callable instance of the second field can be added to the second task queue as an independent task.
[0074] When the first field or the second field includes multiple independent sub-items, the multiple independent sub-items can be split into independent tasks and executed in parallel. That is, the multiple sub-items in the first field containing multiple independent sub-items can be taken as independent tasks, and the first field that does not contain multiple independent sub-items can be taken as an independent task and added to the first task queue; the multiple sub-items in the second field containing multiple independent sub-items can be taken as independent tasks, and the second field that does not contain multiple independent sub-items can be taken as an independent task and added to the second task queue.
[0075] In actual applications, if you choose to perform integrity or consistency checks separately, since there is no relationship between queries and no special additional processing is required, you can perform parallel checks on integrity and consistency respectively, that is, execute step S140. When integrity and consistency checks are performed at the same time, the consistency check can actually be regarded as a subsequent process of the integrity check. When there are integrity problems such as missing components and missing attributes, it is often necessary to modify the modeling and re-check the entirety. If there are too many integrity problems, the significance of the consistency check is greatly weakened. When there is no parallelism and a report is produced at the end of all checks, the impact of this problem is relatively small. However, when all integrity and consistency checks are performed in parallel, the corresponding consistency check clauses should be more meaningful after the integrity check. In abstract terms, there is a causal relationship between the atomic items to be checked, and it is necessary to check the integrity first and then the consistency, that is, execute step S130.
[0076] S130: Submit multiple tasks in the first task queue to the thread pool, and check the integrity of the building semantic model in parallel; after the tasks in the first task queue are completed, submit multiple tasks in the second task queue to the thread pool, and check the consistency of the building semantic model with the SNL rules in parallel.
[0077] The building semantic model is a model obtained by semantic extraction based on BIM, for example, it can be an OWL model. The size of the thread pool can be customized to be positively correlated with the number of CPU cores, and can adapt to the situation of CPU core number computing power differences in various computing environments.
[0078] For the parallel processing of integrity check or consistency check, the embodiment of the present invention is customized based on the tool function under the java.util.concurrent parallel package built in JAVA. Among them, a thread pool Pthread=n of a specified size is newly created through the ExecutorService service, and the Callable+Future instance solution is adopted. All atomic tasks Ti (i.e., the above-mentioned independent tasks) are packaged into a number of Callable instances Ci to accommodate the original SPARQL query part. At the same time, a Future instance Fi is generated, which is equivalent to the expected task of storing the SPARQL query task Ti, and can be executed at any time under the specified conditions to obtain the actual query result. For the submission solution of the atomic task, while ensuring that the original execution order remains unchanged, by constructing an ItemResultCollection collection, all the SPARQL query results originally stored are replaced by the stored Callable list. In the sequential execution process, it is replaced by the packaged Callable instance submitted to the ItemResultCollection. After all the existing checks are executed in sequence, all Callables in the ItemResultCollection are iterated and then submitted to the thread pool for execution.
[0079] S140: Submit multiple tasks in the first task queue or the second task queue to the thread pool, and perform corresponding checks in parallel, wherein the corresponding checks include an integrity check corresponding to the first task queue and a consistency check corresponding to the second task queue.
[0080] The overall algorithm pseudo code from processing task parsing, submitting tasks to parallel execution and merging inspection results can be referred to as follows:
[0081]
[0082]
[0083] The above method is the basis for the parallel integrity and consistency checks. In actual implementation, thread safety processing is also required, and lock control is required for shared semantic and model data. One point that needs to be explained is that the Jena engine used for semantic query does not include thread safety processing. When multi-threaded processing is performed under the same JVM, the Jena engine provides MRSW (multiple-reader, single-writer) concurrency support, and critical section control is performed on the query of the Jena engine in the SPARQL atomic item through the enter / leaveCriticalSection() method.
[0084] The above method is a parallel processing process for one SNL rule. In order to further improve the efficiency of integrity and consistency checking, multiple threads can be opened for parallel checking of different SNL rules.
[0085] A parallelized BIM model checking method provided by an embodiment of the present invention can obtain a SPARQL check statement generated based on an SNL rule, but instead of directly performing a sequential check, first obtain at least one first field related to the integrity check and at least one second field related to the consistency check in the SPARQL check statement for each SNL rule, then add each first field as an independent task to a first task queue, and add each second field as an independent task to a second task queue, and finally adopt different parallel checking strategies according to the inspection requirements, such as submitting the first task queue or the second task queue to a thread pool for parallel processing, or first submitting the first task queue to the thread pool for parallel processing, and then submitting the second task queue to the thread pool for parallel processing, thereby not only improving the CPU utilization, but also improving the inspection efficiency of integrity and consistency.
[0086] In another embodiment of the present invention, the integrity and consistency checks of computational rules and non-computational rules can be processed in parallel to further improve the efficiency of the check. The computational rules are rules that include geometric calculations, and the non-computational rules do not include geometric calculations. In fact, the integrity and consistency checks are cross-cutting with the computational and non-computational rules. Figure 3 As shown, the two matches are different inspection categories and require different processing methods.
[0087] For the integrity and consistency check of non-computational rules, i.e., ordinary semantic queries, the parallel solution is basically the same as the previous embodiment. It is only necessary to independently package the smallest unit of the SPARQL query into a Callable instance, and then submit it to the thread pool for parallel execution according to the original design. For computational rules, due to the complexity of the framework itself and the lack of pre-generated integrity and consistency checks, submitting a parallel framework requires solving the nesting problem.
[0088] First, SNLParser needs to be executed in parallel during SNL parsing. The embodiment of the present invention recompiles SNLParser and configures nonstatic mode to support normal parallel parsing. Second, when the computational rules are packaged as independent tasks Tcomp and submitted, when entering the integrity check extraction, it is necessary to nest the submission integrity subtask Tcompvalid.
[0089] In the normal consistency process, semantic query and rule calculation are placed in the subtask Tcompconsist and submitted at the same time. The specific structure is as follows Figure 4 When computing rules are parallelized, tasks need to be nested and submitted to the same level, and the results can be reaggregated with the help of the result synthesis step.
[0090] After proposing the above-mentioned computational rule nested checking method, it is necessary to focus on the data issues of details. Computational rules will provide a component list and an error value list according to the needs. The component list is often solved by semantic query plus post-processing screening, and the aforementioned has been controlled by parallelization through the Jena engine. Focusing on information such as error values, since there is no need to consider data sharing issues in the serial stage, error values and other data are highly bound to component IDs or ID tuples, and are stored as a whole by the computational rule solver. However, since the computational rule solver will be shared in parallel, causing data conflicts, the embodiment of the present invention expands the computational rule solver architecture and binds the component ID information with additional information. This makes the processing method of computational rules closer to functional programs, ensuring that it has no side effects. In addition, computational rules require highly shared semantic models, geometric models, etc., and these data still use a globally readable and non-writable design.
[0091] In the computational rule calculation, a large number of component ID pairs are generally iterated for processing, and a parallel method can also be introduced at this time. However, this content is the parallelization of a specific geometric calculation algorithm, which is independent of the parallel framework of the embodiment of the present invention. When actually writing rules, using appropriate parallel algorithms can theoretically improve the calculation efficiency.
[0092] In another embodiment of the present invention, in order to truly achieve the goal of being able to serve as a platform to implement inspections for multiple models and multiple specifications in a service mode, a platform-based parallel method is inevitable. Among them, the multi-model parallel inspection involved, the platform data processing, and the final result synthesis are all problems that need to be solved by the platform-based parallel method. The embodiment of the present invention will introduce the processing methods one by one.
[0093] 1. Front-end data preprocessing of the platform
[0094] In the process of upgrading from the stand-alone version to the platform side, the change in usage scenarios also brings new problems. When providing services as a platform, the front end needs to collect the model and rule data of the model review user and submit them for inspection. First, the platform includes rule selection and deletion of the rule library. During data preprocessing, the SNL file is deleted and submitted according to the list to be checked by the user. Secondly, the volume of the semantic model in network transmission also affects the efficiency of the inspection. In fact, the use of JSON (JavaScript Object Notation, JS object notation) semantic model is in a certain sense for universality, convenience of generation and parsing, and readability. This is at the expense of data volume. Among them, component information such as EI, EN, and the naming of key-value pair attributes have taken into account the cost of some volume, but JSON is still not the best choice for network transmission. The following will evaluate various file structures and give the final processing method.
[0095] For binary file formats that can be converted to and from JSON, BSON (Binary Serialized Document Format) and MsgPack are two options. They have different binary structures and can convert JSON with the same structure. Both have the potential to reduce the size of JSON semantic models. Table 1 shows the compression ratios of several sample models under the two schemes.
[0096] Table 1
[0097]
[0098]
[0099] From the above observations, it can be seen that BSON will increase the size of the building semantic model due to the addition of indexes and other related data, while MsgPack can compress the space by about 30%, which is a significant effect. Based on the adjustment of the MsgPack format, the model is compressed against two commonly used algorithms, as shown in Table 2. It can be seen that both compression algorithms have extremely high compression rates for the model, which can reduce the space by about 95%. This situation is due to the large number of repeated fields in the JSON semantic model, such as component ID, component name, etc.
[0100] Table 2
[0101]
[0102] Finally, taking into account the format conversion, compression efficiency, final size of the semantic model file, and compatibility with the online engines, the embodiment of the present invention did not modify the semantic model structure, but adopted the above-mentioned MsgPack combined with the DEFLATE algorithm compression. This can greatly improve the model transmission efficiency when the platform front-end submits the review task.
[0103] (II) Parallel inspection results of the comprehensive platform
[0104] The final product of the BIM model clause check is the result report obtained from checking each selected check clause on the BIM model. Corresponding to the BIMChecker engine, that is, after the engine executes each atomic query, it summarizes and integrates the SNL, clauses, and rule base from the bottom up. The result synthesis needs to consider the impact of parallel optimization. The following will explain further optimization methods from the two points of the timeout design of complex clauses in the report synthesis process of the embodiment of the present invention and the real-time streaming result feedback.
[0105] A timeout reporting method for complex clauses. In actual modeling tests, since the efficiency of SPARQL depends to a certain extent on the robustness of the SNL written by the clause compiler, the time or space scale of some clause checks may expand. In this case, a clause timeout scheme can be designed to monitor whether the time integrity and consistency check of each SNL rule has timed out. If a timeout occurs, a timeout log is generated for the SNL rule that has timed out. In implementation, an embodiment of the present invention collects results within a given timeout limit through the pool polling method of the ExecutorCompletionService class. When the atomic task result cannot be collected after the timeout, the status of each task Future in the queue is traversed, and the tasks that are not marked as completed are canceled. In this way, feedback can be provided to the SNL compiler to remind him to optimize and modify the SNL statement. Ultimately, unified optimization is achieved from the writing of SNL to the parsing and execution of the engine. Figure 5 The figure shows the overall flow of inspection results including the timeout solution. Among them, a real-time streaming result feedback method can be adopted, that is, the report is not generated after all the model inspections are completed, but during the inspection process, after each clause itself is inspected, it is fed back to the user front end in a streaming manner.
[0106] The embodiment of the present invention provides the user with the option of timeout configuration through the above result-related method, and timely feeds back the clause inspection results, thereby ensuring the consistency of the parallel inspection results and the robustness of the program, and solving the problem of low operating efficiency from an interactive perspective.
[0107] According to the above method embodiment, another embodiment of the present invention provides a BIM model intelligent inspection engine platform system, which is generally divided into a front-end model submission and inspection result display part, and a back-end platform parallel inspection engine part. The overall software architecture is as follows: Figure 6 As shown. Users can select the submitted model file and SNL rule base file through the web interface, and select a specific list of inspection clauses, and submit them to the platform backend for inspection. After submission, there is no need to wait online. For models that take a relatively long time to check, the front-end web interface will display information such as the current inspection progress. The backend will process all models and specification data submitted by users. After the model inspection is completed, the platform provides a front-end result display interface for users to view and download the report content.
[0108] The detailed functional module diagram of the platform implemented by the embodiment of the present invention is as follows Figure 7 As shown in the figure, the whole system is divided into the front-end display module, the front-end preprocessing module and the back-end parallel inspection engine module.
[0109] The front-end display module is used to implement the front-end interactive interface of the model checking platform. It includes the model list display interface module, the new review interface module, and the result query interface module. The three modules respectively implement all the contents from displaying the historical model checking request list stored in the current platform, to the SNL selection, model selection, and SNL clause selection interface of the new model check, and then to the detailed display interface of the submitted review results.
[0110] The front-end preprocessing module mainly includes the non-interactive interface display part of the front-end, including the front-end SNL clause content parser, the front-end model compression preprocessing module, and the data processing and upload module. The SNL clause parser module is responsible for parsing and simply displaying the SNL rule library content uploaded by the user on the front end. The model compression preprocessing module uses the DEFLATE algorithm to perform preprocessing operations such as compression on the module to be uploaded by the user. The data processing and upload module is responsible for processing all models and SNL data and communicating with the platform backend.
[0111] The back-end parallel inspection engine module includes the platform multi-model inspection module, the integrity inspection and consistency inspection parallelization module, the computational rule parallelization module, and the parallel scheduling module. It provides the function of simultaneously reviewing multiple models for the platform, and then checks the integrity and consistency respectively, and provides parallel support for computational rule inspection.
[0112] The backend parallel inspection engine is responsible for processing the BIM model, rule base file data, selected inspection clauses, inspection names and other text data provided by the frontend. At the same time, the backend needs to provide storage support for these input data and inspection result data. In terms of implementation, the backend interface is based on the Spring Boot framework and is designed in the form of RESTful API to provide support for data submission and result query of the frontend inspection. The frontend is based on React and implemented with the Axios network library as API support. A list of some key interfaces is shown in Table 3.
[0113] Table 3
[0114]
[0115] In terms of inspection data storage, given the scale and application mode of the model, the system directly uses the file system as a way to store models and inspection clauses, and stores inspection-related metadata in JSON format. The model, inspection clause SNL, metadata, inspection results, etc. in the same inspection are stored in the same directory with UUID as the unique identifier in the form of files. Among them, the model and SNL clause files are stored in the form of original binary files, and the metadata and inspection results are stored in the form of JSON.
[0116] The following is an analysis of parallelization checking using a real case:
[0117] The inspection engine platform provided by the embodiment of the present invention can improve the utilization efficiency of server resources and increase the operation speed. It can perform operation tests on several real models and SNL rule bases to provide actual efficiency comparison.
[0118] Table 4 shows the test building model information used in the embodiment of the present invention. The experiment selected a complete building model, which does not have the problem of losing cross-floor information and can reflect the actual efficiency operation status.
[0119] Table 4
[0120] Model Name Model size A normal school entrepreneurship building 23272KB Jianghu Villa 876KB Teaching building of No.2 Middle School in a certain county 22832KB Outpatient building of a people's hospital 116314KB
[0121] The embodiment of the present invention selected the SNL rule base compiled in 2019 for the "Code for Fire Protection Design of Buildings" GB 50016-2014 (2018 edition), covering 1129 SNL statements. This library is one of the largest rule bases that have been compiled, and the coverage rate of the automatically checkable clauses in the original specification is relatively high. At the same time, the rule base has been formally deployed and used in BIM review systems in many places, and has practical reference value. Therefore, the embodiment of the present invention selects this specification as the data for reference comparison of the model parallelization inspection operation efficiency. As shown in Table 5, it is the running time results of the original inspection engine and the engine after implementing the parallelization method on all the above test case models. Among them, the parallel parameter is 32 threads. It can be seen from the table that after adopting the parallel method, the overall operating efficiency can be improved by about 50%.
[0122] Table 5
[0123] Model Name Fire protection code for building design A normal school entrepreneurship building Original: 3m20s Parallel: 1m30s (-55%) Jianghu Villa Original: 21s Parallel: 8s (-62%) Teaching building of No.2 Middle School in a certain county Original: 49s Parallel: 45s (-9%) Outpatient building of a people's hospital Original: 2h+ (timeout) Parallel: 15m20s (N / A)
[0124] In summary, when a computer with common configuration runs the BIMChecker engine that implements the parallelization method, in the combined inspection test of a mature building fire code rule base containing more than a thousand SNLs and building models of different scales from 1M to 100M, the parallelization method can stably save 40%-60% of the model inspection running time, and more conveniently provide timeout clauses to assist users in conducting testing work. The embodiments of the present invention can better support the use mode of model inspection that requires a large number of iterative modifications.
[0125] Corresponding to the above method embodiment, the embodiment of the present invention provides a parallel BIM model checking device, such as Figure 8 As shown, the device may include:
[0126] A first acquisition unit 80 is used to acquire a SPARQL check statement generated based on a building rule description language SNL rule, wherein the SNL rule is a building specification clause written based on SNL;
[0127] A second acquisition unit 82 is used to acquire, for each SNL rule, at least one first field and at least one second field in the SPARQL check statement, wherein the first field is a field related to the integrity check, and the second field is a field related to the consistency check;
[0128] A queue generating unit 84, configured to add each first field as an independent task to a first task queue, and add each second field as an independent task to a second task queue;
[0129] The parallel checking unit 86 is used to submit multiple tasks in the first task queue to the thread pool, and to check the integrity of the building semantic model in parallel, where the building semantic model is a model obtained by semantic extraction based on the building information model BIM; after the tasks in the first task queue are completed, submit multiple tasks in the second task queue to the thread pool, and check the consistency of the building semantic model with the SNL rules in parallel; or submit multiple tasks in the first task queue or the second task queue to the thread pool, and perform corresponding checks in parallel, where the corresponding checks include the integrity check corresponding to the first task queue and the consistency check corresponding to the second task queue. .
[0130] Optionally, the first field includes a CHECKVALID field, and the second field includes a CHECKSQL, CHECKCOMP, and CHECKREF field.
[0131] Optionally, the queue generating unit 84 includes:
[0132] A first queue generation module, used for treating multiple sub-items in a first field containing multiple independent sub-items as independent tasks respectively, and treating a first field that does not contain multiple independent sub-items as an independent task, and adding them to the first task queue;
[0133] The second queue generation module is used to treat multiple sub-items in the second field containing multiple independent sub-items as independent tasks respectively, and treat the second field not containing multiple independent sub-items as an independent task, and add them to the second task queue.
[0134] Optionally, the parallel checking unit 86 is further configured to perform integrity and consistency checks in parallel for different SNL rules.
[0135] Optionally, the queue generation unit 84 is used to generate a Callable instance based on each first field, and add the Callable instance of the first field as an independent task to the first task queue; generate a Callable instance based on each second field, and add the Callable instance of the second field as an independent task to the second task queue.
[0136] Optionally, the device further comprises:
[0137] A monitoring unit, used to monitor whether a time for performing integrity and / or consistency check on each SNL rule has timed out;
[0138] The log generating unit is used to generate a timeout log for the SNL rule where the timeout occurs if a timeout occurs.
[0139] Based on the above method embodiment, another embodiment of the present invention further provides a storage medium on which executable instructions are stored. When the instructions are executed by a processor, the processor implements the above method.
[0140] Based on the above method embodiment, another embodiment of the present invention further provides an electronic device, including:
[0141] one or more processors;
[0142] a storage device for storing one or more programs,
[0143] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.
[0144] The above-mentioned system and device embodiments correspond to the method embodiments and have the same technical effects as the method embodiments. For specific descriptions, please refer to the method embodiments. The device embodiments are obtained based on the method embodiments. For specific descriptions, please refer to the method embodiment part, which will not be repeated here. It can be understood by those of ordinary skill in the art that the accompanying drawings are only schematic diagrams of one embodiment, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present invention.
[0145] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / then> < / if>
Claims
1. A parallel BIM model checking method, characterized in that: The method comprises: Obtain a SPARQL check statement generated based on a building rule description language SNL rule, wherein the SNL rule is a building code clause written based on SNL; For each SNL rule, respectively obtain at least one first field and at least one second field in the SPARQL check statement, wherein the first field is a field related to the integrity check, and the second field is a field related to the consistency check; Add each first field as an independent task to the first task queue, and add each second field as an independent task to the second task queue; Submitting multiple tasks in the first task queue to a thread pool, and checking in parallel the integrity of a building semantic model, wherein the building semantic model is a model obtained by semantic extraction based on a building information model (BIM); after the tasks in the first task queue are completed, submitting multiple tasks in the second task queue to a thread pool, and checking in parallel the consistency of the building semantic model with SNL rules; Alternatively, multiple tasks in the first task queue or the second task queue are submitted to the thread pool, and corresponding checks are performed in parallel, wherein the corresponding checks include an integrity check corresponding to the first task queue and a consistency check corresponding to the second task queue.
2. The method according to claim 1, characterized in that The first field includes a CHECKVALID field, and the second field includes a CHECKSQL, a CHECKCOMP, and a CHECKREF field.
3. The method according to claim 1, characterized in that Adding each first field as an independent task to the first task queue, and adding each second field as an independent task to the second task queue, including: taking multiple sub-items in the first field containing multiple independent sub-items as independent tasks respectively, and taking the first field not containing multiple independent sub-items as an independent task, and adding them to the first task queue; The multiple sub-items in the second field containing multiple independent sub-items are respectively taken as independent tasks, and the second field not containing multiple independent sub-items is taken as an independent task and added to the second task queue.
4. The method according to claim 1, characterized in that The method further comprises: Integrity and consistency checks are performed in parallel for different SNL rules.
5. The method according to claim 1, characterized in that Adding each first field as an independent task to the first task queue, and adding each second field as an independent task to the second task queue, including: Generate a Callable instance based on each first field, and add the Callable instance of the first field to the first task queue as an independent task; A Callable instance is generated based on each second field, and the Callable instance of the second field is added to the second task queue as an independent task.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Monitor whether the time for integrity and / or consistency check of each SNL rule has timed out; If a timeout occurs, a timeout log is generated for the SNL rule where the timeout occurs.
7. A parallel BIM model checking device, characterized in that: The device comprises: A first acquisition unit is used to acquire a SPARQL check statement generated based on a building rule description language SNL rule, wherein the SNL rule is a building specification clause written based on SNL; A second acquisition unit is used to acquire, for each SNL rule, at least one first field and at least one second field in the SPARQL check statement, wherein the first field is a field related to the integrity check, and the second field is a field related to the consistency check; A queue generation unit, used for adding each first field as an independent task to a first task queue, and adding each second field as an independent task to a second task queue; A parallel checking unit is used to submit multiple tasks in the first task queue to a thread pool, and to check in parallel the integrity of a building semantic model, wherein the building semantic model is a model obtained by semantic extraction based on a building information model (BIM); after the tasks in the first task queue are completed, submit multiple tasks in the second task queue to the thread pool, and to check in parallel the consistency of the building semantic model with SNL rules; or, submit multiple tasks in the first task queue or the second task queue to the thread pool, and perform corresponding checks in parallel, wherein the corresponding checks include an integrity check corresponding to the first task queue and a consistency check corresponding to the second task queue.
8. The device according to claim 7, characterized in that The first field includes a CHECKVALID field, and the second field includes a CHECKSQL, a CHECKCOMP, and a CHECKREF field.
9. A storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 6.
10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Building information model transfer and examination method and system based on visual programming
CN111680070A
BIM-based gravity dam structure design compliance inspection method
CN112948947A