A method for batch rapid conversion of mineral resource reserve database coordinate formats and related equipment

By using a method for batch and rapid conversion of coordinate formats in mineral resource reserve databases, and employing one-dimensional and two-dimensional arrays to process coordinate strings and coordinate pairs, the problem of graphic offsets and errors caused by mixed coordinate systems is solved, achieving efficient coordinate format conversion and verification.

CN120216577BActive Publication Date: 2026-06-23HENAN PROVINCE LAND SPACE SURVEY PLANNING INSTITUTE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HENAN PROVINCE LAND SPACE SURVEY PLANNING INSTITUTE
Filing Date
2025-03-10
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

The use of different coordinate systems in mineral resource reserves databases leads to issues such as graphic offsets, overlaps, and coordinate value errors, which require a huge amount of manual work and are prone to errors.

Method used

This paper provides a method for batch and rapid conversion of coordinate formats in mineral resource reserve databases. The method uses one-dimensional and two-dimensional arrays to process the conversion of coordinate strings and coordinate pairs, achieving forward and reverse conversion and reducing manual operation.

Benefits of technology

It achieves fast, efficient, and accurate coordinate format conversion, reduces manual workload, improves coordinate value verification efficiency, and supports mineral resource reserve database management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216577B_ABST
    Figure CN120216577B_ABST
Patent Text Reader

Abstract

The application provides a method for rapidly converting the coordinate format of a mineral resource reserve database in batches and related equipment. The method first reads the mine area number and registration classification number in the row coordinate record from the coordinate management table, and the string in the mine area or mine range coordinate field and the string in the calculated coordinate field; then, two one-dimensional arrays are used to independently store the block coordinates in the two strings, and two two-dimensional arrays are used to independently store the starting position and the number of inflection points of the block coordinates; finally, according to the information in the four arrays, combined with the coding rules of the strings, the block coordinates are read from the corresponding arrays in sequence and formed into coordinate pair format and written into the corresponding text file, realizing the forward conversion of the coordinate string to the coordinate pair. In addition, the reverse conversion of the coordinate pair to the coordinate string is also provided. The application can quickly realize and provide coordinate pair data that meets the coordinate system conversion format requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mineral resource reserve database and geospatial coordinate data processing technology, and in particular to a method and related equipment for batch and rapid conversion of coordinate formats in mineral resource reserve databases. Background Technology

[0002] Mineral resources are the cornerstone of national economic development. Reserve databases, used to store and manage mineral resource reserve data, are the foundation and crucial tool for mineral resource management. Due to historical reasons, the coordinate systems used in the reserve databases are mixed, causing problems such as offset mining area (mountain) graphics, misalignment, overlapping graphics, incorrect coordinate values, and missing coordinate values. To better manage reserves, mineral resource reserve management departments need to transform all coordinates in the reserve databases to the 2000 National Geodetic Coordinate System. This transformation requires first extracting the coordinate values ​​from the database in batches, converting them into text files with coordinate pairs required by surveying departments, before proceeding with the batch coordinate transformation. After the coordinate transformation is complete, the coordinate pairs in the text files need to be converted back into coordinate strings before being imported back into the reserve database for updating and replacing the transformed coordinate values.

[0003] The annual coordinate values ​​in the reserve database number in the thousands, with some mining areas (mountains) having as many as hundreds of coordinate inflection points. If the coordinate strings are to be organized into a text file in coordinate pair format, handed over to the surveying and mapping department for coordinate value coordinate system transformation, and then converted into a string format coordinate string before being imported back into the reserve database, the workload of manual processing is enormous and extremely prone to errors. Summary of the Invention

[0004] To address the issues of massive workload and high error rates associated with manual conversion between coordinate strings and coordinate pairs, and based on the need for coordinate system transformation of mineral resource reserve database coordinates, this invention provides a method and related equipment for batch and rapid conversion of coordinate formats in mineral resource reserve databases. This method enables forward conversion of reserve database coordinate values ​​from coordinate strings to coordinate pairs, and reverse conversion from coordinate pairs to coordinate strings, achieving rapid, efficient, and accurate coordinate format conversion and providing strong support for mineral resource reserve database management.

[0005] In a first aspect, the present invention provides a method for batch and rapidly converting coordinate formats in a mineral resource reserve database, converting coordinates in string format to coordinate pair format, comprising:

[0006] Step 1: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database;

[0007] Step 2: Read a row of coordinate records from the coordinate management table and extract the mining area number and registration classification number contained in that row;

[0008] Step 3: Read the first string from the coordinate field of the mining area or mine range and the second string from the calculated coordinate field of the coordinate record;

[0009] Step 4: Based on the delimiters in the first string, store all characters between adjacent delimiters in the first one-dimensional array in chronological order, and extract the starting position and inflection point of the range coordinates of each block from the first one-dimensional array and store them in the first two-dimensional array; based on the delimiters in the second string, store all characters between adjacent delimiters in the second one-dimensional array in chronological order, and extract the starting position and inflection point of the calculated coordinates of each block from the second one-dimensional array and store them in the second two-dimensional array;

[0010] Step 5: Write the mining area number, registration classification number, and range coordinate field identifier into a preset text file and use it as the starting line of the range coordinate field; according to the starting position and inflection point number of each block's range coordinates stored in the first two-dimensional array, and in combination with the string encoding rules, read the inflection point number, the X coordinate and Y coordinate of the inflection point in sequence from the first one-dimensional array, form a coordinate pair format, and write it into the starting line of the range coordinate field in the preset text file until all blocks have been processed;

[0011] Step 6: Write the mining area number, registration classification number, and calculated coordinate field identifier into a preset text file and use it as the starting line of the calculated coordinate field; according to the starting position and inflection point number of each block stored in the second two-dimensional array, and combined with the encoding rules of the second string, read the inflection point number, the X coordinate and Y coordinate of the inflection point in turn from the second one-dimensional array in sequence, form a coordinate pair format and write it into the starting line of the calculated coordinate field in the preset text file, until all blocks have been processed;

[0012] Step 7: Return to step 2 until all row coordinate records in the coordinate management table have been processed.

[0013] Furthermore, during the process of writing the block information into the preset file, a separator is set between the information of two adjacent mining area (mountain) coordinate blocks, and a first end symbol is set after the information of the last block; for the information of each mining area (mountain) coordinate block, one inflection point corresponds to one line, and a second end symbol is set after the last inflection point of a block. After the second end symbol, the start and end elevations, block identifier, and block nature are written.

[0014] Furthermore, in step 4, given that the starting position of the range coordinates or the starting position of the calculated coordinates of block 1 is 1 and the number of inflection points is G1, the starting position of the range coordinates or the starting position of the calculated coordinates of the nth block is calculated according to the following formula. n ;

[0015] P n =1+P n-1 +(G n-1 +1)*3+1

[0016] Among them, G n-1 This represents the inflection point number of the (n-1)th block, where n is an integer greater than 1;

[0017] Correspondingly, the index P in the first or second one-dimensional array is... n The element value is used as the inflection point number of the nth block.

[0018] Further, step 5 specifically includes: writing the mining area number, registration classification number, and range coordinate field identifier into a preset text file and using it as the starting line of the range coordinate field; assigning the starting position of the range coordinate to point1 as a pointer to the first one-dimensional array; sequentially reading the element value at index (point1+1) in the first one-dimensional array as the sequence number of the current inflection point, the element value at index (point1+2) as the X coordinate of the current inflection point, and the element value at index (point1+3) as the Y coordinate of the current inflection point; moving the pointer point1 forward and continuing to read the information of the next inflection point until all blocks have been read;

[0019] Further, step 6 specifically includes: writing the mining area number, registration classification number, and calculation coordinate field identifier into a preset text file and using it as the starting line of the calculation coordinate field; assigning the starting position of the calculation coordinate to point2 as a pointer to the second one-dimensional array, sequentially reading the element value at index (point2+1) in the second one-dimensional array as the sequence number of the current inflection point, the element value at index (point2+2) as the X coordinate of the current inflection point, and the element value at index (point2+3) as the Y coordinate of the current inflection point; moving the pointer point2 forward and continuing to read the information of the next inflection point until all blocks have been read.

[0020] Furthermore, after the second terminator, the start and end elevations, block identifier, and block type are written, specifically including:

[0021] Assign the position of the second terminator in the first one-dimensional array to point3 as a pointer to the first one-dimensional array. Read the element value at index (point3+1) in the first one-dimensional array as the starting height of the current block, the element value at index (point3+2) as the ending height of the current block, the element value at index (point3+3) as the block identifier of the current block, and the element value at index (point3+4) as the block property of the current block.

[0022] Secondly, the present invention provides a method for batch and rapidly converting the coordinate format of a mineral resource reserve database, converting coordinate pairs into string-format coordinates, including:

[0023] Step 1: Obtain a preset text file containing the coordinates of the target mining area or mine;

[0024] Step 2: Locate the row containing the mining area number in the preset text file and mark it as the starting row; then read the mining area number, registration classification number, and coordinate field identifier from the starting row and write them into the first three columns of the same row of the third two-dimensional array;

[0025] Step 3: Read the subsequent rows after the starting row, convert the coordinate pairs in the subsequent rows into strings and concatenate them until the preset end character is read. Write the string at this time into the fourth column of the row where the currently located mining area number is located in the third two-dimensional array. The preset end character is used to indicate that all block information contained in the currently located mining area number ends here.

[0026] Step 4: Return to Step 2 until the preset text file has been processed;

[0027] Step 5: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database;

[0028] Step 6: Traverse all row coordinate records in the coordinate management table, and use the mining area number and registration classification number in a single row coordinate record as keywords to search in the third two-dimensional array. If a matching result exists, replace the range coordinate string and calculated coordinate string in the coordinate management table with the string in the fourth column of the matching row to update the coordinate management table.

[0029] Thirdly, the present invention provides an apparatus for batch and rapidly converting the coordinate format of a mineral resource reserve database, used to convert coordinates in string format to coordinate pair format, comprising:

[0030] The acquisition module is used to obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database;

[0031] The mining area information extraction module is used to read a row of coordinate records from the coordinate management table and extract the corresponding mining area number and registration classification number of the row of records.

[0032] The string reading module is used to read the first string from the coordinate field of the mining area or mine range and the second string from the calculated coordinate field from the coordinate record;

[0033] The array writing module is used to store all characters located between adjacent separators in the first string into a first one-dimensional array according to the separators in the first string, and extract the range coordinate start position and inflection point number of each block from the first one-dimensional array and store them into a first two-dimensional array; according to the separators in the second string, it stores all characters located between adjacent separators in the second one-dimensional array according to the separators in the second string, and extracts the calculated coordinate start position and inflection point number of each block from the second one-dimensional array and stores them into a second two-dimensional array;

[0034] The text writing module is used to write the mining area number, registration classification number, and range coordinate field identifier into a preset text file and use them as the starting line of the range coordinate field; based on the starting position and inflection point number of each block's range coordinates stored in the first two-dimensional array, and combined with the encoding rules of the first string, sequentially read the inflection point number, the X coordinate and Y coordinate of the inflection point from the first one-dimensional array, forming a coordinate pair format and writing it into the starting line of the range coordinate field in the preset text file, until all blocks are processed; and to write the mining area number, registration classification number, and calculation coordinate field identifier into a preset text file and use them as the starting line of the calculation coordinate field; based on the starting position and inflection point number of each block's calculation coordinates stored in the second two-dimensional array, and combined with the encoding rules of the second string, sequentially read the inflection point number, the X coordinate and Y coordinate of the inflection point from the second one-dimensional array, forming a coordinate pair format and writing it into the starting line of the calculation coordinate field in the preset text file, until all blocks are processed.

[0035] Fourthly, the present invention provides an apparatus for batch and rapidly converting the coordinate format of a mineral resource reserve database, used to convert coordinate pairs into string-format coordinates, comprising:

[0036] The text acquisition module is used to acquire a preset text file that stores the coordinates of the target mining area or mine.

[0037] The mining area information positioning module is used to locate the row containing the mining area number in the preset text file, which is designated as the starting row; and to read the mining area number, registration classification number, and coordinate field identifier from the starting row and write them into the first three columns of the same row of the third two-dimensional array.

[0038] The string writing module is used to read subsequent lines after the starting line, convert the coordinate pairs in the subsequent lines into strings and concatenate them until a preset end character is read. The string at this point is written into the fourth column of the row where the currently located mining area number is located in the third two-dimensional array. The preset end character is used to indicate that all block information contained in the currently located mining area number ends here.

[0039] The table retrieval module is used to retrieve the coordinate management table of the target mining area or mine from the mineral resource reserves database.

[0040] The table update module is used to traverse all row coordinate records in the coordinate management table, and search in the third two-dimensional array using the mining area number and registration classification number in a single row coordinate record as keywords. If a matching result exists, the string in the fourth column of the matching row replaces the range coordinate string and calculated coordinate string in the coordinate management table to update the coordinate management table.

[0041] Fifthly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in the first and / or second aspects.

[0042] In a sixth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the method described in the first and / or second aspects.

[0043] The beneficial effects of this invention are as follows:

[0044] 1. For situations requiring large-scale transformations from the 1954 Beijing coordinate system or the 1980 Xi'an coordinate system to the 2000 National Geodetic Coordinate System, the method of this invention can quickly realize and provide coordinate pair data that meets the requirements of the coordinate system transformation format.

[0045] 2. This invention can realize the forward conversion of large batches of coordinate strings to coordinate pairs, and the reverse conversion, export and import of coordinate pairs to coordinate strings of storage, greatly reducing the workload of manually organizing coordinate strings and coordinate pairs.

[0046] 3. By converting the coordinate strings in the storage database into coordinate pairs, it is possible to quickly visually determine whether the X and Y coordinate values ​​are correct. This solves the problem that coordinate strings are not intuitive and that it is impossible to directly determine whether the coordinate values ​​in the string are incorrect. It enables rapid verification of coordinate value data errors.

[0047] 4. Based on the converted coordinate pair file, the number of closed blocks in the mining area (mountain) can be quickly determined, which helps to troubleshoot mining area (mountain) coordinate problems;

[0048] 5. Coordinate values ​​in coordinate pairs after coordinate system transformation can be converted back to string format and written back to the storage database, enabling rapid updates of coordinate values ​​in the storage database. Attached Figure Description

[0049] Figure 1 A flowchart illustrating a method for batch and rapid conversion of coordinate formats in a mineral resource reserve database (forward conversion) provided in an embodiment of the present invention;

[0050] Figure 2 A diagram showing the relationship between the mining area (mountain) and its blocks;

[0051] Figure 3 A flowchart illustrating a method for batch and rapid conversion of coordinate formats in a mineral resource reserve database (reverse conversion) provided in an embodiment of the present invention;

[0052] Figure 4 This is a data structure diagram illustrating the correspondence between coordinate strings and coordinate pairs in an embodiment of the present invention.

[0053] Figure 5 A schematic diagram of a device for batch and rapid conversion of coordinate formats of mineral resource reserve databases (forward conversion) provided in an embodiment of the present invention;

[0054] Figure 6 A schematic diagram of the structure of a device for batch and rapid conversion of coordinate format of mineral resource reserve database (reverse conversion) provided in an embodiment of the present invention;

[0055] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0057] This invention provides a method for batch and rapidly converting the coordinate format of mining areas (mountains) in a mineral resource reserve database (hereinafter referred to as the reserve database). The method mainly achieves the following functions: a forward conversion from coordinate strings to coordinate pairs in the reserve database; a reverse conversion from coordinate pairs back to coordinate strings in the reserve database; providing data conforming to the format requirements for the transformation of the mining area (mountain) coordinate system in the reserve database; and quickly updating the transformed coordinate values ​​back to the reserve database, thus realizing the updating of the coordinate data after transformation.

[0058] like Figure 1 As shown, this embodiment of the invention provides a method for batch and quickly converting the coordinate format of a mineral resource reserve database, converting coordinates in string format to coordinate pairs (forward conversion), including the following steps:

[0059] S101: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database, i.e., the KCL_ZB table;

[0060] Specifically, the coordinates of the mining areas (mountains) in the reserve database are stored in the KCL_ZB table. The main fields of the table are shown in Table 1, including kqbh (mining area number), djflbh (registration classification number), kqzb (mining area (mountain) range coordinates), and jszb (calculated coordinates), as shown in Table 1. The keywords are kqbh and djflbh.

[0061] Table 1. Main fields of the KCL_ZB table

[0062]

[0063] S102: Read a row of coordinate records from the KCL_ZB table and extract the corresponding mining area number and registration classification number, i.e., the values ​​of the kqbh and djflbh fields in the KCL_ZB table; where kqbh corresponds to the mining area number and djflbh corresponds to the registration classification number.

[0064] In this embodiment, the SQL SELECT statement is used to read kqbh, djflbh, kqzb, and jszb from the KCL_ZB table. The program statement is: sql = "SELECT kqbh,djflbh,kqzb,jszb FROM KCL_ZB". The database is opened using the db.OpenRecordset method, the SQL statement is executed, and the results are assigned to the rs recordset.

[0065] S103: Read the first string from the coordinate field of the mining area or mine range and the second string from the calculated coordinate field from the coordinate record;

[0066] Specifically, in the KCL_ZB table, the data type for storing coordinate values ​​is long text, and the range coordinates of the mining area (mountain) are as follows (e.g., Figure 2 Both the coordinates shown and the calculated coordinates consist of more than one block, and each block is a closed area formed by the coordinates of the inflection points.

[0067] S104: Based on the delimiters in the first string (usually commas), store all characters between adjacent delimiters in the first one-dimensional array (denoted as array brr1) in chronological order, and extract the starting position and inflection point number of each block's range coordinates from array brr1 and store them in the first two-dimensional array (denoted as array arr1); based on the delimiters in the second string, store all characters between adjacent delimiters in the second one-dimensional array (denoted as array brr2) in chronological order, and extract the starting position and inflection point number of each block's calculated coordinates from array brr2 and store them in the second two-dimensional array (denoted as array arr2);

[0068] Specifically, array `brr1` stores the range coordinate strings of all blocks containing a mining area (mountain), and array `arr1` stores the starting position and inflection point number of the range coordinates of all blocks in that mining area (mountain). Correspondingly, array `brr2` stores the calculated coordinate strings of all blocks containing a mining area (mountain), and array `arr2` stores the starting position and inflection point number of the calculated coordinates of all blocks in that mining area (mountain). Taking range coordinates as an example, the data structures of arrays `arr` and `brr` are shown below. Figure 4 As shown.

[0069] It should be noted that when extracting the starting position and number of inflection points of the coordinates, the encoding rules of the coordinate value strings need to be known. In this embodiment, the encoding rules of the first string and the second string are the same. Generally speaking, the encoding rules of the strings in the KCL_ZB table are as follows: number of blocks, number of inflection points in block 1, 1, X coordinate of inflection point 1, Y coordinate of inflection point 1, 2, X coordinate of inflection point 2, Y coordinate of inflection point 2, ..., n, X coordinate of inflection point n, Y coordinate of inflection point n, upper boundary elevation of sampling depth of block 1, lower boundary elevation of sampling depth of block 1, block number (can be left blank), block nature (1 for normal closed area, -1 for empty sub-area within a ring area), number of inflection points in block 2, 1, X coordinate of inflection point 1, Y coordinate of inflection point 1, 2, X coordinate of inflection point 2, Y coordinate of inflection point 2, ...; Figure 4 As shown in the KCL_ZB table.

[0070] Based on the above encoding rules, we know that the value of brr(0) is the number of blocks. Using this value as the count, we read the values ​​of the elements in the brr array starting from the element of the brr(0) array and calculate the starting position and the number of inflection points of each block from the brr array. These values ​​can then be stored in the first and second columns of the two-dimensional array block arr.

[0071] Taking the range coordinate string as an example, the range coordinate string is set to use commas as delimiters. In this embodiment, the function Split(rs!kqzb,",") is called to split the coordinate string value of the kqzb field and store it in the brr array, where rs!kqzb is the range coordinate string value of a row record in the table.

[0072] S105: Write the mining area number, registration classification number and range coordinate field identifier into a preset text file and use it as the starting line of the range coordinate field, such as "412822602,2004,KQZB", where "412822602" represents the mining area number, "2004" represents the registration classification number, and "KQZB" represents the mining area or mine range coordinate field identifier;

[0073] Write the mining area number, registration classification number, and calculation coordinate field identifier into a preset text file and use it as the starting line of the calculation coordinate field, such as "412822602,2004,JSZB", where "JSZB" represents the calculation coordinate field identifier.

[0074] S106: Based on the starting position and inflection point number of the range coordinates of each block stored in array arr1, and combined with the string encoding rules, read the inflection point number, the X coordinate and Y coordinate of the inflection point in sequence from array brr1, form a coordinate pair format and write it after the starting line of the range coordinate field in the preset text file, until all blocks are processed;

[0075] Based on the starting position and inflection point number of each block stored in array arr2, and combined with the string encoding rules, the inflection point number, X coordinate and Y coordinate of the inflection point are read sequentially from array brr2, and written into the starting line of the calculated coordinate field in the preset text file in coordinate pair format, until all blocks are processed;

[0076] It should be noted that the text file storing the range coordinate pairs and the text file storing the calculated coordinate pairs can be the same, or they can each correspond to a separate text file. Furthermore, for the same line of coordinate records, the writing process for the range coordinate pairs and the writing process for the calculated coordinate pairs are independent of each other and can be completed in parallel.

[0077] S107: Return to step S102 until all row coordinate records in the coordinate management table have been processed.

[0078] This invention enables large-scale, rapid forward conversion, export, and import of coordinate strings to coordinate pairs in a reserve database, significantly reducing the workload of manually organizing coordinate strings and pairs. Furthermore, based on the converted coordinate pair file, the number of closed blocks in a mining area (mountain) can be quickly determined, aiding in troubleshooting coordinate problems in the mining area (mountain).

[0079] In one embodiment, during the process of writing block information into the preset file, a separator (e.g., a newline character) is set between the information of two adjacent blocks, and a first end character (e.g., ",,,,") is set after the information of the last block of a mining area (mountain); for the information of each block, one inflection point corresponds to one line, and a second end character (e.g., "*") is set after the last inflection point of a block. After the second end character, the start and end elevations, block identifier, and block properties are written. Figure 4 The "transformed coordinate pair" shown.

[0080] This invention, through forward conversion, rapidly converts coordinate strings in the reserve database into coordinate pairs in large batches, with each inflection point's coordinate pair corresponding to one line. This allows for quick visual inspection to determine the correct number of digits in the X and Y coordinate values, solving the problems of non-intuitive coordinate strings and the inability to directly identify input errors. It enables rapid verification of coordinate data errors. Furthermore, based on the converted coordinate pair file, the number of closed blocks in the mining area (mountain) can be quickly determined, aiding in troubleshooting coordinate issues and significantly reducing the workload of manually compiling coordinate strings and pairs.

[0081] In one embodiment, if the starting position of the range coordinates or the starting position of the calculated coordinates of block 1 is known to be 1, and the number of inflection points is G1, then the starting position of the range coordinates or the starting position of the calculated coordinates of the nth block is calculated according to the following formula. n ;

[0082] P n =1+P n-1 +(G n-1 +1)*3+1

[0083] Among them, G n-1 This represents the inflection point number of the (n-1)th block, where n is an integer greater than 1;

[0084] Correspondingly, the index P in the first or second one-dimensional array is... n The element value is used as the inflection point number of the nth block.

[0085] Specifically, since array `brr` is used to store the coordinate strings of all blocks containing a mining area (mountain), and array `arr` is used to store the starting position and inflection point number of all blocks in that mining area (mountain), assuming that block 1 has a starting position of 1 and an inflection point number of `brr(1)`, the above formula can also be expressed as:

[0086] Block arr(n,1) = 1 + block arr(n-1,1) + (block arr(n-1,2) + 1) * 3 + 1;

[0087] The formula for calculating the inflection point number of the nth block is:

[0088] Block arr(n,2) = brr(block arr(n,1);

[0089] In one embodiment, in step S106 above, a pointer is used to sequentially read the sequence number and coordinate pair of each inflection point. Specifically:

[0090] Based on the first and second columns of array arr1, extract the starting position and inflection point number of the nth block, respectively; assign the starting position of the range coordinates to point1 as a pointer to array brr1, and sequentially read the element value at index (point1+1) in array brr1 as the index of the current inflection point, the element value at index (point1+2) as the X coordinate of the current inflection point, and the element value at index (point1+3) as the Y coordinate of the current inflection point; move the pointer point1 forward and continue to read the information of the next inflection point until all blocks have been read;

[0091] Similarly, based on the first and second columns of array arr2, the starting position and inflection point number of the nth block are extracted respectively. The starting position of the calculated coordinates is assigned to point2 as a pointer to array brr2. The element value with index (point2+1) in array brr2 is read sequentially as the index of the current inflection point, the element value with index (point2+2) is used as the X coordinate of the current inflection point, and the element value with index (point2+3) is used as the Y coordinate of the current inflection point. The pointer point2 is moved forward to continue reading the information of the next inflection point until all blocks have been read.

[0092] Further, after the second terminator, the start and end elevations, block identifier, and block property are written. Specifically, this includes: assigning the position of the second terminator in array brr1 to point3 as a pointer to array brr1; reading the element value at index (point3+1) in array brr1 as the start elevation of the current block, the element value at index (point3+2) as the end elevation of the current block, the element value at index (point3+3) as the block identifier of the current block, and the element value at index (point3+4) as the block property of the current block; concatenating the second terminator, start elevation, end elevation, block name, and block property into a string, separated by commas, and writing it to a line in a text file.

[0093] like Figure 3 As shown, this embodiment of the invention also provides a method for batch and quickly converting the coordinate format of a mineral resource reserve database, converting coordinate pairs into string format coordinates (reverse conversion), including the following steps:

[0094] S201: Obtain a preset text file that stores the coordinates of the target mining area or mine;

[0095] S202: Locate the row containing the mining area number in the preset text file and record it as the starting row; and read the mining area number, registration classification number and coordinate field identifier in the starting row and write them into the first three columns of the same row of the third two-dimensional array (referred to as array crr);

[0096] For example, a mining area number typically consists of 9 Arabic numerals, each representing a different encoding meaning. Therefore, the encoding meaning of the mining area number can be used to locate the line containing the mining area number. For instance, if the line begins with "41", it indicates the start of the mining area (mountain) coordinates. Based on the text file writing rules, the functions Mid(Line,1,9) can be used to obtain the mining area number, Mid(Line,11,4) to obtain the registration classification number, and Mid(Line,16,4) to obtain the coordinate type, which are then written to crr(i,1), crr(i,2), and crr(i,3) respectively. In these formulas, Line represents the current line of data read, and i represents the line number of a given block.

[0097] In this embodiment, the main fields contained in the array crr are shown in Table 2.

[0098] Table 2 Structure of the CRR array

[0099]

[0100] S203: Read the subsequent rows after the starting row, convert the coordinate pairs in the subsequent rows into strings and concatenate them until a preset end character is read. Write the string at this time into the fourth column of the row where the currently located mining area number is located in the array crr. The preset end character is used to indicate that all block information contained in the currently located mining area number ends here.

[0101] For example, when encountering the block coordinate terminator "*", the coordinate pairs in the next line are converted to strings and concatenated, while the block count is incremented by 1. When encountering the mining area (mountain) coordinate terminator ",,,,", it means that the coordinate pairs of all blocks in a certain mining area have been converted to strings, and the block count and the area coordinate string can be concatenated into a string and written into crr(i,4). Here, the block count is the total number of blocks contained in the coordinates or calculated coordinates of a certain mining area (mountain), and the area coordinate string is the string containing the coordinates of all blocks in a certain mining area (mountain).

[0102] S204: Return to step S202 until the preset text file has been processed.

[0103] S205: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database, i.e., the KCL_ZB table;

[0104] S206: Traverse all row coordinate records in the KCL_ZB table, using the mining area number and registration classification number in a single row coordinate record as keywords, search for the first and second columns in the crr array. If a matching result exists, replace the range coordinate string and calculated coordinate string in the coordinate management table with the string in the fourth column of the matching row to update the coordinate management table.

[0105] This invention enables large-scale, rapid conversion, export, and import of coordinate pairs into coordinate strings in a storage database, significantly reducing the workload of manually organizing coordinate strings and pairs. Coordinate values ​​after coordinate system transformation can be converted back to string format and written back to the storage database, allowing for rapid updates to the coordinate values ​​in the database.

[0106] It should be noted that the process of converting coordinate pairs to string coordinates provided in the embodiments of the present invention is the reverse process of converting string coordinates to coordinate pairs as described above. Specific details will not be repeated here.

[0107] The forward and reverse transformation processes between coordinate strings and coordinate pairs provided by this invention are as follows: Figure 4 As shown. Figure 4 The "Coordinates of Mining Area (Mountain)" field in the KCL_ZB table shown is a coordinate string, and the "Converted Coordinate Pairs" field shows the corresponding coordinate pairs.

[0108] like Figure 5 As shown in the figure, this embodiment of the invention also provides a device for batch and rapid conversion of coordinate formats in a mineral resource reserve database, used to convert coordinates in string format to coordinate pairs format, including an acquisition module, a mining area information extraction module, a string reading module, an array writing module, and a text writing module.

[0109] The acquisition module retrieves the coordinate management table of the target mining area or mine from the mineral resource reserve database. The mining area information extraction module reads a row of coordinate records from the coordinate management table and extracts the corresponding mining area number and registration classification number. The string reading module reads the first string from the mining area or mine range coordinate field and the second string from the calculated coordinate field of the coordinate records. The array writing module stores all characters between adjacent separators in the first string in a first one-dimensional array according to the separators in the first string, and extracts the range coordinate start position and inflection point number of each block from the first one-dimensional array and stores them in a first two-dimensional array; and stores all characters between adjacent separators in the second string in a second one-dimensional array according to the separators in the second string, and extracts the calculated coordinate start position and inflection point number of each block from the second one-dimensional array and stores them in a second two-dimensional array. The text writing module is used to write the mining area number, registration classification number, and range coordinate field identifier into a preset text file and use them as the starting line of the range coordinate field; based on the starting position and inflection point number of each block's range coordinates stored in the first two-dimensional array, and combined with the encoding rules of the first string, it sequentially reads the inflection point number, the X coordinate and Y coordinate of the inflection point from the first one-dimensional array, forming a coordinate pair format and writing it into the starting line of the range coordinate field in the preset text file, until all blocks are processed; and it is also used to write the mining area number, registration classification number, and calculation coordinate field identifier into a preset text file and use them as the starting line of the calculation coordinate field; based on the starting position and inflection point number of each block's calculation coordinates stored in the second two-dimensional array, and combined with the encoding rules of the second string, it sequentially reads the inflection point number, the X coordinate and Y coordinate of the inflection point from the second one-dimensional array, forming a coordinate pair format and writing it into the starting line of the calculation coordinate field in the preset text file, until all blocks are processed.

[0110] It should be noted that the apparatus provided in the embodiments of the present invention is for implementing the above-described method of converting coordinates in string format to coordinate pairs format. Its specific function can be referred to in the above-described method embodiments, and will not be repeated here.

[0111] like Figure 6 As shown, this embodiment of the invention also provides a device for batch and rapid conversion of coordinate formats in a mineral resource reserve database, used to convert coordinate pairs into string format coordinates, including a text acquisition module, a mining area information positioning module, a string writing module, a table acquisition module, and a table update module.

[0112] The text acquisition module is used to acquire a preset text file storing the coordinate pairs of the target mining area or mine. The mining area information positioning module is used to locate the row containing the mining area number in the preset text file, designated as the starting row; and read the mining area number, registration classification number, and coordinate field identifier from the starting row, writing them into the first three columns of the same row in the third two-dimensional array. The string writing module is used to read subsequent rows after the starting row, convert the coordinate pairs in the subsequent rows into strings and concatenate them until a preset end character is read, and write the string at this point into the fourth column of the row containing the currently located mining area number in the third two-dimensional array; the preset end character is used to indicate that all block information contained in the currently located mining area number ends here. The table acquisition module is used to acquire the coordinate management table of the target mining area or mine from the mineral resource reserves database. The table update module is used to traverse all row coordinate records in the coordinate management table, using the mining area number and registration classification number in a single row coordinate record as keywords, searching in the third two-dimensional array; if a matching result exists, the string in the fourth column of the matching row replaces the range coordinate string and calculated coordinate string in the coordinate management table to update the coordinate management table.

[0113] It should be noted that the apparatus provided in the embodiments of the present invention is for implementing the above-described method for converting coordinate pairs into string formats. Its specific functions can be found in the above-described method embodiments, and will not be repeated here.

[0114] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include: a processor 701, a communications interface 702, a memory 703, and a communications bus 704, wherein the processor 701, the communications interface 702, and the memory 703 communicate with each other through the communications bus 704. Processor 701 can call logical instructions in memory 703 to execute a method for batch and rapid conversion of coordinate formats in a mineral resource reserve database, for example including: Step 1: Obtaining the coordinate management table of the target mining area or mine from the mineral resource reserve database; Step 2: Reading a row of coordinate records from the coordinate management table and extracting the corresponding mining area number and registration classification number; Step 3: Reading the first string in the mining area or mine range coordinate field and the second string in the calculated coordinate field from the coordinate record; Step 4: According to the separator in the first string, storing all characters between adjacent separators in a first one-dimensional array in chronological order, and extracting the range coordinate start position and inflection point number of each block from the first one-dimensional array and storing them in a first two-dimensional array; According to the separator in the second string, storing all characters between adjacent separators in a second one-dimensional array in chronological order, and extracting the calculated coordinate start position and inflection point number of each block from the second one-dimensional array and storing them in a second two-dimensional array; Step 5: ... The mining area number, registration classification number, and range coordinate field identifier are written into a preset text file and used as the starting line of the range coordinate field. Based on the starting position and inflection point number of each block's range coordinates stored in the first two-dimensional array, and combined with string encoding rules, the inflection point number, X coordinate, and Y coordinate of the inflection point are sequentially read from the first one-dimensional array, forming a coordinate pair format. This is then written into the starting line of the range coordinate field in the preset text file until all blocks are processed. Step 6: The mining area number, registration classification number, and calculated coordinate field identifier are written into a preset text file and used as the starting line of the calculated coordinate field. Based on the starting position and inflection point number of each block's calculated coordinates stored in the second two-dimensional array, and combined with the encoding rules of the second string, the inflection point number, X coordinate, and Y coordinate of the inflection point are sequentially read from the second one-dimensional array, forming a coordinate pair format. This is then written into the starting line of the calculated coordinate field in the preset text file until all blocks are processed. Step 7: Return to step 2 until all row coordinate records in the coordinate management table are processed.

[0115] For example, it also includes: Step 1: Obtaining a preset text file storing the coordinate pairs of the target mining area or mine; Step 2: Locating the row containing the mining area number in the preset text file, designated as the starting row; and reading the mining area number, registration classification number, and coordinate field identifier from the starting row and writing them into the first three columns of the same row of the third two-dimensional array; Step 3: Reading the subsequent rows after the starting row, converting the coordinate pairs in the subsequent rows into strings and concatenating them until a preset end character is read, and writing the string at this point into the fourth column of the row containing the currently located mining area number in the third two-dimensional array; the preset end character is used to indicate... The information of all blocks included in the currently located mining area number ends here; Step 4: Return to step 2 until the preset text file is processed; Step 5: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserve database; Step 6: Traverse all row coordinate records in the coordinate management table, using the mining area number and registration classification number in a single row coordinate record as keywords, search in the third two-dimensional array. If a matching result exists, replace the range coordinate string and calculated coordinate string in the coordinate management table with the string in the fourth column of the matching row to update the coordinate management table.

[0116] Furthermore, when the logical instructions in the aforementioned memory 703 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0117] This invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the method for batch and rapidly converting the coordinate format of a mineral resource reserve database provided in the above-described method embodiments.

[0118] This invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for batch and rapid conversion of mineral resource reserve database coordinate formats provided in the above-described method embodiments.

[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for batch and rapidly converting the coordinate format of a mineral resource reserve database, characterized in that, Convert coordinates from string format to coordinate pair format, including: Step 1: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database; Step 2: Read a row of coordinate records from the coordinate management table and extract the mining area number and registration classification number contained in that row; Step 3: Read the first string from the coordinate field of the mining area or mine range and the second string from the calculated coordinate field of the coordinate record; Step 4: Based on the delimiters in the first string, store all characters between adjacent delimiters in the first one-dimensional array in chronological order, and extract the starting position and inflection point of the range coordinates of each block from the first one-dimensional array and store them in the first two-dimensional array; based on the delimiters in the second string, store all characters between adjacent delimiters in the second one-dimensional array in chronological order, and extract the starting position and inflection point of the calculated coordinates of each block from the second one-dimensional array and store them in the second two-dimensional array; Step 5: Write the mining area number, registration classification number, and range coordinate field identifier into a preset text file and use it as the starting line of the range coordinate field; based on the starting position and inflection point number of each block's range coordinates stored in the first two-dimensional array, and combined with the encoding rules of the first string, sequentially read the inflection point number, the X coordinate and Y coordinate of the inflection point from the first one-dimensional array, form a coordinate pair format, and write it into the starting line of the range coordinate field in the preset text file until all blocks have been processed; specifically, this includes: assigning the starting position of the range coordinates to point1 as a pointer to the first one-dimensional array, sequentially reading the element value at index (point1 + 1) in the first one-dimensional array as the current inflection point number, the element value at index (point1 + 2) as the current inflection point's X coordinate, and the element value at index (point1 + 3) as the current inflection point's Y coordinate; moving the point1 pointer forward to continue reading the information of the next inflection point until all blocks have been read; Step 6: Write the mining area number, registration classification number, and calculated coordinate field identifier into a preset text file and use it as the starting line of the calculated coordinate field; based on the starting position and inflection point number of each block stored in the second two-dimensional array, and combined with the encoding rules of the second string, sequentially read the inflection point number, X coordinate, and Y coordinate of the inflection point from the second one-dimensional array, form a coordinate pair format, and write it into the starting line of the calculated coordinate field in the preset text file until all blocks have been processed; specifically, this includes: assigning the starting position of the calculated coordinate to point2 as a pointer to the second one-dimensional array, sequentially reading the element value at index (point2 + 1) in the second one-dimensional array as the current inflection point number, the element value at index (point2 + 2) as the current inflection point X coordinate, and the element value at index (point2 + 3) as the current inflection point Y coordinate; moving the point2 pointer forward to continue reading the information of the next inflection point until all blocks have been read; Step 7: Return to Step 2 until all row coordinate records in the coordinate management table have been processed.

2. The method for batch and rapid conversion of coordinate formats in a mineral resource reserve database according to claim 1, characterized in that, During the process of writing the block information into the preset text file, a separator is set between the information of two adjacent blocks, and a first end symbol is set after the information of the last block; for the information of each block, one inflection point corresponds to one line, and a second end symbol is set after the last inflection point of a block. After the second end symbol, the start and end elevations, block identifier and block nature are written.

3. The method for batch and rapid conversion of coordinate formats in a mineral resource reserve database according to claim 1, characterized in that, In step 4, given that the starting position of the range coordinates or the starting position of the calculated coordinates of block 1 is 1, and the number of inflection points is G1, then the starting position of the range coordinates or the starting position of the calculated coordinates of the nth block is calculated according to the following formula. n ; P n =1+ P n-1 +(G n-1 +1)* 3+1 Among them, G n-1 This represents the inflection point number of the (n-1)th block, where n is an integer greater than 1; Correspondingly, the index P in the first or second one-dimensional array is... n The element value is used as the inflection point number of the nth block.

4. The method for batch and rapid conversion of coordinate formats in a mineral resource reserve database according to claim 2, characterized in that, After the second terminator, write the start and end elevations, block identifier, and block type, specifically including: Assign the position of the second terminator in the first one-dimensional array to point3 as a pointer to the first one-dimensional array. Read the element value at index (point3 + 1) in the first one-dimensional array as the starting height of the current block, the element value at index (point3 + 2) as the ending height of the current block, the element value at index (point3 + 3) as the block identifier of the current block, and the element value at index (point3 + 4) as the block property of the current block.

5. A method for batch and rapidly converting the coordinate format of a mineral resource reserve database, characterized in that, Convert coordinates from coordinate pairs to string format, including: Step 1: Obtain a preset text file containing the coordinates of the target mining area or mine; Step 2: Locate the row containing the mining area number in the preset text file and mark it as the starting row; then read the mining area number, registration classification number, and coordinate field identifier from the starting row and write them into the first three columns of the same row of the third two-dimensional array; Step 3: Read the subsequent rows after the starting row, convert the coordinate pairs in the subsequent rows into strings and concatenate them until the preset end character is read. Write the string at this time into the fourth column of the row where the currently located mining area number is located in the third two-dimensional array. The preset end character is used to indicate that all block information contained in the currently located mining area number ends here. Step 4: Return to Step 2 until the preset text file has been processed; Step 5: Obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database; Step 6: Traverse all row coordinate records in the coordinate management table, and use the mining area number and registration classification number in a single row coordinate record as keywords to search in the third two-dimensional array. If a matching result exists, replace the range coordinate string and calculated coordinate string in the coordinate management table with the string in the fourth column of the matching row to update the coordinate management table.

6. A device for batch and rapid conversion of coordinate formats in a mineral resource reserve database, characterized in that, Used to convert coordinates in string format to coordinate pair format, including: The acquisition module is used to obtain the coordinate management table of the target mining area or mine from the mineral resource reserves database; The mining area information extraction module is used to read a row of coordinate records from the coordinate management table and extract the mining area number and registration classification number contained in that row of records; The string reading module is used to read the first string from the coordinate field of the mining area or mine range and the second string from the calculated coordinate field from the coordinate record; The array writing module is used to store all characters located between adjacent separators in the first string into a first one-dimensional array according to the separators in the first string, and extract the range coordinate start position and inflection point number of each block from the first one-dimensional array and store them into a first two-dimensional array; according to the separators in the second string, it stores all characters located between adjacent separators in the second one-dimensional array according to the separators in the second string, and extracts the calculated coordinate start position and inflection point number of each block from the second one-dimensional array and stores them into a second two-dimensional array; The text writing module is used to write the mining area number, registration classification number, and range coordinate field identifier into a preset text file and use it as the starting line of the range coordinate field. Based on the starting position and inflection point number of each block stored in the first two-dimensional array, and combined with the encoding rules of the first string, it sequentially reads the inflection point number, X coordinate, and Y coordinate of the inflection point from the first one-dimensional array, forming a coordinate pair format, and writes it into the starting line of the range coordinate field in the preset text file until all blocks are processed. Specifically, this includes: assigning the starting position of the range coordinate to point1 as a pointer to the first one-dimensional array; sequentially reading the element value at index (point1 + 1) in the first one-dimensional array as the current inflection point number; the element value at index (point1 + 2) as the current inflection point X coordinate; and the element value at index (point1 + 1) as the current inflection point X coordinate. 3) The element value is used as the Y coordinate of the current inflection point; the pointer point1 is moved forward to continue reading the information of the next inflection point until all blocks are read; and the mining area number, registration classification number and calculation coordinate field identifier are written into a preset text file and used as the starting line of the calculation coordinate field; according to the calculation coordinate starting position and inflection point number of each block stored in the second two-dimensional array, combined with the encoding rules of the second string, the inflection point number, the X coordinate and Y coordinate of the inflection point are read sequentially from the second one-dimensional array, and the coordinate pair format is written into the starting line of the calculation coordinate field in the preset text file until all blocks are processed, specifically including: assigning the calculation coordinate starting position to point2 as a pointer to the second one-dimensional array, sequentially reading the element value of the second one-dimensional array with index (point2 + 1) as the index of the current inflection point, the element value of the current inflection point with index (point2 + 2) as the X coordinate of the current inflection point, and the element value of the current inflection point with index (point2 + 3) as the Y coordinate of the current inflection point; moving the pointer point2 forward to continue reading the information of the next inflection point until all blocks are read.

7. A device for batch and rapid conversion of coordinate formats in a mineral resource reserve database, characterized in that, Coordinates used to convert coordinate pairs to string format include: The text acquisition module is used to acquire a preset text file that stores the coordinates of the target mining area or mine. The mining area information positioning module is used to locate the row containing the mining area number in the preset text file, which is designated as the starting row; and to read the mining area number, registration classification number, and coordinate field identifier from the starting row and write them into the first three columns of the same row of the third two-dimensional array. The string writing module is used to read subsequent lines after the starting line, convert the coordinate pairs in the subsequent lines into strings and concatenate them until a preset end character is read. The string at this point is written into the fourth column of the row where the currently located mining area number is located in the third two-dimensional array. The preset end character is used to indicate that all block information contained in the currently located mining area number ends here. The table retrieval module is used to retrieve the coordinate management table of the target mining area or mine from the mineral resource reserves database; The table update module is used to traverse all row coordinate records in the coordinate management table, and search in the third two-dimensional array using the mining area number and registration classification number in a single row coordinate record as keywords. If a matching result exists, the string in the fourth column of the matching row replaces the range coordinate string and calculated coordinate string in the coordinate management table to update the coordinate management table.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 5.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.