RFA file analysis and model reconstruction method

By analyzing and reconstructing the RFA file of the Revit family, and automatically adjusting the geometric relationship and constraints of model elements, the problem of accumulation of Revit family is solved, efficient conversion into a domestic platform model is achieved, and the accuracy and efficiency of model reconstruction are improved.

CN120257422APending Publication Date: 2025-07-04江西博微新技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510308525.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the existing technology, the Revit family has rich accumulation, but how to revitalize existing rfa assets and improve efficiency is a key issue. The BimRvSDK provided by the OpenDesignAlliance Open Design Alliance supports full access to rfa files and model display, but does not support model modification and parameterized model reconstruction.

Method used

It provides an RFA file analysis and model reconstruction method, including traversing the model, constraints and parameterized data in the rfa file, model classification reconstruction, checking and reconstructing constraints of model elements, using graph algorithm to determine whether the constraints are complete, and supplementing incomplete constraints, reconstructing parameters, obtaining detailed information of model elements through the Revit API, automatically adjusting and reconstructing geometric relationships and constraints, and optimizing parameters using graph algorithm and particle swarm optimization algorithm.

Benefits of technology

It improves the efficiency of automatic detection and correction of model elements, reduces manual intervention, ensures that parameter adjustments meet design requirements, improves the efficiency and accuracy of converting the model into a domestic platform model, and can convert 85% of the RFA files into a domestic platform model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120257422A_ABST
    Figure CN120257422A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer software, in particular to an RFA file analysis and model reconstruction method which comprises the following steps: S1, traversing model, constraint and parameterized data in an rfa file; s2, model classification is carried out for reconstruction; s3, checking and reconstructing constraints of model elements; s4, performing one-to-one correspondence conversion on the original constraints of the rfa, then judging whether the constraints are complete or not by using a graph algorithm, and supplementing the incomplete constraints according to rules; s5, reconstructing parameters; when the method is used, geometrical relations and constraints of various model elements are automatically adjusted and rebuilt, efficiency and precision are improved, the model elements meet current design requirements, constraint problems are automatically detected and corrected, manual intervention is reduced, efficiency is improved, it is guaranteed that various constraint conditions are met during parameter adjustment, and the method is suitable for large-scale popularization and application. Therefore, unreasonable or unstable parameter combination is avoided, and 85% of rfa files of the building family library can be converted into a domestic platform model through preliminary evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer software, and particularly relates to a method for parsing RFA files and reconstructing models. Background Art

[0002] In recent years, the application of 3D BIM has been vigorously promoted in the design of power transmission and transformation projects. Revit is a BIM software developed by Autodesk and is widely used in fields such as architectural design, engineering construction, structural engineering, mechanical and electrical engineering, construction management, and facility management.

[0003] In the Revit software, "Family" is a core concept and is the basic component for constructing BIM models. Simply put, a family is a reusable object template with similar attributes and behaviors. Users can create, modify, and save families as needed for reuse in different projects. The design of families greatly enhances the flexibility and detail level of the model and is also the basis for parametric design.

[0004] However, in the prior art, the following disadvantages will occur during use: After more than 20 years of development, a very rich collection of Revit families has accumulated in the market. Today, with the emphasis on the localization of software systems, many domestic BIM products, including D3BIM, have emerged. However, how to revitalize the existing rfa assets and improve efficiency is a problem that must be solved. In addition, the BimRvSDK provided by the OpenDesignAlliance supports the complete access and model display of rfa files, but does not support model modification and the reconstruction of the parameterized model. Therefore, there is an urgent need for a method for parsing RFA files and reconstructing models to solve the above problems.

[0005] In summary, developing a method for parsing RFA files and reconstructing models is still a key problem that urgently needs to be solved in the technical field of computer software. Summary of the Invention

[0006] The purpose of the present invention is to solve the problems existing in the prior art that after more than 20 years of development, a very rich collection of Revit families has accumulated in the market. Today, with the emphasis on the localization of software systems, many domestic BIM products, including D3BIM, have emerged. However, how to revitalize the existing rfa assets and improve efficiency is a problem that must be solved. In addition, the BimRvSDK provided by the OpenDesignAlliance supports the complete access and model display of rfa files, but does not support model modification and the reconstruction of the parameterized model.

[0007] To achieve the above purpose, the present invention provides the following technical solutions:

[0008] The present invention provides an RFA file parsing and model reconstruction method, including the following steps: S1. Traverse the models, constraints, and parametric data in the RFA file;

[0009] S2. Reconstruct the models by classification;

[0010] S3. Check and reconstruct the constraints of the model elements;

[0011] S4. Perform one-to-one conversion of the original constraints in the RFA, then use graph algorithms to determine whether the constraints are complete, and supplement the incomplete ones according to the rules;

[0012] S5. Reconstruct the parameters.

[0013] Furthermore, in step S1, the method for traversing all the models, constraints, and parametric data in the RFA file is as follows:

[0014] Use the API of Revit to open the RFA file, access various models, constraints, and parametric data inside the RFA file, traverse the model elements in the RFA file, use the FamilySymbol class to traverse all the family instances in the file, use the FamilyInstance class to obtain the detailed information of each family instance, for each model element, use the GeometryElement class to access the geometric information of the model element, obtain the shape, size, and position data of the model element, and classify and store the model elements according to different family types including but not limited to structural elements, architectural elements, and MEP components, and use a dictionary and / or database structure to store the model elements and their geometric information, open and access the RFA file:

[0015] where n represents the total number of model elements in the RFA file, FamilySymbol i represents the i-th family symbol in the file, FamilyInstance i represents the i-th family instance in the file, and GeometryElement i represents the i-th geometric element in the file.

[0016] Furthermore, in step S2, the method for reconstructing the models by classification is as follows:

[0017] Further refine the classification according to the structural model, building model, MEP model, furniture and decoration model. By extracting data from the model elements, obtain the geometric information, dimensions, constraints and parameters of the model elements. At the same time, extract the constraint data of the model elements, including spatial constraints, dimension constraints and alignment constraints. According to the extracted geometric data and constraint relationships, reconstruct the geometric shapes, positions and connection methods of the model elements to ensure that the connection relationships between structural elements, including the connection between beams and columns and the docking between walls, meet the design requirements.

[0018] Furthermore, in step S2, the method for reconstructing the model classification is as follows:

[0019] According to the spatial constraints, dimension constraints and alignment constraints of the model elements, automatically adjust the positions and geometric forms of the model elements to ensure the stability and rationality of the structure. According to the dimension parameters and position constraints extracted from the building elements, automatically adjust and match the geometric relationships between the doors, windows and the structural elements of the walls and floors to ensure their correct positions and dimensions in the model. Reconstruct and layout the pipes, electrical equipment and air conditioning equipment in the MEP elements according to the positions and dimensions of the building elements, and cooperate properly with the building model.

[0020] Furthermore, in step S3, the method for checking and reconstructing the constraints of the model elements is as follows:

[0021] Obtain the description of the model elements, scan the types, attributes and mutual relationships of the model elements to determine whether there are defined constraint relationships for the model elements. Extract the constraint conditions through the metadata of the model elements and / or the constraint definition part of the modeling language. Check the applicability of the constraint conditions one by one, identify the constraint conditions that have become invalid and / or cannot be executed, and analyze whether there are inconsistencies and / or errors in the relationship between the constraint conditions and the model elements. At the same time, check whether the constraint conditions are too loose or too strict to obtain the problematic constraint conditions. Without damaging the overall structure of the model elements, adjust the problematic constraint conditions, relax the strict constraint conditions, design priorities for the conflicting constraint conditions, and add new constraint conditions to replace the old invalid constraint conditions. Obtain the description of the model elements:

[0022] ElementDescription i =(ElementType i ,ElementProperties i ,ElementRelationships i ), where ElementType i represents the type of the i-th model element, ElementProperties i represents the attributes of the i-th model element, ElementRelationshipsi Represents the relationship between the i-th model element and other elements, and checks the constraint: ValidConstraint i , where ValidConstraint i = True represents the status of whether the constraint is valid, indicating that the constraint is valid for the current model and can be continued to be applied or executed; ValidConstraint i = False indicates that the constraint is invalid and does not meet the design requirements of the current model. Design priority:

[0023] Where ReorderedConstraints i = Sort(Constraints i , Priority i )

[0024] Priority i is a numerical value used to sort the constraints. Constraint i represents a specific constraint condition. ReorderedConstraints i is the sorted list of constraint conditions. Sort(Constraints i , Priority i ) is a function that represents sorting the set of constraints according to the priority of each constraint.

[0025] Furthermore, in step S3, the method for checking and reconstructing the constraints of model elements is as follows:

[0026] According to the adjusted constraint conditions, verify the working status after reconstructing the constraint conditions, perform automated tests on the re-adjusted model elements and constraint conditions to verify whether the constraint conditions can be executed normally in different scenarios, use static analysis tools to detect the consistency of model elements and constraint conditions, then perform boundary condition tests, and record the design and change process of the constraint conditions and generate a document. The design and change process includes the reasons for changes, design principles, and application scenarios.

[0027] Furthermore, in step S4, the method of converting the original constraints of rfa one by one and then using graph algorithms to judge whether the constraints are complete and supplementing the incomplete ones according to the rules is as follows:

[0028] Extract the existing constraint information from the RFA model based on the dependencies, quantity restrictions, and time requirements between elements. After extraction, the constraint information is transformed into a graph structure representation. Each model element is regarded as a node in a graph, and the constraint conditions are represented by directed edges. The type and direction of the edges reflect the specific nature of the constraint conditions, forming a constraint graph. Apply graph algorithms to analyze the constraint graph, detect the connectivity of the constraint graph, and use a cycle detection algorithm to check whether there are problems of circular dependencies and deadlocks in the constraint graph. Graph structure: Q i ={q1,q2,…,q n}, where Q i represents the i-th model element. For a spatial constraint:

[0029] W ij =(Q i ,Q j ,ConstraintType ij ,Direction ij ), where Q i ,Q j represent two model elements, ConstraintType ij represents the constraint type, and Direction ij represents the direction of the constraint. Constraint graph: E=(Q,W), where Q is the set of nodes and W is the set of edges.

[0030] Furthermore, in step S4, the original constraints of the RFA are converted one by one, and then graph algorithms are used to determine whether the constraints are complete. The method for supplementing the incomplete ones according to the rules is as follows:

[0031] When it is found that the constraint graph is incomplete, according to the existing rules and business logic, combined with the analysis results of the graph algorithms, supplement the model elements lacking constraint conditions. The supplemented constraint conditions need to be transformed into new edges in the constraint graph, and ensure compatibility with the existing constraint system during supplementation. After supplementing the constraint conditions, run the graph algorithms again to ensure that the newly supplemented constraint conditions do not introduce new problems. The new problems include circular dependencies and / or redundant constraints. Use a constraint solver to automatically detect the model elements after supplementing the constraints, and at the same time use graph algorithms to traverse the constraint graph to check for redundant constraints and / or unnecessary complexity.

[0032] Furthermore, in step S5, the method for reconstructing the parameters is as follows:

[0033] Define the model elements of the parameters according to the theoretical basis, calculation method, and constraint relationships behind the parameters. Check whether the existing parameters match the actual requirements and / or goals. Use the graph model and matrix to represent the correlation between the parameters. Collect the relevant data of the parameters. The relevant data includes historical data, real-time monitoring data, and input information. By analyzing the relevant data, find trends, patterns, and anomalies to obtain the analysis results. Let the model parameter be: R i =[r1, r2, …, r n , where R i represents the parameter of the i-th model element.

[0034] Furthermore, in step S5, the method for reconstructing the parameters is as follows:

[0035] According to the analysis results, establish a mathematical model to describe the relationship between the parameters and the system behavior. Based on the existing objective function and constraint conditions, find the optimal parameter values through particle swarm optimization. At the same time, use the iterative optimization algorithm to continuously adjust the parameters until the target conditions are met. The objective function: where o i is the actual observed value, is the predicted value obtained from the parameter vector R, m is the number of data points, and the constraint condition: p j (R)=r j -r max ≤0, where p j (R) represents the value or residual of the j-th constraint condition, r j represents the parameter of the d-th dimension of the position of the j-th particle, r max represents the maximum value allowed in the j-th dimension. The objective function of particle swarm optimization: where s(R) is the objective function, R is the optimization variable, p j (R)≤0 represents the j-th inequality constraint condition, j is the index of the constraint condition, z x (R)=0 represents the x-th equality constraint condition, x is the index of the equality constraint, is the velocity of the i-th particle after the (t + 1)-th iteration, is the velocity of the i-th particle at the t-th iteration, is the inertia weight, f1 is the self-cognition factor, g1 is the first random number, is the optimal position found by the i-th particle during the entire iteration process, is the position of the i-th particle at the t-th iteration, f2 is the social cognition factor, g2 is the second random number, is the global optimal position in the group, is the new position of the i-th particle after the (t + 1)-th iteration, is the position of the i-th particle at the t-th iteration, and the iterative optimization algorithm: R new = R old + α▽L(R), where R new = R old + α▽L(R) is the learning rate, α is the gradient of the objective function ▽L(R) with respect to the parameter R, and R new represents the updated new parameter value, and R old represents the old parameter value before the current iteration.

[0036] Beneficial effects

[0037] Adopting the technical solution provided by the present invention, compared with the known public technology, it has the following

[0038] beneficial effects:

[0039] When the present invention is in use, it automatically adjusts and reconstructs the geometric relationships and constraints of various model elements, which is beneficial to improving efficiency and accuracy, making the model elements meet the current design requirements, is beneficial to automatically detecting and correcting constraint problems, reducing manual intervention and improving efficiency, and is beneficial to ensuring that various constraint conditions are met when adjusting parameters, thereby avoiding unreasonable or unstable parameter combinations. After preliminary evaluation, it is beneficial to convert 85% of the rfa files in the building family library into domestic platform models. Description of the drawings

[0040] Figure 1 is a flowchart of a method for parsing RFA files and reconstructing models according to the present invention. Detailed implementation manners

[0041] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0042] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to those steps or units clearly listed, but includes other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0043] The present invention will be further described in detail below with reference to the drawings:

[0044] Embodiment:

[0045] As Figure 1 shown, the present invention provides an RFA file parsing and model reconstruction method, including the following steps: S1. Traverse the models, constraints and parametric data in the rfa file;

[0046] Further, in step S1, the method for traversing all the models, constraints and parametric data in the rfa file is:

[0047] Use the API of Revit to open the rfa file, access various models, constraints and parametric data inside the rfa file, traverse the model elements in the rfa file, use the FamilySymbol class to traverse all the family instances in the file, use the FamilyInstance class to obtain the detailed information of each family instance, for each model element, use the GeometryElement class to access the geometric information of the model element, obtain the shape, size and position data of the model element, classify and store the model elements according to different family types including but not limited to structural elements, building elements and MEP components, use a dictionary and / or database structure to store the model elements and their geometric information, open and access the rfa file:

[0048] where n represents the total number of model elements in the RFA file, FamilySymbol i represents the i-th family symbol in the file, FamilyInstance i represents the i-th family instance in the file, GeometryElement i represents the i-th geometric element in the file;

[0049] In this embodiment, through the precise invocation of the Revit API, the models, constraints, and parametric data within the rfa file can be effectively obtained, providing detailed and accurate basic data for subsequent model analysis and processing. Dictionaries and database structures are used to store and manage the geometric information of model elements, improving the retrieval efficiency and organizational structure of the data, facilitating subsequent operations. By classifying and storing different family types, various model elements can be quickly accessed and analyzed, enhancing work efficiency and accuracy. The key information of all model elements in the file is traversed and extracted to ensure the integrity and consistency of the model file, providing strong support for further reconstruction and optimization work.

[0050] S2. Reconstruct the model by classification;

[0051] Furthermore, in step S2, the method for reconstructing the model by classification is as follows:

[0052] According to structural models, architectural models, MEP models, furniture and decoration models, further refine the classification. By extracting data from model elements, obtain the geometric information, dimensions, constraints, and parameters of the model elements. At the same time, extract the constraint data of the model elements, including spatial constraints, dimension constraints, and alignment constraints. According to the extracted geometric data and constraint relationships, reconstruct the geometric shapes, positions, and connection methods of the model elements to ensure that the connection relationships between structural elements, including the connection between beams and columns and the docking between walls, meet the design requirements.

[0053] Furthermore, in step S2, the method for reconstructing the model by classification is as follows:

[0054] According to the spatial constraints, dimension constraints, and alignment constraints of the model elements, automatically adjust the positions and geometric forms of the model elements to ensure the stability and rationality of the structure. According to the dimension parameters and position constraints extracted from the architectural elements, automatically adjust and match the geometric relationships of the doors, windows, and structural elements of the walls and floors to ensure their correct positions and dimensions in the model. Reconstruct and layout the pipes, electrical equipment, and air conditioning equipment in the MEP elements according to the positions and dimensions of the architectural elements, and cooperate properly with the architectural model;

[0055] In this embodiment, by automatically adjusting and reconstructing the geometric relationships and constraints of various model elements, ensure that the model meets the design requirements, reduce the errors caused by manual adjustment. By adjusting the spatial constraints, dimension constraints, and alignment constraints, ensure the coordination and rationality of structural, architectural, MEP, and decorative elements, avoiding design inconsistencies or structural instability. By reconstructing and laying out the MEP elements, ensure their close cooperation with the architectural model, improve the integration efficiency of the building and the system. The automated reconstruction process reduces cumbersome manual operations, improves the efficiency and accuracy of design adjustment, and ensures the smooth progress of the project.

[0056] S3. Check and reconstruct the constraints of model elements;

[0057] Further, in step S3, the method for checking and reconstructing the constraints of model elements is as follows:

[0058] Obtain the description of the model element, scan the type, attributes, and mutual relationships of the model element, determine whether there are defined constraint relationships for the model element, extract the constraint conditions through the metadata of the model element and / or the constraint definition part of the modeling language, check the applicability of the constraint conditions one by one, identify the constraint conditions that have become invalid and / or cannot be executed, and analyze whether there are inconsistencies and / or errors in the relationship between the constraint conditions and the model element. At the same time, check whether the constraint conditions are too loose or too strict to obtain the problematic constraint conditions. Without destroying the overall structure of the model element, adjust the problematic constraint conditions, relax the strict constraint conditions, design priorities for conflicting constraint conditions, add new constraint conditions to replace the old invalid constraint conditions, and obtain the description of the model element:

[0059] ElementDescription i =(ElementType i ,ElementProperties i ,ElementRelationships i ), where ElementType i represents the type of the i-th model element, ElementProperties i represents the attributes of the i-th model element, and ElementRelationships i represents the relationship between the i-th model element and other elements. Check the constraint condition: ValidConstraint i , where ValidConstraint i =True indicates the state of whether the constraint is valid, indicating that the constraint is valid for the current model and can continue to be applied or executed; ValidConstraint i =False indicates that the constraint is invalid and does not meet the design requirements of the current model. Design priorities:

[0060] where ReorderedConstraints i =Sort(Constraints i ,Priority i )

[0061] Priority iis a numerical value used to sort constraints, Constraint i represents a specific constraint condition, ReorderedConstraints i is a list of sorted constraint conditions, Sort(Constraints i , Priority i ) is a function that represents sorting a set of constraints according to the priority of each constraint.

[0062] Furthermore, in step S3, the method for checking and reconstructing the constraints of model elements is as follows:

[0063] According to the adjusted constraint conditions, verify the working state after the constraint conditions are reconstructed, perform automated tests on the re-adjusted model elements and constraint conditions, verify whether the constraint conditions can be executed normally under different scenarios, use static analysis tools to detect the consistency of model elements and constraint conditions, then perform boundary condition tests, and record the design and change process of the constraint conditions to generate a document. The design and change process includes the reasons for changes, design principles, and application scenarios;

[0064] In this embodiment, by checking and adjusting invalid or inapplicable constraint conditions, the model is made to conform to the current design requirements, improving the accuracy and executability of the design. By adjusting and optimizing the constraint conditions, overly strict or loose constraints are eliminated, enhancing the stability and rationality of the model. Using automated tests and static analysis tools for verification reduces manual intervention and improves the reliability and consistency of the constraints. By recording the change process, it is ensured that the design changes are transparent and traceable, facilitating subsequent maintenance and optimization.

[0065] S4. Convert the original constraints of rfa one by one, and then use graph algorithms to determine whether the constraints are complete. For those that are incomplete, supplement them according to the rules;

[0066] Furthermore, in step S4, the method of converting the original constraints of rfa one by one and then using graph algorithms to determine whether the constraints are complete and supplementing the incomplete ones according to the rules is as follows:

[0067] Extract the existing constraint information from the rfa model based on the dependencies, quantity restrictions, and time requirements between elements. The extracted constraint information is transformed into a graph structure representation. Each model element is regarded as a node in a graph, and the constraint conditions are represented by directed edges. The type and direction of the edges reflect the specific nature of the constraint conditions, forming a constraint graph. Use graph algorithms to analyze the constraint graph, detect the connectivity of the constraint graph, and through the cycle detection algorithm, check whether there are problems of circular dependencies and deadlocks in the constraint graph. Graph structure: Q i ={q1,q2,…,q n} where Qi represents the i-th model element. For a spatial constraint:

[0068] W ij =(Q i , Q j , ConstraintType ij , Direction ij ), where Q i , Q j represent two model elements, ConstraintType ij represents the constraint type, and Direction ij represents the direction of the constraint. The constraint graph: E=(Q, W), where Q is the set of nodes and W is the set of edges.

[0069] Furthermore, in step S4, the original constraints of the rfa are converted one by one, and then a graph algorithm is used to determine whether the constraints are complete. The method for supplementing the incomplete ones according to the rules is as follows:

[0070] When it is found that the constraint graph is incomplete, according to the existing rules and business logic, combined with the analysis results of the graph algorithm, the model elements lacking constraint conditions are supplemented. The supplemented constraint conditions need to be converted into new edges in the constraint graph, and compatibility with the existing constraint system should be ensured during supplementation. After supplementing the constraint conditions, the graph algorithm is run again to ensure that the newly supplemented constraint conditions do not introduce new problems. The new problems include circular dependencies and / or redundant constraints. A constraint solver is used to automatically detect the model elements after supplementing the constraints, and at the same time, a graph algorithm is used to traverse the constraint graph to check for the existence of redundant constraints and / or unnecessary complexity;

[0071] In this embodiment, by using a graph algorithm to judge and supplement the missing constraints, the integrity of the model's constraint system is ensured, key constraint conditions are prevented from being missed, redundant constraints or potential conflicts are reduced by re-analyzing and optimizing the constraint graph, the rationality and consistency of the constraint conditions are ensured, the relationships between model elements are guaranteed to be correct by supplementing and adjusting the constraints, the design accuracy is improved, and the combination of the graph algorithm and the constraint solver can automatically detect and correct constraint problems, reduce manual intervention, and improve efficiency.

[0072] S5. Reconstruct parameters;

[0073] Furthermore, in step S5, the method for reconstructing parameters is as follows:

[0074] Define the model elements of the parameters according to the theoretical basis, calculation method, and constraint relationships behind the parameters, check whether the existing parameters match the actual requirements and / or goals, use the graph model and matrix to represent the correlation between the parameters, collect the relevant data of the parameters, and the relevant data includes historical data, real-time monitoring data, and input information. By analyzing the relevant data, find trends, patterns, and anomalies to obtain the analysis results. Let the model parameter be: R i =[r1,r2,…,r n , where R i represents the parameter of the i-th model element.

[0075] Furthermore, in step S5, the method for reconstructing the parameters is as follows:

[0076] According to the analysis results, establish a mathematical model to describe the relationship between the parameters and the system behavior. Based on the existing objective function and constraint conditions, use particle swarm optimization to find the optimal parameter values, and at the same time use the iterative optimization algorithm to continuously adjust the parameters until the target conditions are met. The objective function: where o i is the actual observed value, is the predicted value obtained from the parameter vector R, m is the number of data points, and the constraint condition: p j (R)=r j -r max ≤0, where p j (R) represents the value or residual of the j-th constraint condition, r j represents the parameter of the d-th dimension of the position of the j-th particle, r max represents the maximum value allowed on the j-th dimension. The objective function of particle swarm optimization: where s(R) is the objective function, R is the optimization variable, p j (R)≤0 represents the j-th inequality constraint condition, j is the index of the constraint condition, z x (R)=0 represents the x-th equality constraint condition, x is the index of the equality constraint, is the velocity of the i-th particle after the (t + 1)-th iteration, is the velocity of the i-th particle at the t-th iteration, is the inertia weight, f1 is the self-cognition factor, g1 is the first random number, is the optimal position found by the i-th particle during the entire iteration process, is the position of the i-th particle at the t-th iteration, f2 is the social cognition factor, g2 is the second random number, is the global optimal position in the group, is the new position of the i-th particle after the (t + 1)-th iteration, is the position of the i-th particle at the t-th iteration, iterative optimization algorithm: R new =R old +α▽L(R), where R new =R old +α▽L(R) is the learning rate, α is the gradient of the objective function ▽L(R) with respect to the parameter R, R new Represents the updated new parameter value, R old Indicates the old parameter value before the current iteration;

[0077] In this embodiment, through the precise analysis of historical data, real-time monitoring data and models, the optimized parameters can better meet the actual needs and goals. Through particle swarm optimization and iterative optimization algorithms, it is ensured that various constraints are met when adjusting parameters, thereby avoiding unreasonable or unstable parameter combinations. Through multiple iterative optimizations, the model parameters are continuously adjusted to improve the overall performance and stability of the system, ensuring that the predetermined design goals can be achieved.

[0078] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for parsing RFA files and reconstructing models, characterized in that, It includes the following steps: S1. Traverse the models, constraints, and parametric data in the RFA file; S2. Reconstruct the models by classification; S3. Check and reconstruct the constraints of the model elements; S4. Convert the original constraints in the RFA one by one, then use graph algorithms to judge whether the constraints are complete, and supplement the incomplete ones according to the rules; S5. Reconstruct the parameters.

2. The RFA file parsing and model reconstruction method according to claim 1, wherein, In step S1, the method of traversing all the models, constraints, and parametric data in the RFA file is as follows: Use the API of Revit to open the RFA file, access various models, constraints, and parametric data inside the RFA file, traverse the model elements in the RFA file, use the FamilySymbol class to traverse all the family instances in the file, use the FamilyInstance class to obtain the detailed information of each family instance, for each model element, use the GeometryElement class to access the geometric information of the model element, obtain the shape, size, and position data of the model element, classify and store the model elements according to different family types including but not limited to structural elements, architectural elements, and MEP components, use a dictionary and / or database structure to store the model elements and their geometric information, open and access the RFA file: where n represents the total number of model elements in the RFA file, FamilySymbol i represents the i-th family symbol in the file, FamilyInstance i represents the i-th family instance in the file, GeometryElement i represents the i-th geometric element in the file.

3. The RFA file parsing and model reconstruction method according to claim 2, wherein In step S2, the method of reconstructing the models by classification is as follows: Further refine the classification according to structural models, architectural models, MEP models, furniture and decoration models. By parsing the parameters of the model elements, obtain the geometric information, size, constraints, and parameters of the model elements, and at the same time extract the constraint data of the model elements including spatial constraints, dimension constraints, and alignment constraints. According to the extracted geometric data and constraint relationships, reconstruct the geometric shapes, positions, and connection methods of the model elements to ensure that the connection relationships between structural elements including the connection between beams and columns and the docking between walls meet the design requirements.

4. The RFA file parsing and model reconstruction method according to claim 3, characterized in that In step S2, the method of reconstructing the models by classification is as follows: Automatically adjust the positions and geometric forms of the model elements according to the spatial constraints, dimension constraints, and alignment constraints of the model elements to ensure the stability and rationality of the structure. According to the dimension parameters and position constraints extracted from the architectural elements, automatically adjust and match the geometric relationships between the doors, windows, and the structural elements of the walls and floors to ensure their correct positions and sizes in the model. Reconstruct and layout the pipes, electrical equipment, and air conditioning equipment in the MEP elements according to the positions and sizes of the architectural elements to ensure proper coordination with the architectural model.

5. The RFA file parsing and model reconstruction method according to claim 4, characterized in that, In step S3, the method of checking and reconstructing the constraints of the model elements is as follows: Obtain the description of model elements, scan the types, attributes, and interrelationships of model elements, determine whether there are defined constraint relationships for model elements, extract constraint conditions through the metadata of model elements and / or the constraint definition part of the modeling language, check the applicability of constraint conditions one by one, identify constraints that are already invalid and / or cannot be executed, and analyze whether there are inconsistencies and / or errors in the relationship between constraint conditions and model elements. At the same time, check whether the constraint conditions are too loose or too strict to obtain problematic constraint conditions. Without destroying the overall structure of model elements, adjust the problematic constraint conditions, relax the strict constraint conditions, design priorities for conflicting constraint conditions, add new constraint conditions to replace old invalid constraint conditions, and obtain the description of model elements: ElementDescription i =(ElementType i , ElementProperties i , ElementRelationships i ), where ElementType i represents the type of the i-th model element, ElementProperties i represents the properties of the i-th model element, ElementRelationships i represents the relationships between the i-th model element and other elements. Check the constraint condition: ValidConstraint i , where ValidConstraint i = True indicates the status of whether the constraint is valid, meaning the constraint is valid for the current model and can be continued to be applied or executed; ValidConstraint i = False indicates that the constraint is invalid and does not meet the design requirements of the current model. Design priority: where ReorderedConstraints i = Sort(Constraints i , Priority i ) Priority i is a value used to sort constraints, Constraint i represents a specific constraint condition, ReorderedConstraints i is the list of sorted constraint conditions, Sort(Constraints i , Priority i ) is a function that represents sorting a set of constraints according to the priority of each constraint.

6. The RFA file parsing and model reconstruction method according to claim 5, wherein In step S3, the method for checking and reconstructing the constraints of model elements is: According to the adjusted constraint conditions, verify the working state after the reconstruction of the constraint conditions, perform automated tests on the re-adjusted model elements and constraint conditions to verify whether the constraint conditions can be executed normally in different scenarios, use static analysis tools to detect the consistency of model elements and constraint conditions, then perform boundary condition tests, and record the design and change process of the constraint conditions to generate a document. The design and change process includes the reasons for the change, design principles, and application scenarios.

7. An RFA file parsing and model reconstruction method according to claim 6, characterized in that, In step S4, the method of converting the original constraints of rfa one by one and then using graph algorithms to determine whether the constraints are complete and supplementing the incomplete ones according to rules is: Extract the existing constraint information from the RFA model based on the dependencies, quantity restrictions, and time requirements between elements. The extracted constraint information is transformed into a graph structure representation. Each model element is regarded as a node in a graph, and the constraint conditions are represented by directed edges. The type and direction of the edges reflect the specific nature of the constraint conditions, forming a constraint graph. Apply graph algorithms to analyze the constraint graph, detect the connectivity of the constraint graph, and use a cycle detection algorithm to check whether there are problems of circular dependencies and deadlocks in the constraint graph. Graph structure: Q i ={q1,q2,…,q n}, where Q i represents the i-th model element. For a spatial constraint: W ij =(Q i ,Q j ,ConstraintType ij ,Direction ij ), where Q i ,Q j represent two model elements, ConstraintType ij represents the constraint type, and Direction ij represents the direction of the constraint. Constraint graph: E=(Q,W), where Q is the set of nodes and W is the set of edges.

8. The RFA file parsing and model reconstruction method according to claim 7, wherein In step S4, the method of converting the original constraints of rfa one by one and then using graph algorithms to determine whether the constraints are complete and supplementing the incomplete ones according to rules is: In the case where it is found that the constraint graph is incomplete, according to the existing rules and business logic, combined with the analysis results of graph algorithms, supplement the model elements lacking constraint conditions. The supplemented constraint conditions need to be converted into new edges in the constraint graph, and ensure compatibility with the existing constraint system during supplementation. After supplementing the constraint conditions, run the graph algorithm again to ensure that the newly supplemented constraint conditions do not introduce new problems. New problems include circular dependencies and / or redundant constraints. Use a constraint solver to automatically detect the model elements after supplementing the constraints, and at the same time use graph algorithms to traverse the constraint graph to check for redundant constraints and / or unnecessary complexities.

9. The RFA file parsing and model reconstruction method according to claim 8, characterized in that In step S5, the method for reconstructing parameters is: Define the model elements of parameters according to the theoretical basis, calculation method, and constraint relationship behind the parameters, check whether the existing parameters match the actual requirements and / or goals, use graph models and matrices to represent the relevance between parameters, collect relevant data of parameters. Relevant data includes historical data, real-time monitoring data, and input information. Through the analysis of relevant data, find trends, patterns, and anomalies to obtain the analysis results. Let the model parameters be: R i = [r1, r2, …, r n , where R i represents the parameters of the i-th model element.

10. A method for parsing an RFA file and reconstructing a model according to claim 8, characterized in that, In step S5, the method for reconstructing parameters is: Based on the analysis results, a mathematical model is established to describe the relationship between parameters and system behavior. Based on the existing objective function and constraint conditions, the optimal parameter values are found through particle swarm optimization. At the same time, an iterative optimization algorithm is used to continuously adjust the parameters until the target conditions are met. The objective function: where o i is the actual observed value, is the predicted value obtained from the parameter vector R, m is the number of data points, and the constraint condition: p j (R) = r j -r max ≤0, where p j (R) represents the value or residual of the j-th constraint condition, r j represents the i-th dimensional parameter of the position of the j-th particle, r max represents the maximum value allowed in the j-th dimension. The objective function of particle swarm optimization: where s(R) is the objective function, R is the optimization variable, p j (R) ≤ 0 represents the j-th inequality constraint condition, j is the index of the constraint condition, z x (R) = 0 represents the x-th equality constraint condition, x is the index of the equality constraint, is the velocity of the i-th particle after the (t + 1)-th iteration, is the velocity of the i-th particle at the t-th iteration, is the inertia weight, f1 is the self-cognition factor, g1 is the first random number, is the optimal position found by the i-th particle during the entire iteration process, is the position of the i-th particle at the t-th iteration, f2 is the social-cognition factor, g2 is the second random number, is the global optimal position in the group, is the new position of the i-th particle after the (t + 1)-th iteration, is the position of the i-th particle at the t-th iteration, iterative optimization algorithm: R new = R old + α▽L(R), where R new = R old + α▽L(R) is the learning rate, α is the gradient of the objective function ▽L(R) with respect to the parameter R, R new represents the new parameter value after update, and R old represents the old parameter value before the current iteration.