WO2018082245A1 - 栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统 - Google Patents

栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统 Download PDF

Info

Publication number
WO2018082245A1
WO2018082245A1 PCT/CN2017/078302 CN2017078302W WO2018082245A1 WO 2018082245 A1 WO2018082245 A1 WO 2018082245A1 CN 2017078302 W CN2017078302 W CN 2017078302W WO 2018082245 A1 WO2018082245 A1 WO 2018082245A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
raster
aggregation
raster data
shaping
Prior art date
Application number
PCT/CN2017/078302
Other languages
English (en)
French (fr)
Inventor
陈涛
张斌
苏国锋
孙占辉
吕颖
钟少波
袁宏永
黄全义
Original Assignee
北京辰安科技股份有限公司
清华大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京辰安科技股份有限公司, 清华大学 filed Critical 北京辰安科技股份有限公司
Publication of WO2018082245A1 publication Critical patent/WO2018082245A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Definitions

  • the present invention relates to the field of raster data processing, and more particularly to the aggregation and decoupling of multi-layer raster data.
  • Raster data is array data that is arranged in rows and columns of grid cells with different gray levels or colors. The location of each cell (eg, grid, pixel) is defined by its rank and column number. Raster data has the characteristics of good regularity, easy to obtain with respect to vector data, good expressiveness of expression, large data range, common data, relatively small storage format, etc. It is widely used in GIS (Geographic Information System), image processing system, etc. in.
  • GIS Geographic Information System
  • the present invention provides a raster data aggregation method and apparatus for aggregating multi-layer raster data into a layer of raster data to reduce the amount of data, and a raster data decoupling method and apparatus.
  • a first aspect of the present invention provides a raster data aggregation method, including: extracting a plurality of raster data of the same rank number from the multi-layer raster data; and performing the plurality of raster data Aggregate to generate a single raster aggregate value; and generate a layer of raster data based on a single raster aggregate value corresponding to each row and column number.
  • the aggregating the plurality of raster data to generate a single raster aggregate value comprises:
  • the plurality of raster data are arranged in a high and low position to be the single raster aggregate value.
  • the aggregating the plurality of raster data to generate a single raster aggregate value comprises:
  • the plurality of raster data is represented by a value of 2 n -1, and the added value of the 2 n -1 value is taken as a single raster aggregate value, where n is a natural number.
  • the aggregating the plurality of raster data to generate a single raster aggregate value comprises:
  • the plurality of raster data includes more than two shaping data.
  • the arranging the plurality of raster data in the high and low positions to configure the single raster aggregation value includes:
  • the plurality of shaping data are arranged in the high and low positions according to the length of the shaping data, the total length of the shaping data, and the number of the shaping data.
  • the configuration obtains the shaping data aggregation value, and uses the shaping data aggregation value as the single grid aggregation value.
  • the plurality of raster data further includes floating point data.
  • the arranging the plurality of raster data on the high and low positions to configure the single grid aggregation value further includes:
  • the floating point data aggregation value is obtained, and the floating point data aggregation value is used as the single grid aggregation value.
  • the number of the shaping data is a value that is one less than the actual number of shaping data.
  • the number of the shaping data is the actual number of shaping data.
  • a second aspect provided by an embodiment of the present invention relates to a raster data decoupling method, which extracts a single raster aggregation value corresponding to each row and column number from a layer of raster data; and aggregates the single raster value Performing decoupling to generate a plurality of raster data; and integrating raster data of different row and column numbers in the same layer according to the plurality of raster data at each row and column number to generate multi-layer raster data.
  • Decoupling the single raster aggregate value to generate a plurality of raster data includes:
  • the single raster aggregate value is split into the plurality of raster data at high and low levels.
  • Decoupling the single raster aggregate value to generate a plurality of raster data includes:
  • a single raster aggregate value is used as an added value, and according to the added value, a plurality of 2 n -1 values are respectively obtained as a plurality of raster data, wherein n is a natural number.
  • Decoupling the single raster aggregate value to generate a plurality of raster data includes:
  • An index combination dictionary is used to determine an arrangement combination of a plurality of raster data corresponding to the index, thereby obtaining each of the plurality of raster data.
  • the plurality of raster data includes more than two shaping data.
  • the single raster aggregation value is an integer data aggregation value
  • the splitting the single raster aggregate value into the plurality of raster data on the high and low levels comprises:
  • the shaped data aggregate value is split into the plurality of raster data on the high and low levels.
  • the plurality of raster data further includes floating point data.
  • the single raster aggregate value is not an integer data aggregate value, but a floating point data aggregate value
  • the process of splitting the single raster aggregation value into the plurality of raster data on the high and low levels, after calculating the total length of the shaped data, before splitting the shaped data aggregate value further includes:
  • the number of the shaping data is a value that is decremented by one from the actual number of shaping data, and after splitting the shaping data aggregation value, according to the length of the shaping data and already Get multiple raster data and get one raster data,
  • the number of the shaping data is the actual number of shaping data.
  • a third aspect of the present invention provides a data aggregation decoupling method, including:
  • a fourth aspect provided by an embodiment of the present invention relates to a raster data aggregation apparatus, including: a multi-grid extraction unit configured to respectively extract a plurality of raster data of the same rank number from the multi-layer raster data; An aggregation unit configured to aggregate the plurality of raster data to generate a single raster aggregate value; and an aggregate data generation unit configured to generate a layer according to a single raster aggregate value corresponding to each rank number Raster data.
  • the aggregation unit is configured to arrange the plurality of raster data in a high and low position to be the single grid aggregation value.
  • the plurality of raster data includes more than two shaping data.
  • the aggregation unit includes:
  • a total length calculation module configured to calculate a total length of the shaped data according to the length of the shaped data and the number of the shaped data;
  • the shaping data aggregation module is configured to arrange the plurality of shaping data in the high and low positions according to the length of the shaping data, the total length of the shaping data, and the number of the shaping data, to obtain an integer data aggregation value,
  • the shaped data aggregate value is used as the single raster aggregate value.
  • the plurality of raster data further includes floating point data.
  • the aggregation unit further includes:
  • the allowable length calculation module is configured to obtain an allowable length of the floating point data according to the maximum effective length and the total length of the shaped data;
  • a decimal length calculation module configured to obtain a decimal length according to the allowable length and the length of the integer portion
  • a floating point data correction module configured to modify the floating point data according to the floating point data value and the decimal length to obtain a correction value
  • the floating-point data aggregation module is configured to aggregate the floating-point data and the shaping data according to the correction value, the shaping data aggregation value, the total length of the shaping data, and the decimal length Arrange the configuration on the bit to obtain a floating point data aggregation value, instead of using the integer data aggregation value as the single raster aggregation value, but the floating point data aggregation value as a single raster aggregation value.
  • the aggregation unit further includes:
  • a data judging module configured to determine whether the shaped data is a weight data set
  • the number correction module is configured to: when the shaping data is a weight data group, the number of the shaped data that is output is a value that is one less than the actual number of shaping data, when the shaping data is not a weight data group.
  • the number of the shaped data that is output is the actual number of shaped data.
  • a fifth aspect provided by an embodiment of the present invention relates to a raster data decoupling apparatus, comprising: a single-grid extraction unit configured to extract a single grid corresponding to each row and column number from a layer of raster data An aggregated value; a decoupling unit configured to decouple the single raster aggregate value to generate a plurality of raster data; and a decoupled data generating unit configured to be based on each rank number Corresponding to the plurality of raster data, the grid data of different row and column numbers located in the same layer are respectively integrated to generate multi-layer raster data.
  • the decoupling unit is configured to split a single raster aggregate value into the plurality of raster data at high and low levels.
  • the plurality of raster data includes more than two shaping data.
  • the single raster aggregation value is an integer data aggregation value
  • the decoupling unit includes:
  • a total length calculation module configured to calculate a total length of the shaped data according to the length of the shaped data and the number of shaped data
  • the shaping data decoupling module is configured to split the shaping data aggregation value in the high and low positions according to the total length of the shaping data, the length of the shaping data, and the number of the shaping data, to obtain the plurality of grids Grid data.
  • the plurality of raster data further includes floating point data.
  • the single raster aggregate value is not an integer data aggregate value, but a floating point data aggregate value
  • the decoupling unit further includes:
  • a floating-point data decoupling module configured to split the floating-point data aggregation value according to the total length of the shaped data and the decimal length of the floating-point data to obtain a floating-point data value
  • the shaping data aggregation value obtaining module is configured to obtain the shaping data aggregation value according to the floating point data aggregation value, the total length of the shaping data, the floating point data value, and the decimal length
  • the shaping data aggregation value obtaining module inputs the obtained shaping data aggregation value to the shaping data decoupling module.
  • the decoupling unit further includes:
  • a data judging module configured to determine whether the shaped data is a weight data set
  • the data number correction module is configured to: when the shaping data is a weight data group, the number of the shaped data that is output is a value that is reduced by one from the actual number of shaping data.
  • the number of the shaped data that is output is the actual number of shaping data
  • the shaping data decoupling module After the shaping data is a weight data group, the shaping data decoupling module further obtains a raster data according to the length of the shaping data and the plurality of raster data that have been obtained after splitting the shaping data aggregation value. .
  • a sixth aspect of the present invention provides a data processing system, comprising: the above data aggregation device; a data transmission device; and the data decoupling device, wherein the data aggregation device aggregates a layer of gate The data is transmitted to the data decoupling device via the data transmission device, and the data decoupling device decouples the received layer of raster data to obtain multi-layer raster data.
  • a seventh aspect of the present invention provides a data aggregation apparatus, including:
  • a memory for storing instructions executable by the processor
  • processor is configured to: execute an instruction stored by the memory,
  • An eighth aspect of the present invention provides a data decoupling apparatus, including:
  • a memory for storing instructions executable by the processor
  • processor is configured to: execute an instruction stored by the memory,
  • the multi-layer raster data is generated based on the plurality of raster data respectively corresponding to each of the row and column numbers.
  • the data amount of the raster data can be effectively reduced.
  • FIG. 1 is a flowchart showing a raster data aggregation method according to a first embodiment of the present invention
  • FIG. 2 is a flowchart showing the first embodiment of the polymerization method according to the first embodiment of the present invention
  • FIG. 3 is a flow chart showing a second embodiment of the polymerization method according to the first embodiment of the present invention.
  • FIG. 4 is a schematic view showing a raster data aggregation method in Embodiment 2 in which a first embodiment of the present invention is applied to a predetermined area;
  • FIG. 5 is a flowchart showing a raster data decoupling method according to a second embodiment of the present invention.
  • FIG. 6 is a flowchart showing a first embodiment of a decoupling method according to a second embodiment of the present invention.
  • FIG. 7 is a flowchart showing a second embodiment of the decoupling method according to the second embodiment of the present invention.
  • FIG. 8 is a schematic diagram showing a raster data decoupling method in Embodiment 2 in which a second embodiment of the present invention is applied to a predetermined area;
  • FIG. 9 is a schematic block diagram showing a raster data aggregation device according to a third embodiment of the present invention.
  • FIG. 10 is a schematic structural view showing a polymerization unit according to Embodiment 1 of the third embodiment of the present invention.
  • FIG. 11 is a schematic structural view showing a polymerization unit according to a second embodiment of the third embodiment of the present invention.
  • FIG. 12 is a schematic block diagram showing a raster data decoupling apparatus according to a fourth embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram showing a decoupling unit according to Embodiment 1 of the fourth embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram showing a decoupling unit according to Embodiment 2 of the fourth embodiment of the present invention.
  • 15 is a diagram showing the configuration of a data processing system according to a fifth embodiment of the present invention. intention.
  • the inventors of the present invention have found through research that when raster data is applied, it is necessary to map the raster data to the row and column position in advance. At this time, I/O operations are involved, because frequent I/O operations are relatively inefficient, so generally
  • the data of the predetermined area is read once, that is, a huge area data in the original grid area is once cached into the memory to improve efficiency, but if the extracted cache data area is too large, the amount of data is too large, and the memory is occupied. , may cause the system to run out of memory, a memory overflow, and easy to cause the program to crash. This risk will multiply when applying multi-tier raster data.
  • one solution is to reduce the size of the area of one cache and increase the number of I/O operations, but at the cost of reducing efficiency.
  • Another option is to reduce the amount of data. I/O operations are limited by computer systems and are not easily optimized.
  • the inventors of the present invention have proposed a data aggregation method of aggregating multi-layer raster data into one layer of raster data. That is, multiple raster data of the same rank number is aggregated into one raster data. After such data aggregation, data transmission is performed, and when applied, the aggregated layer of raster data is decoupled into multi-layer raster data.
  • multi-layer raster data refers to raster data that includes the same row number range (eg, geographic location) and has different values.
  • row number range e.g, geographic location
  • multi-level raster data in a geographic information system GIS
  • these multiple layers of raster data represent the same geographic area and represent different attributes of the area, respectively.
  • the present invention does not particularly limit the manner in which the multilayer raster data is stacked, the geographical position, and the like.
  • the plurality of raster data respectively represent different attributes at the position of the rank number.
  • the plurality of raster data described above may respectively represent different attributes such as a building type, a number of floors, a building use, a construction period, and the like at the location.
  • the plurality of raster data described above may respectively represent gray scales of the same pixel point, Different properties such as brightness, saturation, etc.
  • the application scenario of the raster data in the present invention is not particularly limited.
  • the raster data of each layer in the multi-layer raster data can be either shaped data or floating point data.
  • Shaped data refers to numeric data that does not contain fractional parts.
  • Floating-point data refers to data that contains fractional parts, including integer parts and fractional parts.
  • the shaping data may also be a weight data set.
  • the weight data group refers to: the original value of each data in the data group is a weight ratio within a range of 0-1, and the sum of the original values is 1, and the ratio data is enlarged by 10 times the N power, and expressed as an integer. Out, thus forming a data set represented by the shaped data.
  • the weight data set is [20, 30, 50]
  • the three original values represented are 0.2:0.3:0.5. That is, the shaped weight data set can be changed by multiplying the ratio shown by the floating point data by a few (for example, 2) power of 10.
  • a few for example, 2 power of 10.
  • the weight ratio is (23%, 32%, 45%), and the sum is 1.
  • the shaping data is a weight data group, since the sum of the ratios is 1, even if one of the ratios is omitted, the omitted ratio can be calculated by the sum of the other ratios. That is, one of the data in the weight data set can be defaulted.
  • the data length refers to the length when the data is converted into a character string, not the actual storage length.
  • FIG. 1 is a flowchart showing a raster data aggregation method according to a first embodiment of the present invention.
  • the i-row j column is referred to as the walad number (i, j).
  • step S10 from the multi-layer raster data, Do not extract multiple raster data for the row number (i, j). Where i is the line number and j is the column number.
  • i is the line number and j is the column number.
  • the raster data if the row number and the column number are the same, it means that they are in the same position, so the plurality of raster data extracted at this time is data for the same position.
  • the raster data of each layer corresponds to the data of the predetermined area of the layer.
  • step S20 a plurality of raster data of the rank number (i, j) are aggregated to generate a single raster aggregate value at the rank number (i, j).
  • a plurality of raster data in a high and low position to form a single raster aggregate value. That is, a plurality of raster data can be arranged in a high-low order of the data length to be a single raster aggregate value.
  • the building type is 1 (0-3)
  • the number of floors is 15 (0-99)
  • the building use is 8 (0-16)
  • the construction period is 20 (0-99)
  • the floating point number is 0.
  • the result of the aggregation algorithm is 1150820.
  • polymerization method of the present invention is not limited to the one described later, and other polymerization methods known to those skilled in the art may be used as long as a plurality of grids of the same rank number in the multi-layer raster data are aggregated. .
  • step S30 it is judged whether or not all the rank numbers of the predetermined area have been operated, and if so, the process proceeds to step S40. If no, the process proceeds to step S50.
  • the predetermined area is an area that is an object of data aggregation.
  • step S40 a layer of raster data is generated based on a single raster aggregate value for each rank number. Specifically, the obtained single raster aggregate value corresponding to each rank number is integrated into one layer of raster data.
  • step S50 the rank number (i, j) is changed, and the process returns to step S10.
  • steps S30-S50 can be understood as: acquiring a single raster aggregation value at each row and column number, and generating a layer of raster data according to a single raster aggregation value at each row and column number.
  • the amount of data is reduced, and the memory is used to achieve decoupling, which greatly reduces the number of I/O operations and is beneficial to improve. Processing efficiency.
  • the plurality of raster data of the same rank number may include the shaped data, and may also include floating point data.
  • the present invention does not particularly limit the number of shaped data and the number of floating point data included in the plurality of raster data.
  • FIG. 2 is a flowchart showing the first embodiment of the polymerization method according to the first embodiment of the present invention.
  • the first embodiment is an example in which a plurality of raster data includes only shaped data and the number of shaped data is two or more. Since the aggregation mode for each rank number is the same, in Embodiment 1, the grid of the row number i and the column number j is taken as an example, and the plurality of raster data in the step S20 is aggregated into a single grid. The process of merging aggregate values is described in detail.
  • step S201 the maximum effective length is obtained according to the stored data type of the raster data.
  • the maximum effective length L max can be calculated as follows:
  • the storage data type is usually a 32-bit short integer Int (which stores a maximum data length L Datatype of 10), a 64-bit long integer long, and the like. It can also be single-precision, double-precision, etc. in floating point shape. You can choose according to the specific data type.
  • raster data storage are often limited by format. That is, the actual stored significant digits of different raster data are different. For example, if the file type GRID raster data supports only 32-bit integers (short shaping), the corresponding data size is -2,147,483,648 to +2,147,483,647, and the maximum data length L Datatype is stored. For 10 significant digits, since the maximum value of the highest digit can only be 2, it cannot be used effectively, so the real effective digit is 9, that is, the maximum effective length L max is 9. That is, the maximum effective length L max that can be stored differs depending on the type of data stored.
  • step S202 the total length L Intsum of the shaped data is calculated based on the shaped data length L Int and the number of shaped data n.
  • the integer data length L Int refers to the length when the shaped data is converted into a character string. If the lengths of the pieces of shaped data in each layer are different, L Int represents the maximum length in the shaped data of each layer.
  • the number of shaped data n is the number of valid shaped data to be stored. In the normal case, the number n of shaped data indicates the number of layers of the multi-layer raster data to be aggregated.
  • the total length of the shaped data L Intsum is the sum of the lengths of all the shaped data.
  • the length of the shaped data and the number of shaped data are not particularly limited. However, the longer the length of the shaped data, the smaller the number of shaped data that can be aggregated. Therefore, combined with the above analysis and the usual raster data storage type and shaping data length, etc., shaping data The value is preferably within 1000, more preferably within 10.
  • the total length of the shaped data is:
  • the above step S202 may further include step S202A.
  • the step S202A may further include steps S2021 and S2022, and determine multiple in step S2021. Whether the shaped data in the raster data is a weight data group, and in step S2022, when the shaped data in the plurality of raster data is a weighted data group, the number of the shaped data is reduced by one, when the plurality of raster data is When the shaping data is not a weight data group, the number of shaping data remains unchanged.
  • the step S202A can be omitted.
  • step S203 it is determined whether the total length L Intsum of the shaped data is greater than the maximum effective length L max . That is, L Intsum > L max . If the total length L Intsum of the shaped data is greater than the maximum effective length L max , it means that the length of the shaped data after aggregation is beyond the maximum effective length that can be stored, and therefore, the processing ends. If the total length L Intsum of the shaped data is less than or equal to the maximum effective length L max , it proceeds to step S204.
  • the number of the shaped data of the plurality of raster data exceeds a predetermined value such that the total length L Intsum of the shaped data is greater than the maximum effective length L max , it is difficult to aggregate all the shaped data in the plurality of raster data into a single grid. Aggregate value. Therefore, in the case where the total length L Intsum of the shaped data is smaller than or equal to the maximum effective length L max , the plurality of shaped data can be aggregated into the shaped data aggregated value.
  • step S204 according to the total length L Intsum of the shaped data, the length of the shaped data L Int , and the number n of the shaped data, a plurality of raster data are arranged in the high and low positions to obtain an integer data aggregation value Data Int (i, j). .
  • L Intsum refers to the total length of the shaped data
  • L Int refers to the shaped data length
  • n refers to the shaped data Number
  • the shaped data aggregate value Data Int (i, j) acquired in step S204 is taken as a single raster aggregate value at the rank number (i, j).
  • Embodiment 1 by aggregating two or more pieces of shaped data into a single raster aggregate value, the amount of data can be effectively reduced.
  • FIG. 3 is a flow chart showing a second embodiment of the aggregation method according to the first embodiment of the present invention.
  • the second embodiment is an example of a case where a plurality of raster data includes one floating-point data in addition to two or more pieces of shaped data.
  • step S20 the process of aggregating a plurality of raster data into a single raster aggregate value in step S20 will be described in detail by taking a grid with a row number i and a column number j as an example.
  • Embodiment 2 after the shaping data aggregation value is obtained as in Embodiment 1, the shaping data aggregation value is not directly used as the single raster data value at the row number (i, j), but in the shaping data.
  • the floating point data is re-aggregated based on the aggregated value to obtain a floating-point data aggregate value, and the obtained floating-point data aggregate value is used as a single raster aggregate value at the row number (i, j).
  • the process of aggregating a plurality of raster data into a single raster aggregation value in Embodiment 2 further includes the following steps S211 to S215 after step S205 of FIG. 2.
  • step S211 the floating-point data allowable length L float is calculated based on the maximum effective length L max and the total length L Intsum of the shaped data.
  • step S212 it is judged whether or not the floating point data allowable length L float is larger than the integer partial length L float_Int of the floating point data. If the floating point data allows the length L float to be larger than the integer partial length L float_Int of the floating point data, that is, L float > L float_Int , then step S213 is performed. If the floating point data allows the length L float to be less than or equal to the integer part length L float_Int of the floating point data, ie L float ⁇ L float_Int , it means that the integer part of the floating point data is aggregated to the shaped data. The aggregated value will exceed the maximum that can be stored. The effective length, therefore, ends the processing.
  • step S213 according to the length L float allows floating point data and integer part of the length L float_Int, decimal floating-point data calculated length L float_delta.
  • the decimal length L float_delta represents the length of the decimal place that the floating point data can retain
  • the integer part length L float_Int actually refers to the integer part length of the largest floating point data among the floating point data of all the grids of the predetermined area.
  • step S214 the value of F.
  • the floating point data correction value Data float (i, j) is a floating point data value in which only the decimal places satisfying the decimal length L float_delta are retained.
  • Round() is a rounding function.
  • step S215 the data aggregation values orthopedic Data Int (i, j), floating-point correction value data Data float (i, j), the total length of the data shaping L Intsum, decimal floating-point data length L float_delta obtain float Point data aggregation value Data(i,j).
  • the decimal length L float_delta of the floating point data can also be the same as the integer data length L Int .
  • the floating point data aggregate value Data(i,j) is:
  • the floating point data aggregation value Data(i, j) obtained in step S215 is taken as a single raster aggregation value.
  • the floating point data value F(i, j) is aggregated to the upper bit of the shaped data aggregate value Data Int (i, j), but the floating point data value may also be used. Aggregates to the lower bits of the shaped data aggregate value.
  • Fig. 4 is a schematic view showing a raster data aggregation method in the second embodiment in which the first embodiment of the present invention is applied to a predetermined area. It should be noted that, since the aggregation manners at each rank number are the same, the aggregation process is illustrated by taking the row number (i, j) as an example, and FIG. 4 shows the predetermined area, For example, a 3 ⁇ 3 grid area performs the process of data aggregation. In FIG. 4, the grids of the same row number can be polymerized by the polymerization method of Example 2, respectively.
  • the plurality of raster data includes not only the shaped data but also the floating point data, and the plurality of raster data including the floating point data can also be aggregated, and therefore, in addition to the advantages of the first embodiment, In addition, the scope of application is more extensive.
  • FIG. 5 is a flowchart showing a raster data decoupling method according to a second embodiment of the present invention.
  • the raster data decoupling method in the second embodiment corresponds to the raster data aggregation method in the first embodiment. That is, one layer of raster data that is aggregated by the raster data aggregation method of the first embodiment can be decoupled into multi-layer raster data by the raster data decoupling method of the second embodiment.
  • step S60 a single raster aggregate value corresponding to the rank number (i, j) is extracted from one layer of raster data, respectively.
  • a single raster aggregate value at the rank number (i, j) is decoupled to generate a plurality of raster data at the rank number (i, j).
  • a single raster aggregate value can be split into multiple raster data at high and low levels.
  • the specific decoupling method will be described in detail later. However, the decoupling method of the present invention is not limited to the manner described later, and other aggregation methods known to those skilled in the art may be utilized as long as it is the same row in one layer of raster data. Multiple rasters of column numbers can be decoupled.
  • step S80 it is judged whether or not all the rank numbers of the predetermined area have been operated, and if so, step S90 is performed. If no, proceed to step S100.
  • step S90 multi-layer raster data is generated by integrating raster data of different row and column numbers located in the same layer according to the plurality of raster data at each row and column number.
  • step S100 the rank number (i, j) is changed, and the process returns to step S60.
  • steps S80-S100 can be understood as: acquiring a plurality of raster data at each row and column number, and generating multi-layer raster data according to the plurality of raster data at all row and column numbers of the predetermined region.
  • the second embodiment of the present invention by decoupling a layer of raster data into multi-layer raster data, only one layer of raster data can be used in data communication transmission and I/O access, thereby greatly reducing the amount of data. And quickly decoupled into the original multi-layer raster data when applied, without losing the accuracy of the original data. As a result, the efficiency is much faster than the conventional data communication transmission or I/O access, without losing data accuracy, and is not easily limited by the size of the memory.
  • Fig. 6 is a flowchart showing the first embodiment of the decoupling process according to the second embodiment of the present invention.
  • the first embodiment is an example in which a plurality of raster data includes only shaped data and the number of shaped data is two or more. Since the decoupling manners for each single grid aggregation value are the same, in Embodiment 1, the grid with the row number i and the column number j is taken as an example, and the single grid aggregation value in step S70 is used. The process of decoupling multiple raster data is described in detail.
  • a single raster aggregate value is the shaped data aggregate value.
  • step S701 the total length L Intsum of the shaped data is calculated based on the shaped data length L Int and the number n of shaped data.
  • the modes of the formulas (2) and (3) in the first embodiment can be used.
  • Step S701 may further include step S701A, the operation of which is the same as the operation of step S202A in the first embodiment, and therefore, the description thereof is omitted here.
  • step S702 according to the total length L Intsum of the shaped data, the length of the shaped data L Int , and the number n of the shaped data, the shaped data aggregation value Data Int (i, j) is split in the high and low bits to obtain a plurality of raster data.
  • X k (i, j) is split in the high and low bits to obtain a plurality of raster data.
  • Int() refers to the rounding function and N is a non-negative integer set.
  • Step S702 may further include step S702A and step S702B after obtaining the plurality of raster data.
  • step S702A it is determined whether the plurality of shaped data are weight data sets. If yes, go to step S702B, and if no, end the operation.
  • step S702B according to the obtained plurality of raster data And the integer data length L Int , the last raster data X n (i, j) is obtained.
  • step S202A the last raster data X n (i, j) at this time is the weighted data group in the plurality of raster data, when the raster data aggregation is performed, in step S202A
  • the default one is the shaping data.
  • Embodiment 1 by decoupling a single raster aggregation value into two or more shaped data, data can be efficiently recovered to ensure data accuracy.
  • Fig. 7 is a flowchart showing a second embodiment of the decoupling process according to the second embodiment of the present invention.
  • the second embodiment is an example of a case where a plurality of raster data includes one floating-point data in addition to two or more pieces of shaped data.
  • step S70 the process of decoupling a single raster aggregation value into a plurality of raster data in step S70 is also specifically described by taking a grid with row number i and column number j as an example.
  • multiple raster data also includes one floating point data
  • the single raster aggregate value is first split into a floating point data value and an integer data aggregate value, and then the shaped data aggregate value is split on the high and low bits. Get multiple shaping data.
  • step S711 and step S712 are further included after step S701 of FIG. 6 and before step S702.
  • step S711 the total length of the data shaping L Intsum, fractional bit length L float_delta, number of ranks (i, j) the single aggregated value of the grid at the Data (i, j) split to obtain floating point values F (i, j).
  • the single raster aggregate value Data(i,j) at this time is the floating point data aggregate value.
  • decimal length L float_delta represents the length of the decimal place that the floating point data can retain. It can be obtained, for example, by the above formula (6) or the like as in the above-described step S213. The description will not be repeated here.
  • the floating point data value is aggregated to the upper bit of the shaped data aggregate value
  • the high bit of the floating point raster aggregate value is split. , obtained floating point data values.
  • the lower bits of the floating-point raster aggregate value may also be split to obtain floating-point data values.
  • step S712 the shaping data aggregation value Data is obtained according to the single raster aggregation value Data(i, j), the floating point data value F(i, j), the integer data length L Intsum , and the decimal length L float_delta . Int (i,j).
  • Fig. 8 is a schematic view showing a raster data decoupling method in the second embodiment in which the second embodiment of the present invention is applied to a predetermined area. It should be noted that, since the decoupling manners at each row and column number are the same, in the above embodiment, the decoupling process is illustrated by taking the row and column number (i, j) as an example, and FIG. 8 shows A process of data decoupling for a predetermined area, such as a 3x3 grid area. In FIG. 8, the grids of the same row number can be decoupled by the decoupling method of Embodiment 2, respectively.
  • the plurality of raster data includes not only the shaped data but also the floating point data, and the raster data in which the floating point data is aggregated can also be decoupled, and therefore, in addition to the advantages of the first embodiment, In addition, the scope of application is more extensive.
  • FIG. 9 is a block diagram showing a configuration of a raster data aggregation device according to a third embodiment of the present invention.
  • the raster data aggregation device 1 includes a multi-grid extraction unit 10, an aggregation unit 20, and an aggregation data generation unit 30.
  • the multi-grid extraction unit 10 is configured to extract a plurality of raster data of the row number (i, j) from the multi-layer raster data, respectively.
  • the aggregation unit 20 is configured to aggregate a plurality of raster data for the rank number (i, j) to generate a single raster aggregate value at the rank number (i, j).
  • the aggregation unit 20 can be configured to arrange a plurality of raster data in a high and low position as a single raster aggregate value.
  • the aggregated data generating unit 30 is configured to generate a layer of raster data based on a single raster aggregate value for each rank number.
  • the aggregated data generating unit 30 may first determine whether or not all row and column numbers of the predetermined region have been operated. If the aggregation operation for all of the row and column numbers has not been completed, the row and column number is changed until the aggregation operation of all the row and column numbers of the predetermined region is completed.
  • the aggregation unit 20 may include: a total length calculation module 210 and an shaping data aggregation module 220. At this time, the polymerization unit 20 can perform the polymerization process of Embodiment 1 of the first embodiment.
  • the total length calculation module 210 is configured to calculate the total length of the shaped data according to the length of the shaped data and the number of the shaped data.
  • the shaping data aggregation module 220 is configured to arrange a plurality of shaping data on the high and low bits according to the length of the shaping data, the total length of the shaping data, and the number of the shaping data, to obtain the shaping data aggregation value, and to use the shaping data aggregation value as a single Grid aggregate value output.
  • the aggregating unit 20 may further include an shaping length judging module 230 configured to obtain a maximum effective length according to the stored data type, and determine whether the total length of the shaping data is greater than a maximum effective length, when the shaping When the total length of the data is less than or equal to the maximum effective length, the shaping data aggregation module 220 performs an operation of arranging a plurality of shaping data on the high and low positions.
  • an shaping length judging module 230 configured to obtain a maximum effective length according to the stored data type, and determine whether the total length of the shaping data is greater than a maximum effective length, when the shaping When the total length of the data is less than or equal to the maximum effective length, the shaping data aggregation module 220 performs an operation of arranging a plurality of shaping data on the high and low positions.
  • the total length calculation module 210 may further include a data determination module 210A and a number correction module 210B, the data determination module 210A is configured to determine whether the shaping data is a weight data group, and the number correction module 210B is configured to be
  • the number of the shaped data to be output is a value that is decremented by one from the actual number of the shaped data, and the shaped data is not the weight.
  • the number of shaped data that is output is the actual number of shaped data.
  • the aggregating unit 20' has the same configuration as the aggregating unit 20 in the embodiment 1,
  • the method may further include: an allowable length calculation module 240, a decimal length calculation module 250, a floating point data modification module 260, and a floating point data aggregation module 270.
  • the polymerization unit 20' can perform the polymerization process of Embodiment 2 of the first embodiment.
  • the allowable length calculation module 240 is configured to obtain an allowable length of the floating point data according to the maximum effective length and the total length of the shaped data.
  • the fractional length calculation module 250 is configured to obtain the fractional length based on the allowable length and the length of the integer portion.
  • the floating point data correction module 260 is configured to correct the floating point data according to the floating point data value and the decimal place length to obtain a correction value.
  • the floating-point data aggregation module 270 is configured to arrange the floating-point data and the shaping data aggregation value in high and low positions according to the correction value, the shaping data aggregation value, the total length of the shaping data, and the decimal length, to obtain floating-point data aggregation.
  • the value, and the floating point data aggregate value as a single raster aggregate value.
  • the aggregating unit 20' may further include an allowable length determining module 280 configured to determine whether the floating point data allowable length is greater than an integer part length of the floating point data, if the floating point data allows the length to be greater than an integer For the partial length, the decimal length is obtained by the decimal length calculation module 250. If the floating point data allows the length to be less than or equal to the integer portion length, the processing ends.
  • an allowable length determining module 280 configured to determine whether the floating point data allowable length is greater than an integer part length of the floating point data, if the floating point data allows the length to be greater than an integer For the partial length, the decimal length is obtained by the decimal length calculation module 250. If the floating point data allows the length to be less than or equal to the integer portion length, the processing ends.
  • FIG. 12 is a schematic block diagram showing a raster data decoupling apparatus according to a fourth embodiment of the present invention.
  • the raster data decoupling device 2 includes a single raster extraction unit 40, a decoupling unit 50, and a decoupling data generation unit 60.
  • the single-grid extraction unit 40 is configured to extract a single raster aggregation value corresponding to the row and column number (i, j) from one layer of raster data.
  • the decoupling unit 50 is configured to decouple a single raster aggregate value at the rank number (i, j) to generate a plurality of raster data at the rank number (i, j).
  • the decoupling data generating unit 60 is configured to respectively integrate the grids of different row and column numbers located in the same layer according to the plurality of raster data at each row and column number.
  • the decoupling data generating unit 60 may first determine whether all row and column numbers of the predetermined area are operated. If the decoupling operation of all the row numbers has not been completed, the row number is changed until the decoupling of all the row numbers of the predetermined area is completed. operating.
  • the decoupling unit 50 includes a total length calculating module 510 and a shaping data decoupling module 520. At this time, the decoupling unit 50 can perform the data decoupling process of Embodiment 1 of the second embodiment.
  • the total length calculation module 510 is the same as the total length calculation module 210 in FIG. 11, and thus the description is omitted.
  • the shaping data decoupling module 520 is configured to split the shaping data aggregation value in the high and low positions according to the total length of the shaping data, the shaping data length, and the number of shaping data to obtain a plurality of raster data.
  • the shaping data decoupling module 520 when the shaping data is a weight data group, the shaping data decoupling module 520 further obtains a grid according to the length of the shaping data and the plurality of raster data that have been obtained after splitting the shaping data aggregation value. data.
  • the decoupling unit 50' includes the total length calculating module 510 and the shaping data decoupling module 520.
  • the floating point data decoupling module 530 and the shaping data decoupling value obtaining module 540 are further included. At this time, the decoupling unit 50' can perform the data decoupling process of the second embodiment of the second embodiment.
  • the floating point data decoupling module 530 is configured to split the floating point data aggregation value according to the total length of the shaped data and the length of the decimal point to obtain a floating point data value.
  • the shaping data aggregation value obtaining module 540 obtains the shaping data aggregation value according to the floating point data aggregation value, the floating point data value, the total length of the shaping data, and the decimal length.
  • the shaping data aggregation value obtaining module 540 inputs the obtained shaping data aggregation value to the shaping data decoupling module 520.
  • the shaping data decoupling module 520 splits the shaping data aggregation value input by the shaping data aggregation value obtaining module 540 on the high and low bits to obtain a plurality of raster data.
  • the data decoupling apparatus according to the fourth embodiment can obtain the same technical effects as those of the second embodiment.
  • the first embodiment and the second embodiment in the first to fourth embodiments described above are arranged such that a plurality of raster data are arranged in a high or low position of the data length as a single raster aggregation value, or a single raster aggregation value.
  • An embodiment of splitting into multiple raster data at high and low levels of data length is not limited thereto, and encryption for data may also be used. Replace other ways in the decryption operation.
  • the 2 n -1 value (for example, 1, 3, 7, 15, 31, 63, 7) has the following speciality: the added value of any of the values can be uniquely determined by which values are added. Where n is a natural number.
  • multiple raster data can be represented by multiple 2 n -1 values (for example, 2 n1 -1, 2 n2 -1, ..., 2 nk -1) to get their
  • the added value A is the added value A as a single raster aggregate value. It is also possible to set an index Index(A) to such an added value, and use the index Index(A) as a single raster aggregate value. Since such an added value or an indexed data amount is small, it is easy to transmit and access.
  • the sum of the 2 n -1 values is uniquely determined according to the added value A, that is, 2 n1 -1, 2 n2 -1, ..., 2 nk -1 are respectively obtained. value. It is also possible to find the added value A corresponding thereto according to the index Index (A), and obtain the value of 2 n1 -1, 2 n2 -1, ..., 2 nk -1 from the added value A. Thereby, loss of data accuracy can be avoided.
  • the index dictionary is generated according to the arrangement and combination of the plurality of raster data, and the correspondence between the plurality of raster data and the index is determined by searching the dictionary.
  • an index is determined based on a combination of a plurality of raster data search indexes, and the index is aggregated as a single raster.
  • the permutation combination of the corresponding plurality of raster data is determined by the index lookup dictionary, thereby obtaining each of the plurality of raster data.
  • the first modification and the second modification described above may be combined with the first to fourth embodiments of the present invention.
  • the examples are used in combination.
  • the plurality of raster data may be first divided into multiple groups, and each group is aggregated using the polymerization mode of the modification 1 to obtain a plurality of intermediate polymerization values, and the first embodiment is used for the intermediate polymerization values.
  • the aggregation method in which a single data aggregation value is obtained.
  • the decoupling method in the second embodiment is used for the single data aggregation value to obtain a plurality of intermediate aggregation values
  • the decoupling manner of the modification 1 is used for each intermediate aggregation value to obtain multiple grids. data.
  • FIG. 15 is a schematic diagram showing the configuration of a data processing system according to a fifth embodiment of the present invention.
  • the data processing system includes the data aggregation device 1 as described in the third embodiment, the data decoupling device 2 as described in the fourth embodiment, and the data transmission device 3.
  • the data aggregation device 1 transmits the aggregated layer of raster data to the data decoupling device 2 via the data transmission device 3, and the data decoupling device 2 decouples the received layer of raster data to obtain a multi-layer grid. data.
  • the data aggregation device 1 and the data decoupling device 2 may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof.
  • the data aggregation device 1 and the data decoupling device 2 may comprise a processor, which may be an integrated circuit, or may be an operational core or a control core such as a CPU. Its function is mainly to explain computer instructions and to process data in computer software.
  • the data aggregation device 1 and the data decoupling device 2 may include a memory that can be divided into a main memory (memory) by use, for example, a ROM (Read Only Memory image), a RAM (Random Access Memory), and a random access memory. And auxiliary storage (external storage).
  • the memory has a memory space for program code for performing any of the method steps described above.
  • the storage space for the program code may include various program codes for implementing the various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card, or a floppy disk. Such computer program products are typically portable or fixed storage units.
  • the storage unit may have a storage section, a storage space, and the like arranged similarly to the memory in the terminal described above.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes Computer readable code, that is, code that can be read by a processor, such as a processor, when executed by a search engine program on a server, causes the server to perform various steps in the methods described above.
  • the data aggregation device 1 and the data decoupling device 2 may also include input devices for interaction between the user and the device, which may be a keyboard, a mouse, an image capture component, a touch screen or the like.
  • the data aggregation device 1 and the data decoupling device 2 may further include an output device, which may be a screen, an image projection unit, a stereoscopic display device, or the like.
  • the data aggregation device 1 and the data decoupling device 2 may also include a communication interface for data communication in a wired or wireless manner.
  • the data transmission device 3 is a device for performing data transmission between the data aggregation device 1 and the data decoupling device 2, and may be a data bus, an I/O interface, a cable, an optical cable, or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Remote Sensing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)

Abstract

本发明涉及栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统。本发明的栅格数据聚合方法,包括:从多层栅格数据中分别提取相同行列号的多个栅格数据;对所述多个栅格数据进行聚合来生成单个栅格聚合值;以及根据与每个行列号对应的单个栅格聚合值,生成一层栅格数据。通过将多个栅格数据进行聚合来生成单个栅格聚合值,能够有效地减少数据量,有利于减少传输负担。

Description

栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统 技术领域
本发明涉及栅格数据处理领域,尤其是涉及多层栅格数据的聚合和解耦。
背景技术
栅格数据是按网格单元的行与列排列、具有不同灰度或颜色的阵列数据。每一个单元(例如,网格、像素)的位置由它的行列号定义。栅格数据具有规则性好、相对于矢量数据容易获取、图释表现力好、数据范围大、数据通用、存储格式相对较小等特点,广泛应用于GIS(地理信息系统)、图像处理系统等中。
然而,在上述应用场景中,有时为了表示不同的属性等,具有多层(多套)栅格数据。例如,在GIS系统中,存在分别表示预定区域的坡度、坡向、植被等不同属性的多层栅格数据。此时,所需的栅格数据的数据量大,占用较多的存储空间,数据通信的通信量也很大。
发明内容
本发明提供一种将多层栅格数据聚合为一层栅格数据从而减少数据量的栅格数据聚合方法和装置、以及栅格数据解耦方法和装置。
本发明的实施方式所提供的第一方式涉及一种栅格数据聚合方法,包括:从多层栅格数据中分别提取相同行列号的多个栅格数据;对所述多个栅格数据进行聚合来生成单个栅格聚合值;以及根据与每个行列号对应的单个栅格聚合值,生成一层栅格数据。
在上述的栅格数据聚合方法中,
所述对所述多个栅格数据进行聚合来生成单个栅格聚合值包括:
将所述多个栅格数据在高低位上排列配置为所述单个栅格聚合值。
在上述的栅格数据聚合方法中,
所述对所述多个栅格数据进行聚合来生成单个栅格聚合值包括:
由2n-1值来表示所述多个栅格数据,并将2n-1值的相加值作为单个栅格聚合值,其中,n为自然数。
在上述的栅格数据聚合方法中,
所述对所述多个栅格数据进行聚合来生成单个栅格聚合值包括:
根据所述多个栅格数据的排列组合查找字典,确定与该排列组合对应的索引,并将该索引作为所述单个栅格聚合值。
在上述的栅格数据聚合方法中,
所述多个栅格数据包括2个以上的整形数据,
所述将所述多个栅格数据在高低位上排列配置为所述单个栅格聚合值包括:
根据存储数据类型,获得最大有效长度,
根据整形数据长度和整形数据个数,计算整形数据总长度,
判断所述整形数据总长度是否大于所述最大有效长度,
当所述整形数据总长度小于或等于所述最大有效长度时,根据所述整形数据长度、所述整形数据总长度及所述整形数据个数,将所述多个整形数据在高低位上排列配置,获得整形数据聚合值,将所述整形数据聚合值作为所述单个栅格聚合值。
在上述的栅格数据聚合方法中,
所述多个栅格数据还包括浮点数据,
在获得整形数据聚合值之后,所述将所述多个栅格数据在高低位上排列配置为所述单个栅格聚合值还包括:
根据所述最大有效长度和所述整形数据总长度,获得浮点数据的允许长度;
根据所述允许长度和整数部分长度,获得小数位长度;
根据浮点数据值和所述小数位长度,对浮点数据进行修正,获得修正值;
根据所述修正值、所述整形数据聚合值、所述整形数据总长度、所述小数位长度,将所述浮点数据值和所述整形数据聚合值在高低位上排列配 置,获得浮点数据聚合值,将所述浮点数据聚合值作为所述单个栅格聚合值。
在上述的栅格数据聚合方法中,
当所述整形数据为权重数据组时,所述整形数据个数为从实际的整形数据个数减一的值,
当所述整形数据不是权重数据组时,所述整形数据个数为实际的整形数据个数。
本发明的实施方式所提供的第二方式涉及一种栅格数据解耦方法,从一层栅格数据中提取与每个行列号对应的单个栅格聚合值;对所述单个栅格聚合值进行解耦来生成多个栅格数据;以及根据每个行列号处的所述多个栅格数据,分别整合位于同一层的不同行列号的栅格数据来生成多层栅格数据。
在上述的数据解耦方法中,
所述对所述单个栅格聚合值进行解耦来生成多个栅格数据包括:
将所述单个栅格聚合值在高低位上拆分成所述多个栅格数据。
在上述的数据解耦方法中,
所述对所述单个栅格聚合值进行解耦来生成多个栅格数据包括:
将单个栅格聚合值作为相加值,根据该相加值,分别获得多个2n-1值,分别作为多个栅格数据,其中,n为自然数。
在上述的数据解耦方法中,
所述对所述单个栅格聚合值进行解耦来生成多个栅格数据包括:
通过索引查找字典,确定与该索引对应的多个栅格数据的排列组合,从而获得多个栅格数据中的每一个。
在上述的数据解耦方法中,
所述多个栅格数据包括2个以上的整形数据,
所述单个栅格聚合值为整形数据聚合值,
所述将所述单个栅格聚合值在高低位上拆分成所述多个栅格数据包括:
根据整形数据长度和整形数据个数,计算整形数据总长度;以及
根据所述整形数据总长度、所述整形数据长度、所述整形数据个数, 将所述整形数据聚合值在高低位上拆分成所述多个栅格数据。
在上述的数据解耦方法中,
所述多个栅格数据还包括浮点数据,
所述单个栅格聚合值不是整形数据聚合值,而是浮点数据聚合值,
将所述单个栅格聚合值在高低位上拆分成所述多个栅格数据的过程在计算整形数据总长度之后、在拆分所述整形数据聚合值之前,还包括:
根据所述整形数据总长度、浮点数据的小数位长度,对所述浮点数据聚合值进行拆分,获得浮点数据值,
根据所述浮点数据聚合值、所述整形数据总长度、所述浮点数据值、所述小数位长度,获得所述整形数据聚合值。
在上述的数据解耦方法中,
当所述整形数据为权重数据组时,所述整形数据个数为从实际的整形数据个数减一的值,并且,在拆分所述整形数据聚合值之后,还根据整形数据长度和已经获得的多个栅格数据,再获得一个栅格数据,
当所述整形数据不是权重数据组时,所述整形数据个数为实际的整形数据个数。
本发明的实施方式所提供的第三方式涉及一种数据聚合解耦方法,包括:
利用上述的数据聚合方法将多层栅格数据聚合为一层栅格数据;以及
利用上述的数据解耦方法将一层栅格数据解耦为多层栅格数据。
本发明的实施方式所提供的第四方式涉及一种栅格数据聚合装置,包括:多栅格提取单元,被配置为从多层栅格数据中分别提取相同行列号的多个栅格数据;聚合单元,被配置为对所述多个栅格数据进行聚合来生成单个栅格聚合值;以及聚合数据生成单元,被配置为根据与每个行列号对应的单个栅格聚合值来生成一层栅格数据。
在上述的栅格数据聚合装置中,
所述聚合单元被配置为将所述多个栅格数据在高低位上排列配置为所述单个栅格聚合值。
在上述的栅格数据聚合装置中,
所述多个栅格数据包括2个以上的整形数据,
所述聚合单元包括:
总长度计算模块,被配置为根据整形数据长度和整形数据个数,计算整形数据总长度;以及
整形数据聚合模块,被配置为根据所述整形数据长度、所述整形数据总长度、所述整形数据个数,将所述多个整形数据在高低位上排列配置,获得整形数据聚合值,将所述整形数据聚合值作为所述单个栅格聚合值。
在上述的栅格数据聚合装置中,
所述多个栅格数据还包括浮点数据,
所述聚合单元还包括:
允许长度计算模块,被配置为根据所述最大有效长度和所述整形数据总长度,获得浮点数据的允许长度;
小数位长度计算模块,被配置为根据所述允许长度和整数部分长度,获得小数位长度;
浮点数据修正模块,被配置为根据浮点数据值和所述小数位长度,对浮点数据进行修正,获得修正值;以及
浮点数据聚合模块,被配置为根据所述修正值、所述整形数据聚合值、所述整形数据总长度及所述小数位长度,将所述浮点数据和所述整形数据聚合值在高低位上排列配置,获得浮点数据聚合值,不是将所述整形数据聚合值作为所述单个栅格聚合值,而是将所述浮点数据聚合值所述作为单个栅格聚合值。
在上述的栅格数据聚合装置中,
所述聚合单元还包括:
数据判断模块,被配置为判断所述整形数据是否为权重数据组;以及
个数修正模块,被配置为当所述整形数据为权重数据组时,输出的所述整形数据个数为从实际的整形数据个数减一的值,当所述整形数据不是权重数据组时,输出的所述整形数据个数为实际的整形数据个数。
本发明的实施方式所提供的第五方式涉及一种栅格数据解耦装置,包括:单栅格提取单元,被配置为从一层栅格数据中提取与每个行列号对应的单个栅格聚合值;解耦单元,被配置为对所述单个栅格聚合值进行解耦来生成多个栅格数据;以及解耦数据生成单元,被配置为根据每个行列号 对应处的所述多个栅格数据,分别整合位于同一层的不同行列号的栅格数据来生成多层栅格数据。
在上述的数据解耦装置中,
所述解耦单元被配置为将单个栅格聚合值在高低位上拆分成所述多个栅格数据。
在上述的数据解耦装置中,
所述多个栅格数据包括2个以上的整形数据,
所述单个栅格聚合值为整形数据聚合值,
所述解耦单元包括:
总长度计算模块,被配置为总长度计算模块被配置为根据所述整形数据长度和整形数据个数,计算整形数据总长度;以及
整形数据解耦模块,被配置为根据所述整形数据总长度、所述整形数据长度及所述整形数据个数,将所述整形数据聚合值在高低位上拆分,获得所述多个栅格数据。
在上述的数据解耦装置中,
所述多个栅格数据还包括浮点数据,
所述单个栅格聚合值不是整形数据聚合值,而是浮点数据聚合值,
所述解耦单元还包括:
浮点数据解耦模块,被配置为根据所述整形数据总长度、浮点数据的小数位长度,对所述浮点数据聚合值进行拆分,获得浮点数据值;以及
整形数据聚合值获取模块,被配置为根据所述浮点数据聚合值、所述整形数据总长度、所述浮点数据值、所述小数位长度,获得所述整形数据聚合值,
所述整形数据聚合值获取模块将所获得的所述整形数据聚合值输入给所述整形数据解耦模块。
在上述的数据解耦装置中,
所述解耦单元还包括:
数据判断模块,被配置为判断所述整形数据是否为权重数据组;以及
数据个数修正模块,被配置为当所述整形数据为权重数据组时,输出的所述整形数据个数为从实际的整形数据个数减一的值,
当所述整形数据不是权重数据组时,输出的所述整形数据个数为实际的整形数据个数,
当所述整形数据为权重数据组时,所述整形数据解耦模块在拆分所述整形数据聚合值之后,还根据整形数据长度和已经获得的多个栅格数据,再获得一个栅格数据。
本发明的实施方式所提供的第六方式涉及一种数据处理系统,包括:上述的数据聚合装置;数据传输装置;以及上述的数据解耦装置,所述数据聚合装置将聚合后的一层栅格数据经由所述数据传输装置发送给所述数据解耦装置,所述数据解耦装置对接收到的一层栅格数据进行解耦,获得多层栅格数据。
本发明的实施方式所提供的第七方式涉及一种数据聚合装置,包括:
处理器;以及
用于存储所述处理器可执行的指令的存储器,
其中,所述处理器被配置为:通过执行所述存储器所存储的指令,
从多层栅格数据中分别提取相同行列号的多个栅格数据;
对所述多个栅格数据进行聚合来生成单个栅格聚合值;
根据与每个行列号对应的单个栅格聚合值,生成一层栅格数据。
本发明的实施方式所提供的第八方式涉及一种数据解耦装置,包括:
处理器;以及
用于存储所述处理器可执行的指令的存储器,
其中,所述处理器被配置为:通过执行所述存储器所存储的指令,
从一层栅格数据中提取与每个行列号对应的单个栅格聚合值;
对所述单个栅格聚合值进行解耦来生成多个栅格数据;以及
根据分别与每个行列号对应的所述多个栅格数据,生成多层栅格数据。
根据本发明的实施方式所涉及的栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统,能够有效地减少栅格数据的数据量。
附图说明
通过参考附图会更加清楚的理解本发明的特征和优点,附图是示意性 的而不应理解为对本发明进行任何限制,在附图中:
图1是示出本发明的第一实施方式所涉及的栅格数据聚合方法的流程图;
图2是示出本发明的第一实施方式所涉及的聚合方式的实施例1的流程图;
图3是示出本发明的第一实施方式所涉及的聚合方式的实施例2的流程图;
图4是示出针对预定区域采用本发明的第一实施方式的实施例2中的栅格数据聚合方式的示意图;
图5是示出本发明的第二实施方式所涉及的栅格数据解耦方法的流程图;
图6是示出本发明的第二实施方式所涉及的解耦方式的实施例1的流程图;
图7是示出本发明的第二实施方式所涉及的解耦方式的实施例2的流程;
图8是示出针对预定区域采用本发明的第二实施方式的实施例2中的栅格数据解耦方式的示意图;
图9是示出本发明的第三实施方式所涉及的栅格数据聚合装置的结构示意图;
图10是示出本发明的第三实施方式的实施例1所涉及的聚合单元的结构示意图;
图11是示出本发明的第三实施方式的实施例2所涉及的聚合单元的结构示意图;
图12是示出本发明的第四实施方式所涉及的栅格数据解耦装置的结构示意图;
图13是示出本发明的第四实施方式的实施例1所涉及的解耦单元的结构示意图;
图14是示出本发明的第四实施方式的实施例2所涉及的解耦单元的结构示意图;
图15是示出本发明的第五实施方式所涉及的数据处理系统的结构示 意图。
具体实施方式
本发明的发明人经过研究发现,在应用栅格数据时,需要提前将栅格数据对应到行列位置,此时,涉及I/O操作,因为频繁的I/O操作效率相对低下,所以一般对预定区域的数据进行一次读取,即将原栅格区域内的一个巨型区域数据一次缓存到内存,以提高效率,但如果提取的缓存数据区域过大,则导致数据量过多,内存占用较多,可能导致系统内存不足,发生内存溢出,容易导致程序崩溃。当在应用多层栅格数据时,这种风险将成倍增长。此外,在存在多层栅格数据的情况下,有时也需要对各层的栅格数据进行跨层操作,对系统的压力也大。
为了解决这个问题,一种方案是减少一次缓存的区域大小,提高I/O操作次数,但是,其代价就是降低效率。另一种方案是减少数据量。I/O操作受到计算机系统的限制,不易进行优化。
对此,在现有技术中,存在对于单层栅格数据,对不同行列号的栅格的数据进行聚合的技术。但是,这样的数据聚合会损失数据精度。
从而,本发明的发明人提出了将多层栅格数据聚合为一层栅格数据的数据聚合方法。即,将相同行列号的多个栅格数据聚合为一个栅格数据。在进行这样的数据聚合之后,进行数据传输,并在应用时,将聚合的一层栅格数据再解耦成多层栅格数据。
在本发明的实施方式中,多层栅格数据是指包含相同行列号范围(例如,地理位置)且其值不同的栅格数据。例如,在地理信息系统(GIS)中的多层栅格数据,这些多层栅格数据表示相同地理区域,且分别表示该区域的不同属性。本发明对多层栅格数据的层叠方式、地理位置等不作特别限定。
在以相同行列号的栅格为对象的情况下,多个栅格数据分别表示该行列号的位置处的不同的属性。例如,当本发明的实施方式应用于GIS中时,上述的多个栅格数据可以分别表示该位置处的建筑类型、楼层数、建筑用途、建造年限等不同属性。另外,例如,当本发明的实施方式应用于图像处理领域时,上述的多个栅格数据可以分别表示相同像素点的灰度、 亮度、饱和度等不同属性。本发明中对栅格数据的应用场景不作特别限定。
多层栅格数据中的每一层的栅格数据可以是整形数据,也可以是浮点数据。整形数据是指不包含小数部分的数值型数据,浮点数据是指包含小数部分的数据,包括整数部分和小数部分。
在本发明的实施方式中,整形数据也可以是权重数据组。权重数据组是指:数据组中的各数据的原始值分别为0-1范围内的权重比值,各原始值的总和为1,将比值数据放大10的N次方倍之后,以整数形式表示出,从而形成的用整形数据表示的数据组。例如,当权重数据组为[20,30,50]时,所表示的三个原始值分别为0.2∶0.3∶0.5。即,可以通过在由浮点数据示出的比值上乘以10的几(例如,2)次方的方式改为整形的权重数据组。例如,在GIS中,若存在3类建筑类型,可以用权重数据组(23,32,45)来表示,此时,权重比值为(23%,32%,45%),其总和为1。当整形数据为权重数据组时,由于比值的总和为1,因此,即便省略其中的一个比值,也可以通过其他比值的总和来算出该省略的比值。也就是说,权重数据组中的一个数据可以缺省。
在本发明实施方式中,数据长度是指数据转换为字符串时的长度,而非实际存储长度。
下面参照附图,详细说明本发明的实施方式的栅格数据聚合方法和装置、以及栅格数据解耦方法和装置。
然而,对于本领域技术人员来说显而易见的是,本发明可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本发明的示例来提供对本发明更清楚的理解。本发明不限于下面所提出的任何具体配置和方法,而是在不脱离本发明的精神的前提下覆盖了相关部件和步骤的任何修改、替换和改进。
<第一实施方式>
图1是示出本发明的第一实施方式所涉及的栅格数据聚合方法的流程图。
以下,为了便于说明,将i行j列记为行列号(i,j)。
在本发明的第一实施方式中,在步骤S10中,从多层栅格数据中,分 别提取行列号(i,j)的多个栅格数据。其中,i表示行号、j表示列号。在栅格数据中,若行号和列号均相同,则表示是处于相同的位置,因此,此时提取的多个栅格数据是针对相同位置的数据。其中,每层的栅格数据对应该层的预定区域的数据。
在步骤S20中,针对行列号(i,j)的多个栅格数据进行聚合,生成该行列号(i,j)处的单个栅格聚合值。在本发明的第一实施方式中,可以通过将多个栅格数据在高低位上排列配置成单个栅格聚合值。即,可以将多个栅格数据在数据长度的高低位上排列配置成单个栅格聚合值。例如,在GIS中,假定建筑类型为1(0-3),楼层数15(0-99),建筑用途8(0-16),建造年限20(0-99),浮点数为0,则聚合算法结果为1150820。具体聚合方式后面再详细叙述。但是,本发明的聚合方式不限于后述的方式,也可以利用本领域技术人员已知的其他聚合方式,只要是对多层栅格数据中的相同行列号的多个栅格进行聚合即可。
在步骤S30中,判断是否对预定区域的所有行列号进行了操作,如果是,则前进到步骤S40。如果否,则前进到步骤S50。其中,所述预定区域是作为数据聚合对象的区域。
在步骤S40中,根据每个行列号的单个栅格聚合值,生成一层栅格数据。具体来说,将已获得的与每个行列号对应的单个栅格聚合值,整合为一层栅格数据。
在步骤S50中,改变行列号(i,j),返回到步骤S10。
上述的步骤S30~S50可以理解为:获取每个行列号处的单个栅格聚合值,并根据每个行列号处的单个栅格聚合值,生成一层栅格数据。
在本发明的第一实施方式中,通过将多层栅格数据聚合为一层栅格数据,从而减少了数据量,使用内存实现聚合解耦,大幅减少了I/O操作次数,有利于提高处理效率。
在本发明的第一实施方式中,相同行列号的多个栅格数据可以包括整形数据,也可以包括浮点数据。本发明对多个栅格数据中所包含的整形数据个数和浮点数据个数不作特别限定。
<实施例1>
图2是示出本发明的第一实施方式所涉及的聚合方式的实施例1的流程图。实施例1是多个栅格数据仅包括整形数据,并且整形数据个数为2个以上的情况的例子。由于针对每个行列号的聚合方式均相同,因此,在实施例1中,以行号i、列号为j的栅格为例,对步骤S20中的将多个栅格数据聚合为单个栅格聚合值的过程进行详细说明。
在步骤S201中,根据栅格数据的存储数据类型,获得最大有效长度。
具体来说,假设存储数据类型为Datatype、该数据类型的存储最大数据长度为LDatatype,则最大有效长度Lmax可以如下计算:
LMax=LDatatype-1     (1)
其中,存储数据类型通常为32位的短整形Int(其存储最大数据长度LDatatype为10)、64位的长整形long等。也可以是浮点形的单精度、双精度等。可以根据具体数据类型而进行选择。
具体来说,各类栅格数据存储时通常受到格式限制。即,不同的栅格数据的实际存储有效位数不同。例如,如文件型的GRID栅格数据,只支持32位的整数(短整形),对应数据大小为-2,147,483,648到+2,147,483,647,存储最大数据长度LDatatype为10个有效数字,因最高位的最大值只能到2,无法有效使用,故真实有效位数为9,即最大有效长度Lmax为9。即,根据存储的数据类型,能够存储的最大有效长度Lmax不同。
在步骤S202中,根据整形数据长度LInt和整形数据个数n,计算整形数据的总长度LIntsum
其中,整形数据长度LInt是指整形数据被转换为字符串时的长度。如果每层中的各整形数据的长度不同,则LInt表示各层的整形数据中的最大长度。整形数据个数n是要存储的有效的整形数据的个数。在通常情况下,整形数据个数n表示要聚合的多层栅格数据的层数。整形数据的总长度LIntsum是所有整形数据长度之和。
在本实施例中,对于整形数据长度和整形数据个数没有特别限定。然而,整形数据长度越长、则能够聚合的整形数据个数减少。因此,结合上述的分析以及通常的栅格数据存储类型和整形数据长度等考虑,整形数据 的值优选的是1000以内,更为优选的是10以内。
例如,假设每层的整形数据的最大长度相同均为LInt,则整形数据的总长度为:
LIntsum=n*LInt        (2)
也可以设定各层的整形数据的长度(或最大长度)不同。此时,如果将k层的整形数据长度设为LInt(k)(k=0,...,n-1),则整形数据的总长度为:
LIntsum=Sum(LInt(k))     (3)
上述的步骤S202还可以包括步骤S202A,在该步骤S202A中,当多个栅格数据中的整形数据为权重数据组时,如上所述,可以缺省一位,因此,可以将整形数据个数减一,即n=n-1。并且,利用减一后的整形数据个数来计算整形数据的总长度。
具体来说,步骤S202A在进行上述的根据整形数据长度LInt和整形数据个数n来计算整形数据的总长度LIntsum的操作之前,可以进一步包括步骤S2021和S2022,在步骤S2021中判断多个栅格数据中的整形数据是否为权重数据组,而在步骤S2022中,当多个栅格数据中的整形数据为权重数据组时,将整形数据个数减一,当多个栅格数据中的整形数据不是权重数据组时,保持整形数据个数不变。
由于通常多个栅格数据中的整形数据为权重数据组的情况较少,因此该步骤S202A是可以省略的。
在步骤S203中,判断整形数据总长度LIntsum是否大于最大有效长度Lmax。即,LIntsum>Lmax。如果整形数据总长度LIntsum大于最大有效长度Lmax,则表示整形数据聚合后的长度会超出能够存储的最大有效长度,因此,结束处理。如果整形数据总长度LIntsum小于或等于最大有效长度Lmax,则前进到步骤S204。
具体来说,如果多个栅格数据的整形数据个数超过预定值,使得整形数据总长度LIntsum大于最大有效长度Lmax,则难以将多个栅格数据中的所有整形数据聚合为单个栅格聚合值。因此,在整形数据总长度LIntsum小于或等 于最大有效长度Lmax的情况下,才能够将多个整形数据聚合为整形数据聚合值。
在步骤S204中,根据整形数据总长度LIntsum、整形数据长度LInt、整形数据个数n,将多个栅格数据在高低位上排列配置,获得整形数据聚合值DataInt(i,j)。
具体可用下列式子表示:
Figure PCTCN2017078302-appb-000001
其中,Xk(i,j)是指第k层栅格数据中行列号(i,j)处的整形数据值,LIntsum指整形数据总长度,LInt指整形数据长度,n指整形数据个数。
在实施例1中,将在步骤S204中获取的整形数据聚合值DataInt(i,j)作为该行列号(i,j)处的单个栅格聚合值。
根据实施例1,通过将2个以上的整形数据聚合为单个栅格聚合值,能够有效地减少数据量。
<实施例2>
图3是示出本发明的第一实施方式所涉及的聚合方式的实施例2的流程图。实施例2是多个栅格数据除了2个以上的整形数据之外,还包括一个浮点数据的情况的例子。
在实施例2中也同样以行号为i、列号为j的栅格为例,对步骤S20中的将多个栅格数据聚合为单个栅格聚合值的过程进行详细说明。
在实施例2中,在如实施例1那样获得整形数据聚合值之后,不是将该整形数据聚合值直接作为该行列号(i,j)处的单个栅格数据值,而是在该整形数据聚合值的基础上再聚合浮点数据,获得浮点数据聚合值,将所获得的浮点数据聚合值作为该行列号(i,j)处的单个栅格聚合值。
具体来说,如图3所示,实施例2中的将多个栅格数据聚合为单个栅格聚合值的过程在图2的步骤S205之后,还包括如下步骤S211~S215。
在步骤S211中,根据最大有效长度Lmax和整形数据总长度LIntsum,计算 浮点数据允许长度Lfloat
具体可用下列式子表示:
Lfloat=LMax-LIntsum      (5)
在步骤S212中,判断浮点数据允许长度Lfloat是否大于浮点数据的整数部分长度Lfloat_Int。如果浮点数据允许长度Lfloat大于浮点数据的整数部分长度Lfloat_Int、即Lfloat>Lfloat_Int,则进行步骤S213。如果浮点数据允许长度Lfloat小于或等于浮点数据的整数部分长度Lfloat_Int、即Lfloat≤Lfloat_Int,则表示将浮点数据的整数部分聚合到整形数据聚合值就会超出能够存储的最大有效长度,因此,结束处理。
在步骤S213中,根据浮点数据允许长度Lfloat和整数部分长度Lfloat_Int,计算浮点数据的小数位长度Lfloat_delta。其中,该小数位长度Lfloat_delta表示浮点数据能够保留的小数位的长度,整数部分长度Lfloat_Int实际是指预定区域的所有栅格的浮点数据之中最大的浮点数据的整数部分长度。
具体可用下列式子表示:
Lfloat_delta=Lfloat-Lfloat_Int       (6)
在步骤S214中,根据小数位长度Lfloat_delta和第i行j列的浮点数据值F(i,j),获得浮点数据修正值Datafloat(i,j)。该浮点数据修正值Datafloat(i,j)是仅保留了满足小数位长度Lfloat_delta的小数位的浮点数据值。
具体可用下列式子表示:
Datafloat(i,j)=Round(F(i,j),Lfloat_delta)       (7)
其中,Round()是四舍五入函数。
在步骤S215中,根据整形数据聚合值DataInt(i,j)、浮点数据修正值Datafloat(i,j)、整形数据总长度LIntsum、浮点数据的小数位长度Lfloat_delta,获得浮点数据聚合值Data(i,j)。
具体可用下列式子表示:
Figure PCTCN2017078302-appb-000002
其中,浮点数据的小数位长度Lfloat_delta也可以与整形数据长度LInt相 同。此时,浮点数据聚合值Data(i,j)为:
Figure PCTCN2017078302-appb-000003
在实施例2中,将在步骤S215中获得的浮点数据聚合值Data(i,j)作为单个栅格聚合值。
在上述的式(8)、式(9)中,将浮点数据值F(i,j)聚合到了整形数据聚合值DataInt(i,j)的高位,但是,也可以将浮点数据值聚合到整形数据聚合值的低位。
图4是示出对预定区域采用本发明的第一实施方式的实施例2中的栅格数据聚合方式的示意图。其中,需要说明的是,由于每个行列号处的聚合方式都是相同的,上面都是以行列号(i,j)处为例说明了聚合过程,而图4示出了针对预定区域、例如3×3的栅格区域进行数据聚合的过程。在图4中,可以对相同行列号的栅格分别采用实施例2的聚合方式进行聚合。
在实施例2中,多个栅格数据不仅包括整形数据,还包括浮点数据,对包含浮点数据的多个栅格数据也能够进行聚合,因此,除了具有实施例1所具有的优点之外,应用范围更为广泛。
<第二实施方式>
图5是示出本发明的第二实施方式所涉及的栅格数据解耦方法的流程图。第二实施方式中的栅格数据解耦方法和第一实施方式中的栅格数据聚合方法相对应。也就是说,通过第一实施方式的栅格数据聚合方法被聚合的一层栅格数据,可以通过第二实施方式的栅格数据解耦方法被解耦成多层栅格数据。
在步骤S60中,从一层栅格数据中,分别提取与行列号(i,j)对应的单个栅格聚合值。
在步骤S70中,针对行列号(i,j)处的单个栅格聚合值进行解耦,生成该行列号(i,j)处的多个栅格数据。在本发明的第二实施方式中,可以将单个栅格聚合值在高低位上拆分成多个栅格数据。具体解耦方式后面再详细叙述。但是,本发明的解耦方式不限于后述的方式,也可以利用本领域技术人员已知的其他聚合方式,只要是对一层栅格数据中的相同行 列号的多个栅格进行解耦即可。
在步骤S80中,判断是否对预定区域的所有行列号进行了操作,如果是,则进行步骤S90。如果否,则进行步骤S100。
在步骤S90中,根据每个行列号处的多个栅格数据,分别整合位于同一层的不同行列号的栅格数据来生成多层栅格数据。
在步骤S100中,改变行列号(i,j),返回到步骤S60。
上述的步骤S80~S100可以理解为:获取每个行列号处的多个栅格数据,并根据预定区域的所有行列号处的多个栅格数据,生成多层栅格数据。
在本发明的第二实施方式中,通过将一层栅格数据解耦成多层栅格数据,能够在数据通信传输、I/O存取时只使用一层栅格数据,大幅减少数据量,而在应用时快速解耦成原始的多层栅格数据,不损失原始数据的精度。由此,效率比以往的数据通信传输或I/O存取快的多,不损失数据精度,且不容易受到内存大小等限制。
<实施例1>
图6是示出本发明的第二实施方式所涉及的解耦过程的实施例1的流程图。实施例1是多个栅格数据仅包括整形数据,并且整形数据个数为2个以上的情况下的例子。由于针对每个单个栅格聚合值的解耦方式均相同,因此,在实施例1中,以行号i、列号为j的栅格为例,对步骤S70中的将单个栅格聚合值解耦为多个栅格数据的过程进行具体说明。
在多个栅格数据仅包括整形数据的情况下,单个栅格聚合值即为整形数据聚合值。
在步骤S701中,根据整形数据长度LInt和整形数据个数n,计算整形数据的总长度LIntsum。例如,可以使用第一实施方式中的(2)、(3)式的方式。
步骤S701还可以包括步骤S701A,该步骤S701A的操作与第一实施方式中的步骤S202A的操作相同,因此,在此省略其说明。
在步骤S702中,根据整形数据总长度LIntsum、整形数据长度LInt、整形数据个数n,将整形数据聚合值DataInt(i,j)在高低位上拆分,获得多个栅格数据Xk(i,j)。
具体可用下列式子表示:
Figure PCTCN2017078302-appb-000004
其中,Int()是指取整函数,N是非负整数集。
步骤S702在获得上述的多个栅格数据之后,还可以包括步骤S702A和步骤S702B。
在步骤S702A中,判断多个整形数据是否为权重数据组。如果是,则前进到步骤S702B,如果否,则结束操作。
在S702B步骤中,根据已获得的多个栅格数据
Figure PCTCN2017078302-appb-000005
和整数数据长度LInt,获得最后一个栅格数据Xn(i,j)。
具体来说,可如下式:
Figure PCTCN2017078302-appb-000006
也就是说,此时的最后一个栅格数据Xn(i,j)是在多个栅格数据中的整形数据为权重数据组的情况下,当进行栅格数据聚合时,在步骤S202A中缺省的那一个整形数据。
根据实施例1,通过将单个栅格聚合值解耦成2个以上的整形数据,能够有效地恢复数据,保证数据精度。
<实施例2>
图7是示出本发明的第二实施方式所涉及的解耦过程的实施例2的流程图。实施例2是多个栅格数据除了2个以上的整形数据之外,还包括一个浮点数据的情况的例子。
在实施例2中也同样以行号为i、列号为j的栅格为例,对步骤S70中的将单个栅格聚合值解耦为多个栅格数据的过程进行具体说明。
在多个栅格数据还包括一个浮点数据的情况下,先将单个栅格聚合值拆分为浮点数据值和整形数据聚合值,然后再将整形数据聚合值在高低位上拆分,获得多个整形数据。
具体来说,如图7所示,在图6的步骤S701之后、步骤S702之前还包括步骤S711和步骤S712。
在步骤S711中,根据整形数据总长度LIntsum、小数位长度Lfloat_delta,对行列号(i,j)处的单个栅格聚合值Data(i,j)进行拆分,获得浮点数据值F(i,j)。此时的单个栅格聚合值Data(i,j)为浮点数据聚合值。
具体可用下列式子表示:
Figure PCTCN2017078302-appb-000007
其中,小数位长度Lfloat_delta表示浮点数据能够保留的小数位的长度。可以如上述步骤S213那样、例如通过如上所示的(6)式等求出。在此不再重复描述。
另外,由于在第一实施方式中说明了将浮点数据值聚合到整形数据聚合值的高位的情况,因此,在上述的(12)式中,对浮点栅格聚合值的高位进行拆分,获得了浮点数据值。但是,在将浮点数据值聚合到整形数据聚合值的低位的情况下,也可以对对浮点栅格聚合值的低位进行拆分,获得了浮点数据值。
接着,在步骤S712中,根据单个栅格聚合值Data(i,j)、浮点数据值F(i,j)、整形数据总长度LIntsum、小数位长度Lfloat_delta,获得整形数据聚合值DataInt(i,j)。
具体可用下列式子表示:
Figure PCTCN2017078302-appb-000008
图8是示出对预定区域采用本发明的第二实施方式的实施例2中的栅格数据解耦方式的示意图。需要说明的是,由于每个行列号处的解耦方式都是相同的,上面的实施例中都是以行列号(i,j)处为例说明了解耦过程,而图8示出了针对预定区域、例如3×3的栅格区域进行数据解耦的过程。在图8中,可以对相同行列号的栅格分别采用实施例2的解耦方式进行解耦。
在实施例2中,多个栅格数据不仅包括整形数据,还包括浮点数据,对聚合了浮点数据的栅格数据也能够进行解耦,因此,除了具有实施例1所具有的优点之外,应用范围更为广泛。
<第三实施方式>
图9是示出本发明的第三实施方式所涉及的栅格数据聚合装置的结构示意图。
如图9所示,栅格数据聚合装置1包括:多栅格提取单元10、聚合单元20、聚合数据生成单元30。其中,多栅格提取单元10被配置为从多层栅格数据中分别提取行列号(i,j)的多个栅格数据。聚合单元20被配置为针对行列号(i,j)的多个栅格数据进行聚合,生成该行列号(i,j)处的单个栅格聚合值。该聚合单元20可以被配置为将多个栅格数据在高低位上排列配置为单个栅格聚合值。聚合数据生成单元30被配置为根据每个行列号的单个栅格聚合值,生成一层栅格数据。聚合数据生成单元30可以先判断是否对预定区域的所有行列号进行了操作,如果还没有完成对所有行列号的聚合操作,则改变行列号直至完成对预定区域的所有行列号的聚合操作。
<实施例1>
当多个栅格数据包括2个以上的整形数据时,如图10所示,聚合单元20可以包括:总长度计算模块210和整形数据聚合模块220。此时,该聚合单元20可以执行第一实施方式的实施例1的聚合过程。
其中,总长度计算模块210被配置为根据整形数据长度和整形数据个数,计算整形数据总长度。整形数据聚合模块220被配置为根据整形数据长度、整形数据总长度、整形数据个数,将多个整形数据在高低位上排列配置,获得整形数据聚合值,并将该整形数据聚合值作为单个栅格聚合值输出。
可选地,聚合单元20还可以包括整形长度判断模块230,所述整形长度判断模块被配置为根据存储数据类型,获得最大有效长度,判断整形数据总长度是否大于最大有效长度,当所述整形数据总长度小于或等于所述最大有效长度时,由整形数据聚合模块220进行将多个整形数据在高低位上排列配置的操作。
可选地,总长度计算模块210还可以包括数据判断模块210A和个数修正模块210B,所述数据判断模块210A被配置为判断整形数据是否为权重数据组,个数修正模块210B被配置为当整形数据为权重数据组时,输出的整形数据个数为从实际的整形数据个数减一的值,当整形数据不是权 重数据组时,输出的整形数据个数为实际的整形数据个数。
<实施例2>
当多个栅格数据除了2个以上的整形数据之外、还包括一个浮点数据时,如图11所示,聚合单元20’除了与实施例1中的聚合单元20相同的构成之外,还可以包括:允许长度计算模块240、小数位长度计算模块250、浮点数据修正模块260、浮点数据聚合模块270。此时,该聚合单元20’可以执行第一实施方式的实施例2的聚合过程。
其中,允许长度计算模块240被配置为根据最大有效长度和整形数据总长度,获得浮点数据的允许长度。小数位长度计算模块250被配置为根据允许长度和整数部分长度,获得小数位长度。浮点数据修正模块260被配置为根据浮点数据值和小数位长度,对浮点数据进行修正,获得修正值。浮点数据聚合模块270被配置为根据所述修正值、整形数据聚合值、整形数据总长度、小数位长度,将浮点数据和整形数据聚合值在高低位上排列配置,获得浮点数据聚合值,并将浮点数据聚合值作为单个栅格聚合值。
可选地,聚合单元20’还可以包括允许长度判断模块280,该允许长度判断模块280被配置为判断浮点数据允许长度是否大于浮点数据的整数部分长度,若浮点数据允许长度大于整数部分长度,则由小数位长度计算模块250获得小数位长度,若浮点数据允许长度小于或等于整数部分长度,则结束处理。
根据第三实施方式也能够获得与第一实施方式相同的效果。
<第四实施方式>
图12是示出本发明的第四实施方式所涉及的栅格数据解耦装置的结构示意图。
如图12所示,栅格数据解耦装置2包括:单栅格提取单元40、解耦单元50、解耦数据生成单元60。其中,单栅格提取单元40被配置为从一层栅格数据中,分别提取与行列号(i,j)对应的单个栅格聚合值。解耦单元50被配置为针对行列号(i,j)处的单个栅格聚合值进行解耦,生成该行列号(i,j)处的多个栅格数据。解耦数据生成单元60被配置为根据每个行列号处的多个栅格数据,分别整合位于同一层的不同行列号的栅格 数据来生成多层栅格数据。解耦数据生成单元60可以先判断是否对预定区域的所有行列号进行了操作,如果还没有完成对所有行列号的解耦操作,则改变行列号直至完成对预定区域的所有行列号的解耦操作。
<实施例1>
当多个栅格数据包括2个以上的整形数据时,如图13所示,解耦单元50包括:总长度计算模块510和整形数据解耦模块520。此时,该解耦单元50可以执行第二实施方式的实施例1的数据解耦过程。
其中,总长度计算模块510与图11中的总长度计算模块210相同,因此省略说明。整形数据解耦模块520被配置为根据整形数据总长度、整形数据长度、整形数据个数,将整形数据聚合值在高低位上拆分,获得多个栅格数据。
可选地,当所述整形数据为权重数据组时,整形数据解耦模块520在拆分整形数据聚合值之后,还根据整形数据长度和已经获得的多个栅格数据,再获得一个栅格数据。
<实施例2>
当多个栅格数据除了2个以上的整形数据之外、还包括一个浮点数据时,如图14所示,所述解耦单元50’除了总长度计算模块510和整形数据解耦模块520之外,还包括:浮点数据解耦模块530和整形数据解耦值获取模块540。此时,该解耦单元50’可以执行第二实施方式的实施例2的数据解耦过程。
其中,浮点数据解耦模块530被配置为根据整形数据总长度、小数位长度,对浮点数据聚合值进行拆分,获得浮点数据值。整形数据聚合值获取模块540根据浮点数据聚合值、浮点数据值、整形数据总长度、小数位长度,获得整形数据聚合值。
整形数据聚合值获取模块540将所获得的整形数据聚合值输入给整形数据解耦模块520。整形数据解耦模块520将整形数据聚合值获取模块540输入的整形数据聚合值在高低位上拆分,获得多个栅格数据。
根据第四实施方式的数据解耦装置能够获得与第二实施方式相同的技术效果。
<变形例>
上述的第一~第四实施方式中的实施例1和实施例2都是以将多个栅格数据在数据长度的高低位上排列配置为单个栅格聚合值、或者将单个栅格聚合值在数据长度的高低位上拆分为多个栅格数据的实施例。然而,将相同行列号处的多个栅格数据聚合为单个栅格聚合值、或者将单个栅格聚合值解耦为多个栅格数据的方式不限于此,也可以使用用于数据的加密解密操作中的其他方式来代替。
变形例1
2n-1值(例如,1,3,7,15,31,63,...)具有如下特殊性:其中任意个值的相加值都可以唯一确定是由哪些值相加得到的。其中,n为自然数。
比如,1+3=4,1+7+15=23,15+31+63=109,…,这些相加值与所相加的值的组合之间的对应关系是唯一确定的。因此,4可以代表1、3(只有1+3的值会等于4),23代表1、7、15(只有这三个值的和会等于23),109可以代表15、31、63。
在聚合时,可以由多个2n-1值(例如,2n1-1,2n2-1,......,2nk-1)来分别表示多个栅格数据,得到他们的相加值A,将相加值A作为单个栅格聚合值。也可以给这样的相加值设定索引Index(A),将该索引Index(A)作为单个栅格聚合值。由于这样的相加值或索引的数据量小,容易传输和存取。
在解耦时,根据该相加值A来唯一确定是哪些2n-1值的和,即,分别获得2n1-1,2n2-1,......,2nk-1的值。也可以根据索引Index(A)查找与其对应的相加值A,再根据相加值A来获得2n1-1,2n2-1,......,2nk-1的值。由此,可以避免损失数据精度。
变形例2
根据多个栅格数据的排列组合生成索引字典,并通过查找该字典的方式确定多个栅格数据和索引之间的对应关系。
在聚合时,根据多个栅格数据的排列组合查找字典来确定索引,并将该索引作为单个栅格聚合值。
在解耦时,通过索引查找字典确定对应的多个栅格数据的排列组合,从而获得多个栅格数据中的每一个。
上述的变形例1和变形例2也可以与本发明的第一~第四实施方式中 的实施例组合使用。
例如,在聚合时,可以先将多个栅格数据分为多组,对每组使用变形例1的聚合方式进行聚合,获得多个中间聚合值,再对这些中间聚合值使用第一实施方式中的聚合方式,获得单个数据聚合值。在解耦时,先对单个数据聚合值使用第二实施方式中的解耦方式,获得多个中间聚合值,再对每个中间聚合值使用变形例1的解耦方式,获得多个栅格数据。
<第五实施方式>
图15是示出本发明的第五实施方式所涉及的数据处理系统的结构示意图。数据处理系统包括如第三实施方式所述的数据聚合装置1、如第四实施方式所述的数据解耦装置2、以及数据传输装置3。
数据聚合装置1将聚合后的一层栅格数据经由数据传输装置3发送给数据解耦装置2,而数据解耦装置2对接收到的一层栅格数据进行解耦,获得多层栅格数据。
数据聚合装置1和数据解耦装置2可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。
数据聚合装置1和数据解耦装置2可以包括处理器,该处理器可以是集成电路,也可以是CPU等运算核心或控制核心。它的功能主要是解释计算机指令以及处理计算机软件中的数据。
数据聚合装置1和数据解耦装置2可以包括存储器,存储器按用途可分为主存储器(内存),例如,ROM(Read Only Memory image,只读存储器)、RAM(Random Access Memory,随机存取存储器)和辅助存储器(外存)。存储器具有用于执行上述方法中的任何方法步骤的程序代码的存储空间。例如,用于程序代码的存储空间可以包括分别用于实现上面的方法中的各种步骤的各个程序代码。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,光盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为便携式或者固定存储单元。该存储单元可以具有与前面所述的终端中的存储器类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计 算机可读代码,即可以由诸如之类的处理器读取的代码,这些代码当由服务器上运行搜索引擎程序时,导致该服务器执行上面所描述的方法中的各个步骤。
数据聚合装置1和数据解耦装置2还可以包括输入装置用于用户与装置之间的相互作用,输入装置可以为键盘、鼠标、图像捕捉元件,触摸屏等。
数据聚合装置1和数据解耦装置2还可以包括输出装置,输出装置可以是屏幕、图像投影单元、立体显示装置等。
数据聚合装置1和数据解耦装置2还可以包括一个以有线或无线方式进行数据通信的通信接口。
数据传输装置3是用于进行数据聚合装置1和数据解耦装置2之间的数据传输的装置,可以是数据总线、I/O接口、电缆、光缆等。
权利要求书中的单词“包括”不排除存在未列在权利要求中的元件或步骤。在包含了若干元件的权利要求中,其中多个元件可以是通过同一个硬件来具体实现。
术领域的技术人员能够了解本发明的内容并据以实施,并不能以此来限制本发明的保护范围。凡根据本发明精神实质所作出的等同变换或修饰,都应涵盖在本发明的保护范围之内。
虽然结合附图描述了本发明的实施方式,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变形,这样的修改和变形均落入由所述权利要求所限定的范围之内。

Claims (10)

  1. 一种栅格数据聚合方法,包括:
    从多层栅格数据中分别提取相同行列号的多个栅格数据;
    对所述多个栅格数据进行聚合来生成单个栅格聚合值;以及
    根据与每个行列号对应的单个栅格聚合值,生成一层栅格数据。
  2. 如权利要求1所述的栅格数据聚合方法,其特征在于,
    所述对所述多个栅格数据进行聚合来生成单个栅格聚合值包括:
    将所述多个栅格数据在高低位上排列配置为所述单个栅格聚合值。
  3. 如权利要求2所述的栅格数据聚合方法,其特征在于,
    所述多个栅格数据包括2个以上的整形数据,
    所述将所述多个栅格数据在高低位上排列配置为所述单个栅格聚合值包括:
    根据存储数据类型,获得最大有效长度,
    根据整形数据长度和整形数据个数,计算整形数据总长度,
    判断所述整形数据总长度是否大于所述最大有效长度,
    当所述整形数据总长度小于或等于所述最大有效长度时,根据所述整形数据长度、所述整形数据总长度及所述整形数据个数,将所述多个整形数据在高低位上排列配置,获得整形数据聚合值,将所述整形数据聚合值作为所述单个栅格聚合值。
  4. 一种栅格数据解耦方法,包括:
    从一层栅格数据中提取与每个行列号对应的单个栅格聚合值;
    对所述单个栅格聚合值进行解耦来生成多个栅格数据;以及
    根据每个行列号处的所述多个栅格数据,分别整合位于同一层的不同行列号的栅格数据来生成多层栅格数据。
  5. 如权利要求4所述的数据解耦方法,其特征在于,
    所述对所述单个栅格聚合值进行解耦来生成多个栅格数据包括:
    将所述单个栅格聚合值在高低位上拆分成所述多个栅格数据。
  6. 如权利要求5所述的数据解耦方法,其特征在于,
    所述多个栅格数据包括2个以上的整形数据,
    所述单个栅格聚合值为整形数据聚合值,
    所述将所述单个栅格聚合值在高低位上拆分成所述多个栅格数据包括:
    根据整形数据长度和整形数据个数,计算整形数据总长度;以及
    根据所述整形数据总长度、所述整形数据长度、所述整形数据个数,将所述整形数据聚合值在高低位上拆分成所述多个栅格数据。
  7. 一种数据聚合解耦方法,包括:
    利用如权利要求1至3中任一项所述的数据聚合方法将多层栅格数据聚合为一层栅格数据;以及
    利用如权利要求4至5中任一项所述的数据解耦方法将一层栅格数据解耦为多层栅格数据。
  8. 一种栅格数据聚合装置,包括:
    多栅格提取单元,被配置为从多层栅格数据中分别提取相同行列号的多个栅格数据;
    聚合单元,被配置为对所述多个栅格数据进行聚合来生成单个栅格聚合值;以及
    聚合数据生成单元,被配置为根据与每个行列号对应的单个栅格聚合值来生成一层栅格数据。
  9. 一种栅格数据解耦装置,包括:
    单栅格提取单元,被配置为从一层栅格数据中提取与每个行列号对应的单个栅格聚合值;
    解耦单元,被配置为对所述单个栅格聚合值进行解耦来生成多个栅格数据;以及
    解耦数据生成单元,被配置为根据每个行列号处的所述多个栅格数据,分别整合位于同一层的不同行列号的栅格数据来生成多层栅格数据。
  10. 一种数据处理系统,包括:
    如权利要求8所述的数据聚合装置;
    数据传输装置;以及
    如权利要求9所述的数据解耦装置,
    所述数据聚合装置将聚合后的一层栅格数据经由所述数据传输装置发 送给所述数据解耦装置,
    所述数据解耦装置对接收到的一层栅格数据进行解耦,获得多层栅格数据。
PCT/CN2017/078302 2016-11-07 2017-03-27 栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统 WO2018082245A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610978254.X 2016-11-07
CN201610978254.XA CN107506361A (zh) 2016-11-07 2016-11-07 栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统

Publications (1)

Publication Number Publication Date
WO2018082245A1 true WO2018082245A1 (zh) 2018-05-11

Family

ID=60679120

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/078302 WO2018082245A1 (zh) 2016-11-07 2017-03-27 栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统

Country Status (2)

Country Link
CN (1) CN107506361A (zh)
WO (1) WO2018082245A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505218B (zh) * 2019-08-07 2021-11-16 中国电子科技集团公司第二十八研究所 基于json的栅格数据自适应压缩传输方法及计算机存储介质
CN113505189B (zh) * 2021-09-07 2022-03-04 中国电子科技集团公司第二十八研究所 一种基于多层级全球格网的面状目标栅格化方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101021945A (zh) * 2007-03-23 2007-08-22 北京中星微电子有限公司 一种图像合成方法及装置
CN101706809A (zh) * 2009-11-17 2010-05-12 北京灵图软件技术有限公司 多源地图数据处理方法、装置和系统
CN103177649A (zh) * 2011-12-26 2013-06-26 北京图盟科技有限公司 一种像素坐标聚合的方法及装置
CN105550199A (zh) * 2015-11-28 2016-05-04 浙江宇视科技有限公司 一种基于多源地图的点位聚合方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101021945A (zh) * 2007-03-23 2007-08-22 北京中星微电子有限公司 一种图像合成方法及装置
CN101706809A (zh) * 2009-11-17 2010-05-12 北京灵图软件技术有限公司 多源地图数据处理方法、装置和系统
CN103177649A (zh) * 2011-12-26 2013-06-26 北京图盟科技有限公司 一种像素坐标聚合的方法及装置
CN105550199A (zh) * 2015-11-28 2016-05-04 浙江宇视科技有限公司 一种基于多源地图的点位聚合方法及装置

Also Published As

Publication number Publication date
CN107506361A (zh) 2017-12-22

Similar Documents

Publication Publication Date Title
CN108701250B (zh) 数据定点化方法和装置
US11514027B2 (en) Paged hybrid LOBs
US11030522B2 (en) Reducing the size of a neural network through reduction of the weight matrices
KR102476343B1 (ko) 자리수가 비교적 적은 고정 소수점 수치의 신경망 연산에 대한 지원 장치와 방법
US20160188623A1 (en) Scan optimization using bloom filter synopsis
KR102535450B1 (ko) 데이터 저장 방법 및 장치, 및 그 컴퓨터 디바이스 및 저장 매체
WO2023045204A1 (zh) 一种有限状态熵编码表的生成方法、系统、介质及设备
CN110363279A (zh) 基于卷积神经网络模型的图像处理方法和装置
CN112292816A (zh) 处理核心数据压缩和存储系统
Zhang et al. OMCBIR: Offline mobile content-based image retrieval with lightweight CNN optimization
KR101929847B1 (ko) 희소행렬 연산 방법과 장치
WO2018082245A1 (zh) 栅格数据聚合方法和装置、栅格数据解耦方法和装置及系统
CN114529741A (zh) 一种图片去重方法、装置及电子设备
CN113468421A (zh) 基于向量匹配技术的产品推荐方法、装置、设备及介质
CN115438114A (zh) 存储格式转换方法、系统、装置、电子设备及存储介质
CN112085154A (zh) 用于神经网络的压缩和推断加速的非对称量化
CN109543772B (zh) 数据集自动匹配方法、装置、设备和计算机可读存储介质
CN115827555A (zh) 数据处理方法、计算机设备、存储介质和乘法器结构
CN113111273B (zh) 一种信息推荐方法、装置、电子设备及存储介质
JP3310525B2 (ja) デジタルデータ処理装置
US12001237B2 (en) Pattern-based cache block compression
CN111414452B (zh) 搜索词匹配方法、装置、电子设备及可读存储介质
CN110134813B (zh) 图像检索方法、图像检索装置及终端设备
CN112509073A (zh) 图像压缩感知方法、装置、电子设备及存储介质
Thepade et al. Performance gain of content based video retrieval technique using intermediate block truncation coding on different color spaces

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17867997

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17867997

Country of ref document: EP

Kind code of ref document: A1