Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
In practical application, mobile devices near the same area have a high probability of needing the same application information, and therefore, when a certain mobile device needs a data file such as an input method lexicon and the like, if other mobile devices which download the data file exist near the mobile device, the mobile device downloads the data file from other mobile devices near the mobile device in a point-to-point (P2P) direct connection mode, and the data is transmitted in a wireless direct connection P2P mode, so that the data volume downloaded from a server end can be effectively saved, the traffic cost is reduced, the bandwidth peak value of the server is reduced, and the success rate of data downloading is improved.
In order to realize the transmission between the mobile devices in a wireless direct connection P2P manner, the background service system and the mobile terminal need to be improved in the present invention, which are respectively described as follows:
referring to fig. 1, fig. 1 is a structural diagram of a background service system according to an embodiment of the present invention. As shown in fig. 1, the system includes: a positioning server;
the positioning server is connected with the mobile device and used for receiving an inquiry request sent by the mobile device when the data file needs to be downloaded, inquiring whether other mobile devices with point-to-point (P2P) agents opened exist at other positions with a first set distance away from the mobile device according to the inquiry request, and sending inquiry results to the mobile device, so that the mobile device can acquire the data file by performing P2P data transmission service with the other mobile devices through the opened P2P agents when the inquiry results are yes.
In a specific implementation, as shown in fig. 1, the location server may include: a positioning interface server and a positioning logic server;
the positioning interface server is connected between the mobile equipment and the positioning logic server, and is used for receiving the query request from the mobile equipment and forwarding the query request to the positioning logic server;
and after receiving the query request, the positioning logic server queries whether other mobile devices with the P2P proxy opened exist at other positions which are different from the mobile device by a first set distance, and informs the mobile device of the query result through the positioning interface server.
Preferably, to facilitate the location logic server to inquire whether there is another mobile device having the P2P proxy opened at another location different from the mobile device by the first set distance, as shown in fig. 1, the location logic server further includes: a location database. The location database stores a location map in advance.
Before describing the location database, further features performed by the location interface server and the location logic server are described:
in the invention, the positioning interface server is also used for receiving the geographical position of the mobile equipment positioned by the mobile equipment and sending the geographical position to the positioning logic server;
the positioning logic server is further configured to, after receiving the geographic location, correct the geographic location by using a location map stored in the location database, so that the corrected geographic location accurately represents the location of the mobile device, and store the corrected geographic location in the location database as the geographic location of the mobile device;
based on the characteristics further executed by the positioning interface server and the positioning logic server, the positioning logic server inquires whether other mobile devices which start the P2P proxy exist at other positions which are different from the mobile device by a first set distance, and the method comprises the following steps:
and determining the geographic position of the mobile equipment from the position database, and inquiring whether other mobile equipment which opens the P2P proxy exists in other positions which are different from the geographic position by a first set distance in the position database.
Based on the above description, it can be seen that the location database is used for pre-storing a location map and dynamically storing the geographical location of the mobile device. In order to distinguish the geographic locations of the mobile devices, the storing the geographic locations of the mobile devices specifically includes: a correspondence between a device identification of the mobile device and a geographic location of the mobile device is saved. The device identifier of the mobile device may be a GUID of the mobile device, a MAC address of an AP accessed by the mobile device, GPS location information of the AP, and the like.
Preferably, as an alternative embodiment of the present invention, the geographic location of the mobile device may not be sent to the location server, but the geographic location and the device identifier corresponding to each mobile device may be directly imported into the location database from the background, for example, similar to the information collecting vehicle of Google today.
As can be seen from the above description, in the present invention, when a mobile device (denoted as a first mobile device) needs to download a data file, as long as the positioning server determines that there are other mobile devices (denoted as second mobile devices) near the first mobile device that have downloaded the data file from the service server and the second mobile device has started the P2P proxy, the first mobile device may download the data file from the second mobile device in a P2P direct connection manner, which can effectively save the data amount downloaded from the server, reduce the traffic cost, reduce the bandwidth peak of the server, and improve the success rate of data downloading compared with the existing method of directly downloading the data file from the service server.
Of course, if all the mobile devices near the first mobile device do not download the data file, in order to ensure that the first mobile device can also obtain the data file, in the present invention, as shown in fig. 1, the system further includes: and a service server.
The service server corresponds to the mobile device and provides a data output source for the mobile device, such as downloading a data file, to complete a service function of the mobile device. Specifically, the service server is configured to receive a data download request sent by the mobile device when the query result is negative, and provide the data file corresponding to the data download request to the mobile device for downloading.
Preferably, in the present invention, when providing the data file, the service server may provide the data file to the mobile device through its associated service material source for downloading. In addition, in the invention, the service server can also configure the upgrading strategy of the mobile equipment, so that the mobile equipment can be upgraded conveniently according to the upgrading strategy.
In the present invention, as shown in fig. 1, the system may further include: an application server;
the application server is used for receiving and storing the data file registered to the application server by calling the P2P proxy of the mobile device after the mobile device downloads the data file.
Preferably, the application server is further configured to receive a peer request sent by the mobile device before performing a P2P data transmission service with other mobile devices notified by the location logic server through the opened P2P proxy, query the data file from all files registered to the application server for the peer request, determine, if the query is received, the other mobile devices that have registered the data file and currently opened the P2P proxy as peers performing a P2P data transmission service with the mobile device, and notify the determined peers to the mobile device, so that the mobile device performs a P2P data transmission service through the opened P2P proxy and the determined peers.
In a specific implementation, in the present invention, the application server may include: an inquiry access server and a logical application server.
The inquiry access server is used for receiving the data file registered by the mobile equipment and forwarding the data file to the logic application server, and receiving a peer request sent by the mobile equipment and forwarding the peer request to the logic application server;
the logic application server is configured to receive and store the data file forwarded by the query access server, query the data file from all files registered to the application server after receiving the peer request, and determine, if the data file is queried, another mobile device that meets the following conditions as a peer performing a P2P data transmission service with the mobile device: and registering the inquired data file, and a mobile device which is different from the mobile device which sends the peer request by a second set distance, or registering the inquired data file, and a mobile device which accesses the same Access Point (AP) as the mobile device which sends the peer request, and informing the determined peer to the mobile device.
Wherein, in order to inquire the mobile device which has opened the P2P proxy, the logic application server can maintain the information list of the online peer node of a certain data file in real time. Here, whether the peer node is online or not may be determined by the query access server by maintaining a heartbeat with the peer node.
Preferably, as an embodiment of the present invention, the query access server may be a tracker conn server, and the logical application server is a tracker app service server, respectively.
It should be noted that the data file registered by the mobile terminal to the application server does not always exist, and can be deleted according to actual situations.
So far, the description of the background service system structure shown in fig. 1 is completed.
The mobile device provided by the present invention is described below with reference to fig. 2:
referring to fig. 2, fig. 2 is a block diagram of a mobile device according to an embodiment of the present invention. The mobile device interacts with the background service system described in fig. 1, and as shown in fig. 2, the mobile device may include: the device comprises a sending unit, an acquisition unit and a transmission unit.
The sending unit is used for sending a query request to a positioning server of the background service system when a data file needs to be downloaded;
a learning unit, configured to learn, from the positioning server, another mobile device that has opened a P2P proxy at a location that is different from the mobile device by a first set distance;
and the transmission unit is used for performing P2P data transmission service with the mobile equipment known by the learning unit through the opened P2P proxy so as to acquire the data file to be downloaded.
Preferably, in the present invention, the sending unit is further configured to send a data download request to a service server of the background service system if the query result is negative; correspondingly, the transmission unit is also used for downloading the data file from a service server.
In the present invention, as shown in fig. 2, the mobile device further includes:
and the positioning unit is used for positioning the geographical position of the mobile equipment and sending the geographical position to the positioning server so that the positioning server inquires whether other mobile equipment with a peer-to-peer P2P proxy opened at other positions with a first set distance from the mobile equipment exists according to the geographical position.
Here, the positioning unit may locate a geographic Location where the mobile device is currently located Based on a Location Based Service (LBS). The location-based service is a value-added service that obtains geographic locations (such as geographic coordinates or geodetic coordinates) through a radio communication network (such as a GSM network or a CDMA network) of a telecommunication mobile operator or an external positioning mode (such as a GPS), and provides corresponding services to mobile device users with the support of a Geographic Information System (GIS) platform.
In the present invention, the sending unit is further configured to send a data download request to the service server of the background service system when the learning unit learns that there is no mobile device that has started the P2P proxy at a position that is different from the mobile device by a first set distance; based on this, the transmission unit is further configured to download the data file from a service server.
Preferably, in the present invention, as shown in fig. 2, the mobile device further includes:
and the registering unit is used for registering the downloaded data file to the application server in the background service system by calling the P2P proxy of the mobile equipment after the transmission unit downloads the data file from the service server. .
The registration unit invokes the P2P proxy of the mobile device to register the data file with the application server in the background service system, so as to facilitate other mobile devices to subsequently perform P2P data service directly with the mobile device to acquire the data file.
In the present invention, the learning unit is further configured to learn the number of mobile devices that have opened P2P proxies at a position that is different from the mobile device by a first set distance; based on this, before the transmitting unit performs the P2P data transmission service with the mobile device known by the learning unit through the opened P2P proxy, the transmitting unit further includes: and judging whether the number of the mobile devices acquired by the acquiring unit is greater than or equal to a set threshold, if so, determining to start the P2P proxy, and continuing to execute the operation of performing the P2P data transmission service on the mobile devices acquired by the acquiring unit through the started P2P proxy, otherwise, determining not to start the P2P proxy. Through the judgment operation, the optionality of the transmission unit for performing the P2P data transmission service with the other mobile device through the opened P2P proxy can be ensured, and the transmission unit does not perform the P2P data transmission service with the mobile device as long as the learning unit learns the mobile device, so that the reliability of the P2P data transmission service can be further ensured.
Preferably, in the present invention, the transmission unit is further configured to send an opposite peer request to an application server in the background service system before performing a P2P data transmission service with the mobile device known by the learning unit through the activated P2P agent; the learning unit is further configured to learn, from the application server, a peer to peer for performing a P2P data transmission service; based on this, the transmission unit learns that the data file needing to be downloaded includes the data file needing to be downloaded through the opened P2P proxy and the P2P data transmission service of the mobile device learned by the learning unit:
the transmission unit acquires the data file needing to be downloaded by carrying out P2P data transmission service through the opened P2P proxy and the peer acquired by the acquisition unit. It can be seen that the transmission unit does not perform the P2P data transmission service with all other mobile devices different by the first set distance, but performs the P2P data transmission service only with the opened P2P proxy and the peer determined by the application server for the peer request, which can ensure that the mobile device obtains the data file that the mobile device needs to download as soon as possible.
So far, the description of the mobile device structure shown in fig. 2 is completed.
The following describes how the background service system shown in fig. 1 and the mobile device shown in fig. 2 communicate with each other through fig. 3:
referring to fig. 3, fig. 3 is a flowchart of a method provided by an embodiment of the invention. As shown in fig. 3, the process may include the following steps:
step 301, the mobile device sends a query request to a location server connected to the mobile device when a data file needs to be downloaded.
Step 302, the location server queries whether other mobile devices with the P2P proxy opened are located at other positions different from the mobile device by a first set distance with respect to the query request, and sends a query result to the mobile device.
As an embodiment of the present invention, before the step 302 is executed, the present invention further includes:
the mobile equipment locates the geographical position and sends the geographical position to the positioning server;
after receiving the geographic position, the positioning server corrects the geographic position by using a position map stored in a position database so that the corrected geographic position accurately represents the position of the mobile equipment, and stores the corrected geographic position as the geographic position of the mobile equipment in the position database;
based on this, in this step 302, the querying, by the positioning server, whether there is another mobile device having opened the peer-to-peer P2P proxy at another location different from the mobile device by the first set distance with respect to the query request includes:
the positioning server inquires the geographic position of the mobile device from the position database, and inquires whether other mobile devices which open the P2P proxy exist at other positions which are different from the geographic position by a first set distance.
And step 303, when the query result is yes, the mobile device performs a P2P data transmission service with the other mobile device through the opened P2P proxy to acquire the data file.
In the present invention, if the query result is yes, the method further includes: the number of other wireless mobile devices which open P2P agents at other positions which are different from the wireless mobile devices by a first set distance;
based on this, in this step 303, before performing the P2P data transmission service with the other mobile device through the opened P2P proxy, the method may further include:
and judging whether the number of the wireless mobile devices in the query result is greater than or equal to a set threshold, wherein the set threshold can be set according to the actual network situation, if so, determining to open the P2P proxy, and continuing to perform the operation of acquiring the data file through the opened P2P proxy and the P2P data transmission service of the other mobile device rows, otherwise, determining not to open the P2P proxy. By performing this determination operation, the optionality of the P2P data transmission service with the other mobile device through the opened P2P proxy in this step 303 can be ensured, and the P2P data transmission service in this step 303 is not executed as long as the query result in step 302 is yes, which can further ensure the reliability of the P2P data transmission service.
It should be noted that, in the present invention, when the query result is negative, the mobile device may further send a data download request to the service server connected thereto, so that the service server provides the data file corresponding to the data download request to the mobile device for downloading. Then, after downloading the data file from the service server, the mobile device registers to the application server connected with the data file by calling the P2P proxy of the mobile device. The P2P proxy is called to register the data file to the application server in the background service system, so as to facilitate other mobile devices to subsequently perform P2P data service directly with the mobile device to acquire the data file.
Thus, in this step 303, the mobile device obtaining the data file through the opened P2P proxy and the data transmission service of the other mobile device row P2P includes:
sending an opposite-end peer request to the application server;
the application server inquires the data file from all files registered to the application server aiming at the peer request, if the data file is inquired, other mobile equipment which registers the data file and currently opens a P2P proxy is determined as the peer which performs the P2P data transmission service with the mobile equipment, and the determined peer is informed to the mobile equipment;
the mobile device acquires the data file through the opened P2P proxy and the peer informed by the application server for P2P data transmission service.
Here, the application server determines the peer of the P2P data transmission service with the mobile device, and the purpose is to explain: the mobile device does not perform the P2P data transmission service with all other mobile devices different by the first set distance, but performs the P2P data transmission service only through the peer determined by the opened P2P proxy and the application server, which can ensure that the mobile device obtains the data files which the mobile device needs to download as soon as possible.
Wherein, the peer determined by the application server is:
the mobile equipment which has registered the inquired data file and has a second set distance with the mobile equipment which has sent the peer request; or,
and the mobile equipment which has registered the inquired data file and accesses the same access point AP as the mobile equipment which sends the peer request.
Thus, the flow description of the method shown in fig. 3 is completed.
According to the technical scheme, when one mobile device (marked as a first mobile device) needs to download the data file, as long as other mobile devices (marked as second mobile devices) near the first mobile device download the data file from the service server, the first mobile device can download the data file from the second mobile device in a P2P direct connection mode, compared with the existing method of directly downloading the data file from the service server, the data volume downloaded from the server end can be effectively saved, the traffic cost is reduced, the bandwidth peak value of the server is reduced, and the success rate of data downloading is improved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.