Water transportation engineering model attribute assignment method and system based on database generation language

Through the method based on the database generation language, standard tabular data in the field of water transport engineering are extracted and processed, and databases and MVC architectures are generated, which solves the problems of low data binding efficiency and accuracy caused by manual operations, and achieves higher-quality water transport engineering model creation.

CN119597725AInactive Publication Date: 2025-03-11HUNAN PROVINCIAL COMM PLANNING SURVEY & DESIGN INST CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411437221.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, manual operations lead to low data binding efficiency and value assignment accuracy, affecting the quality and effect of water transportation engineering model creation.

Method used

Using a database generation language method, the tabular data in national standards or industry standards in the field of water transportation engineering is extracted, the database generation language is generated, a database containing tabular data is created, and a three-layer MVC architecture is generated based on the database, and attribute assignment is performed to generate a water transportation engineering component model.

Benefits of technology

It improves data binding efficiency and the accuracy of assignment, and enhances the quality and effectiveness of water transportation engineering model creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597725A_ABST
    Figure CN119597725A_ABST
Patent Text Reader

Abstract

The invention discloses a water transportation engineering model attribute assignment method and system based on a database generation language. The method comprises the following steps: extracting table data in national standards or industrial standards in the field of water transportation engineering by adopting a first language to obtain first format data; the first language comprises a python language; the data format of the first format data is an Excel file format; processing the first format data to generate a database generation language; creating a database containing table data by utilizing the database generation language; generating an MVC three-layer architecture based on the database; and assigning the MVC three-layer architecture to generate a water transportation engineering component model. According to the scheme provided by the invention, the data binding efficiency and the assignment accuracy can be improved, and the water transport engineering model creation quality and effect are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water transport engineering construction, and in particular to a method and system for assigning attributes to a water transport engineering model based on a database generation language. Background Art

[0002] With the gradual and in-depth application of Building Information Modeling (BIM) technology in the water transport engineering construction industry, the application scenarios of three-dimensional BIM models are gradually increasing, and the Ministry of Transport is also issuing a large number of information standards for related fields.

[0003] How to integrate the relevant engineering construction information standards and engineering technology software currently issued by the Ministry of Transport, such as "Water Transport Engineering Design Information Model Application Standard JTGT 2421-2021", "Water Transport Engineering Construction Information Model Application Standard (JTGT 2422-2021)", and "Water Transport Engineering Information Model Application Unified Standard JTGT 2420-2021" is an urgent problem to be solved. At present, by manually searching for relevant requirements in the standards, and then assigning relevant attributes to the water transport engineering component model according to the relevant requirements, in the process of creating the water transport engineering component model, it is easy to cause data operation assignment errors due to the limitations of human operation, thereby affecting the creation of the water transport engineering component model. That is, human operation will lead to low data binding efficiency and assignment accuracy, thereby affecting the quality and effect of the final water transport engineering model creation. Summary of the invention

[0004] In order to solve the technical problem that human operation will lead to low data binding efficiency and assignment accuracy, thereby affecting the quality and effect of the final water transport engineering model creation, an embodiment of the present invention provides a water transport engineering model attribute assignment method and system based on database generation language.

[0005] The technical solution of the embodiment of the present invention is achieved as follows: An embodiment of the present invention provides a method for assigning attributes to a water transport engineering model based on a database generation language, the method comprising: using a first language to extract tabular data in a national standard or industry standard in the field of water transport engineering to obtain first format data; the first language comprises a python language; the data format of the first format data is an Excel file format; processing the first format data to generate a database generation language; using the database generation language to create a database containing tabular data; generating an MVC three-tier architecture based on the database; assigning values ​​to the MVC three-tier architecture to generate a water transport engineering component model.

[0006] In one embodiment, a first language is used to extract tabular data in a national standard or industry standard in the field of water transport engineering to obtain data in a first format, including: installing a pdfplumber library and / or a pandas library; dispatching a pdf = pdfplumber.open("file path") function to extract a national standard or industry standard in PDF file format from a preset file path; dispatching a pages = pdf.pages function to obtain a file page in the national standard or industry standard; dispatching a tables = [] function to create an empty list, and the empty list is used to store data in an Excel file format; dispatching a foreach in pages: function to loop through the file pages, and dispatching a table = each.extract_table() function to obtain the tabular data in each of the file pages; dispatching a tables.extend(table) function to fill the obtained tabular data in each of the file pages into the empty list; using the DataFrame class in the pdfplumber library and / or the pandas library to create a data frame; dispatching data = pd.DataFrame(tables[1:], The function data.to_excel(".. / data / excelName.xlsx", index=False) is dispatched to write the data in the data frame into an Excel file and save the Excel file at the same time; the Excel file is data in the first format.

[0007] In one embodiment, the first format data is processed to generate a database generation language, including: creating a console application project, using the NuGet package in the application project to install the NPOI library; creating a console application project, and based on the console application project, using the NuGet open source package management development tool to install the NPOI library; reading the data in the first format data through the NPOI library, and storing the read data in an initialized DataTable, and naming the DataTable dt; looping through the data in the dt with columns as the first layer of loop traversal and rows as the second layer of loop traversal; the loop index of the column is i, and the loop index of the row is j; obtaining each loop traversal value through the dt.Rows[j][i].ToString() function, and using Encoding.UTF8.GetByteCount(tempStr) The function calculates the byte length of each loop traversal value; saves the maximum value of the byte length into a List list, and names the List list as byteLengthList; wherein the number of the maximum byte length values ​​stored in the byteLengthList is equal to the number of columns in the dt; processes the data in the dt into the content format of the SQL INSERT INTO statement, and stores it into a sqlInsertDt of the DataTable type; generates a database generation language for the first format data according to the dt, the sqlInsertDt and the byteLengthList.

[0008] In one embodiment, the data in the dt is processed into the content format of the SQL INSERT INTO statement and stored in the sqlInsertDt of the DataTable type, including: obtaining the initialized DataTable and naming the DataTable sqlInsertDt; the sqlInsertDt is used to store the content of the SQL INSERT INTO statement; obtaining the number of rows and columns of the dt, and determining the number of columns of the sqlInsertDt to be twice the number of columns of the dt plus 1; looping through the number of columns of the sqlInsertDt, and using the sqlInsertDt.Columns.Add("ID" +i.ToString(), typeof(string)) function to add columns to the sqlInsertDt; the name of the column is marked as "ID" + i.ToString(), and the format of the column is string; the first layer loops through the number of rows of the dt, the traversal index is rowIndex, and through DataRow row = The sqlInsertDt.NewRow() function adds a row, and the second-level loop traverses the number of columns of the sqlInsertDt, and the traversal index is columnIndex; in the second-level loop, when the columnIndex is 0, the column name is assigned a left bracket value; when the columnIndex is the last column index value and the rowIndex is also the last row index value, the column name is assigned a null value; when the columnIndex is the last column index value and the rowIndex is not the last row index value, the column name is assigned a comma value; when the columnIndex is the second-to-last column index value, the column name is assigned a right bracket value; when the columnIndex is not the first column, the last column, or the last column, the column name is assigned a right bracket value. When there are two columns, determine whether the columnIndex is an even number. If the columnIndex is an even value, assign the column name to a comma value; if the columnIndex is an odd value, determine half of the columnIndex minus one as a temporary value tempDtIndex, determine the number of columns of the sqlInsertDt as another temporary value empsqlInsertDtIndex, input the two temporary values ​​into the dt.Rows[tempsqlInsertDtIndex][tempDtIndex] function, determine whether the value of the function is empty, if the value of the function is empty, assign the column name to a horizontal line value, if the value of the function is not empty, assign the column name to dt.The value of the Rows[tempsqlInsertDtIndex][tempDtIndex].ToString() function; when row is assigned, the row data is filled into the sqlInsertDt through the sqlInsertDt.Rows.Add(row) function. .

[0009] In one embodiment, a database generation language for generating the first format data is generated according to the dt, the sqlInsertDt and the byteLengthList, including: naming the table created in the database as tableName, naming the database name as WaterTransportDesignInformationStandard, naming the initialized SQL statement as sqlStr, and the type of the SQL statement as string; looping through the number of columns in the dt, and dtIndexColumn2 is the loop index value; wherein, in each loop, the sqlStr adds a tab escape character to determine whether the loop index value is the last column, if the loop index value is the last column, then the sqlStr adds a string of "ID" + dtIndexColumn2.ToString() + " " + "varchar(" + byteLengthList[dtIndexColumn2].ToString() + ")," + "\n"; if the loop index value is not the last column, then the sqlStr adds a string of "ID" + dtIndexColumn2.ToString() + " " + "varchar(" +byteLengthList[dtIndexColumn2].ToString() + ")" + "\n" string; after the loop is finished, add "")" + "\n" string, "insert into " and tableName to the sqlStr in turn; loop through the number of columns of the dt, dtIndexColumn3 is the loop index value; wherein, in each loop, during the loop process, determine whether the loop index value is 0, if the loop index value is 0, then add "(" + "ID" + dtIndexColumn3.ToString() + "," to the sqlStr; if the loop index value is the last column index, then add "ID" + dtIndexColumn3.ToString() + ")" to the sqlStr; if the loop index value is not the first column or the last column, then add "ID" + dtIndexColumn3.ToString() + ")" to the sqlStr.ToString() + "," is added to the sqlStr; after the loop is finished, "\n" + "values" + "\n" is added to the sqlStr; the sqlInsertDt is looped through, the first layer traverses the number of rows of the sqlInsertDt, the row index is sqlInsertDtRowIndex2, the second layer traverses the number of columns of the sqlInsertDt, and the column index value is sqlInsertDtColumnIndex2; sqlInsertDt.Rows[i][j].ToString() is assigned to tempSQLInsertDtStr; in the second layer loop, it is determined whether the column index value is the first column, the first to last column, or the second to last column. If the column index value is the first column, the first to last column, or the second to last column, tempS QLInsertDtStr is added to the sqlStr string; if the column index value is not the first column, the last column or the second last column, it is determined whether the column index value is an even column. If the column index value is an even column, the data tempSQLInsertDtStr is added to the sqlStr. If the column index value is not an even column, a single quote, tempSQLInsertDtStr, and a single quote are added to the sqlStr in sequence; after each column loop ends, a line break is added to the sqlStr; when all loops are completed, a line break is added to the sqlStr; database information query is performed, and "select *from " + tableName is added to the sqlStr. .

[0010] In one embodiment, an MVC three-tier architecture is generated based on the database, including: using batch generation of MVC three-tier architecture software to connect with the database to generate DAL, BLL, and MODEL files; using the GetList method in the DAL file to call the database table and store it in a List, naming the List as FinenessHydraulicStructureModelList, wherein the data type stored in the FinenessHydraulicStructureModelList is the FinenessHydraulicStructureModel class, which contains sqlInsertDt and the column name of the same data column as the table, calling the GetList in the DAL file through the GetList2 method in the BLL file to call the table data, and completing the design of the MVC three-tier architecture.

[0011] In one embodiment, the MVC three-layer architecture is assigned a value to generate a water transport engineering component model, including: storing the extracted PDF table data into a database table, clicking the Create Project button, setting the project type in the pop-up project setting window, and then binding the stage model name column data to the design stage control and the model depth level code to the model depth level control by calling, and linking the data through a linkage algorithm, selecting the feasibility study model for the design stage, the model depth is L100, selecting the preliminary design model, the model depth level is L200, and selecting the construction drawing design model, the model depth level is L300; using the first column element type of the database table to bind to the structure type to complete the project setting; confirming that the pile foundation type is to be used For the three-dimensional design of port engineering, according to the element options in the corresponding standard table data, the structure creation button is called. In the automatically formed structure model tree, the pile foundation in the model tree is clicked, and the processed database table is called using the GetDataFunction method; the data matching method is called to automatically match the element information; the pile foundation creation window is instantiated, and the controls in the pile foundation creation window are dynamically created according to the geometricalInformationList and nonGeometricalInformationList information lists; the create button is clicked to call the geometry creation function in the SDK of MicroStation to create the pile foundation geometry, and the generation of the water transport engineering component model is completed.

[0012] In one embodiment, the engineering types include port engineering, waterway engineering, navigation construction engineering and shipbuilding and repairing hydraulic engineering.

[0013] An embodiment of the present invention also provides a water transport engineering model attribute assignment system based on a database generation language, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, the steps of any one of the above methods are executed.

[0014] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0015] The method and system for assigning attributes of a water transport engineering model based on a database generation language provided by an embodiment of the present invention uses a first language to extract tabular data in a national standard or industry standard in the field of water transport engineering to obtain data in a first format; the first language includes a python language; the data format of the first format data is an Excel file format; the first format data is processed to generate a database generation language; a database containing tabular data is created using the database generation language; an MVC three-layer architecture is generated based on the database; the MVC three-layer architecture is assigned to generate a water transport engineering component model. The solution provided by the present invention can improve the efficiency of data binding and the accuracy of assignment, and enhance the quality and effect of water transport engineering model creation. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of a flow chart of a method for assigning values ​​to a water transport engineering model attribute based on a database generation language according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the data table of "A.0.2-5 Hydraulic Structure Professional Model Information Detail" on page 70 of the Water Transport Engineering Design Information Model Application Standard (JTS / T198-2-2019) in the embodiment of the present invention; Figure 3 This is a schematic diagram of Excel file data information generated after processing in step S01 in an embodiment of the present invention; Figure 4 In the embodiment of the present invention, Figure 3 Schematic diagram of the table effect of converting data format into SQL insert statement; Figure 5 This is a schematic diagram of the SQL language effect of the database automatically created in an embodiment of the present invention; Figure 6 This is a schematic diagram of the effect of executing a database query after automatic creation in an embodiment of the present invention; Figure 7 This is a schematic diagram of the result of dividing the highway engineering design information model application standard according to an embodiment of the present invention; Figure 8 A schematic diagram of a project setting window according to an embodiment of the present invention; Fig. 9 A schematic diagram of element options in standard table data corresponding to an embodiment of the present invention; Fig.10 A schematic diagram of a window for instantiating a pile foundation for an embodiment of the present invention; Fig.11 A schematic diagram of the effect after the attribute assignment is completed by matching the specification data and the actual design data in the embodiment of the present invention; Fig.12 1 is a diagram showing the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

[0018] The embodiment of the present invention provides a method for assigning attributes of a water transport engineering model based on a database generation language, such as Figure 1 As shown, the method includes: Step 101: extracting table data in national standards or industry standards in the field of water transport engineering using a first language to obtain data in a first format; the first language includes Python; and the data format of the first format data is an Excel file format; Step 102: Process the first format data to generate a database generation language; Step 103: Create a database containing table data using the database generation language; Step 104: Generate an MVC three-layer architecture based on the database; Step 105: Assign values ​​to the MVC three-layer architecture to generate a water transport engineering component model.

[0019] The solution of this embodiment can improve the efficiency of data binding and the accuracy of value assignment, and enhance the quality and effect of water transport engineering model creation.

[0020] Specifically, this embodiment will take the relevant standards of "Water Transport Engineering Design Information Model Application Standard JTST 198-2-2019" issued by the Ministry of Transport as a reference, and use Python language to extract relevant data tables of the unified standard for the application of water transport engineering information models. The following demonstrates the relevant information in the "Water Transport Engineering Design Information Model Application Standard JTGT 2421-2021".

[0021] Step S01, create a Python application based on the Visual Studio 2022 integrated development environment, and write the code to extract the data table related to the "Water Transport Engineering Design Information Model Application Standard JTGT 2421-2021". First, install the pdfplumber and pandas libraries to perform related operations on PDF processing. Use the pdf = pdfplumber.open("file path") method to extract the pdf file of the "Application Standard of Water Transport Engineering Design Information Model JTGT 2421-2021" standard in the specified path, and write the code pages = pdf.pages to get the page of PDF; use the method tables = [] code to create an empty list to store Excel data, use the method for each in pages: code to loop through pages, use table = each.extract_table() to get the table on each page, and use tables.extend(table) to fill the tables list; use pandas's DataFrame class to create a data frame, and use the code data = pd.DataFrame(tables[1:], columns=tables[0]) to fill the extracted table data into the data frame; use data.to_excel(".. / data / excelName.xlsx", index=False) to write the data into the Excel file and save the Excel file at the same time. Take Table AO2-5 "Details of Model Information of Hydraulic Structures" in "Application Standard of Water Transport Engineering Design Information Model JTGT 2421-2021" as an example. Figure 2 As shown, by the above method Figure 2 Export the data to Excel, such as Figure 3 shown.

[0022] Step S02: Process the extracted standard table data to generate a database generation language.

[0023] Step S021, read the Excel file, first create a console application (.NET Framework) project, use the NuGet open source package management development tool to install the NPOI library, read the data in the Excel file through the NPOI library, and then store the read data in the initialized DataTable, named dt.

[0024] Step S022, calculate the maximum byte length of each column of the dt table. First, loop, the first layer loop traverses the dt column, the loop index is i; the second layer traverses the dt row, the loop index is j; obtain each loop traversal value tempStr through dt.Rows[j][i].ToString(), and calculate the byte length byteLength through Encoding.UTF8.GetByteCount(tempStr); in the second layer loop, compare the calculated byteLength respectively, and save the maximum value in the List list and name it byteLengthList, and the number of the maximum byte lengths stored in byteLengthList is equal to the number of dt columns.

[0025] Step S023, process the data in the dt table into the content format of the SQL INSERT INTO statement, and store it in sqlInsertDt of the DataTable type. First, initialize the DataTable named sqlInsertDt to store the content of the SQL INSERT INTO statement. Get the number of rows of dt and name it rowDtNumber, the number of columns of dt and name it columnDtNumber, calculate the number of columns of sqlInsertDt columnSqlInsertDtNumber as (columnDtNumber+ 1) * 2 calculated value; loop through columnSqlInsertDtNumber, use sqlInsertDt.Columns.Add("ID" + i.ToString(), typeof(string)) to add columns to sqlInsertDt, and the column name is marked as "ID" +i.ToString(), and the format is string.

[0026] Loop through sqlInsertDt. The first layer loops through rowDtNumber rows, with rowIndex as the traversal index, and adds rows through DataRow row = sqlInsertDt.NewRow(). The second layer loops through columnSqlInsertDtNumber columns, with columnIndex as the traversal index.

[0027] In the second loop, when the loop column index value columnIndex is 0, row[column name] is assigned to the left bracket value; when the loop column index is the last column index value and the index value of the first layer traversal is also the last row index value, row[column name] is assigned to empty. If the index value of the first layer traversal is not the last row index value, row[column name] is assigned to a comma value; when the loop column index is the second-to-last column index value, row[column name] is assigned to the right bracket value; if the loop column index is not the first column, the first-to-last column, or the second-to-last column, determine whether the column index is an even number. If it is an even value, row[column name] is assigned to a comma value; if it is an odd value, a temporary value tempDtIndex is calculated as (columnIndex - 1) / 2. Another temporary value tempsqlInsertDtIndex is the number of Rows in sqlInsertDt. If the value of dt.Rows[tempsqlInsertDtIndex][tempDtIndex] is empty, row[column name] is assigned a horizontal line value. If the value is not empty, row[column name] is assigned a value of dt.Rows[tempsqlInsertDtIndex][tempDtIndex].ToString(). When row is assigned, the row data is filled into sqlInsertDt through the sqlInsertDt.Rows.Add(row) method. Finally, the following steps are performed: Figure 3 The data format is converted to Figure 4 Show the effect.

[0028] Step S024, generate the SQL statement of the table data according to dt, sqlInsertDt, and byteLengthList. First, name the hydraulic structure professional model information fineness table created by the database as tableName, name the database as WaterTransportDesignInformationStandard, name the initialization SQL statement as sqlStr, and the type is string; Step S0241, write the following statement: sqlStr += "go" + "\n" + "use WaterTransportDesignInformationStandard " + "\n"+ "go"+"\n"; sqlStr += "if exists(select * from sysobjects where name='" +tableName + "')" + "\n"; sqlStr += "drop table " + tableName + "\n" + "go" + "\n"; sqlStr += "create table " + tableName + "\n"; sqlStr += "(" + "\n"; Step S0242, loop through the number of dt columns, dtIndexColumn2 is the loop index value, each loop sqlStr first adds the tab escape character, and then determines whether the column index value is the last column, if it is sqlStr adds "ID" + dtIndexColumn2.ToString() + " " + "varchar(" + byteLengthList[dtIndexColumn2].ToString() + ")," + "\n" string, if not then sqlStr adds "ID" + dtIndexColumn2.ToString() + " " + "varchar(" + byteLengthList[dtIndexColumn2].ToString() + ")" + "\n" string. After the loop ends, first add ")" + "\n" string to sqlStr, then add "insert into ", and finally add tableName to the string.

[0029] Step S0243, loop through the number of dt columns, dtIndexColumn3 is the loop index value, first determine whether the loop index value is 0 in the loop, if the index value is 0, add "(" + "ID" + dtIndexColumn3.ToString()+ "," to sqlStr; if the index value is the last column index, add "ID" + dtIndexColumn3.ToString() + ")" to sqlStr; if it is not the first column or the last column, add "ID" + dtIndexColumn3.ToString() + "," to sqlStr. Finally, add "\n" + "values" + "\n" to sqlStr.

[0030] Step S0244, loop through sqlInsertDt, the first layer traverses the number of sqlInsertDt rows, the row index is sqlInsertDtRowIndex2, the second layer traverses the number of sqlInsertDt columns, the column index value is sqlInsertDtColumnIndex2. Assign sqlInsertDt.Rows[i][j].ToString() to tempSQLInsertDtStr in the second layer loop, determine whether the index value of the loop column is the first column, the penultimate column, or the penultimate column. If so, add tempSQLInsertDtStr to the sqlStr string; if not, determine whether the column index value is an even column. If so, add the data tempSQLInsertDtStr to the string sqlStr. If it is not an even column, add single quotes, tempSQLInsertDtStr, and single quotes to the sqlStr string in sequence. When each column loop ends, add a line break to sqlStr. When the above loop ends, add a line break to sqlStr. Then query the database information, add "select *from " + tableName in sqlStr, and generate a string through steps S0241, S0242, S0243, and S0244. The final effect is as follows Figure 5 shown.

[0031] Step S03, create a database using a database generation language and automatically generate an MVC three-tier architecture. Use the SQL statement generated in step S02 to execute the query statement. The effect is as follows: Figure 6 As shown. Use batch generation of MVC three-tier architecture software to connect to the database and generate DAL, BLL, and MODEL code files. Use the GetList method in the DAL file to call the table data corresponding to "A.0.2-5 Hydraulic Structure Professional Model Information Detail" on page 70 of the Water Transport Engineering Design Information Model Application Standard (JTS / T198-2-2019). Figure 6 Database table, and store it in List named FinenessHydraulicStructureModelList, where the data type stored in FinenessHydraulicStructureModelList is FinenessHydraulicStructureModel class, which contains sqlInsertDt and the column name of the "A.0.2-5 Hydraulic Structure Professional Model Information Details" table with the same data column. The GetList2 method in BLL calls the GetList in DAL to call the table data, and finally completes the design of the MVC three-tier architecture.

[0032] Through the above general method, all data information of the "Water Transport Engineering Design Information Model Application Standard JTST 198-2-2019" standard can be stored in a database named database, where the database contains all data tables extracted from the standard. According to the standard information, all table data are divided according to general settings, port engineering, waterway engineering, navigation building engineering, and shipbuilding and hydraulic engineering. The general settings include tables such as the coding sequence table and the coding application requirements table for each stage of the design stage information model. The port engineering includes table data such as the general drawing professional model granularity, the waterway professional model granularity, the solid loading and unloading process professional model granularity, the liquid loading and unloading process professional model granularity, and the hydraulic structure professional model granularity. The waterway engineering includes the table data of the hydraulic structure professional model information fineness. The navigation building engineering includes the table data of the general drawing professional model granularity, the metal structure professional model granularity, and the hydraulic structure professional model granularity. The shipbuilding and hydraulic engineering includes the table data of the general drawing professional model granularity, the process professional model granularity, and the metal structure professional model granularity. The above data division structure is as follows: Figure 7 shown.

[0033] Step S04, assigning relevant specification information to the water transport engineering component model to be created in the three-dimensional design system.

[0034] Step S041, first make general settings. Name the general method that uses steps S01, S02, and S03 to extract PDF table data and store it in the database table GetDataFunction, click the Create Project button, and the Project Settings window (such as Figure 8As shown), first set the project type. The project type can include port engineering, waterway engineering, navigation building engineering, and shipbuilding and repairing hydraulic engineering. At this time, we need to perform standard data binding for port engineering 3D design and select port engineering; the design stage includes feasibility study model, preliminary design model, and construction drawing design model. This data is processed by GetDataFunction in "Table 8.2.1 Model Depth Level", and then the stage model name column data is bound to the design stage control and the model depth level code is bound to the model depth level control through calling. The data is linked through the linkage algorithm. When the design stage is selected as the feasibility study model, the model depth is L100, when it is selected as the preliminary design model, the model depth level is L200, and when it is selected as the construction drawing design model, the model depth level is L300. Use GetDataFunction to process the table "Table A.0.1-5 Hydraulic Structure Professional Model Granularity", and bind the element type in the first column of the table to the structure type, which includes pile foundation structure, sheet pile structure, gravity structure, solid slope structure, special structure type, auxiliary facilities, and other 7 types. In this example, the pile foundation structure is selected for creation. Finally, set the project name and project leader in turn, and click OK to complete the project setting.

[0035] Step S042: After step S041 is completed, it has been confirmed that the three-dimensional design of the pile-based port project is to be carried out. Fig. 9 As shown, the structure will create pile foundation, pile cap, beam, upper beam, lower beam, track beam, longitudinal beam, front beam, rear beam, mooring beam, berthing member, horizontal support, column, pier, connecting beam, ground beam, panel, surface layer, node and other structures. Call the structure creation button. Due to the previous settings, the function calls the create pile foundation structure window. At this time, the structure model tree is automatically formed on the left according to the above data, as shown in the figure below. Fig.10 As shown on the left, click the pile foundation in the model tree. At this time, the database table "Table AO2-5 Hydraulic structure professional model information detail" processed by the GetDataFunction method will be called Step S042, at this time, if the element type is a pile foundation structure and the structure is a pile foundation, the data matching method is called to automatically match the element information in FinenessHydraulicStructureModelList. The pile foundation attributes are finally obtained, including geometric information and non-geometric information, where the geometric information includes pile length, outer diameter, wall thickness, section length, section width, hollow diameter, top elevation, slope, plane torsion angle, bottom elevation, and volume, and the non-geometric information includes coding, type, material, reinforcement ratio, reinforcement information, and technical requirements. The geometric information is stored in geometricalInformationList, and the non-geometric information is stored in nonGeometricalInformationList.

[0036] Instantiate the pile foundation creation window, and dynamically create controls in the pile foundation creation window according to the geometricalInformationList and nonGeometricalInformationList information lists. The dynamic creation algorithm is to first obtain the number of elements in the geometricalInformationList, initialize the coordinate values ​​xLocation and yLocation on the left side of the first Label, locate the control size xSize and ySize, and loop through the number of elements in the list. Each time the loop is completed, a control is created on the left side and named according to the corresponding loop value data in the geometricalInformationList. At the same time, a control that can input data is created on the right side. Each time the loop control is completed, the corresponding xLocation and yLocation values ​​are modified according to the actual layout. When the window is initialized, data is input according to the actual design information. Fig.10 shown.

[0037] Step S043, as Fig.10 As shown. Click the Create button to call the geometry creation function in MicroStation's SDK to create the pile foundation geometry through the pile length, top elevation, and outer diameter geometry information. Call the attribute creation function to assign pile foundation attributes. First, obtain the current 3D file DgnFile and the 3D model DgnModel in the current file, instantiate the attribute set, store the geometric attribute set and non-geometric attribute set in ItemType, and store the geometricalInformationList and nonGeometricalInformationList information in them respectively. At the same time, assign the actual input design information to the attribute set, and finally complete the attribute assignment work, as shown. Fig.11 The effect is shown.

[0038] For the creation of other structures of pile foundation structure, the same as steps S042 and S043, taking the pile cap as an example, geometric information and non-geometric information will be obtained, wherein the geometric information includes height, length, width, diameter, side length, top elevation, bottom elevation, and volume, and the non-geometric information includes coding, material, reinforcement ratio, reinforcement information, embedded parts information, reserved grooves, holes, and technical requirements information.

[0039] The creation of other engineering structures is the same as that of port projects. By digitizing the standards and making the algorithms logical, the standardization of the attribute assignment of the water transport engineering design model can be achieved.

[0040] The method for assigning attributes of a water transport engineering model based on a database generation language provided by an embodiment of the present invention uses a first language to extract table data in a national standard or industry standard in the field of water transport engineering to obtain first format data; the first language includes a python language; the data format of the first format data is an Excel file format; the first format data is processed to generate a database generation language; a database containing table data is created using the database generation language; an MVC three-layer architecture is generated based on the database; the MVC three-layer architecture is assigned to generate a water transport engineering component model. The solution provided by the present invention can improve the efficiency of data binding and the accuracy of assignment, and enhance the quality and effect of water transport engineering model creation.

[0041] In order to implement the method of an embodiment of the present invention, an embodiment of the present invention also provides a water transport engineering model attribute assignment system based on a database generation language, including: a processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, the steps of any one of the above methods are executed.

[0042] The above-mentioned system provided in this embodiment belongs to the same concept as the above-mentioned method embodiment. The specific implementation process thereof is detailed in the method embodiment and will not be repeated here.

[0043] In order to implement the method of the embodiment of the present invention, the embodiment of the present invention also provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the above method.

[0044] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides an electronic device (computer device). Specifically, in one embodiment, the computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, the method of any one of the above embodiments is implemented. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0045] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0046] The device provided by the embodiment of the present invention includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the method of any one of the above embodiments is implemented.

[0047] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0048] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0049] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0050] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0051] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0052] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0053] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0054] It can be understood that the memory of the embodiment of the present invention can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.

[0055] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0056] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for assigning attributes to a water transport engineering model based on a database generation language, characterized in that: The method comprises: Using a first language to extract table data in national standards or industry standards in the field of water transport engineering to obtain first format data; the first language includes Python language; the data format of the first format data is Excel file format; Processing the first format data to generate a database generation language; Using the database generation language to create a database containing table data; Generate an MVC three-tier architecture based on the database; Assign values ​​to the MVC three-layer architecture to generate a water transport engineering component model.

2. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 1 is characterized in that: Use the first language to extract the tabular data in the national standard or industry standard in the field of water transport engineering to obtain the first format data, including: Install the pdfplumber library and / or the pandas library; Schedule pdf = pdfplumber.open("file path") function to extract the national standard or industry standard of PDF file format from the preset file path; Schedule pages = pdf.pages function to obtain the file pages in the national standard or industry standard; The dispatch tables = [] function creates an empty list, which is used to store data in Excel file format; Schedule for each in pages: function to loop through the file pages, and schedule table = each.extract_table() function to obtain the table data in each file page; Schedule the tables.extend(table) function to fill the table data in each of the obtained file pages into the empty list; Create a data frame using the DataFrame class in the pdfplumber library and / or the pandas library; Schedule data = pd.DataFrame(tables[1:], columns=tables[0]) function to fill the filled empty table into the data frame; The data.to_excel(".. / data / excelName.xlsx", index=False) function is dispatched to write the data in the data frame into an Excel file and save the Excel file at the same time; the Excel file is data in the first format.

3. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 1, characterized in that: Processing the first format data to generate a database generation language includes: Create a console application project and install the NPOI library using the NuGet package in the application project; Create a console application project, and on the basis of the console application project, use the NuGet open source package management development tool to install the NPOI library; read the data in the first format data through the NPOI library, and store the read data into an initialized DataTable, and name the DataTable dt; The data in the dt are looped over by taking columns as the first layer of loop traversal and rows as the second layer of loop traversal; the loop index of the column is i and the loop index of the row is j; each loop traversal value is obtained by the dt.Rows[j][i].ToString() function, and the byte length of each loop traversal value is calculated by the Encoding.UTF8.GetByteCount(tempStr) function; the maximum value of the byte length is saved in a List list, and the List list is named byteLengthList; wherein the number of the maximum byte lengths stored in the byteLengthList is equal to the number of columns in the dt; Process the data in the dt into the content format of the SQL INSERT INTO statement and store it in sqlInsertDt of the DataTable type; A database generation language is used to generate the first format data according to the dt, the sqlInsertDt and the byteLengthList.

4. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 3 is characterized in that: The data in the dt is processed into the content format of the SQL INSERT INTO statement and stored in the sqlInsertDt of the DataTable type, including: Get the initialized DataTable, and name the DataTable as sqlInsertDt; the sqlInsertDt is used to store the content of the SQL INSERT INTO statement; Obtain the number of rows and columns of the dt, and determine the number of columns of the sqlInsertDt to be twice the number of columns of the dt plus 1; Loop through the number of columns of the sqlInsertDt, and use the sqlInsertDt.Columns.Add("ID" +i.ToString(), typeof(string)) function to add a column to the sqlInsertDt; the name of the column is marked as "ID" + i.ToString(), and the format of the column is string; The first layer loops through the number of rows of the dt, the traversal index is rowIndex, and adds rows through the DataRow row =sqlInsertDt.NewRow() function. The second layer loops through the number of columns of the sqlInsertDt, the traversal index is columnIndex; In the second loop, when the columnIndex is 0, the column name is assigned a left bracket value; when the columnIndex is the last column index value and the rowIndex is also the last row index value, the column name is assigned a null value; when the columnIndex is the last column index value and the rowIndex is not the last row index value, the column name is assigned a comma value; when the columnIndex is the second-to-last column index value, the column name is assigned a right bracket value; when the columnIndex is not the first column, the first-to-last column, or the second-to-last column , determine whether the columnIndex is an even number. If the columnIndex is an even value, assign the column name to a comma value; if the columnIndex is an odd value, determine half of the columnIndex minus one as a temporary value tempDtIndex, determine the number of columns of the sqlInsertDt as another temporary value empsqlInsertDtIndex, and input the two temporary values ​​into dt.Rows[tempsqlInsertDtIndex][tempDtIndex] In the function, determine whether the value of the function is empty. If the value of the function is empty, assign the column name to the horizontal line value. If the value of the function is not empty, assign the column name to the value of the dt.Rows[tempsqlInsertDtIndex][tempDtIndex].ToString() function; when row is assigned, fill the row data into the sqlInsertDt through the sqlInsertDt.Rows.Add(row) function.

5. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 3 is characterized in that: The database generation language for generating the first format data according to the dt, the sqlInsertDt and the byteLengthList includes: Name the table created in the database tableName, name the database WaterTransportDesignInformationStandard, name the initialized SQL statement sqlStr, and the type of the SQL statement is string; Loop through the number of columns in the dt, dtIndexColumn2 is the loop index value; wherein, in each loop, the sqlStr is added with a tab escape character to determine whether the loop index value is the last column. If the loop index value is the last column, the sqlStr is added with a string of "ID" + dtIndexColumn2.ToString() + " " + "varchar(" + byteLengthList[dtIndexColumn2].ToString() + ")," + "\n"; if the loop index value is not the last column, the sqlStr is added with a string of "ID" + dtIndexColumn2.ToString() + " " + "varchar(" + byteLengthList[dtIndexColumn2].ToString() + ")" + "\n"; after the loop ends, the sqlStr is successively added with a string of ")" + "\n", "insert into " and tableName; Loop through the number of columns of the dt, dtIndexColumn3 is the loop index value; wherein, each time the loop is looped, determine whether the loop index value is 0 during the loop process, if the loop index value is 0, then add "(" + "ID" + dtIndexColumn3.ToString() + "," to the sqlStr; if the loop index value is the last column index, then add "ID" + dtIndexColumn3.ToString() + ")" to the sqlStr; if the loop index value is neither the first column nor the last column, then add "ID" + dtIndexColumn3.ToString() + "," to the sqlStr; after the loop ends, add "\n" + "values" + "\n" to the sqlStr; Loop through the sqlInsertDt, the first layer traverses the number of rows of the sqlInsertDt, the row index is sqlInsertDtRowIndex2, the second layer traverses the number of columns of the sqlInsertDt, the column index value is sqlInsertDtColumnIndex2; assign sqlInsertDt.Rows[i][j].ToString() to tempSQLInsertDtStr; in the second layer loop, determine whether the column index value is the first column, the first to last column, or the second to last column. If the column index value is the first column, the first to last column, or the second to last column, assign tempSQLInsertDtStr to the sqlInsertDt.Rows[i][j].ToString(); in the second layer loop, determine whether the column index value is the first column, the first to last column, or the second to last column. If the column index value is the first column, the first to last column, or the second to last column, assign tempSQLInsertDtStr to the sqlInsertDt.Rows[i][j].ToString(); DtStr is added into the sqlStr string; if the column index value is not the first column, the first to last column or the second to last column, it is determined whether the column index value is an even column. If the column index value is an even column, the data tempSQLInsertDtStr is added into the sqlStr; if the column index value is not an even column, single quotes, tempSQLInsertDtStr, and single quotes are added into the sqlStr in sequence; after each column loop ends, a line break is added into the sqlStr; when all loops end, a line break is added into the sqlStr; perform a database information query and add "select *from " + tableName into the sqlStr.

6. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 1, characterized in that: Generate an MVC three-tier architecture based on the database, including: Use batch generation of MVC three-tier architecture software to connect with the database and generate DAL, BLL, and MODEL files; use the GetList method in the DAL file to call the database table and store it in the List, and name the List FinenessHydraulicStructureModelList, wherein the data type stored in the FinenessHydraulicStructureModelList is the FinenessHydraulicStructureModel class, which contains sqlInsertDt and the column name of the table with the same data column, and call the GetList in the DAL file through the GetList2 method in the BLL file to call the table data and complete the design of the MVC three-tier architecture.

7. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 1, characterized in that: Assign values ​​to the MVC three-layer architecture to generate a water transport engineering component model, including: Store the extracted PDF table data into the database table, click the Create Project button, set the project type in the pop-up project setting window, and then bind the stage model name column data to the design stage control and the model depth level code to the model depth level control by calling, and link the data through the linkage algorithm. If the design stage is selected as the feasibility study model, the model depth is L100, if it is selected as the preliminary design model, the model depth level is L200, and if it is selected as the construction drawing design model, the model depth level is L300; use the first column element type of the database table to bind to the structure type to complete the project setting; Confirm that you want to carry out the 3D design of the pile-based port project. According to the element options in the corresponding standard table data, call the structure creation button. In the automatically formed structure model tree, click the pile foundation in the model tree, and use the GetDataFunction method to call the processed database table. Call the data matching method to automatically match element information; Instantiate a pile foundation creation window, and dynamically create controls in the pile foundation creation window according to the geometricalInformationList and nonGeometricalInformationList information lists; Click the Create button to call the geometry creation function in MicroStation's SDK to create the pile foundation geometry and complete the generation of the water transport engineering component model.

8. The method for assigning attributes to a water transport engineering model based on a database generation language according to claim 7 is characterized in that: The types of projects include port projects, waterway projects, navigation construction projects and ship repair and construction hydraulic projects.

9. A water transport engineering model attribute assignment system based on database generation language, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, the steps of the method according to any one of claims 1 to 8 are executed.

10. A storage medium storing a computer program, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • BIM software-based BIM component generation method and device and storage device

    CN109918717A

  • Three-dimensional component model generation method and device, equipment, medium and product

    CN116579111A

  • Method and device for carrying out component assignment by reading Excel table data in batches based on Revit

    CN117349931A