CN106407266B - A method and device for formatted extraction of three-dimensional calculation results - Google Patents
A method and device for formatted extraction of three-dimensional calculation results Download PDFInfo
- Publication number
- CN106407266B CN106407266B CN201610726543.0A CN201610726543A CN106407266B CN 106407266 B CN106407266 B CN 106407266B CN 201610726543 A CN201610726543 A CN 201610726543A CN 106407266 B CN106407266 B CN 106407266B
- Authority
- CN
- China
- Prior art keywords
- crsf
- data
- value
- file
- name
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/84—Mapping; Conversion
- G06F16/86—Mapping to a database
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明公开了一种三维计算结果格式化提取方法和装置,方法包括数据上传、CRSF_TABLE生成以及CRSF_TABLE展示;装置包括用于三维数据计算的三维计算服务器、用于接收并上传CRSF数据文件的CRSF数据服务器、用于提取CRSF数据文件的数据字段,生成CRSF_TABLE并输出的第一操作系统以及用于将所接收的CRSF_TABLE文件属性进行转变,便于查看的第二操作系统。本发明基于Linux平台,使用遍历、迭代查找、输入输出重定向,再结合开源软件AWK和SED技术,可以1分钟内生成格式化的CRSF_TABLE,解决了核电设计三维计算结果提取过程中采用人工方法所产生的耗时、费力、以及遗漏、错误提取数据的问题。
The invention discloses a method and device for formatting and extracting three-dimensional calculation results. The method includes data upload, CRSF_TABLE generation, and CRSF_TABLE display; the device includes a three-dimensional calculation server for three-dimensional data calculation, and CRSF data for receiving and uploading CRSF data files The server, the data field for extracting the CRSF data file, the first operating system for generating and outputting the CRSF_TABLE, and the second operating system for converting the attributes of the received CRSF_TABLE file for easy viewing. The present invention is based on the Linux platform, uses traversal, iterative search, input and output redirection, combined with open source software AWK and SED technology, can generate a formatted CRSF_TABLE within 1 minute, and solves the problem caused by artificial methods in the process of extracting the three-dimensional calculation results of nuclear power design Time-consuming, labor-intensive, and problems of missing and wrongly extracting data.
Description
技术领域technical field
本发明涉及计算机数据处理领域,具体涉及到一种三维计算结果格式化提取方法和装置,尤其涉及一种核电设计三维计算结果格式化提取方法和装置。The invention relates to the field of computer data processing, in particular to a method and device for formatted and extracted three-dimensional calculation results, and in particular to a method and device for formatted and extracted three-dimensional calculation results for nuclear power design.
背景技术Background technique
在三维设计,尤其是核电三维设计过程中,将产生数万份的CRSF(即三维计算结果的数据文件),而CRSF里的数据多呈现出非结构化、无序化、可读性差等特征。因此,设计人员需要从每一份CRSF里手动提取出对设计有价值的数据字段,然后把数据字段逐条复制粘贴到Microsoft Excel文档里,进行二次处理,最终得到一份CRSF_TABLE(即三维计算结果技术参数表),具体操作步骤为:1)人工从CRSF中找到需要的数据字段;2)复制数据字段,粘贴到Microsoft Excel文件对应的数据项;3)不断重复步骤1)、2),最终形成CRSF_TABLE;4)对CRSF_TABLE进行二次校核、修正。In 3D design, especially in the process of nuclear power 3D design, tens of thousands of CRSF (data files of 3D calculation results) will be generated, and the data in CRSF are mostly unstructured, disordered, and poorly readable. . Therefore, the designer needs to manually extract the data fields that are valuable for the design from each CRSF, and then copy and paste the data fields one by one into the Microsoft Excel document for secondary processing, and finally obtain a CRSF_TABLE (that is, the three-dimensional calculation result Technical parameter table), the specific operation steps are: 1) Manually find the required data fields from the CRSF; 2) Copy the data fields and paste them to the corresponding data items in the Microsoft Excel file; 3) Repeat steps 1) and 2) continuously, and finally Form CRSF_TABLE; 4) Perform secondary check and correction on CRSF_TABLE.
由于是通过人工劳动生成CRSF_TABLE,因此上述方法通常会花费设计人员较大的精力和时间,导致设计工作效率低下,且由于上述CRSF_TABLE是通过人工提取字段生成的,受限于人体精力的限制,会产生数据遗漏或数据错误提取的风险,无法确保数据的准确性,还需要进行多次校核后才能使用。Because the CRSF_TABLE is generated by manual labor, the above method usually takes a lot of energy and time for the designer, resulting in low design work efficiency, and because the above CRSF_TABLE is generated by manually extracting fields, it is limited by human energy. There is a risk of data omission or incorrect data extraction, the accuracy of the data cannot be ensured, and multiple checks are required before it can be used.
因此,有必要提供一种三维设计计算,尤其是核电设计三维计算过程中,能从海量CRSF中快速、高效、准确提取重要数据,并自动生成CRSF_TABLE的技术方案,以此来解决现有技术中通过人工劳动产生CRSF_TABLE的过程中耗时长、成本高,以及遗漏、错误提取数据的问题。Therefore, it is necessary to provide a 3D design calculation, especially in the process of 3D calculation of nuclear power design, which can quickly, efficiently and accurately extract important data from massive CRSFs, and automatically generate CRSF_TABLE technical solutions, so as to solve the problems in the existing technology. The process of generating CRSF_TABLE through manual labor takes a long time, high cost, and problems of missing and wrongly extracting data.
发明内容Contents of the invention
针对上述现有技术中问题,本发明提供了一种三维设计计算,尤其是核电设计三维计算过程中,能从海量CRSF中快速、高效、准确提取重要数据,并自动生成CRSF_TABLE的技的方法及装置,以此来提高核电三维设计效率。Aiming at the above-mentioned problems in the prior art, the present invention provides a three-dimensional design calculation, especially in the process of nuclear power design three-dimensional calculation, which can quickly, efficiently and accurately extract important data from massive CRSFs, and automatically generate CRSF_TABLE technical methods and methods device, in order to improve the efficiency of nuclear power three-dimensional design.
本发明就上述技术问题而提出的技术方案如下:The technical scheme that the present invention proposes with respect to above-mentioned technical problem is as follows:
一方面,提供一种三维计算结果格式化提取方法,包括如下步骤:On the one hand, provide a kind of format extraction method of three-dimensional calculation result, comprise the steps:
S1.数据上传:接收并上传三维计算结果中的所有CRSF数据文件;S1. Data upload: receive and upload all CRSF data files in the 3D calculation results;
S2.CRSF_TABLE生成:由第一操作系统服务器获取所述CRSF数据文件,提取所述CRSF数据文件的数据字段,并将所述数据字段格式化,生成CRSF_TABLE并输出;S2. CRSF_TABLE generation: obtain the CRSF data file by the first operating system server, extract the data field of the CRSF data file, and format the data field, generate and output the CRSF_TABLE;
S3.CRSF_TABLE展示:由第二操作系统服务器接收所述CRSF_TABLE,并将所述CRSF_TABLE的第一操作系统文件属性转变成第二操作系统文件属性,用于在所述第二操作系统服务器下查看所述CRSF_TABLE。S3. CRSF_TABLE display: the second operating system server receives the CRSF_TABLE, and converts the first operating system file attribute of the CRSF_TABLE into the second operating system file attribute, which is used to view all the files under the second operating system server CRSF_TABLE described above.
优选的,所述第一操作系统包括Linux系统。Preferably, the first operating system includes a Linux system.
优选的,所述第二操作系统包括Windows系统。Preferably, the second operating system includes Windows system.
优选的,所述第二操作系统的文件属性为Excel文件。Preferably, the file attribute of the second operating system is an Excel file.
优选的,步骤S2中具体包括如下步骤:Preferably, step S2 specifically includes the following steps:
S21、数据遍历:将所述CRSF数据文件上传到所述Linux系统,遍历CRSF_DIR,并列出目录及文件详细信息;S21, data traversal: upload the CRSF data file to the Linux system, traverse CRSF_DIR, and list directory and file details;
S22、字段抽取:按文件名迭代查找每个所述CRSF数据文件,从中找到需要抽取的数据项;S22. Field extraction: iteratively search each of the CRSF data files according to the file name, and find the data items to be extracted;
S23、多次输出重定项:将所述需要抽取的数据项进行AWK、SED多次输出重定项处理,得到所述需要抽取的数据项的对应参数;S23. Multiple output re-items: perform AWK and SED multiple-output re-item processing on the data items to be extracted to obtain corresponding parameters of the data items to be extracted;
S24、CRSF_TABLE生成:格式化输出所述需要抽取的数据项,并形成CRSF_TABLE。S24. CRSF_TABLE generation: format and output the data items to be extracted, and form a CRSF_TABLE.
优选的,步骤S21中,所述列出目录及文件详细信息的步骤包括:使用AWK中的print参数来对所述CRSF_DIR中的每个CRSF_NAME进行过滤,最后形成包含有每个CRSF_NAME_LIST的CRSF_NAME_LIST。Preferably, in step S21, the step of listing directory and file detailed information includes: using the print parameter in AWK to filter each CRSF_NAME in the CRSF_DIR, and finally form a CRSF_NAME_LIST containing each CRSF_NAME_LIST.
优选的,步骤S22中,字段抽取的实现方法包括:Preferably, in step S22, the implementation method of field extraction includes:
从所述CRSF_NAME_LIST中取出一个CRSF_NAME,做遍历操作,从中抽取DATA1数据片段,DATA2数据片段,DATA3数据片段和DATA4数据片段,完毕后采用同样方法依次取出其他CRSF_NAME,依次进行遍历操作,并依次抽取DATA1数据片段,DATA2数据片段,DATA3数据片段和DATA4数据片段,直至CRSF_NAME_LIST中所有CRSF_NAME均做一次遍历操作,并分别抽取出每个CRSF_NAME中的DATA1数据片段,DATA2数据片段,DATA3数据片段和DATA4数据片段。Take out a CRSF_NAME from the CRSF_NAME_LIST, perform a traversal operation, extract DATA1 data fragments, DATA2 data fragments, DATA3 data fragments and DATA4 data fragments, and then use the same method to sequentially extract other CRSF_NAMEs, perform traversal operations in turn, and sequentially extract DATA1 Data fragments, DATA2 data fragments, DATA3 data fragments and DATA4 data fragments, until all CRSF_NAMEs in CRSF_NAME_LIST perform a traversal operation, and extract the DATA1 data fragments, DATA2 data fragments, DATA3 data fragments and DATA4 data fragments in each CRSF_NAME respectively .
优选的,使用TAIL工具对所述CRSF_DIR中的每个CRSF_NAME文件进行取值,取出每个CRSF_NAME文件中最后四行的数据。Preferably, the value of each CRSF_NAME file in the CRSF_DIR is obtained by using the TAIL tool, and the last four lines of data in each CRSF_NAME file are taken out.
优选的,步骤S23中,所述多次输出重定项处理的实现方法包括:Preferably, in step S23, the implementation method of the multiple output re-item processing includes:
最终DATA1值的提取:从所述步骤S22得到的DATA1数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第一行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA1的值;Extraction of the final DATA1 value: find the symbol "=" from the DATA1 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the first row in the second column value, and finally Use the AWK method to format and output the first value, and the first value is the final value of DATA1;
最终DATA2值的提取:从所述步骤S22得到的DATA2数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第二行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA2的值;Extraction of the final DATA2 value: find the symbol "=" from the DATA2 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Then pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the second row in the second column value, and finally Use the AWK method to format and output the first value, and the first value is the final value of DATA2;
最终DATA3值的提取:从所述步骤S22得到的DATA3数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第三行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA3的值;Extraction of the final DATA3 value: find the symbol "=" from the DATA3 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the third row in the second column value, and finally Use the AWK method to format and output the first value, and the first value is the final value of DATA3;
最终DATA4值的提取:从所述步骤S22得到的DATA4数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第四行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA4的值。Extraction of the final DATA4 value: find the symbol "=" from the DATA4 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the fourth row in the second column value, and finally The AWK method is used to format and output the first value, and the first value is the final value of DATA4.
优选的,步骤S24中,将形成的所述CRSF_TABLE命名为CRSF_TABLE.CSV,且使用ECHO方法进行格式化输出,输出的格式为“CRSF_NAME,DATA 1,DATA 2,DATA 3,DATA 4”。Preferably, in step S24, the formed CRSF_TABLE is named as CRSF_TABLE.CSV, and formatted and output using the ECHO method, the output format is "CRSF_NAME, DATA 1, DATA 2, DATA 3, DATA 4".
优选的,所述三维计算结果为核电设计三维计算结果。Preferably, the three-dimensional calculation result is a three-dimensional calculation result of nuclear power design.
另一方面,提供一种三维计算结果格式化提取装置,包括三维计算服务器,用于三维设计过程中的数据计算;On the other hand, a device for formatting and extracting three-dimensional calculation results is provided, including a three-dimensional calculation server, which is used for data calculation in the process of three-dimensional design;
CRSF数据服务器,连接所述计算服务器,用于接收并上传所述计算服务器计算结果中的所有CRSF数据文件;A CRSF data server, connected to the calculation server, for receiving and uploading all CRSF data files in the calculation results of the calculation server;
第一操作系统,连接所述CRSF数据服务器,用于获取所述CRSF数据文件,并提取所述CRSF数据文件的数据字段,并将所述数据字段格式化,生成CRSF_TABLE并输出;The first operating system, connected to the CRSF data server, is used to obtain the CRSF data file, and extract the data field of the CRSF data file, and format the data field to generate and output CRSF_TABLE;
第二操作系统,连接所述第一操作系统,用于件接收所述CRSF_TABLE,并将所述CRSF_TABLE的第一操作系统文件属性转变成第二操作系统文件属性,用于在所述第二操作系统中查看所述CRSF_TABLE。The second operating system, connected to the first operating system, is used to receive the CRSF_TABLE, and convert the first operating system file attribute of the CRSF_TABLE into a second operating system file attribute, which is used in the second operation View the CRSF_TABLE in the system.
优选的,所述第一操作系统包括以下模块:Preferably, the first operating system includes the following modules:
数据遍历模块,用于将所述CRSF数据文件上传到Linux系统,遍历CRSF_DIR,并列出目录及文件详细信息;Data traversal module, for uploading described CRSF data file to Linux system, traverses CRSF_DIR, and lists directory and file detailed information;
字段抽取模块,用于按文件名迭代查找每个所述CRSF数据文件,从中找到需要抽取的数据项;The field extraction module is used to iteratively search each described CRSF data file by file name, and find the data item that needs to be extracted therefrom;
多次输出重定项模块,用于将所述需要抽取的数据项进行AWK、SED多次输出重定项处理,得到所述需要抽取的数据项的对应参数;The multiple output redefinition module is used to perform AWK and SED multiple output redefinition processing on the data items that need to be extracted, so as to obtain the corresponding parameters of the data items that need to be extracted;
CRSF_TABLE生成模块,用于格式化输出所述需要抽取的数据项,并形成CRSF_TABLE。The CRSF_TABLE generation module is used to format and output the data items to be extracted, and form a CRSF_TABLE.
优选的,所述第二操作系统包括Windows系统。Preferably, the second operating system includes Windows system.
优选的,所述第二操作系统的文件属性为Excel文件。Preferably, the file attribute of the second operating system is an Excel file.
优选的,所述列出目录及文件详细信息的步骤包括:使用AWK中的print参数来对所述CRSF_DIR中的每个CRSF_NAME进行过滤,最后形成包含有每个CRSF_NAME_LIST的CRSF_NAME_LIST。Preferably, the step of listing the detailed information of directories and files includes: using the print parameter in AWK to filter each CRSF_NAME in the CRSF_DIR, and finally form a CRSF_NAME_LIST containing each CRSF_NAME_LIST.
优选的,字段抽取的实现方法包括:Preferably, the implementation method of field extraction includes:
从所述CRSF_NAME_LIST中取出一个CRSF_NAME,做遍历操作,从中抽取DATA1数据片段,DATA2数据片段,DATA3数据片段和DATA4数据片段,完毕后采用同样方法依次取出其他CRSF_NAME,依次进行遍历操作,并依次抽取DATA1数据片段,DATA2数据片段,DATA3数据片段和DATA4数据片段,直至CRSF_NAME_LIST中所有CRSF_NAME均做一次遍历操作,并分别抽取出每个CRSF_NAME中的DATA1数据片段,DATA2数据片段,DATA3数据片段和DATA4数据片段。Take out a CRSF_NAME from the CRSF_NAME_LIST, perform a traversal operation, extract DATA1 data fragments, DATA2 data fragments, DATA3 data fragments and DATA4 data fragments, and then use the same method to sequentially extract other CRSF_NAMEs, perform traversal operations in turn, and sequentially extract DATA1 Data fragments, DATA2 data fragments, DATA3 data fragments and DATA4 data fragments, until all CRSF_NAMEs in CRSF_NAME_LIST perform a traversal operation, and extract the DATA1 data fragments, DATA2 data fragments, DATA3 data fragments and DATA4 data fragments in each CRSF_NAME respectively .
优选的,使用TAIL工具对所述CRSF_DIR中的每个CRSF_NAME文件进行取值,取出每个CRSF_NAME文件中最后四行的数据。Preferably, the value of each CRSF_NAME file in the CRSF_DIR is obtained by using the TAIL tool, and the last four lines of data in each CRSF_NAME file are taken out.
优选的,所述多次输出重定项处理的实现方法包括:Preferably, the implementation method of the multiple output re-item processing includes:
最终DATA1值的提取:从所述步骤S22得到的DATA1数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第一行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA1的值;Extraction of the final DATA1 value: find the symbol "=" from the DATA1 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the first row in the second column value, and finally Use the AWK method to format and output the first value, and the first value is the final value of DATA1;
最终DATA2值的提取:从所述步骤S22得到的DATA2数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第二行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA2的值;Extraction of the final DATA2 value: find the symbol "=" from the DATA2 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Then pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the second row in the second column value, and finally Use the AWK method to format and output the first value, and the first value is the final value of DATA2;
最终DATA3值的提取:从所述步骤S22得到的DATA3数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第三行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA3的值;Extraction of the final DATA3 value: find the symbol "=" from the DATA3 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the third row in the second column value, and finally Use the AWK method to format and output the first value, and the first value is the final value of DATA3;
最终DATA4值的提取:从所述步骤S22得到的DATA4数据片段中找到符号“=”,并用AWK方法列出符号“=”所在行的数据,并以符号“=”为界输出第二列数值;再以所述第二列数值传递给SED作为输入参数,并删除所述第二列数值前的所有空格,并且取出所述第二列数值中的第四行中的第一个数值,最后使用AWK方法格式化输出所述第一个数值,所述第一个数值即为最终DATA4的值。Extraction of the final DATA4 value: find the symbol "=" from the DATA4 data segment obtained in the step S22, and use the AWK method to list the data of the row where the symbol "=" is located, and output the second column value with the symbol "=" as a boundary ; Pass the second column value to SED as an input parameter, and delete all spaces before the second column value, and take out the first value in the fourth row in the second column value, and finally The AWK method is used to format and output the first value, and the first value is the final value of DATA4.
优选的,步骤S24中,将形成的所述CRSF_TABLE命名为CRSF_TABLE.CSV,且使用ECHO方法进行格式化输出,输出的格式为“CRSF_NAME,DATA 1,DATA 2,DATA 3,DATA 4”。Preferably, in step S24, the formed CRSF_TABLE is named as CRSF_TABLE.CSV, and formatted and output using the ECHO method, the output format is "CRSF_NAME, DATA 1, DATA 2, DATA 3, DATA 4".
优选的,所述三维计算结果为核电设计三维计算结果。Preferably, the three-dimensional calculation result is a three-dimensional calculation result of nuclear power design.
本发明技术方案带来的技术效果:The technical effect brought by the technical solution of the present invention:
1)可以快速遍历CRSF_DIR,对从CRSF里抽取出设计人员需要的数据项,并1分钟内自动生成CRSF_TABLE,大大提高了设计人员的工作效率。1) It can quickly traverse CRSF_DIR, extract the data items needed by designers from CRSF, and automatically generate CRSF_TABLE within 1 minute, which greatly improves the work efficiency of designers.
2)生成的CRSF_TABLE.CSV可以跨平台使用,具有直观、通读、易懂可视化等优点。2) The generated CRSF_TABLE.CSV can be used across platforms, and has the advantages of intuitiveness, readability, and easy-to-understand visualization.
3)生成CRSF_TABLE的过程人工只参与一次,大大降低人工提取时产生数据遗漏或数据错误提取的风险。3) The process of generating CRSF_TABLE is only manually involved once, which greatly reduces the risk of data omission or wrong data extraction during manual extraction.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1是本发明实施例一提供的三维计算结果格式化提取方法的步骤流程图;Fig. 1 is a flow chart of the steps of the method for formatting and extracting three-dimensional calculation results provided by Embodiment 1 of the present invention;
图2是本发明实施例二提供的三维计算结果格式化提取装置的结构示意图。Fig. 2 is a schematic structural diagram of a device for formatting and extracting three-dimensional calculation results provided by Embodiment 2 of the present invention.
具体实施方式Detailed ways
本发明针对现有三维设计,尤其是核电三维设计过程中,采用人工劳动的方式提取数据,并生成CRSF_TABLE时人力消耗大、效率低以及错误率高等问题,提供了一种能从海量CRSF中快速、高效、准确提取重要数据,并自动生成CRSF_TABLE的的方法及装置,以此来提高核电三维设计效率。其核心思想是:基于Linux平台,使用遍历、迭代查找、输入输出重定向,再结合开源软件AWK和SED技术,可以1分钟内生成格式化的CRSF_TABLE,解决了人工方法耗时,费力,以及及数据抽取误差的问题。The present invention aims at the existing three-dimensional design, especially in the nuclear power three-dimensional design process, which uses manual labor to extract data and generate CRSF_TABLE, which requires a lot of manpower, low efficiency and high error rate, and provides a method that can quickly extract data from massive CRSF A method and device for extracting important data efficiently and accurately, and automatically generating CRSF_TABLE, so as to improve the efficiency of nuclear power three-dimensional design. Its core idea is: Based on the Linux platform, using traversal, iterative search, input and output redirection, combined with the open source software AWK and SED technology, the formatted CRSF_TABLE can be generated within 1 minute, which solves the time-consuming, laborious and time-consuming manual method. The problem of data extraction errors.
实施例一:Embodiment one:
图1示出了三维计算结果格式化提取方法的步骤流程图,其可用于核电设计三维计算结果的提取,其包括:Figure 1 shows a flow chart of the steps of the formatted extraction method for three-dimensional calculation results, which can be used for the extraction of three-dimensional calculation results for nuclear power design, including:
S1.数据上传:接收并上传核电设计三维计算结果中的所有CRSF数据文件;S1. Data upload: receive and upload all CRSF data files in the 3D calculation results of nuclear power design;
S2.CRSF_TABLE生成:由第一操作系统服务器获取所述CRSF数据文件,提取所述CRSF数据文件的数据字段,并将所述数据字段格式化,生成CRSF_TABLE并输出;其具体包括如下步骤:S2.CRSF_TABLE generation: the first operating system server obtains the CRSF data file, extracts the data field of the CRSF data file, and formats the data field to generate and output the CRSF_TABLE; it specifically includes the following steps:
S21.数据遍历:将CRSF上传到第一操作系统下,遍历CRSF_DIR,列出目录及文件详细信息,其包含9个字段,分别为:文件属性字段同、文件硬链接数、文件拥有者、文件拥有都所在的组、文件大小、文件创建时间、文件名。使用AWK中的print参数过滤得到包含每个CRSF_NAME的列表CRSF_NAME_LIST。实现方法:ls-lCRSF_DIR|AWK‘{print$9}’;所述第一操作系统包括Linux系统。S21. Data traversal: upload the CRSF to the first operating system, traverse the CRSF_DIR, and list the directory and file detailed information, which includes 9 fields, which are: the same file attribute field, the number of hard links to the file, the file owner, and the file It has the group, file size, file creation time, and file name of all files. Use the print parameter in AWK to filter to get a list CRSF_NAME_LIST containing each CRSF_NAME. Implementation method: ls-lCRSF_DIR|AWK'{print$9}'; the first operating system includes a Linux system.
S22.字段抽取:按文件名迭代查找每个所述CRSF数据文件,从中找到需要抽取的数据项;具体实现方法为:S22. Field extraction: iteratively search for each of the CRSF data files by file name, and find the data items that need to be extracted therefrom; the specific implementation method is:
forCRSF_NAMEin CRSF_NAME_LISTfor CRSF_NAME in CRSF_NAME_LIST
dodo
DATA1=$(GET_DATA_OPERATION)DATA1=$(GET_DATA_OPERATION)
DATA2=$(GET_DATA_OPERATION)DATA2=$(GET_DATA_OPERATION)
DATA3=$(GET_DATA_OPERATION)DATA3=$(GET_DATA_OPERATION)
DATA4=$(GET_DATA_OPERATION)DATA4=$(GET_DATA_OPERATION)
donedone
由于需要抽取的数据项在每个CRSF的最后四行中,因此可使用TAIL工具对所述CRSF_DIR中的每个CRSF_NAME文件进行取值,取出每个CRSF_NAME文件中最后四行的数据,即GET_DATA_OPERATION具体方法可优选为tail-4CRSF_DIR/CRSF_NAME。Since the data items to be extracted are in the last four lines of each CRSF, you can use the TAIL tool to get the value of each CRSF_NAME file in the CRSF_DIR, and take out the data in the last four lines of each CRSF_NAME file, that is, GET_DATA_OPERATION The method may preferably be tail-4CRSF_DIR/CRSF_NAME.
S23、多次输出重定项:将所述需要抽取的数据项进行AWK、SED多次输出重定项处理,得到所述需要抽取的数据项的对应参数;实现方法为:S23, multiple output redefinition items: perform AWK and SED multiple output redefinition items on the data items that need to be extracted, and obtain the corresponding parameters of the data items that need to be extracted; the implementation method is:
DATA1=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"1,1p"|awk'{print$1}')DATA1=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"1,1p"|awk'{print$1}')
DATA 2=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"2,1p"|awk'{print$1}')DATA 2=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"2,1p"|awk'{print$1}' )
DATA 3=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"3,1p"|awk'{print$1}')DATA 3=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"3,1p"|awk'{print$1}' )
DATA 4=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"4,1p"|awk'{print$1}')DATA 4=$(GET_DATA_OPERATION|awk'BEGIN{FS="="}{print$2}'|sed's/^\s*//g'|sed-n"4,1p"|awk'{print$1}' )
S24.CRSF_TABLE生成:格式化输出抽取的数据项形成CRSF_TABLE,并命名为CRSF_TABLE.CSV,实现方法为:echo“CRSF_NAME,DATA1,DATA2,DATA3,DATA4”。S24. CRSF_TABLE generation: Format and output the extracted data items to form CRSF_TABLE, and name it CRSF_TABLE.CSV, the implementation method is: echo "CRSF_NAME, DATA1, DATA2, DATA3, DATA4".
S3.CRSF_TABLE展示:由第二操作系统服务器接收所述CRSF_TABLE,并将所述CRSF_TABLE的第一操作系统的文件属性转变成第二操作系统的文件属性,用于在所述第二操作系统服务器下查看所述CRSF_TABLE。所述由第二操作系统包括windows系统;所述第二操作系统的文件属性为Excel文件。该方案可将Linux系统生成的CRSF_TABLE.CSV文件下载到Windows平台,并使用MicrosoftExcel打开,便于在windows平台对CRSF_TABLE进行直观的展示和查看。S3. CRSF_TABLE display: the second operating system server receives the CRSF_TABLE, and converts the file attribute of the first operating system of the CRSF_TABLE into the file attribute of the second operating system, which is used for the server under the second operating system See said CRSF_TABLE. The second operating system includes a windows system; the file attribute of the second operating system is an Excel file. This solution can download the CRSF_TABLE.CSV file generated by the Linux system to the Windows platform, and use Microsoft Excel to open it, which is convenient for intuitive display and viewing of the CRSF_TABLE on the Windows platform.
需要说明的是,本实施例中的核电设计三维计算结果也可被其他类似需要处理的三维计算结果替代。It should be noted that the three-dimensional calculation results of nuclear power design in this embodiment may also be replaced by other similar three-dimensional calculation results that need to be processed.
图2示出了三维计算结果格式化提取装置的结构示意图,其可用于核电设计三维计算结果的提取,包括:Fig. 2 shows a schematic structural diagram of a device for formatting and extracting three-dimensional calculation results, which can be used to extract three-dimensional calculation results for nuclear power design, including:
三维计算服务器,用于三维设计过程中的数据计算;3D calculation server, used for data calculation in the process of 3D design;
CRSF数据服务器,连接所述计算服务器,用于接收并上传所述计算服务器计算结果中的所有CRSF数据文件;A CRSF data server, connected to the calculation server, for receiving and uploading all CRSF data files in the calculation results of the calculation server;
第一操作系统,连接所述CRSF数据服务器,用于获取所述CRSF数据文件,并提取所述CRSF数据文件的数据字段,并将所述数据字段格式化,生成CRSF_TABLE并输出;The first operating system, connected to the CRSF data server, is used to obtain the CRSF data file, and extract the data field of the CRSF data file, and format the data field to generate and output CRSF_TABLE;
第二操作系统,连接所述第一操作系统,用于件接收所述CRSF_TABLE,并将所述CRSF_TABLE的第一操作系统文件属性转变成第二操作系统文件属性,用于在所述第二操作系统中查看所述CRSF_TABLE。The second operating system, connected to the first operating system, is used to receive the CRSF_TABLE, and convert the first operating system file attribute of the CRSF_TABLE into a second operating system file attribute, which is used in the second operation View the CRSF_TABLE in the system.
同样的,所述第二操作系统包括windows系统;所述第二操作系统的文件属性优选为Excel文件。Likewise, the second operating system includes a windows system; the file attribute of the second operating system is preferably an Excel file.
进一步的,所述第一操作系统包括以下模块:Further, the first operating system includes the following modules:
数据遍历模块,用于将所述CRSF数据文件上传到Linux系统,遍历CRSF_DIR,并列出目录及文件详细信息;Data traversal module, for uploading described CRSF data file to Linux system, traverses CRSF_DIR, and lists directory and file detailed information;
字段抽取模块,用于按文件名迭代查找每个所述CRSF数据文件,从中找到需要抽取的数据项;The field extraction module is used to iteratively search each described CRSF data file by file name, and find the data item that needs to be extracted therefrom;
多次输出重定项模块,用于将所述需要抽取的数据项进行AWK、SED多次输出重定项处理,得到所述需要抽取的数据项的对应参数;The multiple output redefinition module is used to perform AWK and SED multiple output redefinition processing on the data items that need to be extracted, so as to obtain the corresponding parameters of the data items that need to be extracted;
以及CRSF_TABLE生成模块,用于格式化输出所述需要抽取的数据项,并形成CRSF_TABLE。and a CRSF_TABLE generating module, configured to format and output the data items to be extracted, and form a CRSF_TABLE.
优选的,还可将形成的所述CRSF_TABLE命名为CRSF_TABLE.CSV。Preferably, the formed CRSF_TABLE can also be named as CRSF_TABLE.CSV.
其中,所述列出目录及文件详细信息的步骤、字段抽取的实现方法、GET_DATA_OPERATION的实现方法、多次输出重定项处理的实现方法以及将形成的所述CRSF_TABLE命名为CRSF_TABLE.CSV的实现方法均与实施例一相同。Wherein, the steps of listing the detailed information of directories and files, the implementation method of field extraction, the implementation method of GET_DATA_OPERATION, the implementation method of multiple output redirection processing, and the implementation method of naming the formed CRSF_TABLE as CRSF_TABLE.CSV are all Same as Embodiment 1.
同样的,需要说明的是,本实施例中的核电设计三维计算结果也可被其他类似需要处理的三维计算结果替代。Similarly, it should be noted that the three-dimensional calculation results of the nuclear power design in this embodiment can also be replaced by other similar three-dimensional calculation results that need to be processed.
综上所述,本发明基于Linux平台,使用遍历、迭代查找、输入输出重定向,再结合开源软件AWK和SED技术,可以1分钟内生成格式化的CRSF_TABLE,并可将生成的CRSF_TABLE导出到Windows平台,使用Microsoft Office中的Excel打开,便于查看和展示,解决了现有三维计算结果,尤其是核电设计三维计算结果提取过程中,采用人工方法所产生的耗时、费力、效率低以及遗漏、错误提取数据的问题。In summary, the present invention is based on the Linux platform, uses traversal, iterative search, input and output redirection, combined with open source software AWK and SED technology, can generate a formatted CRSF_TABLE within 1 minute, and can export the generated CRSF_TABLE to Windows The platform is opened with Excel in Microsoft Office, which is easy to view and display, and solves the time-consuming, laborious, low efficiency, omissions, Problem with extracting data incorrectly.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within range.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610726543.0A CN106407266B (en) | 2016-08-25 | 2016-08-25 | A method and device for formatted extraction of three-dimensional calculation results |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610726543.0A CN106407266B (en) | 2016-08-25 | 2016-08-25 | A method and device for formatted extraction of three-dimensional calculation results |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN106407266A CN106407266A (en) | 2017-02-15 |
| CN106407266B true CN106407266B (en) | 2019-12-31 |
Family
ID=58004787
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610726543.0A Active CN106407266B (en) | 2016-08-25 | 2016-08-25 | A method and device for formatted extraction of three-dimensional calculation results |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106407266B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112598783B (en) * | 2020-12-17 | 2023-08-25 | 中国城市规划设计研究院 | Three-dimensional geometric data calculation method and three-dimensional geometric data calculation network architecture |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103793865A (en) * | 2000-10-11 | 2014-05-14 | 健康三重奏有限责任公司 | System for communication of health care data |
| WO2014155761A1 (en) * | 2013-03-29 | 2014-10-02 | 株式会社日立システムズ | Customer-specific data cleansing processing system and customer-specific data cleansing processing method |
| CN104360839A (en) * | 2014-10-20 | 2015-02-18 | 浪潮电子信息产业股份有限公司 | Method for automatically migrating LINUX system to WINDOWS system |
| CN104408150A (en) * | 2014-12-03 | 2015-03-11 | 天津南大通用数据技术股份有限公司 | Data import/ export method and device adapted to a plurality of data formats of databases |
| CN105760515A (en) * | 2016-02-24 | 2016-07-13 | 国家电网公司 | Fusion method for same object data of multiple data sources |
-
2016
- 2016-08-25 CN CN201610726543.0A patent/CN106407266B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103793865A (en) * | 2000-10-11 | 2014-05-14 | 健康三重奏有限责任公司 | System for communication of health care data |
| WO2014155761A1 (en) * | 2013-03-29 | 2014-10-02 | 株式会社日立システムズ | Customer-specific data cleansing processing system and customer-specific data cleansing processing method |
| CN104360839A (en) * | 2014-10-20 | 2015-02-18 | 浪潮电子信息产业股份有限公司 | Method for automatically migrating LINUX system to WINDOWS system |
| CN104408150A (en) * | 2014-12-03 | 2015-03-11 | 天津南大通用数据技术股份有限公司 | Data import/ export method and device adapted to a plurality of data formats of databases |
| CN105760515A (en) * | 2016-02-24 | 2016-07-13 | 国家电网公司 | Fusion method for same object data of multiple data sources |
Non-Patent Citations (1)
| Title |
|---|
| 电力行业分布式ETL数据集成系统研究与实现;林建昌;《中国优秀硕士学位论文全文数据库·信息科技辑》;20160715;I138-689第2-19页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106407266A (en) | 2017-02-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107958057B (en) | Code generation method and device for data migration in heterogeneous database | |
| CN105701098B (en) | The method and apparatus for generating index for the table in database | |
| WO2020135048A1 (en) | Data merging method and apparatus for knowledge graph | |
| CN110990467B (en) | BIM model format conversion method and conversion system | |
| CN111984745B (en) | Database field dynamic expansion method, device, equipment and storage medium | |
| US20140244654A1 (en) | Data migration | |
| US11893048B1 (en) | Automated indexing and extraction of multiple information fields in digital records | |
| CN109376153A (en) | A system and method for writing data to graph database based on NiFi | |
| CN112507721B (en) | Method, apparatus, device and computer readable storage medium for generating text theme | |
| CN113407514A (en) | Method, device and equipment for migrating database and readable medium | |
| US20170024447A1 (en) | System, method, and apparatus for collaborative editing of common or related computer based software output | |
| CN113743432B (en) | Image entity information acquisition method, device, electronic device and storage medium | |
| CN108073582A (en) | A kind of Computational frame selection method and device | |
| CN106934045B (en) | System and method for migration evaluation of database | |
| CN106407266B (en) | A method and device for formatted extraction of three-dimensional calculation results | |
| CN105893068A (en) | Offline upgrading method and device of intelligent equipment | |
| CN114201512A (en) | Data Logical Check Database and Its Establishment Method and Application | |
| US12436925B2 (en) | Systems and methods for automated data dictionary generation and validation | |
| CN116204509B (en) | Data access script generation method and device, electronic equipment and storage medium | |
| CN104462157A (en) | Method and device for secondary structuralizing of text data | |
| CN115576923A (en) | SQL and document conversion method, system, electronic device and storage medium | |
| CN115033526B (en) | Electronic document filing system and method | |
| CN114443484A (en) | Program testing method, device, equipment and storage medium | |
| JP7365446B2 (en) | Method and system for performing reuse analysis for model lifecycle management | |
| CN112612812A (en) | Method and device for processing multi-system data |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |