Based on file sharing method and the system of Bluetooth technologyTechnical field
The present invention relates to file-sharing field, particularly a kind of file sharing method based on Bluetooth technology and system.
Background technology
Along with the development of computer technology and Internet technology, the technology such as the file-sharing between many equipment, transfer of data and information interaction have also been obtained to be applied widely, and user can realize sharing of various file, data and information between different devices.
In prior art, router is utilized to carry out transfer of data between many equipment or file-sharing, a router must be had as medium, thus cause this data transmission method to be limited to router device, if and an employing mobile phone is as focus, then the coverage of mobile phone institute diverged signal can be limited to.Therefore, no matter be utilize router as medium, still utilize mobile phone as focus, bring much inconvenience all can to the transfer of data between many equipment and file-sharing.
Summary of the invention
The technical problem to be solved in the present invention be in order to overcome in prior art utilize router as medium or utilize mobile phone to carry out transfer of data between many equipment or file-sharing as focus time, be limited to the defect of router device or mobile phone signal coverage, provide a kind of and be not limited to media device and the convenient shared file sharing method based on Bluetooth technology and system.
The present invention solves above-mentioned technical problem by following technical proposals:
Based on a file sharing method for Bluetooth technology, be applied in the AdHoc network (AdHoc network is a kind of multi-hop, acentric, ad hoc deployed wireless networks) built by Bluetooth technology, its feature is, comprises the following steps:
Each mobile terminal in described AdHoc network all receives the attribute information of file to be shared in other mobile terminal in automatic network, and choose the first file for downloading according to the attribute information received, wherein, described first file is stored in the second mobile terminal of described AdHoc network;
In described AdHoc network first mobile terminal send described first file download request to described second mobile terminal;
Described first mobile terminal receives described first file sent from described second mobile terminal.
In this programme, the AdHoc network built by Bluetooth technology comprises multiple mobile terminal, wherein, each mobile terminal all can receive the attribute information of file to be shared in other mobile terminal, and can choose arbitrarily the file of wish download according to the attribute information received.For the first mobile terminal, the file that first mobile terminal is chosen for downloading is the first file be stored in the second mobile terminal, therefore, first mobile terminal sends the download request of the first file to the second mobile terminal, and receive the first file that the second mobile terminal sends, now, successfully have shared the first file between the first mobile terminal and the second mobile terminal.It should be noted that the first mobile terminal obtains the mobile terminal residing for the first file according to the attribute information received.
It will be understood by those of skill in the art that the first mobile terminal can for any one mobile terminal in described AdHoc network, the second mobile terminal can for storing the first mobile terminal any one mobile terminal for the first file of download.
Easy understand ground, described first file is the file to be shared in described second mobile terminal.Wherein, file to be shared described in can comprise any files that can share such as picture, document, webpage, video and software installation kit with described first file.
In the AdHoc network of this programme, by the attribute information of file to be shared between shared mobile terminal, and then achieve sharing of file to be shared between mobile terminal.Do not rely on any media device or focus based on the file sharing method of Bluetooth technology in this programme, between any two mobile terminals in AdHoc network, all can carry out sharing of file, convenient and reliable.
Preferably, described attribute information include file title, document location, file size, file type and/or the amendment date.
In this programme, the file for downloading is chosen according to attribute information, such as can obtaining mobile terminal residing for file to be shared according to the document location in attribute information, file for downloading can being chosen according to the file name in attribute information, document location, file size, file type and/or amendment date.Wherein, attribute information is not limited to above-mentioned information, can also comprise any information that other can characterize file attribute.
Preferably, further comprising the steps:
The 3rd mobile terminal in described AdHoc network judges and determines to preserve in network the mobile terminal quantity of described first file;
When described mobile terminal quantity is more than or equal to 2, calculates the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, and choose the mobile terminal of signal the best;
The download request of described first file is issued the mobile terminal of described signal the best, and receive described first file sent from the mobile terminal of described signal the best.
In this programme, after the first file that the 3rd mobile terminal is chosen for downloading, needs judge and determine to preserve the mobile terminal quantity of the first file, when described mobile terminal quantity is 1, directly the download request of the first file are issued the mobile terminal preserving the first file; When described mobile terminal quantity is more than or equal to 2, needs to calculate the RST between the 3rd mobile terminal and each mobile terminal preserving the first file respectively, and the download request of the first file is issued the mobile terminal of signal the best.
In this programme, 3rd mobile terminal is not all send download request to all mobile terminals preserving the first file, download request neither be sent to any mobile terminal preserving the first file, but send download request to the mobile terminal of the signal the best of preserving the first file, and the first file that the mobile terminal of Received signal strength the best sends, effectively improve the speed of transfer files in network, also improve the efficiency of shared file simultaneously.
Preferably, calculate the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, be specially and calculate according to the Distance geometry node between the 3rd mobile terminal and each mobile terminal preserving described first file.
In this programme, according to the Distance geometry node calculate RST therebetween between the 3rd mobile terminal and the mobile terminal preserving the first file.Wherein, node refers to the one or more mobile terminals in AdHoc network between any two mobile terminals.That is, the RST calculated between two mobile terminals not only needs the distance considered therebetween, also needs the mobile terminal considered therebetween.
Wherein, the method calculating RST between any two mobile terminals in AdHoc network is not limited to according to Distance geometry node calculate, can also can calculate the method for RST therebetween for other.
Preferably, the mobile terminal preserving described first file at least comprises described first mobile terminal and described second mobile terminal.
In this programme, first file is stored in the second mobile terminal, first mobile terminal chooses the first file for downloading according to the attribute information received, and send the first file download request to the second mobile terminal, then receive the first file sent from the second mobile terminal.Easy understand ground, other mobile terminal also can send the download request of the first file to the second mobile terminal, and receives the first file.Therefore, when the 3rd mobile terminal also will download the first file, the mobile terminal preserving described first file at least includes the first mobile terminal and the second mobile terminal.
The present invention also provides a kind of shared file system based on Bluetooth technology, and comprise the mobile terminal in the AdHoc network being applied to and being built by Bluetooth technology, its feature is,
Each mobile terminal in described AdHoc network is all for receiving the attribute information of file to be shared in other mobile terminal in automatic network, and choose the first file for downloading according to the attribute information received, wherein, described first file is stored in the second mobile terminal in described AdHoc network;
The first mobile terminal in described AdHoc network downloads request to described second mobile terminal for what send described first file, and receives described first file sent from described second mobile terminal.
Preferably, described attribute information include file title, document location, file size, file type and/or the amendment date.
Preferably, the 3rd mobile terminal in described AdHoc network is for judging and determining to preserve in network the mobile terminal quantity of described first file, when described mobile terminal quantity is more than or equal to 2, calculate the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, and choose the mobile terminal of signal the best, and send the mobile terminal downloading request to described signal the best of described first file, and receive described first file sent from the mobile terminal of described signal the best.
Preferably, described 3rd mobile terminal, for calculating the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, is specially described 3rd mobile terminal for calculating according to the Distance geometry node between the 3rd mobile terminal and each mobile terminal preserving described first file.
Preferably, the mobile terminal preserving described first file at least comprises described first mobile terminal and described second mobile terminal.
On the basis meeting this area general knowledge, above-mentioned each optimum condition, can combination in any, obtains the preferred embodiments of the invention.
Positive progressive effect of the present invention is: compared with prior art, the present invention is by sharing the attribute information of file to be shared between mobile terminal in the ad hoc network, and then achieve sharing of file to be shared between mobile terminal, and do not rely on other media device or focus, convenient and reliable.
Accompanying drawing explanation
Fig. 1 is the flow chart based on the file sharing method of Bluetooth technology in the embodiment of the present invention 1.
Fig. 2 is the structured flowchart of AdHoc network in the embodiment of the present invention 1.
Fig. 3 is the flow chart based on the file sharing method of Bluetooth technology in the embodiment of the present invention 2.
Fig. 4 is the flow chart based on the file sharing method of Bluetooth technology in the embodiment of the present invention 3.
Embodiment
Mode below by embodiment further illustrates the present invention, but does not therefore limit the present invention among described scope of embodiments.
Embodiment 1
Based on a file sharing method for Bluetooth technology, be applied in the AdHoc network built by Bluetooth technology, as shown in Figure 1, comprise the following steps:
Step 101, each mobile terminal all receive attribute information and choose the first file for downloading.
Particularly, each mobile terminal in described AdHoc network all receives the attribute information of file to be shared in other mobile terminal in automatic network, and choose the first file for downloading according to the attribute information received, wherein, described first file is stored in the second mobile terminal of described AdHoc network.
Step 102, the first mobile terminal send and download request to the second mobile terminal.
Particularly, in described AdHoc network first mobile terminal send described first file download request to described second mobile terminal.
Step 103, the first mobile terminal receive the first file.
Particularly, described first mobile terminal receives described first file sent from described second mobile terminal.
In the present embodiment, the AdHoc network built by Bluetooth technology comprises multiple mobile terminal, wherein, each mobile terminal all can receive the attribute information of file to be shared in other mobile terminal, and can choose arbitrarily the file of wish download according to the attribute information received.For the first mobile terminal, the file that first mobile terminal is chosen for downloading is the first file be stored in the second mobile terminal, therefore, first mobile terminal sends the download request of the first file to the second mobile terminal, and receive the first file that the second mobile terminal sends, now, successfully have shared the first file between the first mobile terminal and the second mobile terminal.It should be noted that the first mobile terminal obtains the mobile terminal residing for the first file according to the attribute information received.
It will be understood by those of skill in the art that the first mobile terminal can for any one mobile terminal in described AdHoc network, the second mobile terminal can for storing the first mobile terminal any one mobile terminal for the first file of download.
Easy understand ground, described first file is the file to be shared in described second mobile terminal.Wherein, file to be shared described in can comprise any files that can share such as picture, document, webpage, video and software installation kit with described first file.
Give a concrete illustration below the file sharing method based on Bluetooth technology in the present embodiment is described.
As shown in Figure 2, mobile phone A, mobile phone B, mobile phone C and mobile phone D construct AdHoc network by Bluetooth technology, wherein, each mobile phone all receives the attribute information of file to be shared in other 3 mobile phones, and choose the file L1 for downloading according to the attribute information received, wherein, file L1 is stored in mobile phone A.Now, mobile phone B transmission file L1 downloads request to mobile phone A, and receives the file L1 of mobile phone A transmission.
In above-mentioned example, file L1 is the first file in the present embodiment, and mobile phone B is the first mobile terminal in the present embodiment, and mobile phone A is the second mobile terminal in the present embodiment, achieves sharing to file L1 between mobile phone A and mobile phone B.
In the AdHoc network of the present embodiment, by the attribute information of file to be shared between shared mobile terminal, and then achieve sharing of file to be shared between mobile terminal.Do not rely on any media device or focus based on the file sharing method of Bluetooth technology in the present embodiment, between any two mobile terminals in AdHoc network, all can carry out sharing of file, convenient and reliable.
The present embodiment also provides a kind of shared file system based on Bluetooth technology, comprise the mobile terminal in the AdHoc network being applied to and being built by Bluetooth technology, each mobile terminal in described AdHoc network is all for receiving the attribute information of file to be shared in other mobile terminal in automatic network, and choose the first file for downloading according to the attribute information received, wherein, described first file is stored in the second mobile terminal in described AdHoc network.
The first mobile terminal in described AdHoc network downloads request to described second mobile terminal for what send described first file, and receives described first file sent from described second mobile terminal.
The present embodiment is based in the shared file system of Bluetooth technology, and all mobile terminals that can realize in AdHoc network treat sharing of the attribute information sharing file, can also realize sharing of file to be shared between any two mobile terminals, convenient and reliable.
Embodiment 2
The present embodiment provides a kind of file sharing method based on Bluetooth technology, is applied in the AdHoc network built by Bluetooth technology, as shown in Figure 3, comprises the following steps:
Step 201, the 3rd mobile terminal receive attribute information and choose the first file for downloading.
Particularly, the 3rd mobile terminal in described AdHoc network receives the attribute information of file to be shared in other mobile terminal in automatic network, and chooses the first file for downloading according to the attribute information received.
In the present embodiment, attribute information include file title, document location, file size, file type and/or amendment date.3rd mobile terminal can obtain mobile terminal residing for file to be shared according to the document location in attribute information, can also choose file for downloading according to the file name in attribute information, document location, file size, file type and/or amendment date.3rd mobile terminal chooses the file for downloading in the present embodiment is the first file.
Step 202, the 3rd mobile terminal judge and determine mobile terminal quantity.
Particularly, the 3rd mobile terminal in described AdHoc network judges and determines to preserve in network the mobile terminal quantity of described first file.
Step 203, when mobile terminal quantity is more than or equal to 2, calculates RST and choose the mobile terminal of signal the best.
Particularly, when described mobile terminal quantity is more than or equal to 2, according to the Distance geometry node between the 3rd mobile terminal and each mobile terminal preserving described first file, calculate the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, and choose the mobile terminal of signal the best.Wherein, node refers to the one or more mobile terminals in AdHoc network between any two mobile terminals.That is, the RST calculated between two mobile terminals not only needs the distance considered therebetween, also needs the mobile terminal considered therebetween.
Step 204, the 3rd mobile terminal send download request and receive the first file.
Particularly, the download request of described first file is issued the mobile terminal of described signal the best by the 3rd mobile terminal, and receives described first file sent from the mobile terminal of described signal the best.
In the present embodiment, after the first file that the 3rd mobile terminal is chosen for downloading, needs judge and determine to preserve the mobile terminal quantity of the first file, when described mobile terminal quantity is 1, directly the download request of the first file are issued the mobile terminal preserving the first file; When described mobile terminal quantity is more than or equal to 2, needs to calculate the RST between the 3rd mobile terminal and each mobile terminal preserving the first file respectively, and the download request of the first file is issued the mobile terminal of signal the best.
In the present embodiment, the method calculating RST between any two mobile terminals in AdHoc network is not limited to according to Distance geometry node calculate, can also can calculate the method for RST therebetween for other.
Give a concrete illustration below the file sharing method based on Bluetooth technology in the present embodiment is described.
In network as shown in Figure 2, mobile phone C receives file name and the document location of file to be shared in other 3 mobile phones, and the file L2 chosen for downloading, and learn that file L2 is stored in mobile phone A and mobile phone B according to the file name received and document location.Now, mobile phone C judges and the mobile terminal quantity of determining to preserve in network file L2 is 2, mobile phone C needs to calculate respectively and RST between mobile phone A and mobile phone B, as calculated, the signal of mobile phone B is best, therefore, the download request of file L2 is issued mobile phone B by mobile phone C, and receives the file L2 of mobile phone B transmission.
In above-mentioned example, file L2 is the first file in the present embodiment, mobile phone C is the 3rd mobile terminal in the present embodiment, and mobile phone A and mobile phone B are in the present embodiment the mobile terminal preserving the first file, achieves sharing to file L2 between mobile phone C and mobile phone B.
The present embodiment also provides a kind of shared file system of Bluetooth technology, comprise the mobile terminal in the AdHoc network being applied to and being built by Bluetooth technology, the 3rd mobile terminal in described AdHoc network is for receiving the attribute information of file to be shared in other mobile terminal in automatic network, and choose the first file for downloading according to the attribute information received, judge and determine to preserve in network the mobile terminal quantity of described first file, when described mobile terminal quantity is more than or equal to 2, according to the Distance geometry node between the 3rd mobile terminal and each mobile terminal preserving described first file, calculate the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, and choose the mobile terminal of signal the best, and send the mobile terminal downloading request to described signal the best of described first file, and receive described first file sent from the mobile terminal of described signal the best.
In the present embodiment, 3rd mobile terminal is not all send download request to all mobile terminals preserving the first file, download request neither be sent to any mobile terminal preserving the first file, but send download request to the mobile terminal of the signal the best of preserving the first file, and the first file that the mobile terminal of Received signal strength the best sends, effectively improve the speed of transfer files in network, also improve the efficiency of shared file simultaneously.
Embodiment 3
The present embodiment provides a kind of file sharing method based on Bluetooth technology, is applied in the AdHoc network built by Bluetooth technology, as shown in Figure 4, comprises the following steps:
Step 301, first and the 3rd mobile terminal all receive attribute information and choose for download the first file.
Particularly, the first mobile terminal in described AdHoc network all receives the attribute information of file to be shared in other mobile terminal in automatic network with the 3rd mobile terminal, and choose the first file for downloading according to the attribute information received, wherein, described first file is stored in the second mobile terminal of described AdHoc network.
Step 302, the first mobile terminal send and download request to the second mobile terminal.
Particularly, in described AdHoc network first mobile terminal send described first file download request to described second mobile terminal.
Step 303, the first mobile terminal receive the first file.
Particularly, described first mobile terminal receives described first file sent from described second mobile terminal.
Step 304, the 3rd mobile terminal judge and determine mobile terminal quantity.
Particularly, the 3rd mobile terminal in described AdHoc network judges and determines to preserve in network the mobile terminal quantity of described first file, and now, the mobile terminal preserving the first file comprises the first mobile terminal and the second mobile terminal.
Step 305, when mobile terminal quantity is more than or equal to 2, calculates RST and choose the mobile terminal of signal the best.
Particularly, when described mobile terminal quantity is more than or equal to 2, calculates the RST between described 3rd mobile terminal and each mobile terminal preserving described first file, and choose the mobile terminal of signal the best.In the present embodiment, calculate the RST between the 3rd mobile terminal and the first mobile terminal, the second mobile terminal respectively, and from the first mobile terminal and the second mobile terminal, choose the mobile terminal of signal the best.
Step 306, the 3rd mobile terminal send download request and receive the first file.
Particularly, the download request of described first file is issued the mobile terminal of described signal the best by the 3rd mobile terminal, and receives described first file sent from the mobile terminal of described signal the best.
In the present embodiment, first file is stored in the second mobile terminal, first mobile terminal chooses the first file for downloading according to the attribute information received, and send the first file download request to the second mobile terminal, then receive the first file sent from the second mobile terminal.
In the present embodiment, attribute information include file title, document location, file size, file type and/or amendment date.First mobile terminal and the 3rd mobile terminal can obtain mobile terminal residing for file to be shared according to the document location in attribute information, can also choose file for downloading according to the file name in attribute information, document location, file size, file type and/or amendment date.
Give a concrete illustration below the file sharing method based on Bluetooth technology in the present embodiment is described.
In network as shown in Figure 2, mobile phone A and mobile phone B receive file name and the document location of file to be shared in other 3 mobile phones respectively, and the file L3 chosen for downloading, and learn that file L3 is stored in mobile phone A according to the file name received and document location.Mobile phone B transmission file L3 downloads request to mobile phone A, and after mobile phone B receives the file L3 of mobile phone A transmission, mobile phone D also thinks download file L3.Now, the mobile terminal preserving file L3 in network comprises mobile phone A and mobile phone B.Therefore, mobile phone D needs to calculate respectively and RST between mobile phone A and mobile phone B, and as calculated, the signal of mobile phone B is best, and therefore, the download request of file L3 is issued mobile phone B by mobile phone D, and receives the file L3 that mobile phone B sends.
In above-mentioned example, file L3 is the first file in the present embodiment, mobile phone B is the first mobile terminal in the present embodiment, mobile phone A is the second mobile terminal in the present embodiment, mobile phone D is the 3rd mobile terminal in the present embodiment, achieve mobile phone A, between mobile phone B and mobile phone D to file L3 share.
Easy understand ground, before the 3rd mobile terminal downloads the first file to the second mobile terminal, other mobile terminal also can be the same with the first mobile terminal, sends the download request of the first file, and receive the first file to the second mobile terminal.That is, when the 3rd mobile terminal will download the first file, the mobile terminal preserving described first file at least should comprise the first mobile terminal and the second mobile terminal.
In the ad hoc network, the file sharing method of the present embodiment is used to realize following functions: if the 3rd mobile terminal for downloading the first file from the second distant mobile terminal, can by the first mobile terminal to after the second mobile terminal to download the first file, the 3rd mobile terminal downloads the first file again from the first mobile terminal of close together.First mobile terminal is as the via node between the second mobile terminal and the 3rd mobile terminal, and making between the second mobile terminal and the 3rd mobile terminal can shared file easily.
In the present embodiment, file sharing method based on Bluetooth technology can rely on mobile terminal in AdHoc network as via node, do not rely on any media device or focus, realize between any two mobile terminals in network, all carrying out sharing of file, convenient and reliable.
Although the foregoing describe the specific embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate, protection scope of the present invention is defined by the appended claims.Those skilled in the art, under the prerequisite not deviating from principle of the present invention and essence, can make various changes or modifications to these execution modes, but these change and amendment all falls into protection scope of the present invention.