Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for obtaining an electronic map, which can save network traffic consumed by transmitting the electronic map.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method for obtaining an electronic map is provided, wherein an obtaining time period is set on a terminal, and the method further comprises the following steps of:
the terminal detects the moving speed of the terminal and determines the proportion of the electronic map required currently according to the detected speed;
when determining that an electronic map which comprises the current position of the terminal and has the proportion consistent with the determined proportion does not exist in the electronic map stored in the terminal, sending an acquisition request carrying the current position of the terminal and the determined proportion to a network side;
receiving an electronic map which is returned by a network side, comprises the current position of the terminal carried by the acquisition request and has the proportion consistent with that carried by the acquisition request;
the terminal detects the self-moving speed as follows:
determining the position of the terminal through a Global Positioning System (GPS), and determining the position of the terminal through the GPS again after a preset positioning time period;
calculating the displacement of the terminal in the positioning time period according to the terminal positions measured twice, and further obtaining the speed of the terminal; or,
and receiving the GPS signal, and calculating the speed of the terminal according to the Doppler effect of the GPS signal.
Further, the determining a scale of the electronic map currently required according to the detected speed includes:
configuring a corresponding first speed interval for each proportion of the electronic map in advance;
and determining a first speed interval in which the detected speed is positioned, wherein the proportion of the electronic map corresponding to the determined first speed interval is the proportion of the electronic map required currently.
Further, after the terminal detects the moving speed of the terminal, the method further includes: determining the content of the electronic map required currently according to the detected speed, specifically:
configuring a corresponding second speed interval for each content of the electronic map in advance;
determining a second speed interval where the detected speed is located, wherein the content of the electronic map corresponding to the determined second speed interval is the content of the electronic map required currently;
correspondingly, the acquisition request also carries the content of the electronic map which is currently needed;
and the electronic map transmitted to the terminal by the network side comprises the content of the electronic map required currently.
Further, after the terminal receives the electronic map returned by the network side, the method further comprises: in a set selection time period, when the terminal receives an instruction of refusing to store, which is input by a terminal user, the terminal does not store the received electronic map and ends the current electronic map acquisition process; and when the instruction of refusing to store, which is input by the terminal user, is not received, storing and displaying the received electronic map.
Further, the method further comprises: and the terminal user deletes part or all of the electronic map stored in the terminal according to the self requirement.
The invention also provides a device for acquiring the electronic map, which is arranged on the terminal and comprises: the device comprises a first input module, a detection module, a proportion determination module, a request module and a receiving module; wherein,
the first input module is used for setting an acquisition time period; triggering a detection module every other acquisition time period;
the detection module is used for detecting the moving speed of the terminal;
the proportion determining module is used for determining the proportion of the electronic map required currently according to the detected speed;
the system comprises a request module, a processing module and a processing module, wherein the request module is used for sending an acquisition request carrying the current position of the terminal and the determined proportion to a network side when determining that the electronic map which comprises the current position of the terminal and has the proportion consistent with the determined proportion does not exist in the electronic map stored by the terminal;
the receiving module is used for receiving an electronic map which is returned by a network side, comprises the current position of the terminal carried by the acquisition request and has the proportion consistent with that carried by the acquisition request;
the detection module comprises: the system comprises a positioning module and a first calculation module; wherein,
the positioning module is used for setting a positioning time period; determining the position of the terminal through a Global Positioning System (GPS), and determining the position of the terminal through the GPS again after a preset positioning time period;
the first calculation module is used for calculating the displacement of the terminal in the positioning time period according to the terminal positions measured twice so as to obtain the speed of the terminal;
alternatively, the detection module comprises: the signal receiving module and the second calculating module; wherein,
the signal receiving module is used for receiving GPS signals;
and the second calculation module is used for calculating the speed of the terminal according to the Doppler effect of the GPS signal.
Further, the ratio determination module comprises: a first configuration module and a first determination module; wherein,
the first configuration module is used for configuring a corresponding first speed interval for each scale of the electronic map;
the first determining module is used for determining a first speed interval where the detected speed is located, and the determined proportion of the electronic map corresponding to the first speed interval is the proportion of the electronic map required currently.
Further, the apparatus further comprises:
and the content determining module is used for determining the content of the electronic map which is required currently according to the detected speed.
Further, the content determination module includes: a second configuration module and a second determination module; wherein,
the second configuration module is used for configuring a corresponding second speed interval for each content of the electronic map;