CN118118554A - Aggregation method and device for map layer resources based on back end - Google Patents

Aggregation method and device for map layer resources based on back end Download PDF

Info

Publication number
CN118118554A
CN118118554A CN202410155458.8A CN202410155458A CN118118554A CN 118118554 A CN118118554 A CN 118118554A CN 202410155458 A CN202410155458 A CN 202410155458A CN 118118554 A CN118118554 A CN 118118554A
Authority
CN
China
Prior art keywords
aggregation
grid
buffer area
resource
dynamic
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202410155458.8A
Other languages
Chinese (zh)
Inventor
艾爽
何共辉
雷霆
邱祥平
宋化磊
解传兵
张兴镇
汤威振
林永生
李健
董乐
陶屹凡
杜渂
彭明喜
周赵云
陈健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Diaisi Information Technology Co ltd
Original Assignee
Shanghai Diaisi Information Technology Co ltd
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 Shanghai Diaisi Information Technology Co ltd filed Critical Shanghai Diaisi Information Technology Co ltd
Priority to CN202410155458.8A priority Critical patent/CN118118554A/en
Publication of CN118118554A publication Critical patent/CN118118554A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a method and a device for aggregating map layer resources based on a back end, wherein the method comprises the following steps: acquiring grid division of a current map; if the layer resource is a static resource, loading point location data of the layer resource into a static cache region; performing aggregation operation on the data of the static buffer area by taking the grid as a unit, and storing an aggregation result into a second static buffer area; when a front-end request is received, acquiring an aggregation result from the second static buffer area and sending the aggregation result to the front-end; if the layer resource is a dynamic resource, dynamically refreshing point location data of the layer resource to a dynamic cache region; carrying out snapshot on the dynamic buffer area regularly, carrying out aggregation operation based on snapshot data by taking a grid as a unit, covering the previous aggregation result with a new aggregation result, and storing the new aggregation result into a second dynamic buffer area; and after receiving the front-end request, acquiring the latest aggregation result from the second dynamic buffer area and sending the latest aggregation result to the front-end. The invention improves the aggregation processing efficiency and improves the experience of the front-end user.

Description

Aggregation method and device for map layer resources based on back end
Technical Field
The invention relates to the field of maps, in particular to a method and a device for aggregating map layer resources based on a back end.
Background
With the development of Geographic Information Systems (GIS) and graphics, the requirements of people on maps are also increasing. The map is required to be able to clearly represent geographical information, but also to provide more in-depth and rich information. Thus, it is becoming increasingly important to effectively manage and aggregate layer resources and presentations of maps.
When the layer resource points of the map are more, the aggregation mode display is needed on the map. There are generally two modes of front-end polymerization and back-end polymerization. The front-end aggregation needs to transmit data to the front end, then aggregate and display, and takes video monitoring as an example, the video monitoring points are more, the data volume is large, the aggregation operation is needed for a long time, and the data transmission is needed for a long time, so that the front-end aggregation performance is high in consumption, and the processing capacity requirement on the system is high. The back-end aggregation is to aggregate data and then transmit the aggregated data to the front end for display, so that the back-end aggregation can reduce the transmission data amount and the data transmission time, but when the map resource data amount is large, the aggregation operation of the map resource data still needs a long time, which affects the response speed of display and reduces the user experience. Therefore, there is a need for further improvements in the aggregation of layer resources.
Disclosure of Invention
One of the objectives of the present invention is to provide a method and apparatus for aggregating map layer resources based on a backend, which address at least some of the problems existing in the prior art.
The technical scheme provided by the invention is as follows:
a method for aggregating map layer resources based on a back end comprises the following steps:
acquiring grid division of a map under the current zoom level;
Dividing layer resources of the map into static resources and dynamic resources;
if the current layer resource is a static resource, loading point location data of the current layer resource into a static cache region; performing aggregation operation on the data of the static buffer area by taking grids as units to obtain an aggregation result of each grid and storing the aggregation result into a second static buffer area; when a front-end request is received, acquiring an aggregation result containing grids corresponding to the visual area from the second static buffer area, and sending the aggregation result to the front-end;
If the current layer resource is a dynamic resource, dynamically refreshing point location data of the current layer resource to the dynamic cache region; performing snapshot once on the dynamic buffer area, storing snapshot data into the snapshot buffer area, performing aggregation operation on the data of the snapshot buffer area by taking grids as units, obtaining an aggregation result of each grid, and storing the aggregation result into a second dynamic buffer area; carrying out snapshot on the dynamic buffer area at regular time, repeating the above processes, and updating the second dynamic buffer area according to new snapshot data; and after receiving the front-end request, acquiring an aggregation result containing the grid corresponding to the visual area from the second dynamic buffer area, and sending the aggregation result to the front-end.
In some embodiments, prior to acquiring the meshing of the map at the current zoom level, comprising: the map for each zoom level is gridded once.
In some embodiments, the mesh is a cellular mesh.
In some embodiments, aggregating the data of the static buffer or the snapshot buffer in units of a grid includes:
acquiring point location data of current layer resources contained in each grid from the static buffer area or the snapshot buffer area;
Calculating the position and the numerical value of an aggregation point corresponding to the grid according to the point location data of the current layer resource contained in the grid; and the position of the aggregation point is the centroid determined by the point position distribution of the current layer resource contained in the corresponding grid.
In some embodiments, obtaining point location data for a current layer resource contained by each grid includes:
Loading point location data of the current layer resource into a static cache area or storing snapshot data into the snapshot cache area and simultaneously establishing an R tree index;
And acquiring point location data of the current layer resource positioned in the grid through the R tree index, checking the position information of each acquired point location data according to the geographic position information of the grid, and taking the point location data of the current layer resource positioned in the grid as the point location data of the current layer resource contained in the grid.
In some embodiments, aggregating the data of the static buffer or the snapshot buffer in units of a grid includes:
and carrying out aggregation operation on grids in the visible area by taking the grids as units according to the data of the static buffer area or the snapshot buffer area.
In some embodiments, if the current layer resource is a dynamic resource, transmitting the point location data of the current layer resource in a kafka mode, and dynamically refreshing the point location data to the dynamic cache, where the dynamic cache is managed in a hash table mode.
In some embodiments, after receiving the front-end request, the acquiring, from the second static buffer or the second dynamic buffer, an aggregate result including a grid corresponding to the visible region, and sending the aggregate result to the front-end includes:
When the front-end request is received, a request success message which does not contain the aggregation result is returned, and then the calculated aggregation result of the grids is intermittently sent until all the aggregation results of the grids which need to be sent are sent.
The invention also provides a device for aggregating map layer resources based on the back end, which comprises: the acquisition module is used for acquiring grid division of the map under the current zoom level;
the resource classification module is used for classifying layer resources of the map into static resources and dynamic resources;
The static resource processing module is used for loading point location data of the current layer resource into the static cache area if the current layer resource is the static resource; performing aggregation operation on the data of the static buffer area by taking grids as units to obtain an aggregation result of each grid and storing the aggregation result into a second static buffer area; when a front-end request is received, acquiring an aggregation result containing grids corresponding to the visual area from the second static buffer area, and sending the aggregation result to the front-end;
The dynamic resource processing module is used for dynamically refreshing point location data of the current layer resource to the dynamic cache region if the current layer resource is a dynamic resource; performing snapshot once on the dynamic buffer area, storing snapshot data into the snapshot buffer area, performing aggregation operation on the data of the snapshot buffer area by taking grids as units, obtaining an aggregation result of each grid, and storing the aggregation result into a second dynamic buffer area; carrying out snapshot on the dynamic buffer area at regular time, repeating the above processes, and updating the second dynamic buffer area according to new snapshot data; and after receiving the front-end request, acquiring an aggregation result containing the grid corresponding to the visual area from the second dynamic buffer area, and sending the aggregation result to the front-end.
The invention also provides a device for aggregating map layer resources based on the back end, which comprises:
A memory for storing a computer program;
and the processor is used for realizing the aggregation method of the map layer resources based on the back end according to any embodiment when the computer program is run.
The method and the device for aggregating map layer resources based on the rear end provided by the invention have the following beneficial effects:
1. According to the invention, the grid aggregation processing of the layer resources is processed according to the static resources and the dynamic resources respectively, and only the grid aggregation processing of the dynamic resources is refreshed periodically, so that the efficiency of the back-end aggregation processing is improved, the aggregation result can be fed back to the front end more quickly, the system blocking is reduced, the interactivity is improved for a user, and the user experience is improved.
2. When the data volume of the layer resource is large, the invention reduces the data volume of aggregation processing, shortens the aggregation processing time and can feed back the aggregation result to the front end more quickly by adopting the method of preferentially aggregating the grids in the visible area and feeding back the aggregation result.
3. When the layer resource data amount is large and the aggregation processing time is long, the invention adopts the disconnected access strategy, the front-end request is directly returned to be successful, then gradually comes out along with the aggregation result of the grid, gradually feeds back the aggregation result to the front end in the form of grid segmentation, and can obtain better user experience.
4. According to the invention, the grids are divided only once aiming at the map with each zoom level, and when the visible area is changed due to the subsequent map translation, the grids are not divided again, so that frequent flickering of aggregation points during the map translation can be avoided, and the user experience is improved.
Drawings
The above features, technical features, advantages and implementation manners of a method and apparatus for aggregating map layer resources based on a back end will be further described with reference to the accompanying drawings in a clear and understandable manner.
FIG. 1 is a flow chart of one embodiment of a back-end based aggregation method for map layer resources of the present invention;
FIG. 2 is a schematic diagram illustrating the architecture of one embodiment of a back-end based aggregation device for map layer resources according to the present invention;
FIG. 3 is a schematic diagram illustrating another embodiment of a back-end-based aggregation apparatus for map layer resources according to the present invention;
fig. 4 is an effect diagram of a map layer resource displayed in an aggregate manner.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will explain the specific embodiments of the present invention with reference to the accompanying drawings. It is evident that the drawings in the following description are only examples of the invention, from which other drawings and other embodiments can be obtained by a person skilled in the art without inventive effort.
For the sake of simplicity of the drawing, the parts relevant to the present invention are shown only schematically in the figures, which do not represent the actual structure thereof as a product. Additionally, in order to facilitate a concise understanding of the drawings, components having the same structure or function in some of the drawings are only schematically depicted, or only one of them is labeled. Herein, "a" means not only "only this one" but also "more than one" case.
In one embodiment of the present invention, as shown in fig. 1, a method for aggregating map layer resources based on a backend includes:
step S200 acquires the grid division of the map at the current zoom level.
Specifically, when the layer resource points of the map are more, the corresponding resources are generally displayed on the map in an aggregation mode. The backend may be a server and the front-end may be a client. The method comprises the steps that the rear end performs grid division on a map, aggregation processing is performed on layer resource data by taking grids of the map as units, an aggregation result of the grids is sent to the front end, the front end displays resources on the map in the form of icons according to the aggregation result of the grids, for example, the icons are circular frames, positions of the icons reflect positions of the grids, the radius of the circular frames or numerical values in the circular frames reflect the number of layer resources contained in the grids, and the larger the radius or the larger the number is, the more the resources are. An effect diagram of the layer resource displayed in an aggregation mode is shown in fig. 4.
When the map is divided into grids, the number of grids can be determined according to actual requirements and actual processing capacity, for example, the grids are divided into 25 grids in a visible area.
The map has a plurality of zoom levels, and the size of the actual area corresponding to the visible area is different under different zoom levels. Even if the number of grids in the visible area is the same, the actual area sizes corresponding to the grids under different zoom levels are different, so that grid division under the current zoom level needs to be acquired to obtain the geographic position information of each grid.
The current zoom level of the map may be obtained based on the front-end request information.
Step S300 divides the layer resources of the map into static resources and dynamic resources.
The map is composed of various resource data, such as ocean, mountain, land and the like, each type of resource corresponds to one layer, and the map is formed by overlapping multiple layers of resource data. Some special needs, such as safety needs, also need to know the resource information of important units, traffic junction, police car, cameras, etc. on the map.
The static resources and the dynamic resources are relative, and can be divided according to the change speed of the resource information. The change of the resource information includes a change of the number of resources and a change of the position of the resources. Generally, static resource information changes slowly, such as information of important units, traffic hub places and the like, and does not change in one day, one week or even one month; and dynamic resource information changes rapidly, such as police car information and bus information, and the position of the dynamic resource information can change within one hour.
Step S310, judging whether the current layer resource is a static resource or not;
Step S400, if the current layer resource is a static resource, loading point location data of the current layer resource into a static cache region;
Step S410, carrying out aggregation operation on the data of the static buffer area by taking grids as units to obtain an aggregation result of each grid and storing the aggregation result into a second static buffer area;
Step S420, after receiving the front end request, obtains the aggregation result containing the grid corresponding to the visual area from the second static buffer area, and sends the aggregation result to the front end.
Specifically, the point location data of the layer resource includes geographic position information of the layer resource, and some of the point location data also includes specific information of the layer resource, such as important unit resource, where the point location data includes a unit address, and may also include a unit name and the like; also such as police officer resources, the point location data of which includes the locations where police officers are present, the number of police officers, etc.
The aggregation operation takes time, and the larger the data amount is, the longer the processing time is. Because the static resource changes slowly, if all grids have obtained the aggregation result and stored in the second static buffer area, the subsequent request for the static resource only needs to directly obtain the aggregation result from the second static buffer area, and aggregation calculation is not needed, so that the aggregation calculation time can be reduced.
Considering that the aggregation operation takes time, in one embodiment, a minimum aggregation number threshold is also set. When the number of layer resources in the grid exceeds a minimum aggregation number threshold, aggregation processing is carried out; otherwise, the aggregation processing is not carried out, and the point location data of the layer resources in the grid are directly displayed.
Step S500, if the current layer resource is a dynamic resource, dynamically refreshing point location data of the current layer resource to a dynamic cache region;
Step S510, carrying out snapshot on the dynamic buffer area once, storing snapshot data into the snapshot buffer area, carrying out aggregation operation on the data of the snapshot buffer area according to grids, obtaining an aggregation result of each grid, and storing the aggregation result into a second dynamic buffer area;
Step S520, repeating step S510 at regular time, and updating the second dynamic buffer with the new aggregation result;
Step S530, after receiving the front-end request, acquires the latest aggregation result containing the grid corresponding to the visual area from the second dynamic buffer area, and sends the latest aggregation result to the front-end.
Specifically, the dynamic resource changes rapidly, so the point location data of the dynamic resource needs to be dynamically refreshed to the dynamic cache region. The data of each point location may be reported to the dynamic buffer according to respective periods, the periods may not be consistent, i.e. the data refreshing of each point location may be asynchronous, and the invention does not require synchronization. When the dynamic resources are aggregated, the snapshot is firstly carried out on the dynamic cache region, snapshot data are stored in the snapshot cache region, and the aggregation is carried out according to the data of the snapshot cache region, so that the aggregation operation is not influenced by the refreshing of the data of the dynamic cache region. After the data aggregation operation of the snapshot buffer area is completed, the dynamic buffer area is subjected to the next snapshot, the data of the snapshot buffer area is refreshed, aggregation is carried out according to new snapshot data, the second dynamic buffer area is covered by the new aggregation result, and the circulation is performed, so that the data of the second dynamic buffer area can be ensured to be the latest aggregation result of dynamic resources.
The refreshing of the dynamic buffer memory area and the refreshing of the snapshot buffer memory area can be asynchronous, and the refreshing frequency can be different.
It can be seen that the aggregation result needs to be updated continuously for dynamic resources, and the processing time is long. The static resource only needs more time for the primary aggregation treatment, and the subsequent aggregation result can be directly referenced, so that the treatment time is less. If the map contains both static resources and dynamic resources, the aggregation processing time can be greatly reduced, the aggregation processing efficiency can be improved, and the experience of the front-end user can be improved by classifying the layer resources.
Considering that the aggregation operation takes time, in one embodiment, a minimum aggregation number threshold is also set. When the number of dynamic resources in the grid exceeds a minimum aggregation number threshold, aggregation processing is carried out; otherwise, the aggregation processing is not carried out, and the point location data of the dynamic resources in the grid are directly displayed.
In one embodiment, prior to step S200, it comprises:
Step S100 performs one-time meshing of the map for each zoom level.
Specifically, step S100 is to divide the grids of the map with various zoom levels supported by the system into grids, so as to obtain and store the grid fragments of the map with each zoom level and the geographic position information of each grid. For example, grid tiles of the corresponding map and geographic location information for each grid may be saved with a zoom level as an index.
By performing grid division in advance, the map under the current zoom level does not need to be dynamically grid-divided, so long as the grid division of the map under the corresponding zoom level is directly obtained from the buffer, the processing speed of the rear end can be accelerated, the grid division is only performed once for the map of each zoom level, grids cannot be re-divided when the visible area is changed due to the subsequent map translation, frequent flickering of aggregation point positions during the map translation can be avoided, and the user experience is improved.
In one embodiment, the mesh in step S200 is a hexagonal cellular mesh.
The common grid is a rectangular grid, but the centroid of the rectangular grid is easy to form a straight line visually, and the hexagonal honeycomb grid can be changed to improve the point.
In one embodiment, the aggregating operation is performed on the data of the static buffer in the unit of a grid in step S410, and the aggregating operation is performed on the data of the snapshot buffer in the unit of a grid in step S510, to obtain an aggregate result of each grid, including:
Acquiring point location data of current layer resources contained in each grid from a static buffer area or a snapshot buffer area; calculating an aggregation result of each grid according to the point location data of the current layer resource contained in the grid, wherein the aggregation result comprises the position and the numerical value of the corresponding aggregation point; the location of the aggregation point is the centroid determined by the point location distribution of the current layer resources contained by the corresponding grid. If there are only 1 point location within the grid, the centroid of the grid is the location of that point location. The value of the aggregation point may reflect the number of layer resources included in the corresponding grid, which may be the sum of the number of point bits of the layer resources included in the corresponding grid.
If the value of the aggregation point is 0, the aggregation point is not displayed, which indicates that the grid does not have the current layer resource.
In one embodiment, obtaining point location data for a current layer resource contained by each grid includes:
loading point location data of the current layer resource into a static cache region and establishing an R tree index, or storing snapshot data into the snapshot cache region and simultaneously establishing the R tree index;
And obtaining point location data of the current layer resource positioned in the grid through the R tree index, checking the position information of each obtained point location data according to the geographic position information of the grid, and taking the point location data of the current layer resource positioned in the grid as the point location data of the current layer resource contained in the grid.
Specifically, the point location data of a certain grid area can be obtained quickly through the R tree index, but the obtained point location data is likely to be near the grid area and cannot be guaranteed to be in the grid, so that secondary verification is required to be performed on the obtained point location data according to the geographic position information of the grid, and if the point location is not in the grid, the corresponding point location data is required to be removed. By verifying whether the point location data is in the grid or not, the accuracy of the point location data of the current layer resource contained in the grid can be improved.
In one embodiment, aggregating data of a static buffer or a snapshot buffer in a grid unit includes: and carrying out aggregation operation on the grids in the visible area by taking the grids as units according to the data of the static buffer area or the snapshot buffer area.
Specifically, when the layer resource data amount is greater than a preset threshold, in order to accelerate the aggregation processing speed, a lazy aggregation mode is adopted, namely, only the grids in the visible area are aggregated, and all the grids of the map are not aggregated. Therefore, the data volume of the current aggregation processing can be reduced, the current aggregation processing time is shortened, the aggregation result is fed back to the front end more quickly, and the user experience is improved.
In one embodiment, step S500 includes: if the current layer resource is a dynamic resource, carrying out data transmission on point location data of the current layer resource in a kafka mode, dynamically refreshing the point location data to a dynamic cache region, and managing the dynamic cache region in a hash table mode.
Specifically, kafka is a distributed publish/subscribe mode based message queue. The point data of the layer resources from a plurality of positions are transmitted to the dynamic buffer area through the kafka message queue, and at the time of high traffic, the peak of the traffic can be stored in the kafka message queue, so that the high access impact to the dynamic buffer area is prevented. The use of kafka helps control and optimize the speed of the data stream into the dynamic buffer.
And the data of the dynamic buffer is managed by adopting a hash table mode, so that the target data in the dynamic buffer can be quickly searched.
In one embodiment, when a front-end request is received, an aggregate result including a grid corresponding to a visible region is obtained from a second static buffer or a second dynamic buffer, and sent to the front-end, including:
When the front-end request is received, a request success message which does not contain the aggregation result is returned, and then the calculated aggregation result of the grids is intermittently sent until all the aggregation results of the grids which need to be sent are sent.
Specifically, when the quantity of resources is large and the aggregation operation time is long, a disconnected access strategy is introduced, the request is directly returned to be successful, but the aggregation result is not returned, the aggregation result of the grids is calculated by taking grid fragments as a unit, after the aggregation result of at least one grid is obtained, the calculated aggregation result of the grids is sent to the front end, and the process is repeated until all the aggregation results of the grids which need to be sent are sent. This may improve the experience of the front-end client.
The backend may intermittently push the aggregate results of the individual grids to the front end based on Websocket protocol.
In some embodiments, the aggregate operations of multiple grids may be calculated in parallel, which may further improve the operation efficiency.
In one embodiment of the present invention, as shown in fig. 2, an aggregation apparatus for map layer resources based on a back end includes:
An obtaining module 200, configured to obtain grid division of the map at the current zoom level;
the resource classification module 300 is configured to divide layer resources of the map into static resources and dynamic resources;
the static resource processing module 400 is configured to load point location data of the current layer resource into the static buffer if the current layer resource is a static resource; performing aggregation operation on the data of the static buffer area by taking the grids as units to obtain an aggregation result of each grid and storing the aggregation result into a second static buffer area; when a front-end request is received, acquiring an aggregation result containing grids corresponding to the visual area from a second static buffer area, and sending the aggregation result to the front-end;
The dynamic resource processing module 500 is configured to dynamically refresh the point location data of the current layer resource to the dynamic buffer area if the current layer resource is a dynamic resource; performing snapshot once on the dynamic buffer area, storing snapshot data into the snapshot buffer area, performing aggregation operation on the data of the snapshot buffer area by taking grids as units, obtaining an aggregation result of each grid, and storing the aggregation result into a second dynamic buffer area; carrying out snapshot on the dynamic buffer area at regular time, repeating the above processes, and updating the second dynamic buffer area according to new snapshot data; and after receiving the front-end request, acquiring an aggregation result containing the grid corresponding to the visual area from the second dynamic buffer area, and sending the aggregation result to the front-end.
In one embodiment, the system further comprises a meshing module 100 for meshing the map at each zoom level once.
In one embodiment, the mesh is a hexagonal cellular mesh.
In one embodiment, the static resource processing module is further configured to obtain point location data of a current layer resource included in each grid from the static buffer; calculating an aggregation result of each grid according to the point location data of the current layer resource contained in the grid, wherein the aggregation result comprises the position and the numerical value of the corresponding aggregation point; the position of the aggregation point is the centroid determined by the point location distribution of the current layer resource contained in the corresponding grid.
The dynamic resource processing module is also used for acquiring point location data of the current layer resource contained in each grid from the snapshot buffer area; calculating an aggregation result of each grid according to the point location data of the current layer resource contained in the grid, wherein the aggregation result comprises the position and the numerical value of the corresponding aggregation point; the position of the aggregation point is the centroid determined by the point location distribution of the current layer resource contained in the corresponding grid.
In one embodiment, the static resource processing module is further configured to load point location data of a current layer resource into the static cache region and establish an R tree index at the same time; and obtaining point location data of the current layer resource positioned in the grid through the R tree index, checking the position information of each obtained point location data according to the geographic position information of the grid, and taking the point location data of the current layer resource positioned in the grid as the point location data of the current layer resource contained in the grid.
The dynamic resource processing module is also used for establishing an R tree index while storing the snapshot data in the snapshot buffer area; and obtaining point location data of the current layer resource positioned in the grid through the R tree index, checking the position information of each obtained point location data according to the geographic position information of the grid, and taking the point location data of the current layer resource positioned in the grid as the point location data of the current layer resource contained in the grid.
In one embodiment, the static resource processing module is further configured to aggregate the grid in the visible area according to the data of the static buffer area by taking the grid as a unit.
And the dynamic resource processing module is also used for carrying out aggregation operation on the grids in the visible area by taking the grids as units according to the data of the snapshot buffer area.
In one embodiment, the dynamic resource processing module is further configured to, if the current layer resource is a dynamic resource, perform data transmission on point location data of the current layer resource in a kafka manner, dynamically refresh the point location data to a dynamic cache area, where the dynamic cache area is managed in a hash table manner.
In one embodiment, the static resource processing module is further configured to, after receiving the front-end request, return a request success message that does not include the aggregation result, and then intermittently send the computed aggregation result of the grid until all the aggregation results of the grids that have to be sent are sent.
And the dynamic resource processing module is also used for returning a request success message which does not contain the aggregation result after receiving the front-end request, and then intermittently transmitting the calculated aggregation result of the grids until the aggregation result of all grids which are required to be transmitted is transmitted.
It should be noted that, the embodiment of the apparatus for aggregating map layer resources based on a back end provided by the present invention and the embodiment of the method for aggregating map layer resources based on a back end provided by the present invention are both based on the same inventive concept, so that the same technical effects can be obtained. Thus, for other details of the embodiment of the aggregation device for the back-end-based map layer resource, reference may be made to the description of the embodiment of the aggregation method for the back-end-based map layer resource.
In another embodiment of the present invention, as shown in fig. 3, an aggregation apparatus for map layer resources based on a back end includes:
a memory 10 for storing a computer program 20;
a processor 30 for implementing the back-end based map layer resource aggregation method of any of the previous embodiments when running the computer program 20.
Memory 10 may be any internal storage unit and/or external storage device capable of storing data, programs, and the like. For example, the memory 10 may be a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash memory card, or the like.
The processor 10 may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a general purpose processor or other logic device, etc., as desired.
It should be noted that the above embodiments can be freely combined as needed. The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. The aggregation method of the map layer resource based on the back end is characterized by comprising the following steps:
acquiring grid division of a map under the current zoom level;
Dividing layer resources of the map into static resources and dynamic resources;
if the current layer resource is a static resource, loading point location data of the current layer resource into a static cache region; performing aggregation operation on the data of the static buffer area by taking grids as units to obtain an aggregation result of each grid and storing the aggregation result into a second static buffer area; when a front-end request is received, acquiring an aggregation result containing grids corresponding to the visual area from the second static buffer area, and sending the aggregation result to the front-end;
If the current layer resource is a dynamic resource, dynamically refreshing point location data of the current layer resource to the dynamic cache region; performing snapshot once on the dynamic buffer area, storing snapshot data into the snapshot buffer area, performing aggregation operation on the data of the snapshot buffer area by taking grids as units, obtaining an aggregation result of each grid, and storing the aggregation result into a second dynamic buffer area; carrying out snapshot on the dynamic buffer area at regular time, repeating the above processes, and updating the second dynamic buffer area according to new snapshot data; and after receiving the front-end request, acquiring an aggregation result containing the grid corresponding to the visual area from the second dynamic buffer area, and sending the aggregation result to the front-end.
2. The method of aggregating back-end-based map layer resources of claim 1, wherein prior to acquiring meshing of the map at the current zoom level, comprises:
the map for each zoom level is gridded once.
3. The method of aggregating back-end based map layer resources of claim 1,
The grid is a cellular grid.
4. The aggregation method of map layer resources based on the back end according to claim 1, wherein the aggregation operation is performed on the data of the static buffer area or the snapshot buffer area in a unit of a grid, and the method comprises:
acquiring point location data of current layer resources contained in each grid from the static buffer area or the snapshot buffer area;
Calculating the position and the numerical value of an aggregation point corresponding to the grid according to the point location data of the current layer resource contained in the grid; and the position of the aggregation point is the centroid determined by the point position distribution of the current layer resource contained in the corresponding grid.
5. The method for aggregating back-end-based map layer resources of claim 4, wherein obtaining point location data for current layer resources contained in each grid comprises:
Loading point location data of the current layer resource into a static cache area or storing snapshot data into the snapshot cache area and simultaneously establishing an R tree index;
And acquiring point location data of the current layer resource positioned in the grid through the R tree index, checking the position information of each acquired point location data according to the geographic position information of the grid, and taking the point location data of the current layer resource positioned in the grid as the point location data of the current layer resource contained in the grid.
6. The aggregation method of map layer resources based on the back end according to claim 1, wherein the aggregation operation is performed on the data of the static buffer area or the snapshot buffer area in a unit of a grid, and the method comprises:
and carrying out aggregation operation on grids in the visible area by taking the grids as units according to the data of the static buffer area or the snapshot buffer area.
7. The method of aggregating back-end based map layer resources of claim 1,
And if the current layer resource is a dynamic resource, carrying out data transmission on point location data of the current layer resource in a kafka mode, dynamically refreshing the point location data to the dynamic cache region, and managing the dynamic cache region in a hash table mode.
8. The method for aggregating map layer resources based on a back end according to claim 1, wherein when a front end request is received, an aggregate result including a grid corresponding to a visual area is obtained from the second static buffer or the second dynamic buffer and sent to the front end, and the method comprises:
When the front-end request is received, a request success message which does not contain the aggregation result is returned, and then the calculated aggregation result of the grids is intermittently sent until all the aggregation results of the grids which need to be sent are sent.
9. An aggregation device for map layer resources based on a back end, comprising:
The acquisition module is used for acquiring grid division of the map under the current zoom level;
the resource classification module is used for classifying layer resources of the map into static resources and dynamic resources;
The static resource processing module is used for loading point location data of the current layer resource into the static cache area if the current layer resource is the static resource; performing aggregation operation on the data of the static buffer area by taking grids as units to obtain an aggregation result of each grid and storing the aggregation result into a second static buffer area; when a front-end request is received, acquiring an aggregation result containing grids corresponding to the visual area from the second static buffer area, and sending the aggregation result to the front-end;
The dynamic resource processing module is used for dynamically refreshing point location data of the current layer resource to the dynamic cache region if the current layer resource is a dynamic resource; performing snapshot once on the dynamic buffer area, storing snapshot data into the snapshot buffer area, performing aggregation operation on the data of the snapshot buffer area by taking grids as units, obtaining an aggregation result of each grid, and storing the aggregation result into a second dynamic buffer area; carrying out snapshot on the dynamic buffer area at regular time, repeating the above processes, and updating the second dynamic buffer area according to new snapshot data; and after receiving the front-end request, acquiring an aggregation result containing the grid corresponding to the visual area from the second dynamic buffer area, and sending the aggregation result to the front-end.
10. An aggregation device for map layer resources based on a back end, comprising:
A memory for storing a computer program;
a processor for implementing the aggregation method of backend based map layer resources according to any one of claims 1 to 8 when running the computer program.
CN202410155458.8A 2024-02-04 2024-02-04 Aggregation method and device for map layer resources based on back end Pending CN118118554A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410155458.8A CN118118554A (en) 2024-02-04 2024-02-04 Aggregation method and device for map layer resources based on back end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410155458.8A CN118118554A (en) 2024-02-04 2024-02-04 Aggregation method and device for map layer resources based on back end

Publications (1)

Publication Number Publication Date
CN118118554A true CN118118554A (en) 2024-05-31

Family

ID=91214778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410155458.8A Pending CN118118554A (en) 2024-02-04 2024-02-04 Aggregation method and device for map layer resources based on back end

Country Status (1)

Country Link
CN (1) CN118118554A (en)

Similar Documents

Publication Publication Date Title
CN108984662B (en) Block chain data synchronization method
US20200082318A1 (en) Method and device for determining delivery region
CN111159436B (en) Method, device and computing equipment for recommending multimedia content
CN102446139B (en) Method and device for data storage
CN112114984B (en) Graph data processing method and device
CN104007948A (en) Method and device based on distributed computation and visualized display of three-dimensional GIS mass data
CN108804383B (en) Support point parallel enumeration method and device based on measurement space
CN105227489A (en) A kind of bandwidth management method and electronic equipment
CN108881379B (en) Method and device for data synchronization between server clusters
CN109902059A (en) A kind of data transmission method between CPU and GPU
CN115860300A (en) Battery replacement scheduling method and device for vehicle, electronic equipment and storage medium
CN106570060B (en) Random extraction method and device for data in information flow
CN109657164B (en) Method, device and storage medium for publishing message
CN110083666B (en) Server device, information collection system, information collection method, and recording medium
CN118118554A (en) Aggregation method and device for map layer resources based on back end
CN110188140A (en) Data pulling method and device, storage medium and computer equipment
CN112883239B (en) Resource allocation method and device, computer equipment and storage medium
CN109388498B (en) Mutual exclusion processing method, device, equipment and medium
CN115190102A (en) Information broadcasting method and device, electronic unit, SOC and electronic equipment
CN108804681A (en) A kind of data adaptive transmission method, device and computer storage media
CN111611243B (en) Data processing method and device
CN112686599A (en) Request response method, device, system, electronic equipment and computer readable medium
CN112783719A (en) Monitoring data acquisition method, server, system and computer readable storage medium
CN112799820A (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product
CN113342527A (en) Method, apparatus, electronic device, and computer-readable storage medium for rendering

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination