CN109168158B - Resource downloading method and related device - Google Patents

Resource downloading method and related device Download PDF

Info

Publication number
CN109168158B
CN109168158B CN201810898579.6A CN201810898579A CN109168158B CN 109168158 B CN109168158 B CN 109168158B CN 201810898579 A CN201810898579 A CN 201810898579A CN 109168158 B CN109168158 B CN 109168158B
Authority
CN
China
Prior art keywords
resource
data
devices
target
related information
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.)
Active
Application number
CN201810898579.6A
Other languages
Chinese (zh)
Other versions
CN109168158A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810898579.6A priority Critical patent/CN109168158B/en
Publication of CN109168158A publication Critical patent/CN109168158A/en
Application granted granted Critical
Publication of CN109168158B publication Critical patent/CN109168158B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data
    • H04W8/245Transfer of terminal data from a network towards a terminal

Abstract

The application discloses a resource downloading method and a related device, which are applied to electronic equipment, wherein the electronic equipment and a plurality of adjacent equipment establish connection of a Neighbor Awareness Network (NAN), and the method comprises the following steps: when a downloading request of a first resource is detected, acquiring relevant information of a second resource from the plurality of adjacent devices, wherein the second resource is a data resource stored in the plurality of adjacent devices; comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource, wherein the third resource is the same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource; and acquiring the third resource through the adjacent perception network, and acquiring the fourth resource through a mobile network. The method and the device are beneficial to the electronic equipment to improve the efficiency of resource acquisition and save the data traffic.

Description

Resource downloading method and related device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a resource downloading method and a related apparatus.
Background
With the widespread use of electronic devices (such as mobile phones, tablet computers, and the like), the electronic devices have more and more applications and more powerful functions, and the electronic devices are developed towards diversification and personalization, and become indispensable electronic products in the life of target objects. A Neighbor Awareness Network (NAN) is applied between electronic devices, where the NAN is a local area network in which NAN devices are directly or indirectly connected together, information may directly circulate, and multiple devices are connected to each other, and may share resources among the multiple devices.
Disclosure of Invention
The embodiment of the application provides a resource downloading method and a related device, which are beneficial to improving the resource obtaining efficiency of electronic equipment and saving data traffic.
In a first aspect, an embodiment of the present application provides a resource downloading method, which is applied to an electronic device, where the electronic device and multiple neighboring devices establish a neighbor aware network NAN connection, and the method includes:
when a downloading request of a first resource is detected, acquiring relevant information of a second resource from the plurality of adjacent devices, wherein the second resource is a data resource stored in the plurality of adjacent devices;
comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource, wherein the third resource is the same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource;
and acquiring the third resource through the adjacent perception network, and acquiring the fourth resource through a mobile network.
In a second aspect, an embodiment of the present application provides a resource sharing apparatus applied to an electronic device, where the electronic device and a plurality of neighboring devices establish a neighbor awareness network NAN connection, the resource sharing apparatus includes a detecting unit, a processing unit, and an obtaining unit, where,
the detecting unit is configured to, when a download request of a first resource is detected, obtain relevant information of a second resource from the multiple neighboring devices, where the second resource is a data resource stored in the multiple neighboring devices;
the processing unit is configured to compare the related information of the first resource with the related information of the second resource, and determine a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except for the third resource;
the acquiring unit is configured to acquire the third resource through the proximity-aware network, and acquire the fourth resource through a mobile network.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in any method of the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect of the present application.
It can be seen that, in this embodiment of the present application, when an electronic device detects a download request of a first resource, the electronic device first obtains, from a plurality of neighboring devices, related information of a second resource, where the second resource is a data resource stored in the plurality of neighboring devices, then compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource, and finally obtains, through the proximity-aware network, the third resource and the fourth resource through a mobile network. When the electronic device detects a download request of the first resource, the electronic device may acquire the related information of the second resource from the plurality of neighboring devices, and determine, according to the related information of the second resource, a third resource that may be acquired from the neighboring devices through the neighboring network and a fourth resource that may be acquired through the data network, where the first resource is composed of the third resource and the fourth resource, thereby facilitating improvement of data acquisition efficiency and saving of data traffic.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
FIG. 1A is a schematic diagram of a program runtime space of a smart phone;
FIG. 1B is a system architecture diagram of an android system;
fig. 1C is a network architecture diagram of a NAN according to an embodiment of the present application;
fig. 1D is a schematic view of a scenario for starting a network function according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a resource downloading method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another resource downloading method provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of another resource downloading method provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 6 is a block diagram illustrating functional units of a resource sharing apparatus according to an embodiment of the present disclosure.
Detailed description of the invention
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following are detailed below.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As shown in fig. 1A, currently, electronic devices such as smart phones are generally provided with a program running space, where the program running space includes a user space and an operating system space, where the user space runs one or more application programs, and the one or more application programs are third-party application programs installed in the electronic devices.
The electronic device can specifically run an Android system, a mobile operating system iOS developed by apple Inc., and the like, and the electronic device is not limited herein. As shown in fig. 1B, for example that the electronic device runs an Android system, the corresponding user space includes an Application layer (Applications) in the Android system, and the operating system space may include an Application Framework layer (Application Framework) in the Android system, a system Runtime library layer (including system Runtime Libraries and Android Runtime runtimes), and a Linux Kernel layer (Linux Kernel). The application layer comprises various application programs which are directly interacted with the user or service programs which are written by Java language and run in the background. For example, programs that implement common basic functions on smartphones, such as Short Messaging Service (SMS) SMS, phone dialing, picture viewer, calendar, games, maps, World Wide Web (Web) browser, and other applications developed by developers. The application framework layer provides a series of class libraries required by Android application development, can be used for reusing components, and can also realize personalized extension through inheritance. And the system operation library layer is a support of an application program framework and provides services for each component in the Android system. The system operation library layer is composed of a system class library and Android operation. The Android runtime comprises two parts, namely a core library and a Dalvik virtual machine. The Linux kernel layer is used for realizing core functions such as hardware device driving, process and memory management, a network protocol stack, power management, wireless communication and the like.
Electronic devices may include various handheld devices, vehicle-mounted devices, wearable devices (e.g., smartwatches, smartbands, pedometers, etc.), computing devices or other processing devices connected to wireless modems, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal Equipment (terminal device), and so forth, having wireless communication capabilities. For convenience of description, the above-mentioned devices are collectively referred to as electronic devices.
A Neighbor Awareness Network (NAN), also called a wireless fidelity identity (Wi-fidelity), is described in the embodiments of the present application by using the NAN. The NAN function is mainly used for realizing a real-time efficient discovery mechanism, so that the Wi-Fi function is expanded, and the application experience at the moment is improved. The device and the service are continuously discovered in the Wi-Fi range before connection is established, the device does not need to be connected to a mobile broadband network or a Wi-Fi infrastructure network, and a fast awareness networking mode of a component NAN can be achieved. The social application created by the new technology can be adopted, for example, people can be helped to find nearby friends, information or services meeting the requirements of the people, small-section information can be exchanged under the condition of no connection, for example, position information is carried in a discovery frame discover beacon, information exchange is carried out through interaction of the discovery frame, and the like. In addition, the environment sensing function is improved. Because the terminals do not need to rely on network connection to inform the surrounding experience of the users to the users through the NAN, as long as the Wi-Fi Aware discovers the terminals which also support the NAN function, the Wi-Fi Direct or infrastructure connection can be established, and then multiple experiences are provided. Thus, the NAN functionality may help users complete more tasks using the information they receive, from discovering information to eventual activities, supplementing the proximity-based experience.
Referring to fig. 1C, fig. 1C is a network architecture diagram of a NAN according to an embodiment of the present disclosure, where the network architecture diagram includes an electronic device, a first neighboring device, a second neighboring device, and a third neighboring device. And the electronic equipment and the adjacent equipment in the NAN both support the NAN function, and the NAN function is started before the application is run. The NAN function may be triggered by similar actions like turning on a Wi-Fi switch or turning on a button for controlling the NAN function, as shown in fig. 1D, the neighbor awareness network and the wired network are in an on state, and the wireless network is in an off state; and the system can also be automatically started when the operation parameters meet certain conditions, wherein: the operating parameter may be a current location of the electronic device, for example: parking area, market, highway etc. the operating parameter also can be electronic equipment's foreground application, for example: applications including location services, applications involving neighboring networks, and the like, are not limited herein. When the proximity sensing network, the wireless network and the wired network are all started, which network is specifically used by the electronic equipment can be determined according to a preset priority order.
The following describes embodiments of the present application in detail.
Referring to fig. 2, fig. 2 is a flowchart illustrating a resource downloading method applied to an electronic device, where the electronic device and a plurality of neighboring devices establish a neighbor aware network NAN connection. The resource downloading method comprises the following steps:
s201, when detecting a download request of a first resource, the electronic device obtains relevant information of a second resource from the multiple neighboring devices, where the second resource is a data resource stored in the multiple neighboring devices.
The first resource may be a video resource, a music resource, a file resource, or the like, and when a download request of the first resource is detected, the relevant information of the second resource may be acquired from the multiple neighboring devices, where the second resource is a local resource stored in the multiple neighboring devices, so that the electronic device may know resource conditions in the neighboring devices. The second resource is of the same resource type as the first resource.
The related information of the second resource is used to indicate a resource condition of the second resource, for example, when the second resource is a video resource, the related information of the second resource may be a list of video names, and when the second resource is a file resource, the related information of the second resource may be a list of file names.
S202, the electronic device compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except for the third resource.
The electronic device determines related information of a first resource, compares the related information of the first resource with related information of a second resource, and determines a third resource and a fourth resource, wherein the third resource is the same resource in the first resource and the second resource, the fourth resource is a resource in the first resource except the third resource, and the first resource comprises the third resource and the fourth resource.
S203, the electronic device obtains the third resource through the proximity-aware network and obtains the fourth resource through the mobile network.
The third resource is a data resource which can be acquired by the electronic device from a plurality of adjacent devices through the adjacent network, and the fourth resource is a resource which cannot be acquired by the electronic device from the adjacent devices.
And under the condition that the electronic equipment is not connected with wifi, the fourth resource can be acquired through the data network, so that the complete first resource is obtained according to the third resource and the fourth resource.
It can be seen that, in this embodiment of the present application, when an electronic device detects a download request of a first resource, the electronic device first obtains, from a plurality of neighboring devices, related information of a second resource, where the second resource is a data resource stored in the plurality of neighboring devices, then compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource, and finally obtains, through the proximity-aware network, the third resource and the fourth resource through a mobile network. When the electronic device detects a download request of the first resource, the electronic device may acquire the related information of the second resource from the plurality of neighboring devices, and determine, according to the related information of the second resource, a third resource that may be acquired from the neighboring devices through the neighboring network and a fourth resource that may be acquired through the data network, where the first resource is composed of the third resource and the fourth resource, thereby facilitating improvement of data acquisition efficiency and saving of data traffic.
In one possible example, the obtaining, by the proximity-aware network, the third resource includes: determining at least one of the plurality of neighboring devices that stores the third resource; acquiring the third resource from the at least one neighboring device.
The third resource belongs to a part of the first resource and also belongs to a part of the second resource, and the electronic device can determine at least one neighboring device, which stores the third resource, among the plurality of neighboring devices, so as to acquire the third resource therefrom.
In this example, the electronic device obtains the third resource from at least one neighboring device storing the third resource through the neighboring network, and the data obtaining speed is faster and the security is higher than that of the mobile network, so that the complete first resource can be obtained by obtaining the fourth resource through the mobile network.
In one possible example, the determining at least one of the plurality of neighboring devices that stores the third resource includes: determining a plurality of target neighboring devices of the plurality of neighboring devices that store the third resource; determining data transmission speeds of the plurality of target neighboring devices; selecting at least one target neighboring device having a data transmission speed greater than a preset speed from the plurality of target neighboring devices; determining to acquire the third resource from the at least one target neighboring device.
The electronic device is connected with a plurality of adjacent devices, the adjacent devices with the third resources stored in the adjacent devices are determined to be target adjacent devices, the data transmission speeds of the target adjacent devices are determined, at least one target adjacent device with the data transmission speed larger than the preset speed is selected from the adjacent devices, and therefore the third resources can be acquired from the at least one target adjacent device.
As can be seen, in this example, there are a plurality of target neighboring devices storing the third resource, the data transmission speed of each target neighboring device is determined, at least one neighboring device with the data transmission speed greater than the preset speed is selected, and the third resource is obtained from the selected neighboring device, which is beneficial to reducing the time for obtaining the third resource and improving the obtaining efficiency of the data resource.
In one possible example, the determining to acquire the third resource from the at least one target neighboring device includes: determining a number of proximate devices of the at least one target proximate device; splitting the third resource according to the number to obtain multiple data resources, wherein each data resource corresponds to one adjacent device; and acquiring the corresponding data resource from each target adjacent device in the at least one target adjacent device in parallel to obtain the third resource.
The number of the at least one target adjacent device is determined, and since the third resource is stored in each target adjacent device of the at least one target adjacent device, the third resource can be split according to the number of the target adjacent devices to obtain a plurality of data resources, each data resource corresponds to one target adjacent device, so that different parts of the third resource can be obtained from each adjacent device, and finally, a complete third resource is obtained.
As can be seen, in this example, the third resource is split according to the number of the neighboring devices in the at least one target neighboring device, so that different components of the third resource, and finally the complete third resource, can be acquired from each neighboring device, which is beneficial to improving the acquisition efficiency of the resource.
In one possible example, the first resource is a music resource, the related information of the first resource includes a first music list, and the related information of the second resource includes a second music list; the comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource includes: determining a plurality of identical music tracks in the first music list and the second music list as target music tracks; and determining that the third resource is the data resource of the target music track, and the fourth resource is the data resource of the music tracks in the first music list except the target track.
When the first resource is a music resource, the related information of the first resource comprises a corresponding first music list, the related information of the second resource comprises a second music list, the first music list and the second music list are compared, a plurality of music tracks in the first music list and the second music list are determined to be target music tracks, the data resource corresponding to the target music tracks is a third resource, and the data resource corresponding to the music tracks except for the target music tracks in the first music list is a fourth resource.
For example, the first music list includes music track a, music track B, music track C, and music track D, and the second music list includes music track a, music track B, music track C, music track E, music track F, and music track G, so that it can be determined that the third resource is the data resource corresponding to music track a, music track B, and music track C, and the fourth resource is the data resource corresponding to music track D.
As can be seen, in this example, when the first resource is a music resource, the related information of the first resource is a first music list, and the related information of the second resource is a second music list, so that music tracks corresponding to the third resource and music tracks corresponding to the fourth resource can be determined, and it is beneficial for the electronic device to obtain a part of music tracks from neighboring devices, and then obtain a part of music tracks through the mobile network, so as to obtain the complete first resource.
In one possible example, the obtaining information about the second resource from the plurality of neighboring devices includes: acquiring a connection record between the adjacent equipment and the electronic equipment in the adjacent perception network; determining an affinity value between the proximity device and the electronic device from the connection record; and acquiring related information of the second resource from a plurality of adjacent devices of which the affinity values are greater than a preset threshold value.
When the electronic device acquires the related information of the second resource from the plurality of neighboring devices in the plurality of NANs, the electronic device may acquire connection records between the plurality of neighboring devices in the NAN and the electronic device, determine affinity values between the neighboring devices and the electronic device according to the connection records, and select the plurality of neighboring devices having affinity values greater than a preset threshold value, so as to acquire the related information of the second resource, where the connection records include a record of whether the neighboring devices are connected to the electronic device and perform data transmission, and the number of connections.
It can be seen that, in this example, the electronic device may obtain affinity values between the plurality of neighboring devices in the NAN, and select the plurality of neighboring devices having affinity values greater than a preset threshold, so that information related to the second resource may be obtained from the plurality of neighboring devices, and since the affinity values between the plurality of neighboring devices and the electronic device are higher, the plurality of neighboring devices are reliable and secure neighboring devices, which is beneficial to improving the security and reliability of the output transmission process.
In one possible example, after the acquiring the third resource through the proximity-aware network and the acquiring the fourth resource through the mobile network, the method further includes: and combining the third resource and the fourth resource to obtain the first resource.
The electronic device can determine the fourth resource after determining the third resource, so as to simultaneously acquire the third resource through the neighboring network, acquire the fourth resource through the mobile network, and combine the third resource and the fourth resource to obtain the complete first resource.
As can be seen, in this example, the first resource is split into the third resource and the fourth resource, and the electronic device may obtain the third resource through the neighboring network and obtain the fourth resource through the mobile network instead of directly obtaining the first resource through the mobile network, which not only improves the efficiency of data transmission, but also saves data traffic.
Referring to fig. 3, fig. 3 is a flowchart illustrating a resource downloading method according to an embodiment of the present application, and the method is applied to an electronic device, where the electronic device and a plurality of neighboring devices establish a neighbor aware network NAN connection. As shown in the figure, the resource downloading method includes:
s301, when detecting a download request of a first resource, the electronic device obtains relevant information of a second resource from the multiple neighboring devices, where the second resource is a data resource stored in the multiple neighboring devices.
S302, the electronic device compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except for the third resource.
S303, the electronic device determines at least one neighboring device of the plurality of neighboring devices, which stores the third resource.
S304, the electronic device acquires the third resource from the at least one neighboring device, and acquires the fourth resource through a mobile network.
It can be seen that, in this embodiment of the present application, when an electronic device detects a download request of a first resource, the electronic device first obtains, from a plurality of neighboring devices, related information of a second resource, where the second resource is a data resource stored in the plurality of neighboring devices, then compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource, and finally obtains, through the proximity-aware network, the third resource and the fourth resource through a mobile network. When the electronic device detects a download request of the first resource, the electronic device may acquire the related information of the second resource from the plurality of neighboring devices, and determine, according to the related information of the second resource, a third resource that may be acquired from the neighboring devices through the neighboring network and a fourth resource that may be acquired through the data network, where the first resource is composed of the third resource and the fourth resource, thereby facilitating improvement of data acquisition efficiency and saving of data traffic.
In addition, the electronic equipment acquires the third resource from at least one piece of adjacent equipment storing the third resource through the adjacent network, the data acquisition speed is higher than that of the mobile network, and the safety is higher, so that the complete first resource can be obtained by acquiring the fourth resource through the mobile network.
Referring to fig. 4, fig. 4 is a flowchart illustrating a resource downloading method according to an embodiment of the present application, and the method is applied to an electronic device, where the electronic device and a plurality of neighboring devices establish a neighbor aware network NAN connection. As shown in the figure, the resource downloading method includes:
s401, when detecting a download request of a first resource, the electronic device obtains relevant information of a second resource from the multiple neighboring devices, where the second resource is a data resource stored in the multiple neighboring devices.
S402, the electronic device compares the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource, wherein the third resource is the same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource.
S403, the electronic device determines a plurality of target neighboring devices, which store the third resource, among the plurality of neighboring devices.
S404, the electronic equipment determines the data transmission speeds of the target adjacent equipment.
S405, the electronic device selects at least one target adjacent device with a data transmission speed greater than a preset speed from the plurality of target adjacent devices.
S406, the electronic device acquires the third resource from the at least one target neighboring device, and acquires the fourth resource through a mobile network.
It can be seen that, in this embodiment of the present application, when an electronic device detects a download request of a first resource, the electronic device first obtains, from a plurality of neighboring devices, related information of a second resource, where the second resource is a data resource stored in the plurality of neighboring devices, then compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource, and finally obtains, through the proximity-aware network, the third resource and the fourth resource through a mobile network. When the electronic device detects a download request of the first resource, the electronic device may acquire the related information of the second resource from the plurality of neighboring devices, and determine, according to the related information of the second resource, a third resource that may be acquired from the neighboring devices through the neighboring network and a fourth resource that may be acquired through the data network, where the first resource is composed of the third resource and the fourth resource, thereby facilitating improvement of data acquisition efficiency and saving of data traffic.
In addition, the electronic equipment acquires the third resource from at least one piece of adjacent equipment storing the third resource through the adjacent network, the data acquisition speed is higher than that of the mobile network, and the safety is higher, so that the complete first resource can be obtained by acquiring the fourth resource through the mobile network.
In addition, a plurality of target adjacent devices storing the third resource are provided, the data transmission speed of each target adjacent device is determined, at least one adjacent device with the data transmission speed greater than the preset speed is selected, and the third resource is obtained from the selected adjacent device, so that the time for obtaining the third resource is favorably shortened, and the obtaining efficiency of the data resource is improved.
Consistent with the embodiments shown in fig. 2, fig. 3, and fig. 4, please refer to fig. 5, fig. 5 is a schematic structural diagram of an electronic device 500 provided in the embodiments of the present application, where the electronic device 500 runs one or more application programs and an operating system, as shown in the figure, the electronic device 500 includes a processor 510, a memory 520, a communication interface 530, and one or more programs 521, where the one or more programs 521 are stored in the memory 520 and configured to be executed by the processor 510, and the one or more programs 521 include instructions for performing the following steps;
when a downloading request of a first resource is detected, acquiring relevant information of a second resource from the plurality of adjacent devices, wherein the second resource is a data resource stored in the plurality of adjacent devices;
comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource, wherein the third resource is the same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource;
and acquiring the third resource through the adjacent perception network, and acquiring the fourth resource through a mobile network.
It can be seen that, in this embodiment of the present application, when an electronic device detects a download request of a first resource, the electronic device first obtains, from a plurality of neighboring devices, related information of a second resource, where the second resource is a data resource stored in the plurality of neighboring devices, then compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource, and finally obtains, through the proximity-aware network, the third resource and the fourth resource through a mobile network. When the electronic device detects a download request of the first resource, the electronic device may acquire the related information of the second resource from the plurality of neighboring devices, and determine, according to the related information of the second resource, a third resource that may be acquired from the neighboring devices through the neighboring network and a fourth resource that may be acquired through the data network, where the first resource is composed of the third resource and the fourth resource, thereby facilitating improvement of data acquisition efficiency and saving of data traffic.
In one possible example, in the aspect of obtaining the third resource through the proximity-aware network, the instructions in the program are specifically configured to: determining at least one of the plurality of neighboring devices that stores the third resource; acquiring the third resource from the at least one neighboring device.
In one possible example, in the determining at least one of the plurality of neighboring devices that stores the third resource, the instructions in the program are specifically configured to: determining a plurality of target neighboring devices of the plurality of neighboring devices that store the third resource; determining data transmission speeds of the plurality of target neighboring devices; selecting at least one target neighboring device having a data transmission speed greater than a preset speed from the plurality of target neighboring devices; determining to acquire the third resource from the at least one target neighboring device.
In one possible example, in connection with the determining to acquire the third resource from the at least one target neighboring device, the instructions in the program are specifically configured to: determining a number of proximate devices of the at least one target proximate device; splitting the third resource according to the number to obtain multiple data resources, wherein each data resource corresponds to one adjacent device; and acquiring the corresponding data resource from each target adjacent device in the at least one target adjacent device in parallel to obtain the third resource.
In one possible example, the first resource is a music resource, the related information of the first resource includes a first music list, and the related information of the second resource includes a second music list; in the aspect of determining a third resource and a fourth resource by comparing the related information of the first resource with the related information of the second resource, the instructions in the program are specifically configured to perform the following operations: determining a plurality of identical music tracks in the first music list and the second music list as target music tracks; and determining that the third resource is the data resource of the target music track, and the fourth resource is the data resource of the music tracks in the first music list except the target track.
In one possible example, in terms of the obtaining information about the second resource from the plurality of neighboring devices, the instructions in the program are specifically configured to: acquiring a connection record between the adjacent equipment and the electronic equipment in the adjacent perception network; determining an affinity value between the proximity device and the electronic device from the connection record; and acquiring related information of the second resource from a plurality of adjacent devices of which the affinity values are greater than a preset threshold value.
In a possible example, after the third resource is acquired by the proximity-aware network and the fourth resource is acquired by the mobile network, the instructions in the program are specifically configured to perform the following operations: and combining the third resource and the fourth resource to obtain the first resource.
The above embodiments mainly introduce the scheme of the embodiments of the present application from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
The following is an embodiment of the apparatus of the present invention, which is used to perform the method implemented by the embodiment of the method of the present invention. The resource sharing apparatus 600 shown in fig. 6 is applied to the electronic device, the electronic device includes a microphone, the resource sharing apparatus includes a detecting unit 601, a processing unit 602 and an obtaining unit 603, wherein,
the detecting unit 601 is configured to, when a download request of a first resource is detected, obtain relevant information of a second resource from the multiple neighboring devices, where the second resource is a data resource stored in the multiple neighboring devices;
the processing unit 602 is configured to compare the related information of the first resource with the related information of the second resource, and determine a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except for the third resource;
the obtaining unit 603 is configured to obtain the third resource through the neighbor aware network, and obtain the fourth resource through the mobile network.
The resource sharing apparatus may further include a storage unit 604 for storing program codes and data of the electronic device. The detection unit 601, the processing unit 602, and the obtaining unit 603 may be processors, and the storage unit 604 may be a memory.
It can be seen that, in this embodiment of the present application, when an electronic device detects a download request of a first resource, the electronic device first obtains, from a plurality of neighboring devices, related information of a second resource, where the second resource is a data resource stored in the plurality of neighboring devices, then compares the related information of the first resource with the related information of the second resource, and determines a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource, and finally obtains, through the proximity-aware network, the third resource and the fourth resource through a mobile network. When the electronic device detects a download request of the first resource, the electronic device may acquire the related information of the second resource from the plurality of neighboring devices, and determine, according to the related information of the second resource, a third resource that may be acquired from the neighboring devices through the neighboring network and a fourth resource that may be acquired through the data network, where the first resource is composed of the third resource and the fourth resource, thereby facilitating improvement of data acquisition efficiency and saving of data traffic.
In one possible example, in terms of the acquiring the third resource through the proximity-aware network, the processing unit 602 is specifically configured to: determining at least one of the plurality of neighboring devices that stores the third resource; and for acquiring the third resource from the at least one neighboring device.
In one possible example, in terms of the determining at least one neighboring device of the plurality of neighboring devices that stores the third resource, the processing unit 602 is specifically configured to: determining a plurality of target neighboring devices of the plurality of neighboring devices that store the third resource; and means for determining data transmission speeds of the plurality of target proximate devices; and at least one target neighboring device for selecting a data transmission speed greater than a preset speed from among the plurality of target neighboring devices; and means for determining to acquire the third resource from the at least one target neighboring device.
In one possible example, in terms of the determining to acquire the third resource from the at least one target neighboring device, the processing unit 602 is specifically configured to: determining a number of proximate devices of the at least one target proximate device; the third resource is split according to the number to obtain a plurality of data resources, and each data resource corresponds to one adjacent device; and the third resource is obtained by acquiring the corresponding data resource from each target neighboring device in the at least one target neighboring device in parallel.
In one possible example, the first resource is a music resource, the related information of the first resource includes a first music list, and the related information of the second resource includes a second music list; in the aspect of comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource, the processing unit 602 is specifically configured to: determining a plurality of identical music tracks in the first music list and the second music list as target music tracks; and the data resource is used for determining that the third resource is the data resource of the target music track, and the fourth resource is the data resource of the music tracks in the first music list except the target track.
In one possible example, in terms of the information related to obtaining the second resource from the plurality of neighboring devices, the detecting unit 601 is specifically configured to: acquiring a connection record between the adjacent equipment and the electronic equipment in the adjacent perception network; and means for determining an affinity value between the proximity device and the electronic device from the connection record; and the related information of the second resource is acquired from a plurality of adjacent devices of which the intimacy values are larger than a preset threshold value.
In a possible example, after the third resource is acquired through the proximity-aware network and the fourth resource is acquired through the mobile network, the acquiring unit 603 is further configured to: and combining the third resource and the fourth resource to obtain the first resource.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A resource downloading method is applied to an electronic device, the electronic device and a plurality of adjacent devices are connected through a Neighbor Aware Network (NAN), and the method comprises the following steps:
when a downloading request of a first resource is detected, acquiring relevant information of a second resource from the plurality of adjacent devices, wherein the second resource is a data resource stored in the plurality of adjacent devices; the first resource comprises at least 1 file; the second resource contains one or more complete files;
comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource, wherein the third resource is the same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except the third resource;
acquiring the third resource through the adjacent perception network, and acquiring the fourth resource through a mobile network;
and combining the third resource and the fourth resource to obtain the first resource.
2. The method of claim 1, wherein the obtaining the third resource through the proximity-aware network comprises:
determining at least one of the plurality of neighboring devices that stores the third resource;
acquiring the third resource from the at least one neighboring device.
3. The method of claim 2, wherein the determining at least one of the plurality of neighboring devices that stores the third resource comprises:
determining a plurality of target neighboring devices of the plurality of neighboring devices that store the third resource;
determining data transmission speeds of the plurality of target neighboring devices;
selecting at least one target neighboring device having a data transmission speed greater than a preset speed from the plurality of target neighboring devices;
determining to acquire the third resource from the at least one target neighboring device.
4. The method of claim 3, wherein the determining to acquire the third resource from the at least one target neighboring device comprises:
determining a number of proximate devices of the at least one target proximate device;
splitting the third resource according to the number to obtain multiple data resources, wherein each data resource corresponds to one adjacent device;
and acquiring the corresponding data resource from each target adjacent device in the at least one target adjacent device in parallel to obtain the third resource.
5. The method according to any one of claims 1-4, wherein the first resource is a music resource, the information related to the first resource comprises a first music list, and the information related to the second resource comprises a second music list; the comparing the related information of the first resource with the related information of the second resource to determine a third resource and a fourth resource includes:
determining a plurality of identical music tracks in the first music list and the second music list as target music tracks;
and determining that the third resource is the data resource of the target music track, and the fourth resource is the data resource of the music tracks in the first music list except the target track.
6. The method of claim 1, wherein the obtaining information about the second resource from the plurality of neighboring devices comprises:
acquiring a connection record between the adjacent equipment and the electronic equipment in the adjacent perception network;
determining an affinity value between the proximity device and the electronic device from the connection record;
and acquiring related information of the second resource from a plurality of adjacent devices of which the affinity values are greater than a preset threshold value.
7. A resource sharing apparatus applied to an electronic device, the electronic device and a plurality of neighboring devices establishing a Neighbor Awareness Network (NAN) connection, the resource sharing apparatus comprising a detecting unit, a processing unit and an obtaining unit, wherein,
the detecting unit is configured to, when a download request of a first resource is detected, obtain relevant information of a second resource from the multiple neighboring devices, where the second resource is a data resource stored in the multiple neighboring devices; the first resource comprises at least 1 file; the second resource contains one or more complete files;
the processing unit is configured to compare the related information of the first resource with the related information of the second resource, and determine a third resource and a fourth resource, where the third resource is a same data resource in the first resource and the second resource, and the fourth resource is a data resource in the first resource except for the third resource;
the acquiring unit is configured to acquire the third resource through the proximity-aware network and acquire the fourth resource through a mobile network; and combining the third resource and the fourth resource to obtain the first resource.
8. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-6.
9. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-6.
CN201810898579.6A 2018-08-08 2018-08-08 Resource downloading method and related device Active CN109168158B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810898579.6A CN109168158B (en) 2018-08-08 2018-08-08 Resource downloading method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810898579.6A CN109168158B (en) 2018-08-08 2018-08-08 Resource downloading method and related device

Publications (2)

Publication Number Publication Date
CN109168158A CN109168158A (en) 2019-01-08
CN109168158B true CN109168158B (en) 2021-04-13

Family

ID=64895194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810898579.6A Active CN109168158B (en) 2018-08-08 2018-08-08 Resource downloading method and related device

Country Status (1)

Country Link
CN (1) CN109168158B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159645A (en) * 2007-11-08 2008-04-09 中国传媒大学 Design method and network structure of mutual server facing to P2P application
CN101873348A (en) * 2010-06-09 2010-10-27 清华大学 Cloud storage system based on network gateway devices and network access method thereof
CN102546728A (en) * 2010-12-27 2012-07-04 北大方正集团有限公司 Peer-to-peer network resource downloading method
CN103036597A (en) * 2012-12-12 2013-04-10 华为终端有限公司 Method and device of sharing resources among devices in close range
CN103685472A (en) * 2013-11-20 2014-03-26 卓易畅游(北京)科技有限公司 Method and equipment used for providing resource information corresponding to mobile equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10455400B2 (en) * 2014-06-02 2019-10-22 Qualcomm Incorporated Peer discovery in neighbor awareness networking (NAN) aided data link networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159645A (en) * 2007-11-08 2008-04-09 中国传媒大学 Design method and network structure of mutual server facing to P2P application
CN101873348A (en) * 2010-06-09 2010-10-27 清华大学 Cloud storage system based on network gateway devices and network access method thereof
CN102546728A (en) * 2010-12-27 2012-07-04 北大方正集团有限公司 Peer-to-peer network resource downloading method
CN103036597A (en) * 2012-12-12 2013-04-10 华为终端有限公司 Method and device of sharing resources among devices in close range
CN103685472A (en) * 2013-11-20 2014-03-26 卓易畅游(北京)科技有限公司 Method and equipment used for providing resource information corresponding to mobile equipment

Also Published As

Publication number Publication date
CN109168158A (en) 2019-01-08

Similar Documents

Publication Publication Date Title
EP3439371B1 (en) Method and apparatus for determining access point service capabilities
WO2017166988A1 (en) Network slice processing method and apparatus, terminal, base station, and computer storage medium
CN107479970B (en) Resource allocation method and related product
CN109743783B (en) Data transmission control method and related product
WO2019109868A1 (en) Resource allocation method and related product
CN109040213B (en) File downloading method and related product
KR102427401B1 (en) An electronic device providing call continuity in a weak signal environment and control method thereof
CN107182098B (en) Method and equipment for realizing switching of user equipment between wireless access points
CN109451538B (en) Data flow control method and terminal thereof
CN104838696A (en) System and method for network selection
CN112119673B (en) Electronic device supporting multiple wireless communication protocols and method thereof
KR20160138170A (en) System and method to enhance the user experience of applications for proximity-based peer-to-peer mobile computing
US20150133052A1 (en) Device selection
US11889568B2 (en) Systems and methods for paging over WiFi for mobile terminating calls
US20170325092A1 (en) Discovery mechanism for service server connection
CN109275125B (en) Resource sharing method, device, equipment and storage medium
CN109195149B (en) NAN scanning adjustment method and related equipment
WO2023065255A1 (en) Cell reselection method and apparatus, communication device, and storage medium
CN113949705B (en) Communication method and communication device
WO2014187601A1 (en) Device to device communication
CN104052801B (en) A kind of information processing method and electronic equipment
CN108990039B (en) Data transmission method and related device
CN109168158B (en) Resource downloading method and related device
CN114125942A (en) Network resource management method, device, terminal and storage medium
CN105722192B (en) Network connection method, electronic equipment and system

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
GR01 Patent grant
GR01 Patent grant