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 (Wi-Fi) awareness network, 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 sharing 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 sharing method comprises the following steps:
s201, the electronic device sends music resource acquisition requests to the plurality of nearby devices, wherein the acquisition requests include identification information of the electronic device.
The electronic device can send music resource acquisition requests to a plurality of adjacent devices in the adjacent perception NAN network, the music resources can be resources of a plurality of music tracks in a song list or resources of a music track, and the electronic device does not have the music resources, so that the electronic device can request the plurality of adjacent devices in the NAN to acquire the music resources, the acquisition requests include identification information of the electronic device, and the identification information is used for uniquely identifying the electronic device and informing the adjacent devices of the identification information of the devices needing to acquire the music resources.
S202, the electronic device receives feedback information from the plurality of adjacent devices, wherein the feedback information comprises the identification information of the adjacent devices and the related information of the music resource.
The electronic device receives feedback information sent by a plurality of adjacent devices, wherein the feedback information comprises identification information of the adjacent devices and related information of the music resource, so that the electronic device can determine which adjacent devices have the music resource and which adjacent devices do not have the music resource.
S203, the electronic equipment acquires the music resource from at least one of the plurality of adjacent equipment according to the feedback information.
The electronic equipment selects at least one adjacent device and obtains the music resource from the adjacent device according to the feedback information sent by the adjacent devices, and the music resource is distributed to each adjacent device in the adjacent devices after being split, so that the music resource can be obtained from the adjacent devices in parallel, and the processing efficiency is improved.
It can be seen that, in this embodiment of the present application, an electronic device first sends a music resource acquisition request to the multiple nearby devices, where the acquisition request includes identification information of the electronic device, then receives feedback information from the multiple nearby devices, where the feedback information includes identification information of the nearby devices and information related to the music resource, and finally acquires the music resource from at least one of the multiple nearby devices according to the feedback information. The electronic equipment can send music resource acquisition requests to the plurality of adjacent equipment in the adjacent perception network, and determines at least one adjacent equipment in the plurality of adjacent equipment, which stores the music resource, according to the feedback information sent by the plurality of adjacent equipment, so that the music resource can be acquired from the at least one adjacent equipment at the same time, and the efficiency and the safety of acquiring the music resource are improved.
In one possible example, the obtaining the music resource from at least one neighboring device according to the feedback information includes: determining at least one adjacent device which stores the music resource in the plurality of adjacent devices according to the related information of the music resource in the feedback information; the music assets are simultaneously acquired from the at least one proximate device.
After receiving a music resource acquisition request sent by the electronic device, the neighboring device detects whether the local music resource library contains the music resource, and sends feedback information to the electronic device, where the feedback information includes identification information of the neighboring device and related information of the music resource, and the related information of the music resource may be a local music song list that may include the neighboring resource, so as to determine whether the neighboring device includes the music resource according to the local music song list, or directly feed back a search result of the neighboring device for the music resource.
The electronic equipment determines at least one adjacent equipment storing the music resource in the plurality of adjacent equipment according to the related information of the music resource sent by the plurality of adjacent equipment, and can acquire the music resource from the at least one adjacent equipment at the same time.
It can be seen that, in this example, according to the feedback information sent by the multiple neighboring apparatuses, it is determined which neighboring apparatuses in the neighboring apparatuses have the music resource and which neighboring apparatuses do not have the music resource, and at least one neighboring apparatus having the music resource is selected to perform, in parallel, acquiring the music resource from at least one neighboring apparatus, which is beneficial to improving the efficiency of acquiring the music resource.
In one possible example, the music resource is a target music song, the target music song including a plurality of music tracks; the simultaneously acquiring the music resource from the at least one neighboring device comprises: determining a data transmission speed of the electronic device and the at least one neighboring device; determining target adjacent equipment corresponding to each music track in the plurality of music tracks according to the data transmission speed, wherein the target adjacent equipment is adjacent equipment in the at least one adjacent equipment; and acquiring the music tracks corresponding to each target adjacent device to obtain the plurality of music tracks.
The electronic equipment firstly determines the data transmission speed of each adjacent device in at least one adjacent device, determines the target adjacent device corresponding to each music track according to the transmission speed, acquires the music track corresponding to each target adjacent device, obtains each music track in the target music list and realizes the acquisition of the music resource.
For example, in one possible scenario, the target music menu includes music track 1, music track 2, and music track 3, and the at least one neighboring device includes neighboring device a and neighboring device B, since the data transmission speed between the electronic device and the neighboring device a is greater than the data transmission speed between the electronic device and the neighboring device B, since it can be determined that two music tracks, such as music track 1 and music track 2, are obtained from the neighboring device a, and one music track, such as music track 3, is obtained from the neighboring device B.
In another possible case, the target music menu includes music track 1, music track 2, music track 3, the at least one neighboring device includes neighboring device a, neighboring device B, neighboring device C, and neighboring device D, and the relationship of the data transfer speed between each neighboring device and the electronic device is detected as: a > B > D > C, the neighboring device C may be in a standby state because it may be determined to retrieve a music track from the neighboring device a, such as music track 1, a music track from the neighboring device B, such as music track 2, and a music track from the neighboring device D, such as music track 3.
In another possible case, the target music menu includes music track 1, music track 2, music track 3, at least one of the neighboring devices includes neighboring device a, neighboring device B, and neighboring device C, it is detected that the data amount of music track 1 is larger than the data amount of music track 2, the data amount of music track 2 is larger than the data amount of music track 3, and the relationship of the data transfer speed between each of the neighboring devices and the electronic device is a > C > B, so it is determined to acquire music track 1 from neighboring device a, acquire music track 2 from neighboring device C, and acquire music track 3 from neighboring device B, which are distance descriptions of the above cases, which are not limited in this case.
In this example, when the music resource is a plurality of music tracks in the target music song list, the target neighboring device corresponding to each music track is determined according to the data transmission speed between each neighboring device in the at least one neighboring device and the electronic device, and the corresponding music track is obtained from the target neighboring device, so that different music tracks in the target music song list can be obtained from the at least one neighboring device at the same time, and the obtaining efficiency is improved.
In one possible example, the music resource is a target music track; the simultaneously acquiring the music resource from the at least one neighboring device comprises: determining a data transmission speed of the electronic device and the at least one neighboring device; splitting the target music track according to the data transmission speed to obtain multiple pieces of music data, wherein each piece of music data corresponds to one adjacent device; and acquiring the plurality of pieces of music data from the at least one device to obtain the target music track.
When the music resource is a target music track, namely the target music track is only a music track, but the electronic device acquires the data transmission speed of each adjacent device in at least one adjacent device, splits the target music track according to the data transmission speed, splits the target music track into multiple sections with different sizes to obtain multiple pieces of music data, marks each piece of music data, enables each piece of music data to correspond to one adjacent device, acquires multiple pieces of music data from at least one device at the same time when the data transmission speed of the electronic device is high and the data volume of the music data is large, and integrates the acquired multiple pieces of music data to obtain a complete target music track.
For example, the electronic device obtains a target music track from 3 neighboring devices, splits the target music track into three segments, the total data volume is 6 megabits, the size of three split music data is 3 megabits, 2 megabits and 1 megabits respectively, marks each music data, and the relationship of data transmission speeds in the three neighboring devices is: a > B > C, therefore, the electronic equipment acquires 3 million of music data from the adjacent equipment A, 2 million of music data from the adjacent equipment B and 1 million of music data from the adjacent equipment C, and the electronic equipment integrates the acquired 3 pieces of music data according to the mark of each piece of music data to acquire a complete target music track.
It can be seen that, in this example, when it is detected that the music resource that needs to be acquired by the electronic device is a target music track, the target music track may be split according to the data transmission speed of the electronic device and the at least one neighboring device, and multiple pieces of music data are acquired from different neighboring devices, so that the target music track may be acquired from multiple neighboring devices at the same time, which is beneficial to increasing the download speed of the target music track.
In one possible example, the sending of the music resource acquisition request to the plurality of nearby 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 sending the music resource acquisition request to a plurality of adjacent devices of which the affinity values are greater than a preset threshold value.
When the electronic device sends a music resource acquisition request to a plurality of adjacent devices in a plurality of NANs, the electronic device may acquire connection records between the plurality of adjacent devices in the NANs and the electronic device, determine affinity values between the adjacent devices and the electronic device according to the connection records, the connection records include records of whether the adjacent devices are connected with the electronic device and perform data transmission, and connection times, and the electronic device may select the plurality of adjacent devices whose affinity values are greater than a preset threshold value and send the music resource acquisition request to the plurality of adjacent devices.
As can be seen, 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 the music resource acquisition request may be sent to 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, the receiving feedback information sent from the plurality of neighboring devices includes: determining distances and data transmission speeds between the electronic device and the plurality of neighboring devices; and receiving feedback information sent by the plurality of adjacent devices when the adjacent devices with the distance within the preset range and the data transmission speed higher than the preset speed are detected.
The electronic device can acquire the distance between the electronic device and the plurality of adjacent devices and the data transmission speed, and when the distance between the electronic device and the adjacent devices is detected to be within a preset range and the output transmission speed is higher than the preset speed, the feedback information sent by the plurality of adjacent devices is received, so that the adjacent devices sending the feedback information are screened, and the data transmission efficiency is improved.
As can be seen, in this example, the distance between the neighboring device that sends the feedback information and the electronic device is within the preset range, and the data transmission speed between the electronic device and the neighboring device is greater than the preset speed, so that the stability of the communication connection between the electronic device and the neighboring device can be ensured, which is beneficial to improving the reliability of data transmission in the data transmission process.
In one possible example, after the music resource is acquired from at least one neighboring device according to the feedback information, the method further includes: updating a local music song list of the electronic equipment according to the music resource; sharing the updated local music song list to neighboring devices in the neighbor awareness network.
After the electronic equipment acquires the music resource from at least one piece of adjacent equipment, the local music resource library can be updated according to the music resource to obtain an updated music song list, and meanwhile, the electronic equipment can share the music song list of the electronic equipment to the adjacent equipment in the NAN, so that other adjacent equipment can view the music song list of the electronic equipment.
As can be seen, in this example, after the electronic device acquires the music resource, the electronic device may update the local music song list according to the music resource, and since the electronic device is also a neighboring device with respect to other neighboring devices in the NAN, the electronic device shares the song list with the other neighboring devices in the NAN, which is beneficial for the other neighboring devices to view the song list, so that a music resource acquisition request may be sent to the electronic device, and music resource sharing is achieved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a resource sharing 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 sharing method includes:
s301, the electronic device sends music resource acquisition requests to the plurality of nearby devices, wherein the acquisition requests include identification information of the electronic device.
S302, the electronic device determines the distances between the electronic device and the plurality of adjacent devices and the data transmission speed.
S303, when detecting a neighboring device whose distance is within a preset range and whose data transmission speed is greater than a preset speed, the electronic device receives feedback information sent from the multiple neighboring devices, where the feedback information includes identification information of the neighboring device and related information of the music resource.
S304, the electronic equipment acquires the music resource from at least one of the plurality of adjacent equipment according to the feedback information.
It can be seen that, in this embodiment of the present application, an electronic device first sends a music resource acquisition request to the multiple nearby devices, where the acquisition request includes identification information of the electronic device, then receives feedback information from the multiple nearby devices, where the feedback information includes identification information of the nearby devices and information related to the music resource, and finally acquires the music resource from at least one of the multiple nearby devices according to the feedback information. The electronic equipment can send music resource acquisition requests to the plurality of adjacent equipment in the adjacent perception network, and determines at least one adjacent equipment in the plurality of adjacent equipment, which stores the music resource, according to the feedback information sent by the plurality of adjacent equipment, so that the music resource can be acquired from the at least one adjacent equipment at the same time, and the efficiency and the safety of acquiring the music resource are improved.
In addition, the distance between the adjacent equipment for sending the feedback information and the electronic equipment is within a preset range, and the data transmission speed between the adjacent equipment and the electronic equipment is greater than the preset speed, so that the stability of communication connection between the electronic equipment and the adjacent equipment can be ensured, and the reliability of data transmission in the data transmission process can be improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a resource sharing 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 sharing method includes:
s401, the electronic device sends music resource acquisition requests to the plurality of nearby devices, wherein the acquisition requests include identification information of the electronic device.
S402, the electronic equipment determines the distances between the electronic equipment and the plurality of adjacent equipment and the data transmission speed.
S403, when detecting a neighboring device whose distance is within a preset range and whose data transmission speed is greater than a preset speed, the electronic device receives feedback information sent from the multiple neighboring devices, where the feedback information includes identification information of the neighboring device and related information of the music resource.
S404, the electronic device determines at least one adjacent device, in the plurality of adjacent devices, storing the music resource according to the related information of the music resource in the feedback information.
S405, the electronic equipment simultaneously acquires the music resources from the at least one adjacent equipment.
It can be seen that, in this embodiment of the present application, an electronic device first sends a music resource acquisition request to the multiple nearby devices, where the acquisition request includes identification information of the electronic device, then receives feedback information from the multiple nearby devices, where the feedback information includes identification information of the nearby devices and information related to the music resource, and finally acquires the music resource from at least one of the multiple nearby devices according to the feedback information. The electronic equipment can send music resource acquisition requests to the plurality of adjacent equipment in the adjacent perception network, and determines at least one adjacent equipment in the plurality of adjacent equipment, which stores the music resource, according to the feedback information sent by the plurality of adjacent equipment, so that the music resource can be acquired from the at least one adjacent equipment at the same time, and the efficiency and the safety of acquiring the music resource are improved.
In addition, the distance between the adjacent equipment for sending the feedback information and the electronic equipment is within a preset range, and the data transmission speed between the adjacent equipment and the electronic equipment is greater than the preset speed, so that the stability of communication connection between the electronic equipment and the adjacent equipment can be ensured, and the reliability of data transmission in the data transmission process can be improved.
In addition, according to the feedback information sent by the plurality of adjacent devices, which adjacent devices in the adjacent devices have the music resource and which adjacent devices do not have the music resource are determined, and at least one adjacent device having the music resource is selected to execute the music resource acquisition from the at least one adjacent device in parallel, which is beneficial to improving the efficiency of music resource acquisition.
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 aprocessor 510, a memory 520, acommunication 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 theprocessor 510, and the one or more programs 521 include instructions for performing the following steps;
sending music resource acquisition requests to the plurality of nearby devices, wherein the acquisition requests comprise identification information of the electronic devices;
receiving feedback information from the plurality of neighboring devices, wherein the feedback information comprises identification information of the neighboring devices and related information of the music resource;
and acquiring the music resource from at least one of the plurality of adjacent devices according to the feedback information.
It can be seen that, in this embodiment of the present application, an electronic device first sends a music resource acquisition request to the multiple nearby devices, where the acquisition request includes identification information of the electronic device, then receives feedback information from the multiple nearby devices, where the feedback information includes identification information of the nearby devices and information related to the music resource, and finally acquires the music resource from at least one of the multiple nearby devices according to the feedback information. The electronic equipment can send music resource acquisition requests to the plurality of adjacent equipment in the adjacent perception network, and determines at least one adjacent equipment in the plurality of adjacent equipment, which stores the music resource, according to the feedback information sent by the plurality of adjacent equipment, so that the music resource can be acquired from the at least one adjacent equipment at the same time, and the efficiency and the safety of acquiring the music resource are improved.
In one possible example, in the aspect of obtaining the music resource from at least one neighboring device according to the feedback information, the instructions in the program are specifically configured to: determining at least one adjacent device which stores the music resource in the plurality of adjacent devices according to the related information of the music resource in the feedback information; the music assets are simultaneously acquired from the at least one proximate device.
In one possible example, the music resource is a target music song, the target music song including a plurality of music tracks; in respect of said simultaneous acquisition of said music resources from said at least one neighbouring device, the instructions in said program are specifically adapted to perform the following operations: determining a data transmission speed of the electronic device and the at least one neighboring device; determining target adjacent equipment corresponding to each music track in the plurality of music tracks according to the data transmission speed, wherein the target adjacent equipment is adjacent equipment in the at least one adjacent equipment; and acquiring the music tracks corresponding to each target adjacent device to obtain the plurality of music tracks.
In one possible example, the music resource is a target music track; in respect of said simultaneous acquisition of said music resources from said at least one neighbouring device, the instructions in said program are specifically adapted to perform the following operations: determining a data transmission speed of the electronic device and the at least one neighboring device; splitting the target music track according to the data transmission speed to obtain multiple pieces of music data, wherein each piece of music data corresponds to one adjacent device; and acquiring the plurality of pieces of music data from the at least one device to obtain the target music track.
In one possible example, in the sending of the music resource acquisition request to the plurality of proximate 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 sending the music resource acquisition request to a plurality of adjacent devices of which the affinity values are greater than a preset threshold value.
In one possible example, in the aspect of receiving the feedback information sent from the plurality of neighboring devices, the instructions in the program are specifically configured to: determining distances and data transmission speeds between the electronic device and the plurality of neighboring devices; and receiving feedback information sent by the plurality of adjacent devices when the adjacent devices with the distance within the preset range and the data transmission speed higher than the preset speed are detected.
In a possible example, after the music resource is acquired from at least one neighboring device according to the feedback information, the instructions in the program are specifically configured to: updating a local music song list of the electronic equipment according to the music resource; sharing the updated local music song list to neighboring devices in the neighbor awareness network.
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. Theresource 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 transmittingunit 601, a receivingunit 602 and aprocessing unit 603, wherein,
the sendingunit 601 is configured to send a music resource acquisition request to the multiple nearby devices, where the acquisition request includes identification information of the electronic device;
the receivingunit 602 is configured to receive feedback information from the multiple neighboring devices, where the feedback information includes identification information of the neighboring devices and related information of the music resource;
theprocessing unit 603 is configured to obtain the music resource from at least one of the plurality of neighboring devices according to the feedback information.
The resource sharing apparatus may further include a storage unit 604 for storing program codes and data of the electronic device. The transmittingunit 601, the receivingunit 602, and theprocessing 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, an electronic device first sends a music resource acquisition request to the multiple nearby devices, where the acquisition request includes identification information of the electronic device, then receives feedback information from the multiple nearby devices, where the feedback information includes identification information of the nearby devices and information related to the music resource, and finally acquires the music resource from at least one of the multiple nearby devices according to the feedback information. The electronic equipment can send music resource acquisition requests to the plurality of adjacent equipment in the adjacent perception network, and determines at least one adjacent equipment in the plurality of adjacent equipment, which stores the music resource, according to the feedback information sent by the plurality of adjacent equipment, so that the music resource can be acquired from the at least one adjacent equipment at the same time, and the efficiency and the safety of acquiring the music resource are improved.
In one possible example, in terms of the acquiring the music resource from at least one neighboring device according to the feedback information, theprocessing unit 603 is specifically configured to: determining at least one adjacent device which stores the music resource in the plurality of adjacent devices according to the related information of the music resource in the feedback information; and for simultaneously acquiring the music assets from the at least one proximate device.
In one possible example, the music resource is a target music song, the target music song including a plurality of music tracks; in respect to said obtaining the music resource from the at least one neighboring device simultaneously, theprocessing unit 603 is specifically configured to: determining a data transmission speed of the electronic device and the at least one neighboring device; the target adjacent device corresponding to each music track in the plurality of music tracks is determined according to the data transmission speed, and the target adjacent device is an adjacent device in the at least one adjacent device; and the music tracks are used for acquiring the music tracks corresponding to each target adjacent device to obtain the plurality of music tracks.
In one possible example, the music resource is a target music track; in respect to said obtaining the music resource from the at least one neighboring device simultaneously, theprocessing unit 603 is specifically configured to: determining a data transmission speed of the electronic device and the at least one neighboring device; the data transmission device is used for splitting the target music track according to the data transmission speed to obtain a plurality of pieces of music data, and each piece of music data corresponds to one adjacent device; and the music data acquisition module is used for acquiring the plurality of pieces of music data from the at least one device to obtain the target music track.
In one possible example, in terms of the sending of the music resource acquisition request to the multiple nearby devices, the sendingunit 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 server is used for sending the music resource acquisition request to a plurality of adjacent devices of which the affinity values are greater than a preset threshold value.
In one possible example, in terms of the receiving feedback information sent from the multiple neighboring devices, the receivingunit 602 is specifically configured to: determining distances and data transmission speeds between the electronic device and the plurality of neighboring devices; and the data transmission device is used for receiving feedback information sent by the plurality of adjacent devices when the adjacent devices with the distance within the preset range and the data transmission speed greater than the preset speed are detected.
In a possible example, after the music resource is acquired from at least one neighboring device according to the feedback information, theprocessing unit 603 is further configured to: updating a local music song list of the electronic equipment according to the music resource; and means for sharing the updated local music song list to a neighboring device in the proximity-aware network.
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.