Method and system for weather space position mapping and querying of weather data
By mapping latitude and longitude into binary sequences and combining them with meteorological feature information and layer height encoding, the problem of low efficiency in storing and querying massive energy and meteorological data has been solved, achieving efficient data storage and fast querying, and improving business effectiveness.
Patent Information
- Application Number
- CN202211157929.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-22
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-09-22
AI Technical Summary
Existing technologies cannot efficiently store and query massive amounts of energy and meteorological data. Traditional databases are inadequate in processing large-scale unstructured data and lack effective data storage and compression mechanisms, resulting in slow data extraction speeds.
A binary search method is used to map latitude and longitude into binary sequences, which are then cross-combined and converted into decimal numbers. Combined with meteorological feature information and layer height coding, a mapping information of meteorological spatial location is formed, which can then be used for querying.
It effectively reduces data storage space usage, improves data extraction speed, supports fast querying and data mining, and ensures the effectiveness and ease of use of energy and meteorological data services.
Smart Images

Figure CN115455084B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of energy meteorological data processing, and in particular relates to a method and system for mapping and querying meteorological spatial location data. Background Technology
[0002] Current energy and meteorological data is characterized by its large volume and high latitude. There are 3,267,600 latitude and longitude grid points across the country at a single moment (3×3 km), with 14 existing feature information points. Some feature information contains multiple layers of data, with a layer height of about 10 layers. This data volume is a fatal challenge for traditional databases. Current technologies can only store large amounts of binary, unstructured energy and meteorological data. Compared to mainstream geographic databases, they lack efficient data storage mechanisms, lack data compression mechanisms, and waste space with numerous primary key indexes, failing to meet the performance requirements for second-level data retrieval. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention proposes a technical solution for a meteorological spatial location mapping and query method for meteorological data, thereby resolving the aforementioned technical issues.
[0004] The first aspect of this invention discloses a method for meteorological spatial location mapping and querying of meteorological data, the method comprising:
[0005] Step S1: Apply the binary search method to map the latitude into a binary sequence to obtain the latitude binary sequence;
[0006] Step S2: Apply the binary search method to map longitude into a binary sequence to obtain the longitude binary sequence;
[0007] Step S3: Cross-combine the latitude binary sequence and the longitude binary sequence to obtain a cross sequence;
[0008] Step S4: Convert the preset number of digits k in the cross sequence into decimal numbers;
[0009] Step S5: Convert the decimal number to Base2. k Encode to obtain the mapping information of geographic coordinates;
[0010] Step S6: Combine the meteorological feature information, layer height, and the encoding of the geographic coordinates to obtain the mapping information of meteorological spatial location;
[0011] Step S7: Query the meteorological spatial location using the meteorological spatial mapping information.
[0012] According to the method of the first aspect of the present invention, in step S1, the method of applying the binary search method to map latitude into a binary sequence to obtain a latitude binary sequence includes:
[0013] Let the specified latitude value be 'a';
[0014] Set the initial maximum and minimum latitude values for the loop calculation to the maximum and minimum latitude values:
[0015]
[0016]
[0017] Calculate the median latitude:
[0018]
[0019] Calculate latitude intervals:
[0020]
[0021] Calculate the maximum and minimum latitude values for the next iteration:
[0022] like
[0023] n i =1
[0024] but
[0025]
[0026]
[0027] like
[0028] n i =0
[0029] but
[0030]
[0031]
[0032] After iterating the calculation a predetermined number of times N, the latitude is mapped into a binary sequence n0, n1, n2...n consisting of latitude intervals. N ;
[0033] in, This represents the maximum latitude value during this iteration of calculations. This represents the minimum latitude value during this iteration of calculations. This represents the maximum latitude value during the next iteration of the calculation. This will be the minimum latitude value in the next iteration of the calculation. n represents the median latitude value during this iteration of calculations. i This represents the latitude range for this iteration of calculation.
[0034] According to the method of the first aspect of the present invention, in step S2, the method of applying the binary search method to map longitude into a binary sequence to obtain a longitude binary sequence includes:
[0035] Let the specified longitude value be b;
[0036] Set the initial maximum and minimum longitude values for the loop calculation to the maximum and minimum longitude values:
[0037]
[0038]
[0039] Calculate the median longitude:
[0040]
[0041] Calculate longitude intervals:
[0042]
[0043] Calculate the maximum and minimum longitude values for the next iteration:
[0044] like
[0045] m i =1
[0046] but
[0047]
[0048]
[0049] like
[0050] m i =0
[0051] but
[0052]
[0053]
[0054] After iteratively calculating a predetermined number of times N, the longitude is mapped into a binary sequence m0, m1, m2...m consisting of longitude intervals. N ;
[0055] in, This represents the maximum longitude value during this iteration of calculations. This represents the minimum longitude value during this iteration of calculations. This represents the maximum longitude value during the next iteration of the calculation. This will be the minimum longitude value in the next iteration of the calculation. This is the intermediate longitude value during this iterative calculation, m. i This represents the longitude range for this cycle of calculation.
[0056] According to the method of the first aspect of the present invention, in step S6, the method of combining the encoding of meteorological feature information, layer height, and geographic coordinate location to obtain the mapping information of meteorological spatial location includes:
[0057] The characteristic information of meteorological conditions is represented by three digits from 0 to 9, thus obtaining the encoding of the characteristic information;
[0058] The floor height is represented by three digits from 0 to 9, thus obtaining the floor height code.
[0059] The encoding of the feature information, the encoding of the floor height, and the encoding of the geographic coordinates are combined into a string to obtain the mapping information of the meteorological spatial location.
[0060] According to the method of the first aspect of the present invention, in step S6, the method for obtaining the encoding of the feature information by using three digits from 0 to 9 to represent the meteorological feature information includes:
[0061] The feature information rh represents relative humidity, and the feature information rh is encoded as 001.
[0062] The feature information t2m represents the air temperature at 2 meters above the ground, and the code for the feature information t2m is 002;
[0063] The feature information pres represents the surface air pressure, and the code of the feature information pres is 003;
[0064] The feature information pr represents the total precipitation, and the feature information pr is encoded as 004.
[0065] The feature information wd represents the wind direction, and the feature information wd is encoded as 005.
[0066] The feature information ws represents wind speed, and the feature information ws is encoded as 006.
[0067] The feature information swdown represents irradiance, and the feature information swdown is encoded as 007.
[0068] The feature information cloud refers to cloud cover, and the feature information cloud is encoded as 008.
[0069] The feature information ad represents air density, and the feature information ad is encoded as 009.
[0070] The feature information u represents the horizontal wind speed, and the feature information u is encoded as 010.
[0071] The feature information v represents the vertical wind speed, and the feature information v is encoded as 011.
[0072] The feature information hgt represents altitude, and the feature information hgt is encoded as 012.
[0073] The feature information lng represents longitude, and the feature information lng is encoded as 013.
[0074] The feature information lat represents latitude, and the feature information lat is encoded as 014.
[0075] According to the method of the first aspect of the present invention, in step S6, the method of obtaining the encoding of the layer height by using three digits from 0 to 9 to represent the layer height includes:
[0076] The code for a floor height of 0 to 2 meters above the ground is 001;
[0077] The code for a floor height of 5 to 7 meters above the ground is 002;
[0078] The code for a floor with a height of about 10 meters above the ground is 003;
[0079] The code for a floor with a height of about 30 meters above the ground is 004;
[0080] The code for a floor with a height of about 50 meters above the ground is 005;
[0081] The code for a floor with a height of about 80 meters above the ground is 006;
[0082] The code for a floor with a height of approximately 100 meters above the ground is 007;
[0083] The code for a floor with a height of approximately 150 meters above the ground is 008.
[0084] According to the method of the first aspect of the present invention, in step S7, the method of querying meteorological spatial location through the meteorological spatial mapping information includes:
[0085] First, the meteorological feature information and layer height are determined based on the encoding of the feature information and the encoding of the layer height in the meteorological spatial mapping information;
[0086] Then, by using the encoding of the geographic coordinates in the meteorological spatial mapping information, the region represented by the encoding of the geographic coordinates and its eight predefined regions can be queried.
[0087] The predefined eight regions include:
[0088] The latitude binary sequence of the encoded geographic coordinates is set to S. a The binary sequence of longitude is S b The eight predefined regions are (S a -1,S b +1), (S a ,S b +1), (S a +1,S b +1), (S a -1,S b ), (S a +1,S b ), (S a -1,S b -1), (S a ,S b -1) and (S a +1,S b -1).
[0089] A second aspect of this invention discloses a meteorological spatial location mapping and query system for meteorological data, the system comprising:
[0090] The first processing module is configured to apply a binary search method to map latitude into a binary sequence to obtain a latitude binary sequence.
[0091] The second processing module is configured to apply a binary search method to map longitude into a binary sequence to obtain a longitude binary sequence.
[0092] The third processing module is configured to cross-combine the latitude binary sequence and the longitude binary sequence to obtain a cross sequence.
[0093] The fourth processing module is configured to convert a preset number of digits k in the cross sequence into a decimal number.
[0094] The fifth processing module is configured to convert the decimal number into Base2. k Encode to obtain the mapping information of geographic coordinates;
[0095] The sixth processing module is configured to combine the meteorological feature information, the layer height, and the encoding of the geographic coordinates to obtain the mapping information of the meteorological spatial location.
[0096] The seventh processing module is configured to query the meteorological spatial location through the meteorological spatial mapping information.
[0097] According to a system of a second aspect of the present invention, the first processing module is configured to, wherein the application of a binary search method to map latitude into a binary sequence to obtain a latitude binary sequence comprises:
[0098] Let the specified latitude value be 'a';
[0099] Set the initial maximum and minimum latitude values for the loop calculation to the maximum and minimum latitude values:
[0100]
[0101]
[0102] Calculate the median latitude:
[0103]
[0104] Calculate latitude intervals:
[0105]
[0106] Calculate the maximum and minimum latitude values for the next iteration:
[0107] like
[0108] n i =1
[0109] but
[0110]
[0111]
[0112] like
[0113] n i =0
[0114] but
[0115]
[0116]
[0117] After iterating the calculation a predetermined number of times N, the latitude is mapped into a binary sequence n0, n1, n2...n consisting of latitude intervals. N ;
[0118] in, This represents the maximum latitude value during this iteration of calculations. This represents the minimum latitude value during this iteration of calculations. This represents the maximum latitude value during the next iteration of the calculation. This will be the minimum latitude value in the next iteration of the calculation. n represents the median latitude value during this iteration of calculations. i This represents the latitude range for this iteration of calculation.
[0119] According to a system of a second aspect of the present invention, the second processing module is configured to, wherein the application of the binary search method to map longitude into a binary sequence to obtain a longitude binary sequence includes:
[0120] Let the specified longitude value be b;
[0121] Set the initial maximum and minimum longitude values for the loop calculation to the maximum and minimum longitude values:
[0122]
[0123]
[0124] Calculate the median longitude:
[0125]
[0126] Calculate longitude intervals:
[0127]
[0128] Calculate the maximum and minimum longitude values for the next iteration:
[0129] like
[0130] m i =1
[0131] but
[0132]
[0133]
[0134] like
[0135] m i =0
[0136] but
[0137]
[0138]
[0139] After iteratively calculating a predetermined number of times N, the longitude is mapped into a binary sequence m0, m1, m2...m consisting of longitude intervals. N ;
[0140] in, This represents the maximum longitude value during this iteration of calculations. This represents the minimum longitude value during this iteration of calculations. This represents the maximum longitude value during the next iteration of the calculation. This will be the minimum longitude value in the next iteration of the calculation. This is the intermediate longitude value during this iterative calculation, m. i This represents the longitude range for this cycle of calculation.
[0141] According to the system of the second aspect of the present invention, the sixth processing module is configured to combine the encoding of meteorological feature information, layer height, and geographic coordinate location to obtain meteorological spatial location mapping information, including:
[0142] The characteristic information of meteorological conditions is represented by three digits from 0 to 9, thus obtaining the encoding of the characteristic information;
[0143] The floor height is represented by three digits from 0 to 9, thus obtaining the floor height code.
[0144] The encoding of the feature information, the encoding of the floor height, and the encoding of the geographic coordinates are combined into a string to obtain the mapping information of the meteorological spatial location.
[0145] According to the system of the second aspect of the present invention, the sixth processing module is configured to use three digits (0-9) to represent meteorological characteristic information, and to obtain the encoding of the characteristic information, the encoding includes:
[0146] The feature information rh represents relative humidity, and the feature information rh is encoded as 001.
[0147] The feature information t2m represents the air temperature at 2 meters above the ground, and the code for the feature information t2m is 002;
[0148] The feature information pres represents the surface air pressure, and the code of the feature information pres is 003;
[0149] The feature information pr represents the total precipitation, and the feature information pr is encoded as 004.
[0150] The feature information wd represents the wind direction, and the feature information wd is encoded as 005.
[0151] The feature information ws represents wind speed, and the feature information ws is encoded as 006.
[0152] The feature information swdown represents irradiance, and the feature information swdown is encoded as 007.
[0153] The feature information cloud refers to cloud cover, and the feature information cloud is encoded as 008.
[0154] The feature information ad represents air density, and the feature information ad is encoded as 009.
[0155] The feature information u represents the horizontal wind speed, and the feature information u is encoded as 010.
[0156] The feature information v represents the vertical wind speed, and the feature information v is encoded as 011.
[0157] The feature information hgt represents altitude, and the feature information hgt is encoded as 012.
[0158] The feature information lng represents longitude, and the feature information lng is encoded as 013.
[0159] The feature information lat represents latitude, and the feature information lat is encoded as 014.
[0160] According to the system of the second aspect of the present invention, the sixth processing module is configured to use three digits from 0 to 9 to represent the layer height, and the encoding of the layer height includes:
[0161] The code for a floor height of 0 to 2 meters above the ground is 001;
[0162] The code for a floor height of 5 to 7 meters above the ground is 002;
[0163] The code for a floor with a height of about 10 meters above the ground is 003;
[0164] The code for a floor with a height of about 30 meters above the ground is 004;
[0165] The code for a floor with a height of about 50 meters above the ground is 005;
[0166] The code for a floor with a height of about 80 meters above the ground is 006;
[0167] The code for a floor with a height of approximately 100 meters above the ground is 007;
[0168] The code for a floor with a height of approximately 150 meters above the ground is 008.
[0169] According to the system of the second aspect of the present invention, the seventh processing module is configured such that querying the meteorological spatial location through the meteorological spatial mapping information includes:
[0170] First, the meteorological feature information and layer height are determined based on the encoding of the feature information and the encoding of the layer height in the meteorological spatial mapping information;
[0171] Then, by using the encoding of the geographic coordinates in the meteorological spatial mapping information, the region represented by the encoding of the geographic coordinates and its eight predefined regions can be queried.
[0172] The predefined eight regions include:
[0173] The latitude binary sequence of the encoded geographic coordinates is set to S. a The binary sequence of longitude is S b The eight predefined regions are (S a -1,S b +1), (S a ,S b +1), (S a +1,S b +1), (S a -1,S b ), (S a +1,S b ), (S a -1,S b -1), (S a ,S b -1) and (S a +1,S b -1).
[0174] A third aspect of this invention discloses an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the meteorological spatial location mapping and query method for meteorological data according to any one of the first aspects of this disclosure.
[0175] A fourth aspect of this invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a meteorological spatial location mapping and query method for meteorological data according to any one of the first aspects of this disclosure.
[0176] The solution proposed in this invention,
[0177] 1. In terms of storing massive amounts of energy and meteorological data, mapping can effectively reduce the space occupied by data storage, while big data processing technology can ensure the rapid storage of massive terabyte-level energy and meteorological data, greatly reducing the waiting time for data to be imported into the database.
[0178] 2. In terms of extracting massive amounts of energy and meteorological data, it enables rapid queries from any geographical location and any region. In energy and meteorological derivative services, it ensures the timeliness and ease of use of the services. In data mining, it also allows for efficient model training based on the data. Attached Figure Description
[0179] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0180] Figure 1 This is a flowchart illustrating a meteorological spatial location mapping and query method for meteorological data according to an embodiment of the present invention;
[0181] Figure 2 This is a structural diagram of a meteorological spatial location mapping and query system for meteorological data according to an embodiment of the present invention;
[0182] Figure 3 This is a structural diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0183] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0184] Geographic hash mapping typically uses a single string to represent two coordinates: longitude and latitude (lat, lon). Geographic locations in energy meteorological data are usually represented by the four vertices of an n×n grid, where the value of n depends on the longitude of the meteorological downscaling. Energy meteorological four-dimensional spatiotemporal data is then represented as (value, level, lat, lon). When interacting with data at the business layer, the efficiency of retrieval based on geographic location, floor height, and meteorological characteristics is primarily considered. Taking a specific energy power plant business scenario as an example, given the station's latitude and longitude, the required floor height, and the meteorological characteristic values to be obtained (value1, level1, lat1, lon1).
[0185] The first aspect of this invention discloses a method for mapping and querying meteorological spatial locations of meteorological data. Figure 1 This is a flowchart of a meteorological spatial location mapping and query method for meteorological data according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes:
[0186] Step S1: Apply the binary search method to map the latitude into a binary sequence to obtain the latitude binary sequence;
[0187] Step S2: Apply the binary search method to map longitude into a binary sequence to obtain the longitude binary sequence;
[0188] Step S3: Cross-combine the latitude binary sequence and the longitude binary sequence to obtain a cross sequence;
[0189] Step S4: Convert the preset number of bits k in the cross sequence into a group and then into a decimal number;
[0190] Step S5: Convert the decimal number to Base2. k Encode to obtain the mapping information of geographic coordinates;
[0191] Step S6: Combine the meteorological feature information, layer height, and the encoding of the geographic coordinates to obtain the mapping information of meteorological spatial location;
[0192] Step S7: Query the meteorological spatial location using the meteorological spatial mapping information.
[0193] In step S1, the latitude is mapped into a binary sequence using the binary search method to obtain the latitude binary sequence.
[0194] In some embodiments, in step S1, the method of applying the binary search method to map latitude into a binary sequence to obtain a latitude binary sequence includes:
[0195] Let the specified latitude value be 'a';
[0196] Set the initial maximum and minimum latitude values for the loop calculation to the maximum and minimum latitude values:
[0197]
[0198]
[0199] Calculate the median latitude:
[0200]
[0201] Calculate latitude intervals:
[0202]
[0203] Calculate the maximum and minimum latitude values for the next iteration:
[0204] like
[0205] n i =1
[0206] but
[0207]
[0208]
[0209] like
[0210] n i =0
[0211] but
[0212]
[0213]
[0214] After iterating the calculation a predetermined number of times N, the latitude is mapped into a binary sequence n0, n1, n2...n consisting of latitude intervals. N ;
[0215] in, This represents the maximum latitude value during this iteration of calculations. This represents the minimum latitude value during this iteration of calculations. This represents the maximum latitude value during the next iteration of the calculation. This will be the minimum latitude value in the next iteration of the calculation. n represents the median latitude value during this iteration of calculations. i This represents the latitude range for this iteration of calculation.
[0216] In step S2, the longitude is mapped into a binary sequence using the binary search method to obtain the longitude binary sequence.
[0217] In some embodiments, in step S2, the method of applying the binary search method to map longitude into a binary sequence to obtain a longitude binary sequence includes:
[0218] Let the specified longitude value be b;
[0219] Set the initial maximum and minimum longitude values for the loop calculation to the maximum and minimum longitude values:
[0220]
[0221]
[0222] Calculate the median longitude:
[0223]
[0224] Calculate longitude intervals:
[0225]
[0226] Calculate the maximum and minimum longitude values for the next iteration:
[0227] like
[0228] m i =1
[0229] but
[0230]
[0231]
[0232] like
[0233] m i =0
[0234] but
[0235]
[0236]
[0237] After iteratively calculating a predetermined number of times N, the longitude is mapped into a binary sequence m0, m1, m2...m consisting of longitude intervals. N ;
[0238] in, This represents the maximum longitude value during this iteration of calculations. This represents the minimum longitude value during this iteration of calculations. This represents the maximum longitude value during the next iteration of the calculation. This will be the minimum longitude value in the next iteration of the calculation. This is the intermediate longitude value during this iterative calculation, m. i This represents the longitude range for this cycle of calculation.
[0239] In step S3, the latitude binary sequence and the longitude binary sequence are cross-combined to obtain a cross sequence with longitude first and latitude second.
[0240] Specifically, the latitude binary sequence and the longitude binary sequence are cross-combined, with odd numbers representing latitude and even numbers representing longitude, to obtain the cross sequence m0, n0, m1, n1, m2, n2... m N ,n N .
[0241] The above sequence can be unified into variables x0, x1, x2, x3...x 2n-1 ,x 2n .
[0242] In step S4, the bits of the preset number k in the cross sequence are converted into decimal numbers as a group.
[0243] In some embodiments, the preset number of bits k is 5 or 6.
[0244] Specifically, the five digits in the cross sequence are converted into decimal numbers.
[0245] The formula for converting binary to decimal is:
[0246]
[0247] In step S5, the decimal number is converted to Base2. k Encode the data to obtain the mapping information of the geographic coordinates.
[0248] Specifically, referring to the Base32 encoding table, the decimal numbers are converted into Base32 encoding to obtain the mapping information of the geographic coordinates. The Base32 encoding table is shown in Table 1.
[0249] Table 1 Base32 Encoding Table
[0250] Decimal 0 1 2 3 4 5 6 7 Base32 0 1 2 3 4 5 6 7 Decimal 8 9 10 11 12 13 14 15 Base32 8 9 b c d e f g Decimal 16 17 18 19 20 21 22 23 Base32 h j k m n p q r Decimal 24 25 26 27 28 29 30 31 Base32 s t u v w x y z
[0251] Base32 encoding combines the numbers 0-9 with 26 letters (excluding a, i, l, and o) to form a 32-character encoding. For example, using (lat:39.9257460000, lng:116.5998310000), when N is 30, the final location of the energy station is wx4gjk32kgh0.
[0252] In step S6, the meteorological feature information, layer height, and the encoding of the geographic coordinates are combined to obtain the mapping information of the meteorological spatial location.
[0253] In some embodiments, in step S6, the method of combining the encoding of meteorological feature information, layer height, and geographic coordinate location to obtain the mapping information of meteorological spatial location includes:
[0254] The characteristic information of meteorological conditions is represented by three digits from 0 to 9, thus obtaining the encoding of the characteristic information;
[0255] The floor height is represented by three digits from 0 to 9, thus obtaining the floor height code.
[0256] The encoding of the feature information, the encoding of the floor height, and the encoding of the geographic coordinates are combined into a string to obtain the mapping information of the meteorological spatial location.
[0257] The method for encoding meteorological feature information using three digits (0-9) to represent the feature information includes:
[0258] The feature information rh represents relative humidity, and the feature information rh is encoded as 001.
[0259] The feature information t2m represents the air temperature at 2 meters above the ground, and the code for the feature information is 002.
[0260] The feature information pres represents the surface air pressure, and the code for the feature information is 003.
[0261] The feature information pr represents the total precipitation, and the feature information pr is encoded as 004.
[0262] The feature information wd represents the wind direction, and the feature information wd is encoded as 005.
[0263] The feature information ws represents wind speed, and the feature information ws is encoded as 006.
[0264] The feature information swdown represents irradiance, and the feature information swdown is encoded as 007.
[0265] The feature information cloud refers to cloud cover, and the feature information cloud is encoded as 008.
[0266] The feature information ad represents air density, and the feature information ad is encoded as 009.
[0267] The feature information u represents the horizontal wind speed, and the feature information u is encoded as 010.
[0268] The feature information v represents the vertical wind speed, and the feature information v is encoded as 011.
[0269] The feature information hgt represents altitude, and the feature information hgt is encoded as 012.
[0270] The feature information lng represents longitude, and the feature information lng is encoded as 013.
[0271] The feature information lat represents latitude, and the feature information lat is encoded as 014.
[0272] The method for encoding the layer height using three digits from 0 to 9 includes:
[0273] The code for a floor height of 0 to 2 meters above the ground is 001;
[0274] The code for a floor height of 5 to 7 meters above the ground is 002;
[0275] The code for a floor with a height of about 10 meters above the ground is 003;
[0276] The code for a floor with a height of about 30 meters above the ground is 004;
[0277] The code for a floor with a height of about 50 meters above the ground is 005;
[0278] The code for a floor with a height of about 80 meters above the ground is 006;
[0279] The code for a floor with a height of approximately 100 meters above the ground is 007;
[0280] The code for a floor with a height of approximately 150 meters above the ground is 008.
[0281] Specifically, three digits from 0 to 9 are used to represent the meteorological characteristic information, and the encoding of the characteristic information is shown in Table 2.
[0282] Table 2 Feature Information Numbering Table
[0283]
[0284]
[0285] The floor height is represented by three digits from 0 to 9 (which can represent floor height or meters), resulting in the floor height code, as shown in Table 3.
[0286] Table 3: Numbering Table Corresponding to Floor Height
[0287] Floor height number Indicates height serial number 1 0~2 meters above the ground 001 2 5 to 7 meters above the ground 002 3 About 10 meters above the ground 003 4 About 30 meters above the ground 004 5 About 50 meters above the ground 005 6 About 80 meters above the ground 006 7 About 100 meters above the ground 007 8 About 150 meters above the ground 008
[0288] The encoding of the feature information, the encoding of the layer height, and the encoding of the geographic coordinates are combined into a string to obtain the mapping information of the meteorological spatial location. The wind speed at the above latitude and longitude at the 5th layer can be expressed as: 001005wx4gjk32kgh0.
[0289] In step S7, the meteorological spatial location is queried through the meteorological spatial mapping information.
[0290] In some embodiments, in step S7, the method of querying meteorological spatial location through the meteorological spatial mapping information includes:
[0291] First, the meteorological feature information and layer height are determined based on the encoding of the feature information and the encoding of the layer height in the meteorological spatial mapping information;
[0292] Then, by using the encoding of the geographic coordinates in the meteorological spatial mapping information, the region represented by the encoding of the geographic coordinates and its eight predefined regions can be queried.
[0293] The predefined eight regions include:
[0294] The latitude binary sequence of the encoded geographic coordinates is set to S. a The binary sequence of longitude is S b The eight predefined regions are (S a -1,S b +1), (S a ,S b +1), (S a +1,S b +1), (S a -1,S b ), (S a +1,S b ), (S a -1,S b -1), (S a ,S b -1) and (S a +1,S b -1).
[0295] Specifically, using the example above, if n is 30, the current hash region is wx4gjk32kgh0, and the surrounding 8 hash regions are wx4gjk32kfur, wx4gjk32kgh2, wx4gjk32kgh3, wx4gjk32kfup, wx4gjk32kgh1, wx4gjk32kfgz, wx4gjk32kg5b, and wx4gjk32kg5c; if n is 15, the current hash region is wx4gjk, and the surrounding 8 hash regions are wx4gje, wx4gjs, wx4gjt, wx4gj7, wx4gjm, wx4gj5, wx4gjh, and wx4gjj. Table 4 shows the hash length and corresponding precision.
[0296] Table 4 Hash Length and Corresponding Precision
[0297]
[0298] In summary, the solution proposed in this invention can
[0299] 1. In terms of storing massive amounts of energy and meteorological data, mapping can effectively reduce the space occupied by data storage, while big data processing technology can ensure the rapid storage of massive terabyte-level energy and meteorological data, greatly reducing the waiting time for data to be imported into the database.
[0300] 2. In terms of extracting massive amounts of energy and meteorological data, it enables rapid queries from any geographical location and any region. In energy and meteorological derivative services, it ensures the timeliness and ease of use of the services. In data mining, it also allows for efficient model training based on the data.
[0301] The second aspect of this invention discloses a meteorological spatial location mapping and query system for meteorological data. Figure 2 This is a structural diagram of a meteorological spatial location mapping and query system for meteorological data according to an embodiment of the present invention; as follows: Figure 2 As shown, the system 100 includes:
[0302] The first processing module is configured to apply a binary search method to map latitude into a binary sequence to obtain a latitude binary sequence.
[0303] The second processing module is configured to apply a binary search method to map longitude into a binary sequence to obtain a longitude binary sequence.
[0304] The third processing module is configured to cross-combine the latitude binary sequence and the longitude binary sequence to obtain a cross sequence.
[0305] The fourth processing module is configured to convert a preset number of digits k in the cross sequence into a decimal number.
[0306] The fifth processing module is configured to convert the decimal number into Base2. k Encode to obtain the mapping information of geographic coordinates;
[0307] The sixth processing module is configured to combine the meteorological feature information, the layer height, and the encoding of the geographic coordinates to obtain the mapping information of the meteorological spatial location.
[0308] The seventh processing module is configured to query the meteorological spatial location through the meteorological spatial mapping information.
[0309] According to a system of a second aspect of the present invention, the first processing module is configured to, wherein the application of a binary search method to map latitude into a binary sequence to obtain a latitude binary sequence comprises:
[0310] Let the specified latitude value be 'a';
[0311] Set the initial maximum and minimum latitude values for the loop calculation to the maximum and minimum latitude values:
[0312]
[0313]
[0314] Calculate the median latitude:
[0315]
[0316] Calculate latitude intervals:
[0317]
[0318] Calculate the maximum and minimum latitude values for the next iteration:
[0319] like
[0320] n i =1
[0321] but
[0322]
[0323]
[0324] like
[0325] n i =0
[0326] but
[0327]
[0328]
[0329] After iterating the calculation a predetermined number of times N, the latitude is mapped into a binary sequence n0, n1, n2...n consisting of latitude intervals. N ;
[0330] in, This represents the maximum latitude value during this iteration of calculations. This represents the minimum latitude value during this iteration of calculations. This represents the maximum latitude value during the next iteration of the calculation. This will be the minimum latitude value in the next iteration of the calculation. n represents the median latitude value during this iterative calculation. i This represents the latitude range for this iteration of calculation.
[0331] According to a system of a second aspect of the present invention, the second processing module is configured to, wherein the application of the binary search method to map longitude into a binary sequence to obtain a longitude binary sequence includes:
[0332] Let the specified longitude value be b;
[0333] Set the initial maximum and minimum longitude values for the loop calculation to the maximum and minimum longitude values:
[0334]
[0335]
[0336] Calculate the median longitude:
[0337]
[0338] Calculate longitude intervals:
[0339]
[0340] Calculate the maximum and minimum longitude values for the next iteration:
[0341] like
[0342] m i =1
[0343] but
[0344]
[0345]
[0346] like
[0347] m i =0
[0348] but
[0349]
[0350]
[0351] After iteratively calculating a predetermined number of times N, the longitude is mapped into a binary sequence m0, m1, m2...m consisting of longitude intervals. N ;
[0352] in, This represents the maximum longitude value during this iteration of calculations. This represents the minimum longitude value during this iteration of calculations. This represents the maximum longitude value during the next iteration of the calculation. This will be the minimum longitude value in the next iteration of the calculation. This is the intermediate longitude value during this iterative calculation, m. i This represents the longitude range for this cycle of calculation.
[0353] According to the system of the second aspect of the present invention, the sixth processing module is configured to combine the encoding of meteorological feature information, layer height, and geographic coordinate location to obtain meteorological spatial location mapping information, including:
[0354] The characteristic information of meteorological conditions is represented by three digits from 0 to 9, thus obtaining the encoding of the characteristic information;
[0355] The floor height is represented by three digits from 0 to 9, thus obtaining the floor height code.
[0356] The encoding of the feature information, the encoding of the floor height, and the encoding of the geographic coordinates are combined into a string to obtain the mapping information of the meteorological spatial location.
[0357] According to the system of the second aspect of the present invention, the sixth processing module is configured to use three digits (0-9) to represent meteorological characteristic information, and to obtain the encoding of the characteristic information, the encoding includes:
[0358] The feature information rh represents relative humidity, and the feature information rh is encoded as 001.
[0359] The feature information t2m represents the air temperature at 2 meters above the ground, and the code for the feature information t2m is 002;
[0360] The feature information pres represents the surface air pressure, and the code of the feature information pres is 003;
[0361] The feature information pr represents the total precipitation, and the feature information pr is encoded as 004.
[0362] The feature information wd represents the wind direction, and the feature information wd is encoded as 005.
[0363] The feature information ws represents wind speed, and the feature information ws is encoded as 006.
[0364] The feature information swdown represents irradiance, and the feature information swdown is encoded as 007.
[0365] The feature information cloud refers to cloud cover, and the feature information cloud is encoded as 008.
[0366] The feature information ad represents air density, and the feature information ad is encoded as 009.
[0367] The feature information u represents the horizontal wind speed, and the feature information u is encoded as 010.
[0368] The feature information v represents the vertical wind speed, and the feature information v is encoded as 011.
[0369] The feature information hgt represents altitude, and the feature information hgt is encoded as 012.
[0370] The feature information lng represents longitude, and the feature information lng is encoded as 013.
[0371] The feature information lat represents latitude, and the feature information lat is encoded as 014.
[0372] According to the system of the second aspect of the present invention, the sixth processing module is configured to use three digits from 0 to 9 to represent the layer height, and the encoding of the layer height includes:
[0373] The code for a floor height of 0 to 2 meters above the ground is 001;
[0374] The code for a floor height of 5 to 7 meters above the ground is 002;
[0375] The code for a floor with a height of about 10 meters above the ground is 003;
[0376] The code for a floor with a height of about 30 meters above the ground is 004;
[0377] The code for a floor with a height of about 50 meters above the ground is 005;
[0378] The code for a floor with a height of about 80 meters above the ground is 006;
[0379] The code for a floor with a height of approximately 100 meters above the ground is 007;
[0380] The code for a floor with a height of approximately 150 meters above the ground is 008.
[0381] According to the system of the second aspect of the present invention, the seventh processing module is configured such that querying the meteorological spatial location through the meteorological spatial mapping information includes:
[0382] First, the meteorological feature information and layer height are determined based on the encoding of the feature information and the encoding of the layer height in the meteorological spatial mapping information;
[0383] Then, by using the encoding of the geographic coordinates in the meteorological spatial mapping information, the region represented by the encoding of the geographic coordinates and its eight predefined regions can be queried.
[0384] The predefined eight regions include:
[0385] The latitude binary sequence of the encoded geographic coordinates is set to S. a The binary sequence of longitude is S b The eight predefined regions are (S a -1,S b +1), (S a ,S b +1), (S a +1,S b +1), (S a -1,S b ), (S a +1,S b ), (S a -1,S b -1), (S a ,S b -1) and (S a +1,S b -1).
[0386] A third aspect of this invention discloses an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the meteorological spatial location mapping and query method for meteorological data according to any one of the first aspects of this invention.
[0387] Figure 3 This is a structural diagram of an electronic device according to an embodiment of the present invention, such as... Figure 3 As shown, the electronic device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, Near Field Communication (NFC), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0388] Those skilled in the art will understand that Figure 3 The structure shown is merely a structural diagram of the part related to the technical solution of this disclosure and does not constitute a limitation on the electronic device to which the solution of this application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0389] A fourth aspect of this invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a meteorological spatial location mapping and query method for meteorological data according to any one of the first aspects of this invention.
[0390] Please note that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for mapping and querying meteorological spatial locations of meteorological data, characterized in that, The method includes: Step S1: Apply the binary search method to map the latitude into a binary sequence to obtain the latitude binary sequence; Step S2: Apply the binary search method to map longitude into a binary sequence to obtain the longitude binary sequence; Step S3: Cross-combine the latitude binary sequence and the longitude binary sequence to obtain a cross sequence; Step S4: Convert the preset number of digits k in the cross sequence into decimal numbers; Step S5: Convert the decimal number to Base2. k Encode to obtain the mapping information of geographic coordinates; Step S6: Combine the meteorological feature information, layer height, and the encoding of the geographic coordinates to obtain the mapping information of meteorological spatial location; Step S7: Query the meteorological spatial location using the meteorological spatial mapping information; In step S7, the method for querying meteorological spatial location through the meteorological spatial mapping information includes: First, the meteorological feature information and layer height are determined based on the encoding of the feature information and the encoding of the layer height in the meteorological spatial mapping information; Then, by using the encoding of the geographic coordinates in the meteorological spatial mapping information, the region represented by the encoding of the geographic coordinates and its eight predefined regions can be queried. The predefined eight regions include: The latitude binary sequence of the encoded geographic coordinates is set to S. a The binary sequence of longitude is S b The eight predefined regions are (S a -1,S b +1), (S a ,S b +1), (S a +1,S b +1), (S a -1,S b ), (S a +1,S b ), (S a -1,S b -1), (S a ,S b -1) and (S a +1,S b -1).
2. The meteorological spatial location mapping and query method for meteorological data according to claim 1, characterized in that, In step S1, the method of applying the binary search method to map latitude into a binary sequence to obtain the latitude binary sequence includes: Let the specified latitude value be 'a'; Set the initial maximum and minimum latitude values for the loop calculation to the maximum and minimum latitude values: Calculate the median latitude: Calculate latitude intervals: Calculate the maximum and minimum latitude values for the next iteration: like but like but Calculate the preset number of times in a loop N Then, the latitude is mapped into a binary sequence n0, n1, n2...n consisting of latitude intervals. N ; in, This represents the maximum latitude value during this iteration of calculations. This represents the minimum latitude value during this iteration of calculations. This represents the maximum latitude value during the next iteration of the calculation. This will be the minimum latitude value in the next iteration of the calculation. This is the median latitude value used in this iteration of calculations. This represents the latitude range for this iteration of calculation.
3. The meteorological spatial location mapping and query method for meteorological data according to claim 1, characterized in that, In step S2, the method of mapping longitude into a binary sequence using the binary search method to obtain the longitude binary sequence includes: Let the specified longitude value be b; Set the initial maximum and minimum longitude values for the loop calculation to the maximum and minimum longitude values: Calculate the median longitude: Calculate longitude intervals: Calculate the maximum and minimum longitude values for the next iteration: like but like but Calculate the preset number of times in a loop N Then, the longitude is mapped into a binary sequence m0, m1, m2...m consisting of longitude intervals. N ; in, This represents the maximum longitude value during this iteration of calculations. This represents the minimum longitude value during this iteration of calculations. This represents the maximum longitude value during the next iteration of the calculation. This will be the minimum longitude value in the next iteration of the calculation. This is the intermediate longitude value during this iteration of calculations. This represents the longitude range for this cycle of calculation.
4. The meteorological spatial location mapping and query method for meteorological data according to claim 1, characterized in that, In step S6, the method of combining the encoding of meteorological feature information, layer height, and geographic coordinates to obtain the mapping information of meteorological spatial location includes: The characteristic information of meteorological conditions is represented by three digits from 0 to 9, thus obtaining the encoding of the characteristic information; The floor height is represented by three digits from 0 to 9, thus obtaining the floor height code. The encoding of the feature information, the encoding of the floor height, and the encoding of the geographic coordinates are combined into a string to obtain the mapping information of the meteorological spatial location.
5. The meteorological spatial location mapping and query method for meteorological data according to claim 4, characterized in that, In step S6, the method for encoding the meteorological feature information using three digits (0-9) to represent the feature information includes: The feature information rh represents relative humidity, and the feature information rh is encoded as 001. The feature information t2m represents the air temperature at 2 meters above the ground, and the code for the feature information t2m is 002; The feature information pres represents the surface air pressure, and the code of the feature information pres is 003; The feature information pr represents the total precipitation, and the feature information pr is encoded as 004. The feature information wd represents the wind direction, and the feature information wd is encoded as 005. The feature information ws represents wind speed, and the feature information ws is encoded as 006. The feature information swdown represents irradiance, and the feature information swdown is encoded as 007. The feature information cloud refers to cloud cover, and the feature information cloud is encoded as 008. The feature information ad represents air density, and the feature information ad is encoded as 009. The feature information u represents the horizontal wind speed, and the feature information u is encoded as 010. The feature information v represents the vertical wind speed, and the feature information v is encoded as 011. The feature information hgt represents altitude, and the feature information hgt is encoded as 012. The feature information lng represents longitude, and the feature information lng is encoded as 013. The feature information lat represents latitude, and the feature information lat is encoded as 014.
6. The meteorological spatial location mapping and query method for meteorological data according to claim 4, characterized in that, In step S6, the method of using three digits (0-9) to represent the layer height and obtaining the layer height encoding includes: The code for a floor height of 0-2 meters above the ground is 001; The code for a floor height of 5 to 7 meters above the ground is 002; The code for a floor with a height of about 10 meters above the ground is 003; The code for a floor with a height of about 30 meters above the ground is 004; The code for a floor with a height of about 50 meters above the ground is 005; The code for a floor with a height of about 80 meters above the ground is 006; The code for a floor with a height of approximately 100 meters above the ground is 007; The code for a floor with a height of approximately 150 meters above the ground is 008.
7. A meteorological spatial location mapping and query system for meteorological data, characterized in that, The system includes: The first processing module is configured to apply a binary search method to map latitude into a binary sequence to obtain a latitude binary sequence. The second processing module is configured to apply a binary search method to map longitude into a binary sequence to obtain a longitude binary sequence. The third processing module is configured to cross-combine the latitude binary sequence and the longitude binary sequence to obtain a cross sequence. The fourth processing module is configured to convert a preset number of digits k in the cross sequence into a decimal number. The fifth processing module is configured to convert the decimal number into Base2. k Encode to obtain the mapping information of geographic coordinates; The sixth processing module is configured to combine the meteorological feature information, the layer height, and the encoding of the geographic coordinates to obtain the mapping information of the meteorological spatial location. The seventh processing module is configured to query meteorological spatial location through the meteorological spatial mapping information; The process of querying meteorological spatial location through the meteorological spatial mapping information includes: First, the meteorological feature information and layer height are determined based on the encoding of the feature information and the encoding of the layer height in the meteorological spatial mapping information; Then, by using the encoding of the geographic coordinates in the meteorological spatial mapping information, the region represented by the encoding of the geographic coordinates and its eight predefined regions can be queried. The predefined eight regions include: The latitude binary sequence of the encoded geographic coordinates is set to S. a The binary sequence of longitude is S b The eight predefined regions are (S a -1,S b +1), (S a ,S b +1), (S a +1,S b +1), (S a -1,S b ), (S a +1,S b ), (S a -1,S b -1), (S a ,S b -1) and (S a +1,S b -1).
8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps in the meteorological spatial location mapping and query method for meteorological data according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the meteorological spatial location mapping and query method for meteorological data according to any one of claims 1 to 6.
Citation Information
Patent Citations
Space-time geographic big data retrieval method and system
CN105426491A
Meteorological data query method and device
CN114385932A