An automatic generation method and system for surface matrix catalog registration forms
Through the method and system of automatically generating surface matrix catalog registration tables, the problem of time-consuming and error-prone manual entry is solved, and efficient and accurate data entry is achieved.
Patent Information
- Application Number
- CN202211488641.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-11-25
AI Technical Summary
In the prior art surface matrix survey process, manual cataloging of surface matrix catalog registration forms is time-consuming and prone to errors in filling information and inaccurate cutting of soil pattern bar charts.
A method and system for automatic generation of surface matrix catalog registration tables is adopted. By obtaining field survey record tables, information is automatically entered and row height is adjusted according to layering thickness, soil pattern bar charts and ruler pictures are inserted, and automatic generation is achieved in Excel using the VBA module.
It improves the input efficiency of surface matrix catalog registration tables, avoids manual entry errors and irregular picture cutting problems, and ensures the accuracy of the data.
Smart Images

Figure CN115859928B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of geological data processing, and particularly relates to a method and system for automatically generating a surface matrix catalog registration form. Background Art
[0002] The statements in this part only provide background technical information related to the present invention, and do not necessarily constitute prior art.
[0003] Surface matrix survey refers to a comprehensive, basic, and public welfare survey work carried out for the surface matrix layer with strategic significance in natural resource work. In actual survey work, staff need to "reprocess" and catalog the data collected at all survey points in the survey area to form a surface matrix catalog registration form. This process requires a lot of time and energy from the staff, and there are prone to problems such as incorrect information filling and inaccurate cropping of the length of the soil pattern columnar diagram during manual cataloging. Summary of the Invention
[0004] To overcome the deficiencies of the above-mentioned prior art, the present invention provides a method and system for automatically generating a surface matrix catalog registration form, which can automatically and efficiently generate the surface matrix catalog registration form and improve the accuracy of the cataloging work at the same time.
[0005] To achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
[0006] A method for automatically generating a surface matrix catalog registration form includes the following steps:
[0007] Obtain a single-frame surface matrix field survey record form;
[0008] Create a blank surface matrix catalog registration form and enter information according to the surface matrix field survey record form;
[0009] Adjust the row height of each layer according to the thickness value of the layering situation in the surface matrix catalog registration form;
[0010] Insert a soil pattern columnar diagram at the columnar diagram position of each layer according to the soil type of each layer;
[0011] Insert a scale picture at the scale position in the layering situation area;
[0012] Insert the edited matrix photo at the matrix photo position.
[0013] Further, pre-record the row and column positions of each type of information in the surface matrix field survey record form, as well as the row and column positions of each type of information in the surface matrix catalog registration form, and realize the positioning of each type of information in the surface matrix field survey record form or the surface matrix catalog registration form based on the row and column positions of the cells.
[0014] Further, the information entry based on the field investigation record form of the surface substrate includes:
[0015] Assign the basic information in the field investigation record form of the surface substrate to the corresponding positions in the surface substrate cataloging registration form;
[0016] Assign the description information of the stratification situation of the first layer in the field investigation record form of the surface substrate to the corresponding positions in the surface substrate cataloging registration form, determine whether there is a next stratification in the field investigation record form of the surface substrate, if so, assign the description information of the next stratification situation to the corresponding positions in the surface substrate cataloging registration form, and repeat this process until all the description information of the stratification situation is assigned.
[0017] Further, according to the conversion relationship between the preset stratification thickness and the stratification height in the table, set the initial number of rows of the corresponding cells in the surface substrate cataloging registration form; adjust the height of each stratification by adjusting the height of each row in each stratification.
[0018] Further, pre-store the pattern columnar charts and scale pictures of all soil types;
[0019] When performing the insertion operation, determine the required picture path based on the picture name and perform the insertion;
[0020] After the insertion, perform cropping according to the height of each stratification.
[0021] Further, pre-store the edited substrate photos;
[0022] When performing the insertion operation, determine the required picture path based on the picture name and perform the insertion;
[0023] After the insertion, adjust its length and width according to the substrate photo cell.
[0024] Further, the method further includes deleting the blank rows in the stratification situation area of the surface substrate cataloging registration form.
[0025] An automatic generation system for a surface substrate cataloging registration form according to one or more embodiments, comprising:
[0026] An investigation data acquisition module for acquiring a single-field investigation record form of the surface substrate;
[0027] A registration form creation module for creating a blank surface substrate cataloging registration form;
[0028] The registration form entry module is used to enter information according to the field investigation record form of the surface substrate; adjust the row height of each layer according to the thickness value of the layer-by-layer situation in the surface substrate catalog registration form; insert a soil pattern histogram at the histogram position of each layer according to the soil type of each layer; insert a scale picture at the scale position in the layer-by-layer situation area; insert the edited substrate photo at the substrate photo position.
[0029] One or more embodiments An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the automatic generation method of the surface substrate catalog registration form is implemented.
[0030] One or more embodiments A computer-readable storage medium stores a computer program thereon, characterized in that the program is executed by the processor to implement the automatic generation method of the surface substrate catalog registration form.
[0031] The above one or more technical solutions have the following beneficial effects:
[0032] When entering data in this application, first enter the basic information in the field investigation record form of the surface substrate, that is, the text or numerical data that does not need to be adjusted, into the surface substrate catalog registration form. Then, according to the thickness value of each layer, based on the conversion relationship between the pre-calibrated scale and the surface substrate thickness, adaptively adjust the height of the corresponding cell for each layer, and then insert picture data such as soil histograms, scale pictures, and substrate photos. On the one hand, it avoids the problems of filling errors that may occur in manual entry of text or numerical data, as well as problems such as non-standard picture cropping and inaccurate correspondence between the scale and the layer depth. On the other hand, it greatly improves the entry efficiency of the surface substrate catalog registration form. Description of the Drawings
[0033] The specification drawings forming a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention.
[0034] Figure 1 It is a flowchart of the automatic generation method of the surface substrate catalog registration form in one or more embodiments of the present invention;
[0035] Figure 2 It is a schematic diagram of the field investigation record form of the surface substrate in one or more embodiments of the present invention;
[0036] Figure 3 It is a schematic diagram of the blank surface substrate catalog registration form in one or more embodiments of the present invention;
[0037] Figure 4Schematic diagram of the surface substrate catalog registration after data entry in one or more embodiments of the present invention. Detailed implementation manners
[0038] It should be noted that the following detailed description is exemplary and is intended to provide further illustration of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0039] It should be noted that the terms used herein are only for describing specific implementation manners and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0040] In the case of no conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0041] Embodiment 1
[0042] This embodiment discloses an automatic generation method for a surface substrate catalog registration form based on VBA. As Figure 1 shown, it includes the following steps:
[0043] Step 1: Obtain a single-field surface substrate field survey record form.
[0044] The surface substrate field survey record form is also called the soil quality form. As Figure 2 shown, it includes basic information, description information of stratification conditions, and survey execution information. The basic information includes identification information such as number, line number, point number, geographical information such as geographical location, township where it is located, longitude and latitude coordinates, elevation, landform information, land use information, etc. The description information of stratification conditions includes the classification, depth range, color, structure, humidity, compactness, sampling depth, and sample number of each layer, and each row corresponds to a stratification.
[0045] The format of the surface substrate field survey record form is fixed to facilitate traversing and collecting data therefrom. After obtaining the surface substrate field survey record form, the description content is uniformly formatted, that is, the location information, the penetration depth of the Luoyang shovel, and the description content of each stratification are separated by a period.
[0046] Step 2: Create a blank surface substrate catalog registration form and enter information according to the surface substrate field survey record form.
[0047] The surface substrate catalog registration form, as Figure 3As shown, it includes basic information, stratification information, and investigation execution information. Among them, the basic information includes point number, depth, geographical location, elevation, etc.; the stratification information includes layer numbers and names, depths, thicknesses, stratification and sample description information. In addition, it also includes soil pattern columnar diagrams, substrate photos, and scale pictures; the investigation execution information includes investigators, investigation time, and investigation units for conducting the investigation.
[0048] In this embodiment, both the surface substrate catalog registration form and the surface substrate catalog registration form are recorded in the form of table files, such as Excel table files. Each stratification of the stratification information corresponds to one or more rows of cells respectively, and the initial height of each stratification can adjust the corresponding number of initial cells according to actual needs.
[0049] Specifically, a scale picture file with a specific resolution is pre-stored, a conversion relationship between the scales in the scale picture and the thickness of the surface substrate is established, and the initial number of rows corresponding to each stratification is initialized according to the maximum thickness of the stratification and the maximum adjustable row height of Excel.
[0050] The information entry according to the surface substrate field investigation record form specifically includes:
[0051] (1) Assign the basic information in the surface substrate field investigation record form to the corresponding positions in the surface substrate catalog registration form.
[0052] The row and column positions of various types of information in the surface substrate field investigation record form and the row and column positions of various types of information in the surface substrate catalog registration form are pre-recorded, and the transfer and filling operations of numerical values and texts are directly performed through the row and column numbers of the cells.
[0053] (2) Assign the stratification description information of the first layer in the surface substrate field investigation record form to the corresponding positions in the surface substrate catalog registration form, determine whether there is a next layer, if so, assign the stratification description information of the next layer, and repeat this process until all the stratification description information is assigned.
[0054] Since there is at least one layer of stratification content in the stratification column of the surface substrate field investigation record form, in this embodiment, first, the stratification information of the first layer is assigned to the catalog form, and then the Do While loop is used to judge whether there are other layers in the soil quality table stratification. If so, continue to fill downwards; if not, jump out and execute the subsequent code.
[0055] Among them, the thickness value of the stratification in the catalog form is obtained from the depth information. Since the depth information is in a format like "5 - 10", first, the Split method is used to split the depth information into an array with the symbol "-", and then the elements of the array are subtracted to obtain the thickness value.
[0056] The function code for determining whether there are other layers in the soil quality table is as follows. Define ws as the current soil quality table object. The code a = 1 is used to set the control offset position variable. Starting from the cells B15 and A6 named by the first layer classification respectively, use the offset function to locate the corresponding layers of the soil quality table and the surface substrate catalog table. The location codes are ws.Range("B15").Offset(a,0) and Workbooks(1).Worksheets(n).Range("A6").Offset((1 + 3*(a - 1)),0) respectively. When the value of ws.Range("B15").Offset(a,0).Value is empty, break out of the loop.
[0057]
[0058] Step 3: Adjust the row height of each layer according to the thickness value of the layering situation in the surface substrate catalog registration form.
[0059] In this embodiment, since the maximum row height that can be set in the Excel table is 409 points, and the Excel layer height converted by the subsequent thickness value may be greater than 819 points, that is, greater than twice the maximum set row height. Therefore, three rows of cells are uniformly set for each layer in the surface substrate catalog registration form template to facilitate adjusting the height of each layer in the Excel table.
[0060] Define the control layer variable n. Since three rows of cells are uniformly set for each layer in the surface substrate catalog registration form template, first use Range("C"&(6 + 3*(n - 1))) to locate the cell of the layer thickness value of each layer, and use the Do While statement to judge. If there is a value, execute the internal conditional judgment statement to adjust the row height of each row in the layer in turn. The conditional judgment statement has three cases, that is, the layer thickness value is greater than 818, greater than 409, and less than 409 after being converted to points. Then adjust the height values of the three rows of cells according to the judgment situation respectively. The first layer starts from the 6th row, and every three rows represent a layer. The specific code for adjusting the height value of the nth layer is:
[0061]
[0062] Step 4: Insert a soil pattern column chart at the column chart position of each layer according to the soil type of each layer.
[0063] Pre-store the pattern column charts of all soil types, and the file names of the soil pattern pictures are named based on the soil types. Of course, those skilled in the art can understand that other naming methods that can uniquely correspond to the soil column chart or soil type can also be adopted, and the picture path can be obtained according to the file name.
[0064] After adjusting the line heights of each layer, use the Insert() method to insert soil pattern histograms at the positions of the histograms corresponding to each layer according to the soil types of each layer. After inserting the soil pattern histograms, also adjust the picture size according to the width of the cell where it is located, and perform cropping in combination with the height value of the layer where it is located.
[0065] To avoid the problem of the picture pressing the line after cropping, make a slight movement of the picture.
[0066] Step 5: Insert a scale picture at the scale position in the layer situation area.
[0067] Insert a scale picture into the corresponding cell, and perform size adjustment and cropping.
[0068] After performing the above operations, use a Do While loop to delete the blank cells below the catalog table. Use Range("A"&(6 + 3*(n - 1))).Value to locate the blank cell below for null value judgment. If it is a null value, delete the corresponding layer. The deletion operation continues until the row of investigators at the bottom of the table.
[0069] The surface substrate catalog registration form for deleting blank layers is as Figure 4 shown.
[0070]
[0071] The above steps are the process of generating a surface substrate catalog registration form for a single surface substrate field investigation record form. The field data workbook obtained daily usually includes more than one surface substrate field investigation record form, corresponding to more than one sheet file in the Excel table. For this, after obtaining the field data workbook, if the total number of surface substrate field investigation record forms in it is wb2_number, use a For loop formula to traverse:
[0072] For n = 1 To wb2_number ...
[0074] Next n
[0075] In each loop process, after reading the nth surface substrate field investigation record form, first create a blank surface substrate catalog registration form. Specifically, a blank template of the surface substrate catalog registration form can be copied to the current blank template by the copy method, and then data filling operations are performed on the current blank template, that is, data is filled into the blank surface substrate catalog registration form. The specific implementation method refers to the above steps 1 - 5.
[0076] The above solution can automatically generate a surface matrix catalog registration form by combining the built-in module of VBA in Excel. It can obtain data from each worksheet (soil quality table) in the field data collection workbook, set the data storage area and graphic area in the Excel surface matrix catalog registration form respectively, input the obtained data into the surface matrix catalog registration form according to the row and column attributes of the data storage area, use VBA code to read the soil layer depth data of each layer, calculate the soil layer thickness value of each layer and fill it into the corresponding cell. Automatically adjust the row height of Excel using the soil layer thickness value of each layer to make it correspond to the scale on the last inserted scale picture. Insert the corresponding soil pattern histogram according to the soil layer naming data of each layer in the surface matrix catalog registration form, then adjust the length and width of the histogram according to the row height of the corresponding layer in Excel and crop it, and finely adjust the histogram so that it does not press the line. Obtain the total depth of the Luoyang shovel penetration at this point according to the soil layer thickness of each layer, insert a scale picture and crop it according to the total depth.
[0077] Example Two
[0078] Based on the above Example One, this example provides a system for automatically generating a surface matrix catalog registration form, including:
[0079] An investigation data acquisition module, used to acquire a single-surface matrix field investigation record form;
[0080] A registration form creation module, used to create a blank surface matrix catalog registration form;
[0081] A registration form input module, used to input information according to the surface matrix field investigation record form; adjust the row height of each layer according to the thickness value of the layer in the surface matrix catalog registration form; insert a soil pattern histogram at the histogram position of each layer according to the soil type of each layer; insert a scale picture at the scale position of the layer situation area; and insert the edited matrix photo at the matrix photo position.
[0082] Example Three
[0083] The purpose of this example is to provide an electronic device.
[0084] An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor executes the method described in Example One.
[0085] Example Four
[0086] The purpose of this example is to provide a computer-readable storage medium.
[0087] A computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method described in Example One.
[0088] The steps involved in the above Second to Fourth Embodiments correspond to those in the Method Embodiment 1. For specific implementation manners, reference may be made to the relevant description part of Embodiment 1.
[0089] Based on the above one or more embodiments, the automatic entry of the surface matrix catalog registration form is realized. On the one hand, it avoids problems such as filling errors that may occur in manual entry of text or numerical data, as well as non-standard picture cropping and inaccurate correspondence between the scale and the stratification depth. On the other hand, it greatly improves the entry efficiency of the surface matrix catalog registration form.
[0090] Those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computer device. Optionally, they can be implemented by program codes executable by the computing device. Thus, they can be stored in the storage device for execution by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0091] Although the specific implementation manners of the present invention are described above in conjunction with the accompanying drawings, it is not a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications or deformations that can be made without creative efforts on the basis of the technical solutions of the present invention are still within the protection scope of the present invention.
Claims
1. A method for automatically generating a registration form for surface substrate cataloging, characterized in that, It includes the following steps: Obtain a single-field investigation record form of surface substrate; Create a blank catalog registration form of surface substrate, and input information according to the surface substrate field investigation record form. The information input according to the surface substrate field investigation record form includes: Assign the basic information in the surface substrate field investigation record form to the corresponding positions in the surface substrate catalog registration form; Assign the stratification description information of the first layer in the surface substrate field investigation record form to the corresponding positions in the surface substrate catalog registration form. Determine whether there is a next stratification in the surface substrate field investigation record form. If so, assign the stratification description information of the next layer to the corresponding positions in the surface substrate catalog registration form, and repeat this process until all the stratification description information is assigned; Based on the scale ruler picture, calibrate the conversion relationship between the stratification thickness and the stratification height in the table, set the initial number of rows of the corresponding cells of each stratification in the surface substrate catalog registration form according to the conversion relationship, and adjust the row height of each stratification according to the thickness value of the stratification situation in the surface substrate catalog registration form; Pre-store the pattern column charts and ruler pictures of all soil types; insert the soil pattern column charts at the column chart positions of each stratification according to the soil types of each stratification; insert the ruler pictures at the ruler positions in the stratification situation area; when performing the insertion operation, determine the required picture path based on the picture name and perform the insertion; after insertion, crop according to the height of each stratification; Insert the edited corresponding photo at the substrate photo position.
2. The method for automatically generating a surface matrix catalog registration form according to claim 1, wherein, Pre-record the row and column positions of each type of information in the surface substrate field investigation record form, as well as the row and column positions of each type of information in the surface substrate catalog registration form, and realize the positioning of each type of information in the surface substrate field investigation record form or the surface substrate catalog registration form based on the row and column positions.
3. The method for automatically generating a surface matrix catalog registration form according to claim 1, characterized in that, Pre-store the edited substrate photos; When performing the insertion operation, determine the required picture path based on the picture name and perform the insertion; After insertion, adjust its length and width according to the overall height.
4. The method for automatically generating a surface matrix catalog registration form according to claim 1, wherein, The method further includes deleting the blank rows in the stratification situation area of the surface substrate catalog registration form.
5. An automatic generation system for surface matrix catalog registration forms, characterized in that, It includes: An investigation data acquisition module, used to obtain a single-field investigation record form of surface substrate; A registration form creation module, used to create a blank catalog registration form of surface substrate; A registration form input module, used to input information according to the surface substrate field investigation record form. The information input according to the surface substrate field investigation record form includes: Assign the basic information in the surface substrate field investigation record form to the corresponding positions in the surface substrate catalog registration form; Assign the stratification description information of the first layer in the surface substrate field investigation record form to the corresponding positions in the surface substrate catalog registration form. Determine whether there is a next stratification in the surface substrate field investigation record form. If so, assign the stratification description information of the next layer to the corresponding positions in the surface substrate catalog registration form, and repeat this process until all the stratification description information is assigned; Based on the scale bar image, calibrate the conversion relationship between the layered thickness and the layered height in the table, set the initial number of rows of the cells corresponding to each layer in the surface matrix catalog registration form according to the conversion relationship, and adjust the row height of each layer according to the thickness value of the layer situation in the surface matrix catalog registration form; Pre-store the pattern histograms and scale bar images of all soil types; according to the soil type of each layer, insert the soil pattern histogram at the histogram position of each layer; insert the scale bar image at the scale bar position in the layer situation area; when performing the insertion operation, determine the required image path based on the image name and perform the insertion; after insertion, crop according to the height of each layer; Insert the edited photo at the matrix photo position.
6. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the automatic generation method of the surface matrix catalog registration form described in any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the automatic generation method of the surface matrix catalog registration form described in any one of claims 1-4.
Citation Information
Patent Citations
Whole-course automation method of geological exploration interior work
CN103914298A