Rapid retrieval method and system for power grid engineering survey data
By designing combined spatio-temporal feature Rowkey and Elasticsearch secondary retrieval in power grid engineering survey data, the problem of low retrieval efficiency of power grid engineering survey data is solved, fast and accurate retrieval of multiple types of data is achieved, and the efficiency of power grid data applications is met. Query requirements.
Patent Information
- Application Number
- CN202410155160.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-02-04
AI Technical Summary
Existing technologies cannot effectively meet the demand for rapid retrieval of power grid engineering survey data, especially because the data sources are diverse, large in volume, and have strong temporal and spatial attributes. Traditional methods are difficult to make full use of these characteristics, resulting in low retrieval efficiency.
A fast retrieval method for power grid engineering survey data is designed. It uses the joint spatio-temporal feature Rowkey based on HBase and HDFS for structured data retrieval, and uses Elasticsearch for secondary retrieval. Combined with HDFS to achieve unstructured data retrieval, making full use of time. and spatial information to improve retrieval efficiency.
It achieves fast and accurate retrieval of various types of power grid engineering survey data, maintains efficient retrieval performance despite large and continuous growth in data volume, and meets the data support needs for power grid planning, construction, and operation and maintenance decision-making.
Smart Images

Figure CN118013090B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid data processing methods, and in particular to a fast retrieval method and system for power grid engineering survey data. Background Art
[0002] With the continuous expansion and development of the power system, the power grid engineering survey data has also been continuously expanded, providing data support for the design, construction, operation and maintenance of power grid engineering. The efficient organization and management of power grid engineering survey data is crucial. However, the sources of power grid engineering survey data are wide, the types are diverse, and the data volume is huge. Traditional retrieval methods can no longer meet the needs of rapid data acquisition. There is an urgent need for a rapid retrieval method for power grid engineering survey data to quickly and automatically obtain the required data, improve data processing efficiency, and provide strong data support for power grid planning, construction, and operation and maintenance decision-making.
[0003] Power grid engineering survey data has complex data characteristics, which can be mainly reflected in the following three points: (1) multi-source heterogeneity. Power grid engineering survey data comes from a wide range of sources and in various formats, including remote sensing images, sensor data (such as point clouds and tilt data), basic survey data, etc.; (2) the data volume is huge and continues to grow. Power grid engineering survey data covers a large area, and the survey content includes key buildings, topography, hydrology and meteorology, etc. The amount of data generated is huge and shows a continuous growth trend; (3) it has strong temporal and spatial attribute characteristics. Power grid engineering survey data is usually collected at a specific time and geographical location, and has a strong spatiotemporal correlation.
[0004] Existing data retrieval methods can be roughly divided into the following categories: (1) Spatial index retrieval, which organizes and stores spatial data according to certain rules for fast retrieval and query. Common ones include: 1) Binary tree spatial index. Binary tree is a relatively simple indexing algorithm compared to other indexing methods. There are many nodes, but each node has at most two leaf nodes. This algorithm is suitable for situations where spatial data is evenly distributed. Classic ones include KDB tree, T tree and LSD tree; 2) B-tree spatial index. The spatial index of B-tree is derived from the algorithm of binary tree. It is composed of index nodes and leaf nodes, and can quickly locate the location of data. The nodes of B-tree are not limited to two nodes. It is a self-balancing tree structure and is suitable for ordered data; 3) B+ tree is a variant of B-tree. It puts the index on the leaf node, which improves the efficiency of range query and traversal. It is often used in database management systems; 4) Hash index: Hash index uses hash function to map key value to a fixed storage location. It is suitable for equal value query, but does not support range query. (2) Distributed database retrieval: Through distributed query processing and data replication strategies, high availability and high performance data retrieval are achieved. Common search engines include: 1) Hadoop is a distributed storage and computing framework. Based on HDFS, data can be stored on multiple nodes and parallel computing can be performed through MapReduce; 2) Spark is another popular distributed computing framework that supports in-memory computing and higher-level data processing, such as Spark SQL, Spark Streaming, and MLlib. (3) Relational database retrieval: Using SQL query language for retrieval, efficient data retrieval is achieved by building indexes and optimizing query statements. (4) Graph database retrieval: Graph databases are used to store and process graph data. Nodes are used to represent entities, and edges are used to represent relationships between entities. (5) Full-text search: Through indexing and word segmentation, efficient retrieval of text data is achieved. Common search engines include Elasticsearch and Solr. (6) Content-based retrieval technology is used to process unstructured data, such as images, audio, and video. By extracting feature vectors of data, similarity calculation is used to quickly retrieve similar data.
[0005] Although the existing data retrieval methods have performed well in many fields, they have not fully adapted to the characteristics of power grid engineering survey data, resulting in poor adaptability to power grid engineering survey data. Therefore, a more targeted power grid engineering data fast retrieval method is needed to better meet the retrieval needs of power grid engineering survey data. Summary of the invention
[0006] Aiming at the defects of the existing data retrieval method and designed according to the characteristics of power grid engineering survey data, the present invention proposes a fast retrieval method and system for power grid engineering survey data, so as to realize fast and accurate retrieval of power grid engineering survey data.
[0007] In order to solve the above technical problems, the present invention provides the following solutions:
[0008] A method for quickly retrieving power grid engineering survey data comprises the following steps:
[0009] Data is classified based on the source and type of power grid engineering survey data, and HBase database is used to store structured data and HDFS is used to store unstructured data;
[0010] Design the Rowkey of joint spatiotemporal features. The Rowkey of joint spatiotemporal features is composed of data type code, space code, space sorting code, time code and random identification code, with a total of 86 characters. HBase structured data retrieval is implemented based on the Rowkey of joint spatiotemporal features.
[0011] Perform secondary retrieval of HBase structured data based on Elasticsearch to achieve multi-condition structured data retrieval;
[0012] Unstructured data retrieval is realized based on HDFS, and finally the retrieval of power grid engineering survey data is completed based on Elasticsearch, HBase and HDFS.
[0013] Optionally, the designing of a Rowkey combining spatiotemporal features comprises the following steps:
[0014] Set the data type of power grid engineering survey and obtain the data type code;
[0015] Perform Hilbert grid division on power grid engineering survey data to obtain data space code;
[0016] Based on the time information of the power grid engineering survey data, the data time code is obtained;
[0017] Use hash function encryption algorithm to generate random data identification code;
[0018] The data type code, space code, time code and random identification code are connected in sequence to obtain the Rowkey of the joint spatiotemporal features.
[0019] Optionally, the step of setting the data type of the power grid engineering survey and obtaining the data type code includes:
[0020] The power grid engineering survey data is divided into four types, namely remote sensing image data, basic survey data, sensor data and three-dimensional model data. The remote sensing image data type code is 0, the basic survey data type code is 1, the sensor data type code is 2, and the three-dimensional model data type code is 3.
[0021] Optionally, the Hilbert grid division of the power grid engineering survey data to obtain the data space code comprises the following steps:
[0022] Firstly, the power grid engineering survey data is mapped onto the one-dimensional Hilbert curve according to the spatial range, and then the grid is divided by the grid iterative quartering method. The first-level grid is divided into 4 grids, which are numbered 0, 1, 2, and 3 in sequence according to the direction of the Hilbert curve. If there are many objects in a grid in the m-th level grid, the grid is divided into the m+1th level iterative division. The grid code increases by one bit for each level of division, and so on. The highest grid order is 15, that is, after the 15th level grid is divided, the grid is no longer divided, thereby obtaining the spatial code;
[0023] The spatial code is a Hilbert curve grid code, ensuring that the code length of each grid does not exceed the set maximum length. For Hilbert codes less than 15 bits, a placeholder "a" is added after the code to make it 15 bits.
[0024] If there are multiple objects in the grid, they are sorted according to their distance from the center of the grid and encoded into a spatial sort code with numbers. The sort code indicates the number of objects in the grid and their distance. The smaller the sort code, the closer it is to the center of the grid. If the code is less than 3 digits, it will be padded with 0 before encoding to make it 3 digits.
[0025] Optionally, obtaining the data time code based on the time information of the power grid engineering survey data comprises the following steps:
[0026] The data generation time based on the timestamp record of the power grid engineering survey data is converted into a timestamp value through datetime in Python. If the number of digits is less than 10, 0 is added in front to make it full to 10 digits.
[0027] Optionally, the HBase structured data secondary retrieval based on Elasticsearch to implement multi-condition structured data retrieval includes the following steps:
[0028] Based on parameters such as node disk usage, shard size, and the number of existing shards on the node, a sharding strategy is designed to dynamically adjust the number of index shards; based on the corresponding Rowkey of ElasticSearch, qualified results are retrieved in HBase.
[0029] Optionally, designing a sharding strategy based on parameters such as node disk usage, shard size, and the number of existing shards of a node to dynamically adjust the number of index shards includes the following steps:
[0030] Let the data volume be D, the total number of nodes be n, and the disk usage rate of a node i be rate i, the shard size is Shard, and the number of shards that a node i has is ShardNum i , the number of shards that can be placed on a node i is ShardNum i ', the initial number of shards is ShardNum, and the maximum number of shards allowed for a node i is maxShardNum i ;
[0031] (1) Obtaining rate through JAVA interface i and ShardNum i When rate i At the same time, satisfy the rate i ≤85% and ShardNum i <maxShardNum i , then the current node is an available node; and so on, each node is judged until node n; when the last node is judged, the number of available nodes is accumulated to obtain the total number of initial available nodes;
[0032] (2) Shard should not exceed 25G, and the initial number of primary shards is
[0033] (3) Divide ShardNum by the total number of initially available nodes obtained in (1) to get the number of shards that can be placed on a node i: ShardNum i ';
[0034] (4) Determine ShardNum i 'With maxShardNum i The size of , if the number of shards of node i is ShardNum i ”=ShardNum i +ShardNum i ', ShardNum i '≥maxShardNum i Then adjust the node to an unavailable state;
[0035] (5) Calculate the number of shards for each available node one by one.
[0036] Optionally, based on the rowkey corresponding to ElasticSearch, search HBase for results that meet the conditions, including:
[0037] Each unit doc of ElasticSearch corresponds to a RowKey in HBase; each Rowkey has multiple column families to represent different element values; the fields in the column family are indexed, and the eligible RowKeys are quickly filtered through ElasticSearch's multi-condition search, and the qualified results are retrieved in HBase through the specified RowKey to achieve efficient retrieval of massive power grid engineering survey data.
[0038] Based on the above system in the present invention, the present invention further provides a rapid retrieval system for power grid engineering survey data, including:
[0039] The power grid engineering survey data classification module is used to classify data based on the source and type of power grid engineering survey data, using the HBase database to store structured data and HDFS to store unstructured data;
[0040] The structured data retrieval module is used to design the Rowkey of the joint spatiotemporal features. The Rowkey of the joint spatiotemporal features is composed of a data type code, a space code, a space sorting code, a time code, and a random identification code, with a total of 86 characters. HBase structured data retrieval is implemented based on the Rowkey of the joint spatiotemporal features.
[0041] Multi-condition structured data retrieval module, used for secondary retrieval of HBase structured data based on Elasticsearch, realizing multi-condition structured data retrieval;
[0042] The unstructured data retrieval module is used to implement unstructured data retrieval based on HDFS, and ultimately complete the retrieval of power grid engineering survey data based on Elasticsearch, HBase, and HDFS.
[0043] The beneficial effects of adopting the above technical solution are: (1) It realizes the retrieval of power grid engineering survey data from multiple sources and types, such as image data, basic survey data, point cloud data, and three-dimensional model data. (2) It can meet the rapid retrieval of large-scale power grid engineering survey data, and can still achieve efficient retrieval when the amount of data continues to increase. (3) Considering that power grid engineering survey data has strong time and space attributes, this method makes full use of time and geographical location information to achieve fast and accurate data retrieval.
[0044] In summary, the method can realize fast and accurate retrieval operation of power grid engineering survey data, bringing more convenient and efficient data query experience to the power grid data application field. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0046] Figure 1 is a main flow chart of the method described in the embodiment of the present invention;
[0047] Figure 2 It is a Rowkey composition diagram of the combined spatiotemporal features in the method described in the embodiment of the present invention;
[0048] Figure 3 is the Hilbert grid division diagram in the method described in the embodiment of the present invention;
[0049] Figure 4 It is a diagram of the data time code composition in the method described in the embodiment of the invention;
[0050] Figure 5 It is a schematic diagram of performing secondary retrieval of HBase structured data based on ElasticSearch in the method described in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0053] like Figure 1 As shown, in general, the embodiment of the present invention discloses a method for quickly retrieving power grid engineering survey data, including the following steps:
[0054] S1: Data is classified based on the source and type of power grid engineering survey data, and HBase database is used to store structured data and HDFS is used to store unstructured data;
[0055] S2: Design the Rowkey of joint spatiotemporal features. The Rowkey of joint spatiotemporal features is composed of data type code, space code, space sorting code, time code and random identification code, with a total of 86 characters. HBase structured data retrieval is implemented based on the Rowkey of joint spatiotemporal features.
[0056] S3: Perform secondary retrieval of HBase structured data based on Elasticsearch to achieve multi-condition structured data retrieval;
[0057] S4: Implement unstructured data retrieval based on HDFS, and finally complete the rapid retrieval of power grid engineering survey data based on Elasticsearch, HBase, and HDFS.
[0058] The above method is described in detail below with specific steps:
[0059] Step S1 classifies data based on the source and type of power grid engineering survey data, uses HBase database to store structured data, and uses HDFS to store unstructured data:
[0060] The method classifies the data based on the source and type of power grid engineering survey data, and divides the power grid engineering survey data into the following four categories, as shown in Table 1:
[0061] Table 1 Classification of power grid engineering survey data
[0062]
[0063] The HBase database is used to store structured data generated during power grid surveys, such as basic survey data; HDFS stores unstructured data such as image data, point cloud data, and three-dimensional model data.
[0064] Furthermore, the power grid engineering survey data content includes satellite images, oblique photogrammetry images, BIM data, geological, hydrological and meteorological data, geographic base maps, vector graphics and other two-dimensional data. The formats include xml, obj, pgf, shp, tiff and other multi-format data types.
[0065] Table 2 Content and format of power grid engineering survey data
[0066]
[0067] Step S2: Rowkey design combining spatiotemporal features
[0068] The Rowkey of the combined spatiotemporal features is composed of a data type code, a space code, a space sorting code, a time code, and a random identification code, with a total of 86 characters. HBase structured data retrieval is implemented based on the Rowkey of the combined spatiotemporal features. HBase query data needs to be retrieved according to the Rowkey, and the design of the Rowkey determines the performance of the retrieval. According to the characteristics of the power grid engineering survey data that have time and space attribute characteristics, the present invention proposes a Rowkey design method of the combined spatiotemporal features, which combines the time and space information of the power grid engineering survey data. On the one hand, similar data can be closer in physical storage and reduce the amount of data transmission on the network; on the other hand, when searching the power grid engineering survey data, the data in the area can be located according to the time dimension and the space dimension, avoiding traversing all the data and improving data processing efficiency. The composition diagram of the Rowkey of the combined spatiotemporal features is as follows: Figure 2 shown.
[0069] Each type of data will have the data collection time and geographic location when it is acquired. Encoding the time and spatial location of the data into the Rowkey can make the query more efficient. For example, if you want to query the power grid data within a specific time period, you can locate the location of the required data by encoding the time information in the Rowkey. The Rowkey of the combined spatiotemporal features is composed of the data type code, space code, space sorting code, time code, and random identification code, totaling 86 characters. Its function is to make full use of the time and space attributes of power grid engineering survey data, which can improve efficiency in both storage and retrieval.
[0070] Step S2.1 Set the data type of power grid engineering survey and obtain the data type code
[0071] The data types are the four types of power grid engineering survey data in Table 1, where remote sensing image data is 0, basic survey data is 1, sensor data is 2, and three-dimensional model data is 3.
[0072] Step 2.2 Perform Hilbert grid division on the power grid engineering survey data to obtain the data space code
[0073] The power grid engineering survey data is divided into Hilbert grids. The specific method is as follows Figure 3As shown in the figure, the power grid engineering survey data is first mapped to the one-dimensional Hilbert curve according to the spatial range (such as longitude and latitude coordinates). Then the grid is divided by the grid iterative quartering method. The first-level grid is divided into 4 grids, which are numbered 0, 1, 2, and 3 in the direction of the Hilbert curve. If there are many objects in a grid in the m-th level grid, the grid is divided into the m+1th level iterative division, and the grid code increases by one bit for each level of division. By analogy, the highest order of the grid is 15, that is, after dividing the 15th level grid, the grid is no longer divided, thereby obtaining the spatial code.
[0074] The spatial code is a Hilbert curve grid code, ensuring that the code length of each grid does not exceed the set maximum length. For Hilbert codes less than 15 bits, a placeholder "a" is added after the code to make it full to 15 bits.
[0075] There are many objects in the grid, and they are sorted according to their distance from the center of the grid, and the spatial sort code is encoded with numbers. The sort code can represent the number of objects in the grid and their distance. The smaller the sort code, the closer it is to the center of the grid. If the number is less than 3 digits, it is padded with 0 before encoding to make it 3 digits.
[0076] Step S2.3: Based on the time information of the power grid engineering survey data, obtain the data time code
[0077] According to the time information of the power grid engineering survey data (xxxx year xx month xx day xx minutes xx seconds), it is converted into a 10-digit timestamp value through datetime in Python, where g is a 1-digit time granularity identification code g (g∈1,2,3,4,5,6), and the value corresponds to year, month, day, hour, minute, second). When applied, it can be converted according to the required time granularity. If the number of digits is less than 10, add 0 in front to make it 10 digits. The timestamp diagram is as follows Figure 4 shown.
[0078] Step S2.4 uses the hash function encryption algorithm to generate a random data identification code
[0079] The hash function encryption algorithm (SHA3-224) is used to generate a random identification code of 56 irregular letters and numbers.
[0080] Step S2.5 connects the data type code, space code, time code and random identification code in sequence to obtain the Rowkey of the joint spatiotemporal features.
[0081] Step S3 performs secondary retrieval of HBase structured data based on Elasticsearch to achieve multi-condition structured data retrieval
[0082] HBase does not natively support secondary indexes, and index failure may occur when querying non-primary keys. Therefore, this patent proposes to implement multi-condition search based on Elasticsearch's secondary search to make up for the deficiency of HBase's difficulty in supporting multi-dimensional queries.
[0083] Step S3.1: Design a sharding strategy based on the node disk usage, shard size, and number of existing shards on the node, and dynamically adjust the number of index shards.
[0084] The present invention proposes a dynamic index slice allocation method for native Elasticsearch. The specific method is as follows: let the data volume be D, the total number of nodes be n, and the disk usage rate of a node i be rate i , the shard size is Shard, and the number of shards that a node i has is ShardNum i , the number of shards that can be placed on a node i is ShardNum i ', the initial number of shards is ShardNum, and the maximum number of shards allowed for a node i is maxShardNum i . Which rate i It should be less than 85% and the Shard size should not exceed 25G.
[0085] (1) Obtaining rate through JAVA interface i and ShardNum i When rate i At the same time, satisfy the rate i ≤85% and ShardNum i <maxShardNum i , then the current node is an available node. And so on, judge each node until node n. When the last node is judged, add up the number of available nodes to get the total number of initial available nodes.
[0086] (2) Shard should not exceed 25G, and the initial number of primary shards can be obtained as follows:
[0087] (3) Divide ShardNum by the total number of initially available nodes obtained in (1) to get the number of shards that can be placed on a node i: ShardNum i '.
[0088] (4) Determine ShardNum i 'With maxShardNum i The size of , if the number of shards of node i is ShardNum i ”=ShardNum i +ShardNum i';ShardNum i '≥maxShardNum i The node is adjusted to an unavailable state.
[0089] (5) Calculate the number of shards for each available node one by one.
[0090] Step S3.2 retrieves the results that meet the conditions in HBase based on the Rowkey corresponding to ElasticSearch
[0091] Each unit doc of ElasticSearch corresponds to the RowKey in HBase. Each Rowkey has multiple column families to represent different element values. This patent is divided into four column families, namely remote sensing image column family, basic survey column family, sensor column family and three-dimensional model column family, including image type, geological type, model type, wind speed, humidity and other elements. Index the fields in the column family, and quickly filter to qualified RowKey through ElasticSearch's multi-condition search, and retrieve qualified results in HBase through the specified RowKey to achieve efficient retrieval of massive power grid engineering survey data. Figure 5 As shown, according to N1=N15, the corresponding Rowkey is searched in the retrieval data, and the value of N2 can be found according to the value of Rowkey.
[0092] Step 4 implements unstructured data retrieval based on HDFS, and finally completes the rapid retrieval of power grid engineering survey data based on Elasticsearch, HBase, and HDFS.
[0093] The present invention is different from the prior art in that: (1) in view of the characteristics of power grid engineering survey data, a Rowkey combining spatiotemporal features is designed to make full use of time and geographic location information to achieve fast and accurate retrieval of power grid engineering survey data; (2) a dynamic index slice allocation method for Elasticsearch is designed to ensure that as the amount of data grows, more nodes can be easily added to balance the load; (3) a secondary search based on Elasticsearch is proposed to achieve multi-condition retrieval to make up for the deficiency that HBase is difficult to support multi-dimensional queries. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and interpreted scripting language JavaScript.
[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0097] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0098] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
[0099] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.
Claims
1. A rapid retrieval method for power grid engineering survey data, characterized in that: The steps include: The power grid engineering survey data is classified according to data source and type, and the HBase database is used to store structured data and HDFS is used to store unstructured data; Design the Rowkey of joint spatiotemporal features. The Rowkey of joint spatiotemporal features is composed of data type code, space code, space sorting code, time code and random identification code, with a total of 86 characters. HBase structured data retrieval is implemented based on the Rowkey of joint spatiotemporal features. Perform secondary retrieval of HBase structured data based on Elasticsearch to achieve multi-condition structured data retrieval; Unstructured data retrieval is realized based on HDFS, and finally the rapid retrieval of power grid engineering survey data is completed based on Elasticsearch, HBase, and HDFS; The design of the Rowkey combining the spatiotemporal features includes the following steps: Set the data type of power grid engineering survey and obtain the data type code; Perform Hilbert grid division on power grid engineering survey data to obtain data space code; Based on the time information of the power grid engineering survey data, the data time code is obtained; Use hash function encryption algorithm to generate random data identification code; Connect the data type code, space code, space order code, time code and random identification code in sequence to obtain the Rowkey of the joint spatiotemporal features; The step of setting the data type of the power grid engineering survey and obtaining the data type code includes: The power grid engineering survey data is divided into four types, namely remote sensing image data, basic survey data, sensor data and three-dimensional model data. The remote sensing image data type code is 0, the basic survey data type code is 1, the sensor data type code is 2, and the three-dimensional model data type code is 3; The Hilbert grid division of the power grid engineering survey data to obtain the data space code includes the following steps: Firstly, the power grid engineering survey data is mapped onto the one-dimensional Hilbert curve according to the spatial range, and then the grid is divided by the grid iterative quartering method. The first-level grid is divided into 4 grids, which are numbered 0, 1, 2, and 3 in sequence according to the direction of the Hilbert curve. If there are many objects in a grid in the m-th level grid, the grid is divided into the m+1th level iterative division. The grid code increases by one bit for each level of division, and so on. The highest grid order is 15, that is, after the 15th level grid is divided, the grid is no longer divided, thereby obtaining the spatial code; The spatial code is a Hilbert curve grid code, ensuring that the code length of each grid does not exceed the set maximum length. If the Hilbert code is less than 15 bits, a placeholder "a" is added after the code to make it 15 bits. If there are multiple objects in the grid, they are sorted according to their distance from the center of the grid and coded into a spatial sort code with numbers. The sort code indicates the number of objects in the grid and their distance. The smaller the sort code, the closer it is to the center of the grid. If the code is less than 3 digits, it is padded with 0 before coding to make it 3 digits. The method of obtaining the data time code based on the time information of the power grid engineering survey data comprises the following steps: The data generation time recorded by the timestamp of the power grid engineering survey data is converted into a timestamp value through datetime in Python. If the number of digits is less than 10, add 0 in front to make it full to 10 digits. The method of performing secondary retrieval of HBase structured data based on Elasticsearch to realize multi-condition structured data retrieval includes the following steps: Design sharding strategies based on node disk usage, shard size, and number of existing shards on a node, and dynamically adjust the number of index shards; retrieve qualified results in HBase based on the corresponding Rowkey of ElasticSearch; The method of designing a sharding strategy based on the node disk usage, shard size, and the number of existing shards of the node and dynamically adjusting the number of index shards includes the following steps: Let the data volume be D, the total number of nodes be n, and the disk usage rate of a node i be rate i , the shard size is Shard, and the number of shards that a node i has is ShardNum i , the number of shards that can be placed on a node i is ShardNum i ' The initial number of shards is ShardNum, and the maximum number of shards allowed for a node i is maxShardNum i ; (1) Obtaining rate through JAVA interface i and ShardNum i When rate i At the same time, satisfy the rate i ≤85% and ShardNum i <maxShardNum i , then the current node is an available node; and so on, each node is judged until node n; when the last node is judged, the number of available nodes is accumulated to obtain the total number of initial available nodes; (2) Shard should not exceed 25G, and the initial number of primary shards is ; (3) Divide ShardNum by the total number of initially available nodes obtained in (1) to get the number of shards that can be placed on a node i: ShardNum i ' ; (4) Determine ShardNum i ' with maxShardNum i The size of , if the number of shards of node i is ShardNum i '' =ShardNum i + ShardNum i ' , ShardNum i ' ≥maxShardNum i Then adjust the node to an unavailable state; (5) Calculate the number of shards for each available node one by one; Based on the Rowkey corresponding to ElasticSearch, search HBase for results that meet the conditions, including: Each unit doc of ElasticSearch corresponds to a RowKey in HBase; each Rowkey has multiple column families to represent different element values; the fields in the column family are indexed, and the eligible RowKeys are quickly filtered through ElasticSearch's multi-condition search, and the qualified results are retrieved in HBase through the specified RowKey to achieve efficient retrieval of massive power grid engineering survey data.
2. A rapid retrieval system for power grid engineering survey data, the system using the rapid retrieval method for power grid engineering survey data as claimed in claim 1, characterized in that: include: The power grid engineering survey data classification module is used to classify data based on the source and type of power grid engineering survey data, using the HBase database to store structured data and HDFS to store unstructured data; The structured data retrieval module is used to design the Rowkey of the joint spatiotemporal features. The Rowkey of the joint spatiotemporal features is composed of a data type code, a space code, a space sorting code, a time code, and a random identification code, with a total of 86 characters. HBase structured data retrieval is implemented based on the Rowkey of the joint spatiotemporal features. Multi-condition structured data retrieval module, used for secondary retrieval of HBase structured data based on Elasticsearch, realizing multi-condition structured data retrieval; The unstructured data retrieval module is used to implement unstructured data retrieval based on HDFS, and ultimately complete the retrieval of power grid engineering survey data based on Elasticsearch, HBase, and HDFS.
