Disclosure of Invention
An object of the present invention is to solve at least the above problems and to provide at least the advantages described later.
It is still another object of the present invention to provide a method and an apparatus for multi-category asynchronous loading and de-duplication of a map, which can enable faster loading presentation of the first screen content on the map and weaken the obtrusive effect of content presentation.
To achieve these objects and other advantages in accordance with the purpose of the invention, there is provided a map multi-classification asynchronous loading and deduplication method, comprising:
step one, an organization request corresponding to a map moving or zooming instruction sent by a user through a mobile terminal is disassembled into single requests of a plurality of minimum units;
step two, comparing the single request of the minimum unit stored in the memory of the mobile terminal with the single request of the minimum unit of the current instruction, reserving intersection data in the memory of the mobile terminal, deleting difference data between the result of the current instruction and the result of the mobile terminal, and storing the result of the current instruction and the difference data of the memory of the mobile terminal in the memory of the mobile terminal;
and step three, updating the label points displayed by the map of the mobile terminal according to the data stored in the memory of the mobile terminal.
Preferably, in the second step, the single request of the minimum unit stored in the memory of the mobile terminal is a single request of splitting an organization request corresponding to a command for moving or zooming a map, which is sent by the user through the mobile terminal last time, into a plurality of minimum units.
Preferably, the disassembly is performed according to the traffic classification or time-consuming of the instructions.
Preferably, the single request of the minimum unit is stored in the mobile terminal memory according to the service classification.
Preferably, the specific disassembling mode is as follows: the method comprises the steps of dividing according to the type of requested service, distributing a unique identifier to each service, regarding the classification corresponding to the identifier as a minimum request unit, if the corresponding request under the identifier takes longer time, enabling a service end to carry out optimized disassembly on the classified service by utilizing an analysis result, continuously distributing the unique identifier to the disassembled sub-services, and so on, so as to achieve the request standard of the minimum unit.
The asynchronous loading of map multi-classification and device of removing duplications includes:
the data disassembling module is used for disassembling an organization request corresponding to a map moving or zooming instruction sent by a user through a mobile terminal into a single request of a plurality of minimum units;
a data storage module storing a single request for a plurality of minimum units;
the data comparison module is used for comparing the single request of the minimum unit stored in the data storage module with the single request of the minimum unit of the current instruction, reserving intersection data in a memory of a mobile terminal, deleting difference data between the result of the current instruction and the result of the mobile terminal, and storing the result of the current instruction and the difference data of the data storage module in the data storage module;
and the data display module updates the annotation points displayed by the map at the mobile terminal according to the data stored by the data storage module.
An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method.
A storage medium having stored thereon a computer program which, when executed by a processor, implements the method.
The invention at least comprises the following beneficial effects:
the invention mainly aims at the content classification asynchronous acquisition and duplicate removal presentation of the map on the client. The basic unit of control is a single data request, presentation to result; a plurality of single requests are combined together to form a multi-classification asynchronous request scheme, so that the first screen content on the map can be loaded and presented more quickly, and the abrupt effect of content presentation is weakened.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention.
Detailed Description
The present invention is further described in detail below with reference to the attached drawings so that those skilled in the art can implement the invention by referring to the description text.
It will be understood that terms such as "having," "including," and "comprising," as used herein, do not preclude the presence or addition of one or more other elements or groups thereof.
It is to be noted that the experimental methods described in the following embodiments are all conventional methods unless otherwise specified, and the reagents and materials are commercially available unless otherwise specified.
As shown in fig. 1-2, the present invention provides a map multi-classification asynchronous loading and deduplication method, which includes:
step one, a mobile terminal and a server interact to carry out instruction analysis through an instruction of moving or zooming a map sent by a user through the mobile terminal, a corresponding organization request is disassembled into a plurality of single requests of minimum units, the disassembly can be carried out according to the same type of data, the disassembly mode is large and small, the disassembly mode is one in small, the single request of the minimum unit refers to services which cannot be continuously divided, for example, the classification of a gas station is inquired, the gas station can be divided into a country and a private, and then the division can be carried out according to brands, such as medium petroleum, medium sea oil and the like;
step two, the memory of the mobile terminal stores the single request results of a plurality of minimum units, if the first instruction of the APP is loaded for the first time by the user, the data stored in the memory of the mobile terminal is empty, if the second instruction of the APP is loaded for the user, the data stored in the memory of the mobile terminal is the request results of all the minimum units corresponding to the last instruction, if the first or second instruction of the APP is not loaded for the first time by the user, the data stored in the memory of the mobile terminal is a data set of a plurality of minimum units obtained by deleting and complementing the single request results of a plurality of minimum units corresponding to the last instruction or a plurality of instructions (the processing of the step two), the single request of the minimum unit corresponding to the current instruction of the user forms another set, the two sets are compared, for the memory of the mobile terminal, the single request stored in the memory of the mobile terminal and the same type of minimum units in the current instruction are compared, deleting the data in the memory, which does not have the single request result, reserving the data of the request result of the minimum unit intersected with the instruction, comparing the request result of the remaining minimum unit with the data in the memory of the mobile terminal, and storing the data which is not in the memory of the mobile terminal to form a new data set;
and step three, updating the label points displayed by the map of the mobile terminal according to the data stored in the memory of the mobile terminal.
In the technical scheme, the content classification of the map on the client side is mainly subjected to asynchronous acquisition and duplicate removal presentation. The basic unit of control is a single data request, presentation to result; a plurality of single requests are combined together to form a multi-classification asynchronous request scheme, so that the first screen content on the map can be loaded and presented more quickly, and the abrupt effect of content presentation is weakened. Taking a gas station as an example, a gas station A, B, C is displayed in a current map, A, B, C is cached in a memory at the same time, a user moves or zooms the map to form a secondary request for updating the gas station, the request result contains B, C, F, G points, at the moment, two comparisons are needed, in the first step, A, B, C cached in the memory is compared with B, C, F, G in the request result, and after the comparison is completed, the cache in the memory is updated to B, C; and comparing the request result with the updated cache data, updating the cache in the memory to B, C, F, G after the request result is completed, and finally displaying B, C, F, G on the map, wherein the map cannot reload B, C points since the B, C points are displayed on the map from the beginning, so that the display-deletion-redisplay process of the map data is solved.
In another technical solution, in the second step, the single request of the minimum unit stored in the memory of the mobile terminal is a single request of splitting an organization request corresponding to a command for moving or zooming a map, which is sent by the user through the mobile terminal last time, into a plurality of minimum units. Only comparing the data of two adjacent instructions can reduce the occupation of the memory, reduce the comparison times and load the data quickly.
In another technical scheme, the disassembly is carried out according to the service classification of the instruction or the consumed time. And the service function singleness and logic simplicity can be ensured according to the business classification disassembly. The time-consuming service is disassembled, so that the requests with small time consumption can be preferentially displayed in the plurality of disassembled requests, and the effect of overlong waiting time is avoided.
In another technical scheme, the single request of the minimum unit is stored in the memory of the mobile terminal according to the service classification. The situation that when a new request is initiated each time, the classification needs to be repeatedly acquired from the server is avoided, and the situation that the map has no data due to the fact that the server classification interface is failed to acquire is avoided.
In another technical scheme, the specific disassembling mode is as follows: the method comprises the steps of dividing according to the type of requested service, distributing a unique identifier to each service, regarding the classification corresponding to the identifier as a minimum request unit, if the corresponding request under the identifier takes longer time, enabling a service end to carry out optimized disassembly on the classified service by utilizing an analysis result, continuously distributing the unique identifier to the disassembled sub-services, and so on, so as to achieve the request standard of the minimum unit. The method is self-determined according to different services, and can be used for dividing the major classes into minor classes, splitting the time-consuming services and splitting the time-consuming services into parts with small time consumption and large time consumption. The service classification includes: parts and links of a clothed walking, etc., such as gas stations or hospitals, etc., as mentioned herein, such as dividing hospitals into different levels.
The asynchronous loading of map multi-classification and device of removing duplications includes:
the data disassembling module is used for disassembling an organization request corresponding to a map moving or zooming instruction sent by a user through a mobile terminal into a single request of a plurality of minimum units;
a data storage module storing a single request for a plurality of minimum units;
the data comparison module is used for comparing the single request of the minimum unit stored in the data storage module with the single request of the minimum unit of the current instruction, reserving intersection data in a memory of a mobile terminal, deleting difference data between the result of the current instruction and the result of the mobile terminal, and storing the result of the current instruction and the difference data of the data storage module in the data storage module;
and the data display module updates the annotation points displayed by the map at the mobile terminal according to the data stored by the data storage module.
An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method.
A storage medium having stored thereon a computer program which, when executed by a processor, implements the method.
The number of apparatuses and the scale of the process described herein are intended to simplify the description of the present invention. Applications, modifications and variations of the present invention will be apparent to those skilled in the art.
While embodiments of the invention have been described above, it is not limited to the applications set forth in the description and the embodiments, which are fully applicable in various fields of endeavor to which the invention pertains, and further modifications may readily be made by those skilled in the art, it being understood that the invention is not limited to the details shown and described herein without departing from the general concept defined by the appended claims and their equivalents.