WO2016050143A1 - Method for sharing resources between devices and electronic device - Google Patents

Method for sharing resources between devices and electronic device Download PDF

Info

Publication number
WO2016050143A1
WO2016050143A1 PCT/CN2015/089957 CN2015089957W WO2016050143A1 WO 2016050143 A1 WO2016050143 A1 WO 2016050143A1 CN 2015089957 W CN2015089957 W CN 2015089957W WO 2016050143 A1 WO2016050143 A1 WO 2016050143A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
resource identifier
electronic device
nfc
identifier
Prior art date
Application number
PCT/CN2015/089957
Other languages
French (fr)
Chinese (zh)
Inventor
魏鹏飞
Original Assignee
阿里巴巴集团控股有限公司
魏鹏飞
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 阿里巴巴集团控股有限公司, 魏鹏飞 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016050143A1 publication Critical patent/WO2016050143A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities

Definitions

  • the present application belongs to the field of wireless communication technologies, and in particular, to a method and an electronic device for sharing resources between devices.
  • the multimedia file sharing such as video between the electronic devices such as the wireless smart device mainly shares the URI (Uniform Resource Identifier) of the multimedia, and then the electronic device acquires the multimedia file according to the received URI. Play.
  • the URI of the multimedia file belongs to the resource information of the multimedia file.
  • the URI sharing technology of the multimedia file mainly includes the DLNA (Digital Living Network Alliance) based on the UPNP (Universal Plug and Play) protocol. Alliance technology, Apple's Air Play technology, etc., these technologies undoubtedly need to share the same LAN environment based on WIFI connection, that is, the resource information sharing before acquiring multimedia files for playback needs to be in the same LAN.
  • the purpose of the embodiments of the present application is to provide a method and an electronic device for sharing resources between devices, which can implement point-to-point sharing between devices without adding to the same WLAN.
  • the embodiment of the present application provides a method for sharing resources between devices and an electronic device is implemented as follows:
  • the embodiment of the present application provides a method for sharing resources between devices, including:
  • the resource identifier of the resource browsed by the resource browsing application is encapsulated into the NFC data packet as load information
  • the method further includes:
  • the progress information browsed by the resource browsing application is encapsulated into the NFC data package as load information.
  • the resource identifier of the resource browsed by the resource browsing application and the progress information browsed are encapsulated into the load information of the same NFC data packet.
  • the triggering condition for starting the NFC communication link to implement resource information sharing includes: an event that is touched by the receiver device occurs.
  • the method further includes: after detecting a trigger condition for starting the NFC communication link to implement resource information sharing, continuing to determine whether the current resource browsing application provides the resource identifier of the browsed resource.
  • the resource identifier is a uniform resource identifier URI.
  • Another aspect of the embodiment of the present application further provides a method for sharing resources between devices, including:
  • the resource browsing application is used to browse the resource identified by the resource identifier.
  • the method further includes:
  • browsing starts from the location identified by the progress information.
  • the resource browsing application capable of processing the extracted resource identifier includes:
  • the search is performed by the protocol header of the resource identifier, and a resource browsing application capable of processing the resource identifier is obtained.
  • a further aspect of the embodiments of the present application further provides an electronic device, including:
  • the detecting unit is configured to detect, when the resource browsing application is enabled to browse the resource, whether a trigger condition for starting the NFC communication link to implement resource information sharing is detected;
  • a resource identifier encapsulating unit configured to encapsulate the resource identifier of the resource browsed by the resource browsing application as load information into an NFC data packet after the detecting unit detects the triggering condition
  • an NFC communication unit configured to send the NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
  • the method further includes:
  • the progress information encapsulating unit is configured to encapsulate the progress information browsed by the resource browsing application as load information into the NFC data package.
  • the resource representation encapsulation unit and the progress information encapsulation unit specifically encapsulate the resource identifier and the progress information of the resource browsed by the resource browsing application into the load information of the same NFC data packet.
  • the triggering condition for enabling the NFC communication link to implement resource information sharing includes: an event that is touched by the receiver device occurs.
  • the method further includes:
  • the resource identifier existence identifying unit is configured to determine, after the detecting unit detects the trigger condition, whether the current resource browsing application provides the resource identifier of the browsed resource.
  • the resource identifier is a URI.
  • Another aspect of the embodiment of the present application further provides an electronic device, including:
  • a resource identifier extracting unit configured to extract a resource identifier from load information of the NFC data packet after receiving the NFC data packet;
  • An application matching unit configured to search for a resource browsing application capable of processing the extracted resource identifier
  • a resource obtaining unit configured to acquire, according to the resource identifier, a resource identified by the resource identifier
  • the initiating unit is configured to start the resource browsing application to browse the resource identified by the resource identifier.
  • the application matching unit includes:
  • the protocol matching unit is configured to perform a search by using a protocol header of the resource identifier, and obtain a resource browsing application capable of processing the resource identifier.
  • the method further includes:
  • a progress information extracting unit configured to extract progress information from the received NFC data packet
  • the initiating unit is specifically configured to start the resource browsing application, browse the resource identified by the resource identifier, and start browsing from the location identified by the progress information.
  • the technical solution provided by the foregoing embodiment of the present application can implement that the resource identifier is transmitted between the sender device and the receiver device through the NFC communication link, and the resource identifier is used to obtain the resource, because the resource identifier is adopted by the NFC.
  • the communication link does not need to be implemented by means of the WLAN, and the resource identification by the resource identifier eliminates the need for the sender device and the receiver device to join the same WLAN, thereby reducing the resource sharing requirements for the network environment.
  • FIG. 1 is a flowchart of a method for sharing resources between devices according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for sharing resources between devices according to another embodiment of the present application.
  • FIG. 3 is a flowchart of an embodiment of a method for sharing resources between devices provided by the present application
  • FIG. 4 is a flow chart of another embodiment of a method for sharing resources between devices provided by the present application.
  • FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an electronic device according to another embodiment of the present application.
  • An embodiment of the present application provides a method for sharing resources between devices, which is described from the sender device side. As shown in FIG. 1 , the method includes the following steps:
  • Step S101 In the process of browsing the resource by the resource browsing application, detecting a trigger condition for starting the NFC communication link to implement resource information sharing;
  • Step S102 The resource identifier of the resource browsed by the resource browsing application is encapsulated into the NFC data packet as load information.
  • Step S103 Send the NFC data packet in step S102 to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
  • the recipient device herein can be any electronic device with certain computing power, especially for smart mobile devices with an operating system, such as a smart phone, a tablet, a personal digital assistant (PDA), and the like.
  • an operating system such as a smart phone, a tablet, a personal digital assistant (PDA), and the like.
  • the resource identifier can be transmitted through the NFC communication link with the receiver device, and the resource information can be shared between the devices, and the resource information sharing based on the point-to-point communication can be realized without adding the same wireless local area network.
  • the receiver device After the receiver device obtains the resource identifier, it is often necessary to use the network identifier to obtain the resource, such as a local area network, the Internet, etc., of course, if the resource itself is in the storage device of the receiver device, the network environment is no longer needed. You can open the resource to browse.
  • the resource such as a local area network, the Internet, etc.
  • the data transmission through the NFC communication link is particularly suitable for small data volume data transmission.
  • the resource identifier of the resource is often small, so it is more suitable for transmission using an NFC communication link. .
  • Another embodiment of the present application further provides a method for sharing resources between devices, which is described from a receiver device, as shown in FIG. 2, the method includes the following steps:
  • Step S201 After receiving the NFC data packet, extracting the capital contribution from the received load information of the NFC data packet.
  • Source identifier
  • Step S202 Search for a resource browsing application capable of processing the resource identifier extracted in step S201;
  • Step S203 Acquire, according to the resource identifier, the resource identified by the resource identifier.
  • Step S204 Browse, by using the resource browsing application, the resource identified by the resource identifier.
  • the resource identifier can be transmitted through the NFC communication link with the sender device, and the resource identifier is used to obtain the resource. Since the resource identifier is transmitted through the NFC communication link, it does not need to be implemented by using a wireless local area network. Obtaining resources through the resource identifier eliminates the need for the sender device and the receiver device to join the same WLAN. This reduces the resource sharing requirements for the network environment.
  • the resource identifiers shared by the devices may have various types of resources, such as sound files, video files, picture files, etc.
  • resources such as sound files, video files, picture files, etc.
  • the specific implementation of the present application is described in detail below with a few examples.
  • the electronic device A serves as the initiator of the shared resource information
  • the electronic device B serves as the receiver of the shared resource information.
  • Both the electronic device A and the electronic device B have an NFC communication module to complete NFC communication between the electronic devices.
  • the electronic device A and the electronic device B in this example may be any electronic device that can communicate through the NFC communication module, including but not limited to smart mobile phones, tablets, desktop computers, portable computers, PDAs (personal digital assistants), and the like.
  • the electronic device A and the electronic device B are both smart mobile phones as an example.
  • the method for sharing resources between devices includes the following steps:
  • Step S301 The electronic device A starts a certain video application and plays the selected video resource.
  • the video application launched by the user may be a local video player capable of playing a specific format, such as a video player provided by the operating system installed in the electronic device A or a video player downloaded from the application store by the user; or some The client application corresponding to the video website or local server.
  • the video resource played by the user may be a video resource from a video website server in the Internet, or may be a video resource from a streaming media server in the local area network.
  • the resource type of the resource information that is shared in the actual is not limited to the video resource.
  • the resource to which the shared resource information belongs may also be a multimedia resource such as a picture or a sound, or may be supported by Microsoft Office by default. Text files, spreadsheet files, slide files, small database files, etc., as well as plain text files supported by the Notepad program by default. Accordingly, the electronic device A launches an application that can open the resources that need to be shared for browsing.
  • Step S302 After the electronic device A and the electronic device B are touched, the electronic device A detects the occurrence of a touch event, thereby achieving a trigger condition for starting resource information sharing by means of the NFC communication link.
  • the electronic device A and the electronic device B can be touched to generate communication by means of NFC.
  • the link triggers the resource information sharing.
  • the electronic device A and the electronic device B touch the operating system bottom layer of the electronic device A generates a corresponding touch event, and the application currently opened by the electronic device A can The event is captured, and then electronic device A begins to enter the preparation phase of sharing resources through the NFC communication link.
  • the electronic device A can utilize the mechanism of the NFC module itself to complete the detection of the touch.
  • the trigger condition for sharing resource information through the NFC communication link in this example is defined as the fact that the electronic device A is touched by other devices is only an example, and in practice, it can also be defined as the electronic device A receives The sharing request sent by other electronic devices through a short-range communication connection such as Bluetooth or infrared, or may be defined as the electronic device A transmitting a sharing request to other electronic devices through a short-range communication connection such as Bluetooth or infrared, and receiving feedback information indicating permission. .
  • Step S303 The electronic device A determines whether its own NFC function is enabled.
  • the electronic device Based on the consideration of improving energy efficiency and extending standby time, usually the electronic device does not turn on the NFC function for a long time, but only when it is needed. For this reason, it is necessary to verify whether the NFC function of the electronic device A is turned on before the electronic device A shares the resource information through the NFC communication link. If you find that the NFC function is enabled, you can enter the shared resource information. If you find that the NFC function is not enabled, you can directly end the process. You can also go to the step of setting the NFC function to be enabled. In practice, when the NFC function is not enabled, the setting interface for setting the NFC function can be presented. When the user selects to enable the NFC function and successfully starts the NFC function, the subsequent steps are continued.
  • step S303 may also be omitted, for example, in a scenario where the electronic device does not need to consider an energy efficiency problem, or when the electronic device starts an application for browsing resources, the NFC function is automatically turned on, and the like.
  • the electronic device A can determine whether the error code that is fed back when the resource information is shared by the NFC communication link is an error that the NFC function is not turned on.
  • Step S304 When the result of the determination in step S303 is YES, it is continued to determine whether the current video application of the electronic device A provides the URI for the resource transmitted through the NFC communication link.
  • step S304 it may first be determined whether the current video application provides a URI for transmission over the NFC communication link. When the result of the determination in step S304 is NO, the subsequent steps may be stopped.
  • Step S305 When the result of the determination in step S304 is YES, the electronic device A encapsulates the URI of the video resource being played by the current video application as load information into the NFC data packet, and sends the data to the electronic device B through the NFC communication module.
  • the Android platform supports the transmission of data in the NDEF (NFC Data Exchange Format) format, and the NDEF data is the data format in the NFC Tag (tag) information agreed by the NFC organization.
  • the data in the NDEF format will be encapsulated into NFC packets (in practice, it can be NdefMessage, but this application is not limited to this).
  • NdefRecords can be included in an NdefMessage, and an NdefRecord contains the following fields:
  • TDF Type Name Format
  • Variable Length Type used to describe the type of the NdefRecord, which can be filled in according to the type name format field;
  • Variable Length ID which is used to uniquely identify the NdefRecord. This field is not required to be filled in.
  • Variable Length Payload is used to contain data that needs to be transmitted.
  • resource information such as the URI of the video resource
  • resource information may be wrapped into the field.
  • wrapping the URI of the video resource into NdefMessage can be done by the NFC module of the Android system.
  • Step S306 The electronic device B monitors whether the NFC data packet is received on the premise that the NFC function is enabled.
  • monitoring whether an NFC packet is received depends on whether the received NFC packet is valid or not, and sometimes the receiving data is incorrect due to the instability of the communication link, thereby causing the NFC packet to be unrecognizable.
  • Step S307 After the electronic device B detects that the NFC data packet is received in step S306, the load information in the received NFC data packet is extracted.
  • the electronic device B after analyzing the load information of the NFC data packet sent from the electronic device A, the electronic device B can extract the URI of the video resource.
  • Step S308 The electronic device B determines whether there is an application in the electronic device B that can process the URI of the extracted video resource.
  • the operation that the application will carry to the electronic device B during the installation of the new application to the electronic device B The system declares the data and events that it can handle. For example, you can declare that you can open the image in png format, or you can process the URI of a protocol (for example, you can handle the URI in the http protocol: http://play.google.com). Or it can handle events of a certain system (such as low battery, WIFI disconnected, NFC communication connection, etc.).
  • the electronic device B can query whether there is an application in the operating system that can process such events and data. If there is, the application is called.
  • the plurality of queried applications may be displayed in a graph or other manner for the user to select, after receiving the application selection information, according to the application. The selection information invokes the selected application.
  • the actual URI consists of a protocol header (such as "http://", “Ftp://”, etc.), a host name (Host), a port (Port), and a path (Path).
  • the electronic device B can perform a query according to the above information to check whether there is a matching application. For example, the protocol header can be matched first to check whether there is an application in the system that can process the protocol header. If the query can continue to match the next level, for example, matching the host name, check whether there is an application in the system that can process the URI of the host. .
  • the protocol header portion of the URI of the video resource is specifically defined, for example, as "taobao.com://", and when an application capable of processing the URI is installed in the electronic device B, The application can declare to the operating system that it can handle the URI with the protocol header "taobao.com://". In this way, when the device B performs the matching, the application that can process the URI can be quickly matched, and in practice, if only one application capable of processing the protocol header is used, the user needs to avoid multiple matching applications. Trouble in selecting (ie, from multiple candidates).
  • Step S309 The electronic device B starts an application capable of processing the URI of the extracted video resource, and plays the video resource pointed to by the URI.
  • the URI of the video resource when the URI of the video resource is shared by the NFC communication between the two electronic devices, the point-to-point sharing between the devices can be realized, and the wireless local area network is not required. Even if the resources pointed to by the URI are played, LAN support may still be needed, but the two electronic devices that do not need to be shared are in the same LAN.
  • FIG. 4 is a flowchart of an embodiment of a method for sharing resources between devices according to Embodiment 2 of the present application.
  • the electronic device A is still the initiator of the shared resource information, and the electronic device B is used as the initiator. The recipient of the shared resource information.
  • Both the electronic device A and the electronic device B have an NFC communication module to complete NFC communication between the electronic devices.
  • Electronic device A and electronic device B in this example may be any electronic device that can communicate through an NFC communication link, including but not limited to smart mobile phones, tablets, desktop computers, portable computers, PDAs (personal digital assistants). Wait.
  • the electronic device A and the electronic device B are both smart mobile phones as an example.
  • the difference from the first embodiment is mainly that the viewing progress information of the resources is shared together in this embodiment.
  • the resource viewing progress may be, for example, the progress of playing a video or music file, the progress of viewing a document file (such as viewing the number of lines, or viewing the number of pages).
  • the resource may be used as a video resource
  • the progress of the resource is described as an example of the progress of the video resource
  • the resource information being the URI of the video resource
  • the playback progress of the video resource may be information such as the time point of playing or the chapter played.
  • the method for sharing resources between devices includes the following steps:
  • Step S401 The electronic device A starts a certain video application and plays the selected video resource.
  • the video application launched by the user may be a local video player capable of playing a specific format, such as a video player provided by the operating system installed in the electronic device A or a video player downloaded from the application store by the user; or some The client application corresponding to the video website or local server.
  • the video resource played by the user may be a video resource from a video website server in the Internet, or may be a video resource from a streaming media server in the local area network.
  • the resource type of the resource information that is shared in the actual is not limited to the video resource.
  • the resource to which the shared resource information belongs may also be a multimedia resource such as a picture or a sound, or may be supported by Microsoft Office by default. Text files, spreadsheet files, slide files, small database files, etc., as well as plain text files supported by the Notepad program by default. Accordingly, the electronic device A launches an application that can open the resources that need to be shared for browsing.
  • Step S402 After the electronic device A and the electronic device B touch, the electronic device A detects the occurrence of the touch time, and further triggers the triggering of resource information sharing by using the NFC communication module.
  • the electronic device A and the electronic device B can be touched to generate communication by means of NFC.
  • the electronic device A and the electronic device B make a touch
  • the operating system bottom layer of the electronic device A generates a corresponding touch event
  • the application currently opened by the electronic device A can capture the event, and then the electronic device A starts. Enter the preparation phase of sharing resource information through the NFC communication link.
  • the trigger condition for sharing resource information through the NFC communication link in this example is defined as the fact that the electronic device A is touched by other devices is only an example, and in practice, it can also be defined as the electronic device A receives Its
  • the sharing request sent by the electronic device through a short-range communication connection such as Bluetooth or infrared or may be defined as the electronic device A transmitting a sharing request to other electronic devices through a short-range communication connection such as Bluetooth or infrared, and receiving feedback information indicating permission. .
  • Step S403 The electronic device A determines whether its own NFC function is enabled.
  • the electronic device Based on the consideration of improving energy efficiency and extending standby time, usually the electronic device does not turn on the NFC function for a long time, but only when it is needed. For this reason, it is necessary to verify whether the NFC function of the electronic device A is turned on before the electronic device A shares the resource information through the NFC communication link. If you find that the NFC function is enabled, you can enter the shared resource information. If you find that the NFC function is not enabled, you can directly end the process. You can also go to the step of setting the NFC function to be enabled. In practice, when the NFC function is not enabled, the setting interface for setting the NFC function can be presented. When the user selects to enable the NFC function and successfully starts the NFC function, the subsequent steps are continued.
  • step S303 may also be omitted, for example, in a scenario where the electronic device does not need to consider an energy efficiency problem, or when the electronic device starts an application for browsing resources, the NFC function is automatically turned on, and the like.
  • the electronic device A can determine whether the error code that is fed back when the resource information is shared by the NFC communication link is an error that the NFC function is not turned on.
  • Step S404 When the result of the determination in step S403 is YES, it is continued to determine whether the current video application of the electronic device A provides a URI for the resource transmitted through the NFC communication link.
  • Step S405 When the result of the determination in step S404 is YES, the electronic device A encapsulates the URI and the play progress of the video resource being played by the current video application into the NFC data packet as the load information, and sends the data to the electronic device B through the NFC communication module.
  • the electronic device A When the electronic device A encapsulates the URI and the playback progress as load information into the NFC data packet, the electronic device A and the electronic device B can follow a unified protocol, for example, the first N bits in the load information are the locations where the URI information is placed. The next part is where the playback progress is placed.
  • Step S406 The electronic device B monitors whether the NFC data packet is received on the premise that the NFC function is enabled.
  • monitoring whether an NFC packet is received depends on whether the received NFC packet is valid or not, and sometimes the receiving data is incorrect due to the instability of the communication link, thereby causing the NFC packet to be unrecognizable.
  • step S407 after the electronic device B detects that the NFC data packet is received, the electronic device B extracts the load information in the received NFC data packet, thereby obtaining the URI and the playback progress of the video resource.
  • a common protocol is adhered between the electronic device A and the electronic device B, based on which the electronic device B can normally separate the URI and the playback progress information from the load information.
  • the resource identifier and the progress information are encapsulated into the load information of the same NFC data packet.
  • the electronic device A may also identify the resource and Progress information It is not encapsulated into the load information of two NFC data packets, and is transmitted and received through the implementation of the agreed protocol, so that the resource identification and progress information can be correctly extracted from the two NFC data packets.
  • Step S408 The electronic device B determines whether there is an application in the electronic device B that can process the URI of the extracted video resource.
  • the application declares the data and events that the electronic device B is capable of processing, for example, can declare that it can open the image in the png format, or Can handle the URI of a protocol (for example, can handle the URI in the http protocol: http://play.google.com), or can handle events of a system (such as low battery, WIFI disconnected, NFC communication connection) Wait).
  • the electronic device B can query whether there is an application in the operating system that can process such events and data. If there is, the application is called.
  • the plurality of queried applications may be displayed in a graph or other manner for the user to select, after receiving the application selection information, according to the application. The selection information invokes the selected application.
  • the actual URI consists of a protocol header (such as "http://", “Ftp://”, etc.), a host name (Host), a port (Port), and a path (Path).
  • the electronic device B can perform a query according to the above information to check whether there is a matching application. For example, the protocol header can be matched first to check whether there is an application in the system that can process the protocol header. If the query can continue to match the next level, for example, matching the host name, check whether there is an application in the system that can process the URI of the host. .
  • the protocol header portion of the URI of the video resource is specifically defined, for example, as "taobao.com://", and when an application capable of processing the URI is installed in the electronic device B, The application can declare to the operating system that it can handle the URI with the protocol header "taobao.com://". In this way, when the device B performs the matching, the application that can process the URI can be quickly matched, and in practice, if only one application capable of processing the protocol header is used, the user needs to avoid multiple matching applications. Trouble in selecting (ie, from multiple candidates).
  • Step S409 The electronic device B starts an application capable of processing the URI of the extracted video resource, and continues to play the video resource pointed to by the URI from the obtained playback progress.
  • the wireless local area network is not required. Even if the resources pointed to by the URI are played, LAN support may still be needed, but the two electronic devices that do not need to be shared are in the same LAN.
  • the electronic device which is a sender of a shared resource.
  • the electronic device includes a detecting unit 501, a resource identifier encapsulating unit 502, and an NFC communication unit 503.
  • the detecting unit 501 is configured to detect, in the process of browsing the resource by the resource browsing application, whether there is a trigger condition for starting the NFC communication link to implement resource information sharing.
  • the triggering condition for starting the NFC communication link to implement resource information sharing may specifically be an event that occurs by the receiving device.
  • the resource identifier encapsulating unit 502 is configured to encapsulate the resource identifier of the resource browsed by the resource browsing application as load information into the NFC data packet after the detecting unit 501 detects the trigger condition.
  • the NFC communication unit 503 is configured to send the encapsulated NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
  • the resource identifier here can be the URI of the resource.
  • the resource type of the resource information that is shared in the actual is not limited to the video resource.
  • the resource of the shared resource information may also be a multimedia resource such as a picture or a sound, or may be a text supported by Microsoft Office by default. Files, spreadsheet files, slide files, small database files, etc., as well as plain text files supported by the Notepad program by default. Accordingly, the electronic device A launches an application that can open the resources that need to be shared for browsing.
  • the resource identifier can be transmitted to the receiver device through the NFC communication link, so that the receiver device acquires the resource by using the resource identifier. Since the resource identifier is transmitted through the NFC communication link, the wireless local area network is not needed. The resource is not required to be added to the same WLAN through the resource identifier. Therefore, the resource sharing requirement for the network environment is reduced.
  • the electronic device further includes a progress information encapsulating unit 504, configured to encapsulate the progress information browsed by the resource browsing application as load information.
  • a progress information encapsulating unit 504 configured to encapsulate the progress information browsed by the resource browsing application as load information.
  • the resource representation encapsulation unit 502 and the progress information encapsulating unit 504 specifically encapsulate the resource identification and progress information of the resource browsed by the resource browsing application into the load information of the same NFC data packet.
  • the resource identifier existence identifying unit is further configured to determine the current resource browsing application after the detecting unit 501 detects the triggering condition. Whether the resource identifier of the browsed resource is provided, and only after the current resource browsing application provides the resource identifier of the browsed resource, the resource identifier encapsulating unit 502 starts to perform the encapsulation process.
  • the electronic device includes a resource identifier extraction unit 601, an application matching unit 602, and a startup unit 603.
  • the resource identifier extraction unit 601 is configured to extract the resource identifier from the received load information of the NFC data packet after receiving the NFC data packet.
  • the application matching unit 602 is configured to search for a resource browsing application that can process the resource identifier extracted by the resource identifier extraction unit 601.
  • the resource obtaining unit 604 is configured to obtain, according to the resource identifier, the resource identified by the resource identifier.
  • the initiating unit 603 is configured to start the resource browsing application found by the application matching unit 602 to browse the resources identified by the extracted resource identifier.
  • the matching logic of the application matching unit 602 in the search process may have many specific implementation manners.
  • a special case URI as a resource identifier is composed of a protocol header, a host name, a port, and a path, and the application matching unit 602 may start from a protocol header. Matches step by step to find matching resource browsing applications.
  • the application matching unit 602 includes: a protocol matching unit, configured to perform a lookup by using a protocol header of the resource identifier, to obtain a resource browsing application capable of processing the resource identifier.
  • the sender device also encapsulates the progress information in the NFC data packet.
  • the electronic device in this embodiment further includes: a progress information extracting unit, configured to extract progress information from the received NFC data packet. After the startup unit starts the resource browsing application, the resource browsing application starts browsing the resource identified by the resource identifier from the location identified by the progress information.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product.
  • the computing device includes one or more processors (CPU ), input / output interface, network interface and memory.
  • the computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • the computer software product can be stored in the memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM electrically erasable programmable read only memory
  • flash memory or other memory technology
  • compact disk read only memory CD-ROM
  • DVD digital versatile disk
  • Magnetic tape cartridges magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
  • This application can be used in a variety of general purpose or special purpose computer system environments or configurations.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Abstract

Embodiments of the present application provide a method for sharing resources between devices and an electronic device. The method comprises: during the process of starting a resource browsing application to browse a resource, detecting a trigger condition of activating a near field communication (NFC) communication link to realize resource information sharing; encapsulating a resource identifier of the resource browsed by the resource browsing application as load information into an NFC data packet; and sending the NFC data packet to a receiver device so that the receiver device parses out the resource identifier according to the NFC data packet and acquires the resource by using the resource identifier. According to the embodiments of the present application, a resource identifier can be transferred through an NFC communication link between a sender device and a receiver device, and a resource can be acquired by using the resource identifier; because the resource identifier is transferred through the NFC communication link, a wireless local area network is not required, and because the resource is acquired by using the resource identifier, the sender device and the receiver device no longer need to join the same wireless local area network.

Description

设备间共享资源的方法及电子设备Method and electronic device for sharing resources between devices 技术领域Technical field
本申请属于无线通信技术领域,尤其涉及一种设备间共享资源的方法及电子设备。The present application belongs to the field of wireless communication technologies, and in particular, to a method and an electronic device for sharing resources between devices.
背景技术Background technique
在现有技术中,无线智能设备等电子设备间进行视频等多媒体文件共享主要是先共享多媒体的URI(Uniform Resource Identifier,通用资源标识符),再由电子设备根据接收到的URI获取多媒体文件进行播放。而多媒体文件的URI属于该多媒体文件的资源信息,目前实现多媒体文件的URI共享的技术主要有基于UPNP(Universal Plug and Play,通用即插即用)协议的DLNA(Digital Living Network Alliance,数字生活网络联盟)技术、苹果公司的Air Play技术等,这些技术无疑都需要共享双方处于基于WIFI连接的同一个局域网环境中,即在获取多媒体文件进行播放之前的资源信息共享也需要处于同一个局域网中。In the prior art, the multimedia file sharing such as video between the electronic devices such as the wireless smart device mainly shares the URI (Uniform Resource Identifier) of the multimedia, and then the electronic device acquires the multimedia file according to the received URI. Play. The URI of the multimedia file belongs to the resource information of the multimedia file. Currently, the URI sharing technology of the multimedia file mainly includes the DLNA (Digital Living Network Alliance) based on the UPNP (Universal Plug and Play) protocol. Alliance technology, Apple's Air Play technology, etc., these technologies undoubtedly need to share the same LAN environment based on WIFI connection, that is, the resource information sharing before acquiring multimedia files for playback needs to be in the same LAN.
在智能手机等智能设备普及的今天,人们越来越需要随时随地快捷地在电子设备间共享文件,显然限制人们必须到同一个基于WIFI信号的局域网中是非常不方便的。Today, with the popularization of smart devices such as smart phones, people increasingly need to share files between electronic devices anytime and anywhere. Obviously, it is very inconvenient to restrict people from going to the same WIFI-based LAN.
发明内容Summary of the invention
本申请实施例的目的是提供一种设备间共享资源的方法和电子设备,可实现设备间点到点的共享,不需加入同一个无线局域网中。The purpose of the embodiments of the present application is to provide a method and an electronic device for sharing resources between devices, which can implement point-to-point sharing between devices without adding to the same WLAN.
为解决上述技术问题,本申请实施例提供一种设备间共享资源的方法及电子设备是这样实现的:To solve the above technical problem, the embodiment of the present application provides a method for sharing resources between devices and an electronic device is implemented as follows:
一方面,本申请实施例提供一种设备间共享资源的方法,包括:In one aspect, the embodiment of the present application provides a method for sharing resources between devices, including:
在开启资源浏览应用对资源进行浏览的过程中,检测到启动进场通信NFC通信链路实现资源信息共享的触发条件;In the process of browsing the resource by the resource browsing application, detecting a trigger condition for starting the NFC communication link of the incoming communication to realize resource information sharing;
将所述资源浏览应用所浏览的资源的资源标识作为负载信息封装到NFC数据包中;The resource identifier of the resource browsed by the resource browsing application is encapsulated into the NFC data packet as load information;
将所述NFC数据包发送至接收方设备,以使所述接收方设备根据该NFC数据包解析出所述资源标识,并利用所述资源标识获取资源。And sending the NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
在一个优选的实施例中,所述方法还包括:In a preferred embodiment, the method further includes:
将所述资源浏览应用所浏览的进度信息作为负载信息封装到NFC数据包中。The progress information browsed by the resource browsing application is encapsulated into the NFC data package as load information.
在一个优选的实施例中,所述资源浏览应用所浏览的资源的资源标识、以及所浏览的进度信息被封装到同一个NFC数据包的负载信息中。 In a preferred embodiment, the resource identifier of the resource browsed by the resource browsing application and the progress information browsed are encapsulated into the load information of the same NFC data packet.
在一个优选的实施例中,所述启动NFC通信链路实现资源信息共享的触发条件包括:发生被接收方设备触碰的事件。In a preferred embodiment, the triggering condition for starting the NFC communication link to implement resource information sharing includes: an event that is touched by the receiver device occurs.
在一个优选的实施例中,所述方法还包括:在检测到启动NFC通信链路实现资源信息共享的触发条件后,继续判断当前的资源浏览应用是否提供了所浏览的资源的资源标识。In a preferred embodiment, the method further includes: after detecting a trigger condition for starting the NFC communication link to implement resource information sharing, continuing to determine whether the current resource browsing application provides the resource identifier of the browsed resource.
在一个优选的实施例中,所述资源标识为统一资源标识URI。In a preferred embodiment, the resource identifier is a uniform resource identifier URI.
本申请实施例另一方面还提供一种设备间共享资源的方法,包括:Another aspect of the embodiment of the present application further provides a method for sharing resources between devices, including:
在接收到NFC数据包以后,从所述NFC数据包的负载信息中提取出资源标识;After receiving the NFC data packet, extracting the resource identifier from the load information of the NFC data packet;
查找能够处理所述提取出的资源标识的资源浏览应用;Finding a resource browsing application capable of processing the extracted resource identifier;
根据所述资源标识获取该资源标识所标识的资源;Obtaining, according to the resource identifier, the resource identified by the resource identifier;
利用所述资源浏览应用对所述资源标识所标识的资源进行浏览。The resource browsing application is used to browse the resource identified by the resource identifier.
在一个优选的实施例中,所述方法还包括:In a preferred embodiment, the method further includes:
从所述NFC数据包中还提取出进度信息;Progress information is also extracted from the NFC data packet;
在利用所述资源浏览应用对所述资源标识所标识的资源进行浏览时,从所述进度信息标识的位置处开始浏览。When browsing the resource identified by the resource identifier by using the resource browsing application, browsing starts from the location identified by the progress information.
在一个优选的实施例中,所述查找能够处理所述提取出的资源标识的资源浏览应用包括:In a preferred embodiment, the resource browsing application capable of processing the extracted resource identifier includes:
通过所述资源标识的协议头来进行查找,得到能够处理所述资源标识的资源浏览应用。The search is performed by the protocol header of the resource identifier, and a resource browsing application capable of processing the resource identifier is obtained.
本申请实施例再一方面还提供一种电子设备,包括:A further aspect of the embodiments of the present application further provides an electronic device, including:
检测单元,用于在开启资源浏览应用对资源进行浏览的过程中,检测是否存在启动NFC通信链路实现资源信息共享的触发条件;The detecting unit is configured to detect, when the resource browsing application is enabled to browse the resource, whether a trigger condition for starting the NFC communication link to implement resource information sharing is detected;
资源标识封装单元,用于在所述检测单元监测到所述触发条件后,将所述资源浏览应用所浏览的资源的资源标识作为负载信息封装到NFC数据包中;a resource identifier encapsulating unit, configured to encapsulate the resource identifier of the resource browsed by the resource browsing application as load information into an NFC data packet after the detecting unit detects the triggering condition;
NFC通信单元,用于将所述NFC数据包发送至接收方设备,以使所述接收方设备根据该NFC数据包解析出所述资源标识,并利用所述资源标识获取资源。And an NFC communication unit, configured to send the NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
在一个优选的实施例中,还包括:In a preferred embodiment, the method further includes:
进度信息封装单元,用于将所述资源浏览应用所浏览的进度信息作为负载信息封装到NFC数据包中。The progress information encapsulating unit is configured to encapsulate the progress information browsed by the resource browsing application as load information into the NFC data package.
在一个优选的实施例中,所述资源表示封装单元和进度信息封装单元具体是将所述资源浏览应用所浏览的资源的资源标识和进度信息封装到同一个NFC数据包的负载信息中。In a preferred embodiment, the resource representation encapsulation unit and the progress information encapsulation unit specifically encapsulate the resource identifier and the progress information of the resource browsed by the resource browsing application into the load information of the same NFC data packet.
在一个优选的实施例中,所述启动NFC通信链路实现资源信息共享的触发条件包括:发生被接收方设备碰触的事件。 In a preferred embodiment, the triggering condition for enabling the NFC communication link to implement resource information sharing includes: an event that is touched by the receiver device occurs.
在一个优选的实施例中,还包括:In a preferred embodiment, the method further includes:
资源标识存在识别单元,用于在所述检测单元检测到触发条件后,判断当前的资源浏览应用是否提供了所浏览的资源的资源标识。The resource identifier existence identifying unit is configured to determine, after the detecting unit detects the trigger condition, whether the current resource browsing application provides the resource identifier of the browsed resource.
在一个优选的实施例中,所述资源标识为URI。In a preferred embodiment, the resource identifier is a URI.
本申请实施例另一方面还提供一种电子设备,包括:Another aspect of the embodiment of the present application further provides an electronic device, including:
资源标识提取单元,用于在接收到NFC数据包以后,从所述NFC数据包的负载信息中提取出资源标识;a resource identifier extracting unit, configured to extract a resource identifier from load information of the NFC data packet after receiving the NFC data packet;
应用匹配单元,用于查找能够处理所述提取出的资源标识的资源浏览应用;An application matching unit, configured to search for a resource browsing application capable of processing the extracted resource identifier;
资源获取单元,用于根据所述资源标识获取该资源标识所标识的资源;a resource obtaining unit, configured to acquire, according to the resource identifier, a resource identified by the resource identifier;
启动单元,用于启动所述资源浏览应用,以对所述资源标识所标识的资源进行浏览。The initiating unit is configured to start the resource browsing application to browse the resource identified by the resource identifier.
在一个优选的实施例中,所述应用匹配单元包括:In a preferred embodiment, the application matching unit includes:
协议匹配单元,用于通过所述资源标识的协议头进行查找,得到能够处理所述资源标识的资源浏览应用。The protocol matching unit is configured to perform a search by using a protocol header of the resource identifier, and obtain a resource browsing application capable of processing the resource identifier.
在一个优选的实施例中,还包括:In a preferred embodiment, the method further includes:
进度信息提取单元,用于从所述接收到的NFC数据包中提取出进度信息;a progress information extracting unit, configured to extract progress information from the received NFC data packet;
所述启动单元具体用于启动所述资源浏览应用,以对所述资源标识所标识的资源进行浏览,并从所述进度信息标识的位置处开始浏览。The initiating unit is specifically configured to start the resource browsing application, browse the resource identified by the resource identifier, and start browsing from the location identified by the progress information.
由以上本申请实施例提供的技术方案可见,本申请实施例能够实现发送方设备与接收方设备之间通过NFC通信链路传送资源标识,并以该资源标识获取资源,由于资源标识是通过NFC通信链路传送的,不需要借助无线局域网来实现,而通过资源标识获取资源则不再需要发送方设备和接收方设备加入同一个无线局域网中,为此降低了资源分享对网络环境的要求。It can be seen that the technical solution provided by the foregoing embodiment of the present application can implement that the resource identifier is transmitted between the sender device and the receiver device through the NFC communication link, and the resource identifier is used to obtain the resource, because the resource identifier is adopted by the NFC. The communication link does not need to be implemented by means of the WLAN, and the resource identification by the resource identifier eliminates the need for the sender device and the receiver device to join the same WLAN, thereby reducing the resource sharing requirements for the network environment.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a few embodiments described in the present application, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1是本申请一个实施例提供的一种设备间共享资源的方法流程图;FIG. 1 is a flowchart of a method for sharing resources between devices according to an embodiment of the present application;
图2是本申请另一个实施例提供的一种设备间共享资源的方法流程图;2 is a flowchart of a method for sharing resources between devices according to another embodiment of the present application;
图3是本申请提供的设备间共享资源的方法的一个实施例的流程图; 3 is a flowchart of an embodiment of a method for sharing resources between devices provided by the present application;
图4是本申请提供的设备间共享资源的方法的另一个实施例的流程图;4 is a flow chart of another embodiment of a method for sharing resources between devices provided by the present application;
图5是本申请一个实施例提供的电子设备的示意图;FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application; FIG.
图6是本申请另一个实施例提供的电子设备的示意图。FIG. 6 is a schematic diagram of an electronic device according to another embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following, in which the technical solutions in the embodiments of the present application are clearly and completely described. The embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope shall fall within the scope of the application.
本申请一个实施例提供一种设备间共享资源的方法,该方法从发送方设备一侧进行描述,如图1所示,该方法包括如下步骤:An embodiment of the present application provides a method for sharing resources between devices, which is described from the sender device side. As shown in FIG. 1 , the method includes the following steps:
步骤S101:在开启资源浏览应用对资源进行浏览的过程中,检测到启动NFC通信链路实现资源信息共享的触发条件;Step S101: In the process of browsing the resource by the resource browsing application, detecting a trigger condition for starting the NFC communication link to implement resource information sharing;
步骤S102:将上述资源浏览应用所浏览的资源的资源标识作为负载信息封装到NFC数据包中;Step S102: The resource identifier of the resource browsed by the resource browsing application is encapsulated into the NFC data packet as load information.
步骤S103:将步骤S102中的NFC数据包发送至接收方设备,以使所述接收方设备根据该NFC数据包解析出所述资源标识,并利用所述资源标识获取资源。Step S103: Send the NFC data packet in step S102 to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
这里的接收方设备可以任何具有一定计算能力的电子设备,尤其适用于具有操作系统的智能移动设备,例如智能手机、平板电脑、个人数字助理(PDA)等。The recipient device herein can be any electronic device with certain computing power, especially for smart mobile devices with an operating system, such as a smart phone, a tablet, a personal digital assistant (PDA), and the like.
通过该方案,能够实现与接收方设备之间通过NFC通信链路传送资源标识,实现资源信息在设备间的共享,且不需要加入同一个无线局域网中,实现基于点对点通信的资源信息共享。Through the solution, the resource identifier can be transmitted through the NFC communication link with the receiver device, and the resource information can be shared between the devices, and the resource information sharing based on the point-to-point communication can be realized without adding the same wireless local area network.
接收方设备在获取到资源标识后,以该资源标识获取资源往往需要借助网络环境,例如局域网、互联网等,当然如果该资源本身就在接收方设备的存储设备中,则不再需要借助网络环境就可以打开该资源进行浏览。After the receiver device obtains the resource identifier, it is often necessary to use the network identifier to obtain the resource, such as a local area network, the Internet, etc., of course, if the resource itself is in the storage device of the receiver device, the network environment is no longer needed. You can open the resource to browse.
实际上,通过NFC通信链路进行传输数据尤其适用于小数据量的数据传输,在本申请实施例中,资源的资源标识的数据量往往比较小,因此比较适用于使用NFC通信链路进行传输。In fact, the data transmission through the NFC communication link is particularly suitable for small data volume data transmission. In the embodiment of the present application, the resource identifier of the resource is often small, so it is more suitable for transmission using an NFC communication link. .
本申请另一个实施例还提供一种设备间共享资源的方法,该方法从接收方设备进行描述,如图2所示,该方法包括如下步骤:Another embodiment of the present application further provides a method for sharing resources between devices, which is described from a receiver device, as shown in FIG. 2, the method includes the following steps:
步骤S201:在接收到NFC数据包以后,从接收到的NFC数据包的负载信息中提取出资 源标识;Step S201: After receiving the NFC data packet, extracting the capital contribution from the received load information of the NFC data packet. Source identifier
步骤S202:查找能够处理步骤S201中提取出的资源标识的资源浏览应用;Step S202: Search for a resource browsing application capable of processing the resource identifier extracted in step S201;
步骤S203:根据所述资源标识获取该资源标识所标识的资源;Step S203: Acquire, according to the resource identifier, the resource identified by the resource identifier.
步骤S204:利用所述资源浏览应用对所述资源标识所标识的资源进行浏览。Step S204: Browse, by using the resource browsing application, the resource identified by the resource identifier.
通过该方案,能够实现与发送方设备之间通过NFC通信链路传送资源标识,并以该资源标识获取资源,由于资源标识是通过NFC通信链路传送的,不需要借助无线局域网来实现,而通过资源标识获取资源则不再需要发送方设备和接收方设备加入同一个无线局域网中,为此降低了资源分享对网络环境的要求。With the solution, the resource identifier can be transmitted through the NFC communication link with the sender device, and the resource identifier is used to obtain the resource. Since the resource identifier is transmitted through the NFC communication link, it does not need to be implemented by using a wireless local area network. Obtaining resources through the resource identifier eliminates the need for the sender device and the receiver device to join the same WLAN. This reduces the resource sharing requirements for the network environment.
在实际中,设备间共享的资源标识的资源种类可以有很多种,例如声音文件、视频文件、图片文件等,以下以几个例子详细说明本申请的具体实现。In practice, the resource identifiers shared by the devices may have various types of resources, such as sound files, video files, picture files, etc. The specific implementation of the present application is described in detail below with a few examples.
实施例一Embodiment 1
图3示出了本申请提供的设备间共享资源的方法的一个实施例的流程图。在本例中电子设备A作为共享资源信息的发起方,电子设备B作为共享资源信息的接收方。电子设备A和电子设备B均具有NFC通信模块,以便完成电子设备间的NFC通信。本例中的电子设备A和电子设备B可以为任何可以通过NFC通信模块进行通信的电子设备,包括但不限于智能移动电话、平板电脑、桌面型电脑、便携式电脑、PDA(个人数字助理)等。作为一个特例,本实施例中以电子设备A和电子设备B均为智能移动电话为例进行说明。3 is a flow chart showing one embodiment of a method of sharing resources between devices provided by the present application. In this example, the electronic device A serves as the initiator of the shared resource information, and the electronic device B serves as the receiver of the shared resource information. Both the electronic device A and the electronic device B have an NFC communication module to complete NFC communication between the electronic devices. The electronic device A and the electronic device B in this example may be any electronic device that can communicate through the NFC communication module, including but not limited to smart mobile phones, tablets, desktop computers, portable computers, PDAs (personal digital assistants), and the like. . As a specific example, in the embodiment, the electronic device A and the electronic device B are both smart mobile phones as an example.
如图3所示,本实施例提供的设备间共享资源的方法包括如下步骤:As shown in FIG. 3, the method for sharing resources between devices provided by this embodiment includes the following steps:
步骤S301:电子设备A启动某一视频应用,播放所选择的视频资源。Step S301: The electronic device A starts a certain video application and plays the selected video resource.
用户所启动的视频应用可以是能够播放特定格式的本地视频播放器,例如电子设备A所安装的操作系统自带的视频播放器或者用户从应用商店中下载的视频播放器等;也可以是一些视频网站或本地服务器所对应的客户端应用。The video application launched by the user may be a local video player capable of playing a specific format, such as a video player provided by the operating system installed in the electronic device A or a video player downloaded from the application store by the user; or some The client application corresponding to the video website or local server.
用户所播放的视频资源可以是来自互联网中视频网站服务器中的视频资源,也可以是来自本地局域网中流媒体服务器中的视频资源。The video resource played by the user may be a video resource from a video website server in the Internet, or may be a video resource from a streaming media server in the local area network.
在实际中所共享的资源信息的资源类型不限于视频资源,在可替换的实施例中,共享的资源信息所属的资源还可以是图片、声音等多媒体资源,也可以是由Microsoft Office默认支持的文本文件、电子表格文件、幻灯片文件、小型数据库文件等,以及由记事本程序默认支持的纯文本文件。相应地,电子设备A启动能够打开的所需要分享的资源的应用进行浏览。在打开以播放时间为浏览进度的资源(比如视频、Flash动画、声音等),播放该资源属于对该资源的一种浏览;在打开以当前阅读页序数为浏览进度的资源(比如幻灯片文件、文本文 件、PDF格式的文件等),逐页查看该资源属于对该资源的一种浏览;在打开以当前阅读行序数为浏览进度的资源(比如纯文本文件、电子表格文件等),逐行查看该资源属于对该资源的一种浏览;在打开以特殊内嵌对象为浏览进度的资源(比如单文件承载的小型数据库文件),查看或编辑内嵌对象中的内容属于对该资源的一种浏览。The resource type of the resource information that is shared in the actual is not limited to the video resource. In an alternative embodiment, the resource to which the shared resource information belongs may also be a multimedia resource such as a picture or a sound, or may be supported by Microsoft Office by default. Text files, spreadsheet files, slide files, small database files, etc., as well as plain text files supported by the Notepad program by default. Accordingly, the electronic device A launches an application that can open the resources that need to be shared for browsing. When opening a resource (such as video, Flash animation, sound, etc.) with the playback time as the browsing progress, playing the resource belongs to a kind of browsing of the resource; opening the resource with the current reading page number as the browsing progress (such as a slide file) Text Piece, PDF file, etc.), page by page to view the resource belongs to a kind of browsing of the resource; open the resource with the current reading line number as the browsing progress (such as plain text file, spreadsheet file, etc.), view line by line The resource belongs to a kind of browsing of the resource; when opening a resource with a special embedded object as a browsing progress (such as a small database file carried by a single file), viewing or editing the content in the embedded object belongs to the resource. Browse.
步骤S302:电子设备A与电子设备B之间触碰后,电子设备A检测到有触碰事件的发生,进而达到启动借助NFC通信链路实现资源信息共享的触发条件。Step S302: After the electronic device A and the electronic device B are touched, the electronic device A detects the occurrence of a touch event, thereby achieving a trigger condition for starting resource information sharing by means of the NFC communication link.
当使用电子设备A的用户想要将其已经打开并正在播放的视频资源的资源信息分享给使用电子设备B的用户时,可以将电子设备A和电子设备B进行触碰,以产生借助NFC通信链路实现资源信息共享的触发条件,在实际中,当电子设备A和电子设备B进行触碰时,电子设备A的操作系统底层会产生相应的触碰事件,电子设备A当前打开的应用可以捕获到该事件,随后电子设备A开始进入通过NFC通信链路共享资源的准备阶段。When the user using the electronic device A wants to share the resource information of the video resource that he has opened and is playing to the user who uses the electronic device B, the electronic device A and the electronic device B can be touched to generate communication by means of NFC. The link triggers the resource information sharing. In actuality, when the electronic device A and the electronic device B touch, the operating system bottom layer of the electronic device A generates a corresponding touch event, and the application currently opened by the electronic device A can The event is captured, and then electronic device A begins to enter the preparation phase of sharing resources through the NFC communication link.
电子设备A可以利用NFC模块本身的机制来完成触碰的检测。The electronic device A can utilize the mechanism of the NFC module itself to complete the detection of the touch.
本领域技术人员应该能够理解,本例中将通过NFC通信链路共享资源信息的触发条件定义为电子设备A被其他设备触碰仅是一个例子,在实际中还可以定义为电子设备A接收到其他电子设备通过蓝牙、红外等近距离通信连接发送过来的共享请求,或还可定义为电子设备A通过蓝牙、红外等近距离通信连接向其他电子设备发送共享请求并接收到表示允许的反馈信息。Those skilled in the art should be able to understand that the trigger condition for sharing resource information through the NFC communication link in this example is defined as the fact that the electronic device A is touched by other devices is only an example, and in practice, it can also be defined as the electronic device A receives The sharing request sent by other electronic devices through a short-range communication connection such as Bluetooth or infrared, or may be defined as the electronic device A transmitting a sharing request to other electronic devices through a short-range communication connection such as Bluetooth or infrared, and receiving feedback information indicating permission. .
步骤S303:电子设备A判断自身的NFC功能是否开启。Step S303: The electronic device A determines whether its own NFC function is enabled.
基于提高能效和延长待机时间的考虑,通常电子设备不会长时间开启NFC功能,而是仅在需要使用时开启。出于这样的考虑,在电子设备A通过NFC通信链路共享资源信息之前需要核实自身的NFC功能是否开启。在发现NFC功能开启时进入共享资源信息的步骤,而如果发现NFC功能未开启时可以直接结束流程,也可以跳转到设置NFC功能开启的步骤。在实际中,当发现NFC功能未开启时,可以呈现设置NFC功能开启的设置界面,当接收到用户选择开启NFC功能并成功开启NFC功能后继续执行后续步骤。Based on the consideration of improving energy efficiency and extending standby time, usually the electronic device does not turn on the NFC function for a long time, but only when it is needed. For this reason, it is necessary to verify whether the NFC function of the electronic device A is turned on before the electronic device A shares the resource information through the NFC communication link. If you find that the NFC function is enabled, you can enter the shared resource information. If you find that the NFC function is not enabled, you can directly end the process. You can also go to the step of setting the NFC function to be enabled. In practice, when the NFC function is not enabled, the setting interface for setting the NFC function can be presented. When the user selects to enable the NFC function and successfully starts the NFC function, the subsequent steps are continued.
在某些特定场景下可替换的实施例中,步骤S303也可以省去,例如在电子设备不需要考虑能效问题的场景下,或者电子设备启动浏览资源的应用时NFC功能自动打开等。电子设备A可以在后续通过NFC通信链路共享资源信息时反馈的错误码判断是否属于NFC功能没有开启的错误。In an alternative embodiment in some specific scenarios, step S303 may also be omitted, for example, in a scenario where the electronic device does not need to consider an energy efficiency problem, or when the electronic device starts an application for browsing resources, the NFC function is automatically turned on, and the like. The electronic device A can determine whether the error code that is fed back when the resource information is shared by the NFC communication link is an error that the NFC function is not turned on.
步骤S304:当步骤S303判断结果为是时,继续判断电子设备A的当前视频应用是否提供了用于通过NFC通信链路传输的资源的URI。Step S304: When the result of the determination in step S303 is YES, it is continued to determine whether the current video application of the electronic device A provides the URI for the resource transmitted through the NFC communication link.
在实际中基于版权、隐私等考虑,不是每一个打开的资源的资源信息都支持共享,在支 持共享的资源信息中还可以限定只有符合特定要求的资源的资源信息才能支持通过NFC通信链路传输。因此在通过NFC通信链路共享资源信息前,可以首先判断当前视频应用是否提供了用于通过NFC通信链路传输的URI。当步骤S304判断结果为否时,可以停止执行后续步骤。In practice, based on copyright, privacy, etc., not every resource resource of an open resource supports sharing. In the shared resource information, resource information of resources that meet specific requirements can also be limited to support transmission through the NFC communication link. Therefore, before sharing the resource information through the NFC communication link, it may first be determined whether the current video application provides a URI for transmission over the NFC communication link. When the result of the determination in step S304 is NO, the subsequent steps may be stopped.
步骤S305:当步骤S304判断结果为是时,电子设备A将当前视频应用正在播放的视频资源的URI作为负载信息封装到NFC数据包中,并通过NFC通信模块发送至电子设备B。Step S305: When the result of the determination in step S304 is YES, the electronic device A encapsulates the URI of the video resource being played by the current video application as load information into the NFC data packet, and sends the data to the electronic device B through the NFC communication module.
以运行Android平台的电子设备为例,Android平台支持传递NDEF(NFC Data Exchange Format)格式的数据,NDEF数据是NFC组织约定的NFC Tag(标签)信息中数据格式。在Android平台中NDEF格式的数据会被封装成NFC数据包(在实际中可以为NdefMessage,但本申请并不以此为限)。For example, the Android platform supports the transmission of data in the NDEF (NFC Data Exchange Format) format, and the NDEF data is the data format in the NFC Tag (tag) information agreed by the NFC organization. In the Android platform, the data in the NDEF format will be encapsulated into NFC packets (in practice, it can be NdefMessage, but this application is not limited to this).
在一个NdefMessage中可以包括一个或多个NdefRecord,一个NdefRecord中包含以下字段:One or more NdefRecords can be included in an NdefMessage, and an NdefRecord contains the following fields:
类型名称格式(Type Name Format,TNF),用于指定如何转义后续将要说明的可变长类型字段,长度通常定义为3bit;Type Name Format (TNF), which is used to specify how to escape the variable length type field to be described later. The length is usually defined as 3 bits.
可变长类型字段(Variable Length Type),用于描述该NdefRecord的类型,可以根据类型名称格式字段来填写该字段;Variable Length Type, used to describe the type of the NdefRecord, which can be filled in according to the type name format field;
可变长ID(Variable Length ID),用于唯一标识该NdefRecord,该字段在实际中非必须填写;Variable Length ID, which is used to uniquely identify the NdefRecord. This field is not required to be filled in.
可变长负载(Variable Length Payload),用于包含真正需要传输的数据,本实施例中可以将需要共享的资源信息(例如视频资源的URI)包装到该字段中。Variable Length Payload is used to contain data that needs to be transmitted. In this embodiment, resource information (such as the URI of the video resource) that needs to be shared may be wrapped into the field.
在实际中,将视频资源的URI包装到NdefMessage可以由Android系统的NFC模块来完成。In practice, wrapping the URI of the video resource into NdefMessage can be done by the NFC module of the Android system.
步骤S306:电子设备B在开启NFC功能的前提下,监测是否接收到NFC数据包;Step S306: The electronic device B monitors whether the NFC data packet is received on the premise that the NFC function is enabled.
在实际中,监测是否接收到NFC数据包具体还要判断接收到的NFC数据包是否有效,有时因为通信链路的不稳定会导致接收数据错误,进而造成NFC数据包无法被正常识别。In practice, monitoring whether an NFC packet is received depends on whether the received NFC packet is valid or not, and sometimes the receiving data is incorrect due to the instability of the communication link, thereby causing the NFC packet to be unrecognizable.
步骤S307:在步骤S306中电子设备B监测到接收到NFC数据包以后,将接收到的NFC数据包中的负载信息提取出来。Step S307: After the electronic device B detects that the NFC data packet is received in step S306, the load information in the received NFC data packet is extracted.
在本实施例中,电子设备B在将从电子设备A发送过来的NFC数据包的负载信息解析以后,可以提取得到视频资源的URI。In this embodiment, after analyzing the load information of the NFC data packet sent from the electronic device A, the electronic device B can extract the URI of the video resource.
步骤S308:电子设备B判断在电子设备B中是否存在可以处理提取出来的视频资源的URI的应用。Step S308: The electronic device B determines whether there is an application in the electronic device B that can process the URI of the extracted video resource.
在实际中,在将新应用安装到电子设备B的过程中,该应用会向电子设备B所搭载的操作 系统声明自己能够处理的数据以及事件,例如可以声明自己能够打开png格式的图片,或者可以处理某个协议的URI(例如能够处理http协议中的URI:http://play.google.com),或者可以处理某个系统的事件(如电池电量低、WIFI已断开,NFC通信连接等)。In practice, the operation that the application will carry to the electronic device B during the installation of the new application to the electronic device B The system declares the data and events that it can handle. For example, you can declare that you can open the image in png format, or you can process the URI of a protocol (for example, you can handle the URI in the http protocol: http://play.google.com). Or it can handle events of a certain system (such as low battery, WIFI disconnected, NFC communication connection, etc.).
电子设备B在提取到视频资源的URI后,可以查询操作系统中是否有声明可以处理这种事件和数据的应用。如果有,则调用该应用。在实际中,当查询到多于一个的应用都能处理该URI时,可以将查询到的多个应用以图表或其他方式进行显示,供用户进行选择,在接收到应用选择信息以后,根据应用选择信息调用所选择的应用。After extracting the URI of the video resource, the electronic device B can query whether there is an application in the operating system that can process such events and data. If there is, the application is called. In practice, when more than one application is queried to process the URI, the plurality of queried applications may be displayed in a graph or other manner for the user to select, after receiving the application selection information, according to the application. The selection information invokes the selected application.
实际中的URI由协议头(例如“http://”、“Ftp://”等)、主机名(Host)、端口(Port)和路径(Path)组成。电子设备B可以根据上述信息逐级进行查询是否有匹配的应用存在。例如可以先匹配协议头,查看系统中是否有声明可以处理该协议头的应用,如果查询到可以继续匹配下一级,例如匹配主机名,查看系统中是否有声明可以处理该主机的URI的应用。The actual URI consists of a protocol header (such as "http://", "Ftp://", etc.), a host name (Host), a port (Port), and a path (Path). The electronic device B can perform a query according to the above information to check whether there is a matching application. For example, the protocol header can be matched first to check whether there is an application in the system that can process the protocol header. If the query can continue to match the next level, for example, matching the host name, check whether there is an application in the system that can process the URI of the host. .
在一个优选的实施例中,将视频资源的URI中的协议头部分进行了特别定义,例如定义为“taobao.com://”,而在电子设备B中安装能够处理该URI的应用时,该应用可以向操作系统声明自己能够处理协议头为“taobao.com://”的URI。这样,电子设备B在进行匹配时,可以很快匹配到能够处理该URI的应用,而且在实际中,能够处理该协议头的应用如果只有一个,则进一步避免了用户需要从多个匹配的应用中(即从多个候选项中)进行选择的困扰。In a preferred embodiment, the protocol header portion of the URI of the video resource is specifically defined, for example, as "taobao.com://", and when an application capable of processing the URI is installed in the electronic device B, The application can declare to the operating system that it can handle the URI with the protocol header "taobao.com://". In this way, when the device B performs the matching, the application that can process the URI can be quickly matched, and in practice, if only one application capable of processing the protocol header is used, the user needs to avoid multiple matching applications. Trouble in selecting (ie, from multiple candidates).
步骤S309:电子设备B启动能够处理提取出来的视频资源的URI的应用,并播放该URI指向的视频资源。Step S309: The electronic device B starts an application capable of processing the URI of the extracted video resource, and plays the video resource pointed to by the URI.
由此可见,本实施例中通过两个电子设备之间的NFC通信实现视频资源的URI的共享时,可实现设备间点到点的共享,不需要无线局域网。即便是在播放该URI所指向的资源时可能仍需要局域网支持,但是也不需要实现共享的两个电子设备处于同一个局域网中。It can be seen that in the embodiment, when the URI of the video resource is shared by the NFC communication between the two electronic devices, the point-to-point sharing between the devices can be realized, and the wireless local area network is not required. Even if the resources pointed to by the URI are played, LAN support may still be needed, but the two electronic devices that do not need to be shared are in the same LAN.
实施例二Embodiment 2
图4示出了本申请实施例二提供的一种设备间共享资源的方法的一个实施例的流程图,在本例中,仍然是电子设备A作为共享资源信息的发起方,电子设备B作为共享资源信息的接收方。电子设备A和电子设备B均具有NFC通信模块,以便完成电子设备间的NFC通信。FIG. 4 is a flowchart of an embodiment of a method for sharing resources between devices according to Embodiment 2 of the present application. In this example, the electronic device A is still the initiator of the shared resource information, and the electronic device B is used as the initiator. The recipient of the shared resource information. Both the electronic device A and the electronic device B have an NFC communication module to complete NFC communication between the electronic devices.
本例中的电子设备A和电子设备B可以为任何可以通过NFC通信链路进行通信的电子设备,包括但不限于智能移动电话、平板电脑、桌面型电脑、便携式电脑、PDA(个人数字助理)等。作为一个特例,本实施例中以电子设备A和电子设备B均为智能移动电话为例进行说明。Electronic device A and electronic device B in this example may be any electronic device that can communicate through an NFC communication link, including but not limited to smart mobile phones, tablets, desktop computers, portable computers, PDAs (personal digital assistants). Wait. As a specific example, in the embodiment, the electronic device A and the electronic device B are both smart mobile phones as an example.
与实施例一的不同主要在于,本实施例中还将资源的查看进度信息一并实现共享。这里 的资源查看进度例如可以是视频或音乐文件的播放进度、文档文件的查看进度(如查看行数、或者查看页数)等。The difference from the first embodiment is mainly that the viewing progress information of the resources is shared together in this embodiment. Here The resource viewing progress may be, for example, the progress of playing a video or music file, the progress of viewing a document file (such as viewing the number of lines, or viewing the number of pages).
本例中不妨以资源为视频资源,资源的查看进度为视频资源的播放进度、资源信息为视频资源的URI和视频资源的播放进度为例进行说明。在一个具体的例子中,这里的视频资源的播放进度可以是播放到的时间点或播放到的章节等信息。In this example, the resource may be used as a video resource, and the progress of the resource is described as an example of the progress of the video resource, the resource information being the URI of the video resource, and the playback progress of the video resource. In a specific example, the playing progress of the video resource herein may be information such as the time point of playing or the chapter played.
参照图4,本实施例提供的设备间共享资源的方法包括如下步骤:Referring to FIG. 4, the method for sharing resources between devices provided by this embodiment includes the following steps:
步骤S401:电子设备A启动某一视频应用,播放所选择的视频资源。Step S401: The electronic device A starts a certain video application and plays the selected video resource.
用户所启动的视频应用可以是能够播放特定格式的本地视频播放器,例如电子设备A所安装的操作系统自带的视频播放器或者用户从应用商店中下载的视频播放器等;也可以是一些视频网站或本地服务器所对应的客户端应用。The video application launched by the user may be a local video player capable of playing a specific format, such as a video player provided by the operating system installed in the electronic device A or a video player downloaded from the application store by the user; or some The client application corresponding to the video website or local server.
用户所播放的视频资源可以是来自互联网中视频网站服务器中的视频资源,也可以是来自本地局域网中流媒体服务器中的视频资源。The video resource played by the user may be a video resource from a video website server in the Internet, or may be a video resource from a streaming media server in the local area network.
在实际中所共享的资源信息的资源类型不限于视频资源,在可替换的实施例中,共享的资源信息所属的资源还可以是图片、声音等多媒体资源,也可以是由Microsoft Office默认支持的文本文件、电子表格文件、幻灯片文件、小型数据库文件等,以及由记事本程序默认支持的纯文本文件。相应地,电子设备A启动能够打开的所需要分享的资源的应用进行浏览。在打开以播放时间为浏览进度的资源(比如视频、Flash动画、声音等),播放该资源属于对该资源的一种浏览;在打开以当前阅读页序数为浏览进度的资源(比如幻灯片文件、文本文件、PDF格式的文件等),逐页查看该资源属于对该资源的一种浏览;在打开以当前阅读行序数为浏览进度的资源(比如纯文本文件、电子表格文件等),逐行查看该资源属于对该资源的一种浏览;在打开以特殊内嵌对象为浏览进度的资源(比如单文件承载的小型数据库文件),查看或编辑内嵌对象中的内容属于对该资源的一种浏览。The resource type of the resource information that is shared in the actual is not limited to the video resource. In an alternative embodiment, the resource to which the shared resource information belongs may also be a multimedia resource such as a picture or a sound, or may be supported by Microsoft Office by default. Text files, spreadsheet files, slide files, small database files, etc., as well as plain text files supported by the Notepad program by default. Accordingly, the electronic device A launches an application that can open the resources that need to be shared for browsing. When opening a resource (such as video, Flash animation, sound, etc.) with the playback time as the browsing progress, playing the resource belongs to a kind of browsing of the resource; opening the resource with the current reading page number as the browsing progress (such as a slide file) , text file, PDF file, etc.), page by page to view the resource belongs to a kind of browsing of the resource; open the resource with the current reading line number as the browsing progress (such as plain text file, spreadsheet file, etc.) Viewing the resource belongs to a kind of browsing of the resource; opening a resource with a special embedded object as the browsing progress (such as a small database file carried by a single file), viewing or editing the content in the embedded object belongs to the resource A kind of browsing.
步骤S402:电子设备A与电子设备B之间碰触后,电子设备A检测到有触碰时间的发生,进而达到启动借助NFC通信模块实现资源信息共享的触发条件。Step S402: After the electronic device A and the electronic device B touch, the electronic device A detects the occurrence of the touch time, and further triggers the triggering of resource information sharing by using the NFC communication module.
当使用电子设备A的用户想要将其已经打开并正在播放的视频资源的资源信息分享给使用电子设备B的用户时,可以将电子设备A和电子设备B进行触碰,以产生借助NFC通信链路实现资源信息共享的触发条件。在实际中,当电子设备A和电子设备B进行触碰时,电子设备A的操作系统底层会产生相应的触碰事件,电子设备A当前打开的应用可以捕获到该事件,随后电子设备A开始进入通过NFC通信链路共享资源信息的准备阶段。When the user using the electronic device A wants to share the resource information of the video resource that he has opened and is playing to the user who uses the electronic device B, the electronic device A and the electronic device B can be touched to generate communication by means of NFC. The trigger condition for the link to implement resource information sharing. In practice, when the electronic device A and the electronic device B make a touch, the operating system bottom layer of the electronic device A generates a corresponding touch event, and the application currently opened by the electronic device A can capture the event, and then the electronic device A starts. Enter the preparation phase of sharing resource information through the NFC communication link.
本领域技术人员应该能够理解,本例中将通过NFC通信链路共享资源信息的触发条件定义为电子设备A被其他设备触碰仅是一个例子,在实际中还可以定义为电子设备A接收到其 他电子设备通过蓝牙、红外等近距离通信连接发送过来的共享请求,或还可定义为电子设备A通过蓝牙、红外等近距离通信连接向其他电子设备发送共享请求并接收到表示允许的反馈信息。Those skilled in the art should be able to understand that the trigger condition for sharing resource information through the NFC communication link in this example is defined as the fact that the electronic device A is touched by other devices is only an example, and in practice, it can also be defined as the electronic device A receives Its The sharing request sent by the electronic device through a short-range communication connection such as Bluetooth or infrared, or may be defined as the electronic device A transmitting a sharing request to other electronic devices through a short-range communication connection such as Bluetooth or infrared, and receiving feedback information indicating permission. .
步骤S403:电子设备A判断自身的NFC功能是否开启。Step S403: The electronic device A determines whether its own NFC function is enabled.
基于提高能效和延长待机时间的考虑,通常电子设备不会长时间开启NFC功能,而是仅在需要使用时开启。出于这样的考虑,在电子设备A通过NFC通信链路共享资源信息之前需要核实自身的NFC功能是否开启。在发现NFC功能开启时进入共享资源信息的步骤,而如果发现NFC功能未开启时可以直接结束流程,也可以跳转到设置NFC功能开启的步骤。在实际中,当发现NFC功能未开启时,可以呈现设置NFC功能开启的设置界面,当接收到用户选择开启NFC功能并成功开启NFC功能后继续执行后续步骤。Based on the consideration of improving energy efficiency and extending standby time, usually the electronic device does not turn on the NFC function for a long time, but only when it is needed. For this reason, it is necessary to verify whether the NFC function of the electronic device A is turned on before the electronic device A shares the resource information through the NFC communication link. If you find that the NFC function is enabled, you can enter the shared resource information. If you find that the NFC function is not enabled, you can directly end the process. You can also go to the step of setting the NFC function to be enabled. In practice, when the NFC function is not enabled, the setting interface for setting the NFC function can be presented. When the user selects to enable the NFC function and successfully starts the NFC function, the subsequent steps are continued.
在某些特定场景下可替换的实施例中,步骤S303也可以省去,例如在电子设备不需要考虑能效问题的场景下,或者电子设备启动浏览资源的应用时NFC功能自动打开等。电子设备A可以在后续通过NFC通信链路共享资源信息时反馈的错误码判断是否属于NFC功能没有开启的错误。In an alternative embodiment in some specific scenarios, step S303 may also be omitted, for example, in a scenario where the electronic device does not need to consider an energy efficiency problem, or when the electronic device starts an application for browsing resources, the NFC function is automatically turned on, and the like. The electronic device A can determine whether the error code that is fed back when the resource information is shared by the NFC communication link is an error that the NFC function is not turned on.
步骤S404:当步骤S403判断结果为是时,继续判断电子设备A的当前视频应用是否提供用于通过NFC通信链路传输的资源的URI。Step S404: When the result of the determination in step S403 is YES, it is continued to determine whether the current video application of the electronic device A provides a URI for the resource transmitted through the NFC communication link.
步骤S405:当步骤S404判断结果为是时,电子设备A将当前视频应用正在播放的视频资源的URI和播放进展作为负载信息封装到NFC数据包中,并通过NFC通信模块发送至电子设备B。Step S405: When the result of the determination in step S404 is YES, the electronic device A encapsulates the URI and the play progress of the video resource being played by the current video application into the NFC data packet as the load information, and sends the data to the electronic device B through the NFC communication module.
电子设备A在将URI和播放进展作为负载信息封装到NFC数据包中时,电子设备A和电子设备B之间可以遵守统一的协议,例如在负载信息中的前N位为放置URI信息的位置,以后的部分为放置播放进展的位置。When the electronic device A encapsulates the URI and the playback progress as load information into the NFC data packet, the electronic device A and the electronic device B can follow a unified protocol, for example, the first N bits in the load information are the locations where the URI information is placed. The next part is where the playback progress is placed.
步骤S406:电子设备B在开启NFC功能的前提下,监测是否接收到NFC数据包。Step S406: The electronic device B monitors whether the NFC data packet is received on the premise that the NFC function is enabled.
在实际中,监测是否接收到NFC数据包具体还要判断接收到的NFC数据包是否有效,有时因为通信链路的不稳定会导致接收数据错误,进而造成NFC数据包无法被正常识别。In practice, monitoring whether an NFC packet is received depends on whether the received NFC packet is valid or not, and sometimes the receiving data is incorrect due to the instability of the communication link, thereby causing the NFC packet to be unrecognizable.
步骤S407:在步骤S406中电子设备B监测到接收到NFC数据包以后,将接收到的NFC数据包中的负载信息提取出来,进而得到视频资源的URI和播放进度。电子设备A和电子设备B之间遵守了共同的协议,基于该协议,电子设备B可以正常从负载信息中分离出URI和播放进度信息。In step S407, after the electronic device B detects that the NFC data packet is received, the electronic device B extracts the load information in the received NFC data packet, thereby obtaining the URI and the playback progress of the video resource. A common protocol is adhered between the electronic device A and the electronic device B, based on which the electronic device B can normally separate the URI and the playback progress information from the load information.
需要说明的是,作为一个特例,本实施例中将资源标识和进度信息封装到同一个NFC数据包的负载信息中,在另一个可替换的实施例中,电子设备A也可将资源标识和进度信息分 别封装到两个NFC数据包的负载信息中,并通过实现约定的协议进行发送和接收,从而可以正确从两个NFC数据包中分别提取出资源标识和进度信息。It should be noted that, as a special case, in this embodiment, the resource identifier and the progress information are encapsulated into the load information of the same NFC data packet. In another alternative embodiment, the electronic device A may also identify the resource and Progress information It is not encapsulated into the load information of two NFC data packets, and is transmitted and received through the implementation of the agreed protocol, so that the resource identification and progress information can be correctly extracted from the two NFC data packets.
步骤S408:电子设备B判断在电子设备B中是否存在可以处理提取出来的视频资源的URI的应用。Step S408: The electronic device B determines whether there is an application in the electronic device B that can process the URI of the extracted video resource.
在实际中,在将新应用安装到电子设备B的过程中,该应用会向电子设备B所搭载的操作系统声明自己能够处理的数据以及事件,例如可以声明自己能够打开png格式的图片,或者可以处理某个协议的URI(例如能够处理http协议中的URI:http://play.google.com),或者可以处理某个系统的事件(如电池电量低、WIFI已断开,NFC通信连接等)。In practice, in the process of installing a new application to the electronic device B, the application declares the data and events that the electronic device B is capable of processing, for example, can declare that it can open the image in the png format, or Can handle the URI of a protocol (for example, can handle the URI in the http protocol: http://play.google.com), or can handle events of a system (such as low battery, WIFI disconnected, NFC communication connection) Wait).
电子设备B在提取到视频资源的URI后,可以查询操作系统中是否有声明可以处理这种事件和数据的应用。如果有,则调用该应用。在实际中,当查询到多于一个的应用都能处理该URI时,可以将查询到的多个应用以图表或其他方式进行显示,供用户进行选择,在接收到应用选择信息以后,根据应用选择信息调用所选择的应用。After extracting the URI of the video resource, the electronic device B can query whether there is an application in the operating system that can process such events and data. If there is, the application is called. In practice, when more than one application is queried to process the URI, the plurality of queried applications may be displayed in a graph or other manner for the user to select, after receiving the application selection information, according to the application. The selection information invokes the selected application.
实际中的URI由协议头(例如“http://”、“Ftp://”等)、主机名(Host)、端口(Port)和路径(Path)组成。电子设备B可以根据上述信息逐级进行查询是否有匹配的应用存在。例如可以先匹配协议头,查看系统中是否有声明可以处理该协议头的应用,如果查询到可以继续匹配下一级,例如匹配主机名,查看系统中是否有声明可以处理该主机的URI的应用。The actual URI consists of a protocol header (such as "http://", "Ftp://", etc.), a host name (Host), a port (Port), and a path (Path). The electronic device B can perform a query according to the above information to check whether there is a matching application. For example, the protocol header can be matched first to check whether there is an application in the system that can process the protocol header. If the query can continue to match the next level, for example, matching the host name, check whether there is an application in the system that can process the URI of the host. .
在一个优选的实施例中,将视频资源的URI中的协议头部分进行了特别定义,例如定义为“taobao.com://”,而在电子设备B中安装能够处理该URI的应用时,该应用可以向操作系统声明自己能够处理协议头为“taobao.com://”的URI。这样,电子设备B在进行匹配时,可以很快匹配到能够处理该URI的应用,而且在实际中,能够处理该协议头的应用如果只有一个,则进一步避免了用户需要从多个匹配的应用中(即从多个候选项中)进行选择的困扰。In a preferred embodiment, the protocol header portion of the URI of the video resource is specifically defined, for example, as "taobao.com://", and when an application capable of processing the URI is installed in the electronic device B, The application can declare to the operating system that it can handle the URI with the protocol header "taobao.com://". In this way, when the device B performs the matching, the application that can process the URI can be quickly matched, and in practice, if only one application capable of processing the protocol header is used, the user needs to avoid multiple matching applications. Trouble in selecting (ie, from multiple candidates).
步骤S409:电子设备B启动能够处理所提取出来的视频资源的URI的应用,并从所获得的播放进展处开始继续播放该URI指向的视频资源。Step S409: The electronic device B starts an application capable of processing the URI of the extracted video resource, and continues to play the video resource pointed to by the URI from the obtained playback progress.
由此可见,本实施例中通过两个电子设备之间的NFC通信实现视频资源的URI和播放进展的共享时,不需要无线局域网。即便是在播放该URI所指向的资源时可能仍需要局域网支持,但是也不需要实现共享的两个电子设备处于同一个局域网中。It can be seen that in the embodiment, when the URI of the video resource and the playback progress are shared by the NFC communication between the two electronic devices, the wireless local area network is not required. Even if the resources pointed to by the URI are played, LAN support may still be needed, but the two electronic devices that do not need to be shared are in the same LAN.
本申请实施例另一方面还提供一种电子设备,该电子设备作为共享资源的发送方,如图5所示,该电子设备包括检测单元501、资源标识封装单元502和NFC通信单元503。Another aspect of the embodiment of the present application further provides an electronic device, which is a sender of a shared resource. As shown in FIG. 5, the electronic device includes a detecting unit 501, a resource identifier encapsulating unit 502, and an NFC communication unit 503.
其中,检测单元501用于在开启资源浏览应用对资源进行浏览的过程中,检测是否存在启动NFC通信链路实现资源信息共享的触发条件。这里的启动NFC通信链路实现资源信息共享的触发条件具体可以是发生被接收方设备碰触的事件。 The detecting unit 501 is configured to detect, in the process of browsing the resource by the resource browsing application, whether there is a trigger condition for starting the NFC communication link to implement resource information sharing. Here, the triggering condition for starting the NFC communication link to implement resource information sharing may specifically be an event that occurs by the receiving device.
资源标识封装单元502用于在检测单元501检测到上述触发条件后,将资源浏览应用所浏览的资源的资源标识作为负载信息封装到NFC数据包中。The resource identifier encapsulating unit 502 is configured to encapsulate the resource identifier of the resource browsed by the resource browsing application as load information into the NFC data packet after the detecting unit 501 detects the trigger condition.
NFC通信单元503用于将封装完成的NFC数据包发送至接收方设备,以使所述接收方设备根据该NFC数据包解析出所述资源标识,并利用所述资源标识获取资源。这里的资源标识可以是资源的URI。The NFC communication unit 503 is configured to send the encapsulated NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier. The resource identifier here can be the URI of the resource.
在实际中所共享的资源信息的资源类型不限于视频资源,在可替换的实施例中,共享的资源信息的资源还可以是图片、声音等多媒体资源,也可以是由Microsoft Office默认支持的文本文件、电子表格文件、幻灯片文件、小型数据库文件等,以及由记事本程序默认支持的纯文本文件。相应地,电子设备A启动能够打开的所需要分享的资源的应用进行浏览。在打开以播放时间为浏览进度的资源(比如视频、Flash动画、声音等),播放该资源属于对该资源的一种浏览;在打开以当前阅读页序数为浏览进度的资源(比如幻灯片文件、文本文件、PDF格式的文件等),逐页查看该资源属于对该资源的一种浏览;在打开以当前阅读行序数为浏览进度的资源(比如纯文本文件、电子表格文件等),逐行查看该资源属于对该资源的一种浏览;在打开以特殊内嵌对象为浏览进度的资源(比如单文件承载的小型数据库文件),查看或编辑内嵌对象中的内容属于对该资源的一种浏览。The resource type of the resource information that is shared in the actual is not limited to the video resource. In an alternative embodiment, the resource of the shared resource information may also be a multimedia resource such as a picture or a sound, or may be a text supported by Microsoft Office by default. Files, spreadsheet files, slide files, small database files, etc., as well as plain text files supported by the Notepad program by default. Accordingly, the electronic device A launches an application that can open the resources that need to be shared for browsing. When opening a resource (such as video, Flash animation, sound, etc.) with the playback time as the browsing progress, playing the resource belongs to a kind of browsing of the resource; opening the resource with the current reading page number as the browsing progress (such as a slide file) , text file, PDF file, etc.), page by page to view the resource belongs to a kind of browsing of the resource; open the resource with the current reading line number as the browsing progress (such as plain text file, spreadsheet file, etc.) Viewing the resource belongs to a kind of browsing of the resource; opening a resource with a special embedded object as the browsing progress (such as a small database file carried by a single file), viewing or editing the content in the embedded object belongs to the resource A kind of browsing.
通过上述的电子设备,可以实现通过NFC通信链路向接收方设备传送资源标识,使得接收方设备以该资源标识获取资源,由于资源标识是通过NFC通信链路传送的,不需要借助无线局域网来实现,而通过资源标识获取资源则不再需要与接收方设备加入同一个无线局域网中,为此降低了资源分享对网络环境的要求。Through the foregoing electronic device, the resource identifier can be transmitted to the receiver device through the NFC communication link, so that the receiver device acquires the resource by using the resource identifier. Since the resource identifier is transmitted through the NFC communication link, the wireless local area network is not needed. The resource is not required to be added to the same WLAN through the resource identifier. Therefore, the resource sharing requirement for the network environment is reduced.
此外,为了进一步能够共享发送方设备对于资源的浏览进度,在一个优选的实施例中,上述电子设备还包括进度信息封装单元504,用于将资源浏览应用所浏览的进度信息作为负载信息封装到NFC数据包中。In addition, in order to further share the browsing progress of the resource by the sender device, in a preferred embodiment, the electronic device further includes a progress information encapsulating unit 504, configured to encapsulate the progress information browsed by the resource browsing application as load information. In the NFC packet.
在一个优选的实施例中,资源表示封装单元502和进度信息封装单元504具体是将所述资源浏览应用所浏览的资源的资源标识和进度信息封装到同一个NFC数据包的负载信息中。In a preferred embodiment, the resource representation encapsulation unit 502 and the progress information encapsulating unit 504 specifically encapsulate the resource identification and progress information of the resource browsed by the resource browsing application into the load information of the same NFC data packet.
另外,不是每个资源浏览应用都支持资源标识共享,因此在一个可替换的实施例中,还包括资源标识存在识别单元,用于在检测单元501检测到触发条件后,判断当前的资源浏览应用是否提供了所浏览的资源的资源标识,只有当前的资源浏览应用提供了所浏览的资源的资源标识后,资源标识封装单元502才开始执行封装过程。In addition, not all the resource browsing applications support the resource identification sharing. Therefore, in an alternative embodiment, the resource identifier existence identifying unit is further configured to determine the current resource browsing application after the detecting unit 501 detects the triggering condition. Whether the resource identifier of the browsed resource is provided, and only after the current resource browsing application provides the resource identifier of the browsed resource, the resource identifier encapsulating unit 502 starts to perform the encapsulation process.
本申请实施例另一方面还提供一种电子设备,该电子设备作为资源共享的接收方设备,如图6所示,该电子设备包括资源标识提取单元601、应用匹配单元602和启动单元603。 Another aspect of the embodiment of the present application further provides an electronic device as a receiver device for resource sharing. As shown in FIG. 6, the electronic device includes a resource identifier extraction unit 601, an application matching unit 602, and a startup unit 603.
其中,资源标识提取单元601用于在接收到NFC数据包以后,从接收到的NFC数据包的负载信息中提取出资源标识。The resource identifier extraction unit 601 is configured to extract the resource identifier from the received load information of the NFC data packet after receiving the NFC data packet.
应用匹配单元602用于查找能够处理资源标识提取单元601提取出的资源标识的资源浏览应用。The application matching unit 602 is configured to search for a resource browsing application that can process the resource identifier extracted by the resource identifier extraction unit 601.
资源获取单元604,用于根据所述资源标识获取该资源标识所标识的资源。The resource obtaining unit 604 is configured to obtain, according to the resource identifier, the resource identified by the resource identifier.
启动单元603用于启动应用匹配单元602查找到的资源浏览应用,以对提取出的资源标识所标识的资源进行浏览。The initiating unit 603 is configured to start the resource browsing application found by the application matching unit 602 to browse the resources identified by the extracted resource identifier.
应用匹配单元602在进行查找过程中的匹配逻辑可以有很多种具体实现方式,例如作为资源标识的一种特例URI由协议头、主机名、端口和路径组成,应用匹配单元602可以从协议头开始逐级进行匹配,查找匹配的资源浏览应用。在一个优选的实施例中,应用匹配单元602包括:协议匹配单元,用于通过资源标识的协议头进行查找,得到能够处理该资源标识的资源浏览应用。The matching logic of the application matching unit 602 in the search process may have many specific implementation manners. For example, a special case URI as a resource identifier is composed of a protocol header, a host name, a port, and a path, and the application matching unit 602 may start from a protocol header. Matches step by step to find matching resource browsing applications. In a preferred embodiment, the application matching unit 602 includes: a protocol matching unit, configured to perform a lookup by using a protocol header of the resource identifier, to obtain a resource browsing application capable of processing the resource identifier.
另外,为了能够实现本实施例中的电子设备能够共享来自发送方设备的对资源的浏览进度信息,在一个优选的实施例中,发送方设备还在NFC数据包中封装有进度信息,此时本实施例中的电子设备还包括:进度信息提取单元,用于从接收到的NFC数据包中提取出进度信息。而启动单元在启动资源浏览应用后,该资源浏览应用从进度信息所标识的位置处开始浏览资源标识所标识的资源。In addition, in order to enable the electronic device in this embodiment to share the browsing progress information of the resource from the sender device, in a preferred embodiment, the sender device also encapsulates the progress information in the NFC data packet. The electronic device in this embodiment further includes: a progress information extracting unit, configured to extract progress information from the received NFC data packet. After the startup unit starts the resource browsing application, the resource browsing application starts browsing the resource identified by the resource identifier from the location identified by the progress information.
通过上述的电子设备,实现通过NFC通信链路获取发送方设备传送的资源标识,并以该资源标识获取资源,由于资源标识是通过NFC通信链路传送的,不需要借助无线局域网来实现,而通过资源标识获取资源则不再需要与发送方设备加入同一个无线局域网中,为此降低了资源分享对网络环境的要求。Obtaining, by using the foregoing electronic device, the resource identifier transmitted by the sender device through the NFC communication link, and acquiring the resource by using the resource identifier, because the resource identifier is transmitted through the NFC communication link, and does not need to be implemented by using a wireless local area network, and Obtaining resources through the resource identifier eliminates the need to join the same WLAN device with the sender device. This reduces the resource sharing requirements for the network environment.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相 类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements to a technology could clearly distinguish between hardware improvements (eg, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (for process flow improvements). However, as technology advances, many of today's method flow improvements can be seen as direct improvements in hardware circuit architecture. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented by hardware entity modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. The designer is self-programming to "integrate" a digital system onto a single PLD without requiring the chip manufacturer to design and fabricate a dedicated integrated circuit chip 2 . Moreover, today, instead of manually making integrated circuit chips, this type of programming is mostly implemented using "logic compiler" software, which is compatible with the software compiler used in programming development. Similarly, the original code to be compiled must also be written in a specific programming language. This is called the Hardware Description Language (HDL), and HDL is not the only one, but there are many kinds, such as ABEL. (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language) Etc. Currently, the most commonly used VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog2. It should also be apparent to those skilled in the art that the hardware flow for implementing the logic method flow can be easily obtained by simply programming the method flow into the integrated circuit with a few hardware description languages.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。The controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. In the form of logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。Those skilled in the art will also appreciate that in addition to implementing the controller in purely computer readable program code, the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding. The form of a microcontroller or the like to achieve the same function. Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component. Or even a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。The system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, the above devices are described separately by function into various units. Of course, the functions of each unit may be implemented in the same software or software and/or hardware when implementing the present application.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。该计算机软件产品可以包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。该计算机软件产品可以存储在内存 中,内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括短暂电脑可读媒体(transitory media),如调制的数据信号和载波。It will be apparent to those skilled in the art from the above description of the embodiments that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product. In a typical configuration, the computing device includes one or more processors (CPU ), input / output interface, network interface and memory. The computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments. The computer software product can be stored in the memory The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium. Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。This application can be used in a variety of general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor based systems, set-top boxes, programmable consumer electronics devices, network PCs, small computers, mainframe computers, including A distributed computing environment of any of the above systems or devices, and the like.
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The application can be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types. The present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
虽然通过实施例描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。 While the present invention has been described by the embodiments of the present invention, it will be understood by those skilled in the art

Claims (18)

  1. 一种设备间共享资源的方法,其特征在于,包括:A method for sharing resources between devices, comprising:
    在开启资源浏览应用对资源进行浏览的过程中,检测到启动进场通信NFC通信链路实现资源信息共享的触发条件;In the process of browsing the resource by the resource browsing application, detecting a trigger condition for starting the NFC communication link of the incoming communication to realize resource information sharing;
    将所述资源浏览应用所浏览的资源的资源标识作为负载信息封装到NFC数据包中;The resource identifier of the resource browsed by the resource browsing application is encapsulated into the NFC data packet as load information;
    将所述NFC数据包发送至接收方设备,以使所述接收方设备根据该NFC数据包解析出所述资源标识,并利用所述资源标识获取资源。And sending the NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    将所述资源浏览应用所浏览的进度信息作为负载信息封装到NFC数据包中。The progress information browsed by the resource browsing application is encapsulated into the NFC data package as load information.
  3. 根据权利要求2所述的方法,其特征在于,所述资源浏览应用所浏览的资源的资源标识、以及所浏览的进度信息被封装到同一个NFC数据包的负载信息中。The method according to claim 2, wherein the resource identifier of the resource browsed by the resource browsing application and the browsed progress information are encapsulated into load information of the same NFC data packet.
  4. 根据权利要求1所述的方法,其特征在于,所述启动NFC通信链路实现资源信息共享的触发条件包括:发生被接收方设备触碰的事件。The method according to claim 1, wherein the triggering condition for starting the NFC communication link to implement resource information sharing comprises: generating an event touched by the receiving device.
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:在检测到启动NFC通信链路实现资源信息共享的触发条件后,继续判断当前的资源浏览应用是否提供了所浏览的资源的资源标识。The method according to claim 1, wherein the method further comprises: after detecting that the triggering condition for starting the NFC communication link to implement resource information sharing, continuing to determine whether the current resource browsing application provides the browsed resource. Resource ID.
  6. 根据权利要求1所述的方法,其特征在于,所述资源标识为统一资源标识URI。The method according to claim 1, wherein the resource identifier is a uniform resource identifier URI.
  7. 一种设备间共享资源的方法,其特征在于,包括:A method for sharing resources between devices, comprising:
    在接收到NFC数据包以后,从所述NFC数据包的负载信息中提取出资源标识;After receiving the NFC data packet, extracting the resource identifier from the load information of the NFC data packet;
    查找能够处理所述提取出的资源标识的资源浏览应用;Finding a resource browsing application capable of processing the extracted resource identifier;
    根据所述资源标识获取该资源标识所标识的资源;Obtaining, according to the resource identifier, the resource identified by the resource identifier;
    利用所述资源浏览应用对所述资源标识所标识的资源进行浏览。The resource browsing application is used to browse the resource identified by the resource identifier.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, wherein the method further comprises:
    从所述NFC数据包中还提取出进度信息;Progress information is also extracted from the NFC data packet;
    在利用所述资源浏览应用对所述资源标识所标识的资源进行浏览时,从所述进度信息标识的位置处开始浏览。When browsing the resource identified by the resource identifier by using the resource browsing application, browsing starts from the location identified by the progress information.
  9. 根据权利要求7所述的方法,其特征在于,所述查找能够处理所述提取出的资源标识的资源浏览应用包括:The method according to claim 7, wherein the searching for the resource browsing application capable of processing the extracted resource identifier comprises:
    通过所述资源标识的协议头来进行查找,得到能够处理所述资源标识的资源浏览应用。The search is performed by the protocol header of the resource identifier, and a resource browsing application capable of processing the resource identifier is obtained.
  10. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    检测单元,用于在开启资源浏览应用对资源进行浏览的过程中,检测是否存在启动NFC 通信链路实现资源信息共享的触发条件;The detecting unit is configured to detect whether the NFC is started during the browsing of the resource by the resource browsing application. The triggering condition for the communication link to realize resource information sharing;
    资源标识封装单元,用于在所述检测单元监测到所述触发条件后,将所述资源浏览应用所浏览的资源的资源标识作为负载信息封装到NFC数据包中;a resource identifier encapsulating unit, configured to encapsulate the resource identifier of the resource browsed by the resource browsing application as load information into an NFC data packet after the detecting unit detects the triggering condition;
    NFC通信单元,用于将所述NFC数据包发送至接收方设备,以使所述接收方设备根据该NFC数据包解析出所述资源标识,并利用所述资源标识获取资源。And an NFC communication unit, configured to send the NFC data packet to the receiver device, so that the receiver device parses the resource identifier according to the NFC data packet, and acquires the resource by using the resource identifier.
  11. 根据权利要求10所述的电子设备,其特征在于,还包括:The electronic device according to claim 10, further comprising:
    进度信息封装单元,用于将所述资源浏览应用所浏览的进度信息作为负载信息封装到NFC数据包中。The progress information encapsulating unit is configured to encapsulate the progress information browsed by the resource browsing application as load information into the NFC data package.
  12. 根据权利要求11所述的电子设备,其特征在于,所述资源表示封装单元和进度信息封装单元具体是将所述资源浏览应用所浏览的资源的资源标识和进度信息封装到同一个NFC数据包的负载信息中。The electronic device according to claim 11, wherein the resource representation encapsulation unit and the progress information encapsulating unit specifically encapsulate the resource identifier and the progress information of the resource browsed by the resource browsing application into the same NFC data packet. Load information.
  13. 根据权利要求10所述的电子设备,其特征在于,所述启动NFC通信链路实现资源信息共享的触发条件包括:发生被接收方设备碰触的事件。The electronic device according to claim 10, wherein the triggering condition for starting the NFC communication link to implement resource information sharing comprises: generating an event that is touched by the receiving device.
  14. 根据权利要求10所述的电子设备,其特征在于,还包括:The electronic device according to claim 10, further comprising:
    资源标识存在识别单元,用于在所述检测单元检测到触发条件后,判断当前的资源浏览应用是否提供了所浏览的资源的资源标识。The resource identifier existence identifying unit is configured to determine, after the detecting unit detects the trigger condition, whether the current resource browsing application provides the resource identifier of the browsed resource.
  15. 根据权利要求10所述的电子设备,其特征在于,所述资源标识为URI。The electronic device of claim 10, wherein the resource identifier is a URI.
  16. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    资源标识提取单元,用于在接收到NFC数据包以后,从所述NFC数据包的负载信息中提取出资源标识;a resource identifier extracting unit, configured to extract a resource identifier from load information of the NFC data packet after receiving the NFC data packet;
    应用匹配单元,用于查找能够处理所述提取出的资源标识的资源浏览应用;An application matching unit, configured to search for a resource browsing application capable of processing the extracted resource identifier;
    资源获取单元,用于根据所述资源标识获取该资源标识所标识的资源;a resource obtaining unit, configured to acquire, according to the resource identifier, a resource identified by the resource identifier;
    启动单元,用于启动所述资源浏览应用,以对所述资源标识所标识的资源进行浏览。The initiating unit is configured to start the resource browsing application to browse the resource identified by the resource identifier.
  17. 根据权利要求16所述的电子设备,其特征在于,所述应用匹配单元包括:The electronic device according to claim 16, wherein the application matching unit comprises:
    协议匹配单元,用于通过所述资源标识的协议头进行查找,得到能够处理所述资源标识的资源浏览应用。The protocol matching unit is configured to perform a search by using a protocol header of the resource identifier, and obtain a resource browsing application capable of processing the resource identifier.
  18. 根据权利要求16所述的电子设备,其特征在于,还包括:The electronic device according to claim 16, further comprising:
    进度信息提取单元,用于从所述接收到的NFC数据包中提取出进度信息;a progress information extracting unit, configured to extract progress information from the received NFC data packet;
    所述启动单元具体用于启动所述资源浏览应用,以对所述资源标识所标识的资源进行浏览,并从所述进度信息标识的位置处开始浏览。 The initiating unit is specifically configured to start the resource browsing application, browse the resource identified by the resource identifier, and start browsing from the location identified by the progress information.
PCT/CN2015/089957 2014-09-29 2015-09-18 Method for sharing resources between devices and electronic device WO2016050143A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410513407.4 2014-09-29
CN201410513407.4A CN105530590A (en) 2014-09-29 2014-09-29 Method and electronic equipment for realizing resource sharing between equipment

Publications (1)

Publication Number Publication Date
WO2016050143A1 true WO2016050143A1 (en) 2016-04-07

Family

ID=55629420

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/089957 WO2016050143A1 (en) 2014-09-29 2015-09-18 Method for sharing resources between devices and electronic device

Country Status (2)

Country Link
CN (1) CN105530590A (en)
WO (1) WO2016050143A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968805A (en) * 2018-09-30 2020-04-07 上海掌门科技有限公司 Application sharing method and device and readable storage medium
CN113938479A (en) * 2021-10-09 2022-01-14 维沃移动通信有限公司 Resource sharing method and resource sharing device

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106210262A (en) * 2016-06-20 2016-12-07 北京小米移动软件有限公司 picture sharing method, device and mobile device
CN106211033A (en) * 2016-06-28 2016-12-07 北京小米移动软件有限公司 Data sharing method, device and electronic equipment
CN108108316B (en) * 2017-12-14 2023-08-11 珠海西格电力科技有限公司 Interface expansion method and system based on field programmable gate array
CN109407899A (en) * 2018-09-12 2019-03-01 北京星云城科技有限公司 A kind of desktop alternative projection system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080162141A1 (en) * 2006-12-28 2008-07-03 Lortz Victor B Voice interface to NFC applications
CN101843124A (en) * 2007-10-31 2010-09-22 摩托罗拉公司 Negotiation of a short range wireless communication parameters using configuration data received through RFID
CN102694849A (en) * 2012-05-14 2012-09-26 中国科学院计算机网络信息中心 IOT (Internet of Things) resource information acquiring method, terminal equipment and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546768A (en) * 2011-12-23 2012-07-04 深圳市同洲电子股份有限公司 Content sharing method, device and system
CN103036597B (en) * 2012-12-12 2015-05-27 华为终端有限公司 Method and device of sharing resources among devices in close range
CN103067403B (en) * 2013-01-10 2016-07-06 中兴通讯股份有限公司 A kind of business switch method, system and server
CN103607380A (en) * 2013-11-07 2014-02-26 深圳创维数字技术股份有限公司 Multi-screen interaction method, device thereof and system thereof
CN103686361B (en) * 2013-12-04 2018-11-30 康佳集团股份有限公司 Obtain method, system and the smart television of smart television sharing contents
CN103873692B (en) * 2014-03-21 2017-01-11 天脉聚源(北京)传媒科技有限公司 Method, device and system for resource sharing
CN103957218B (en) * 2014-05-14 2018-09-28 刘瑞雪 The method and system of shared media play

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080162141A1 (en) * 2006-12-28 2008-07-03 Lortz Victor B Voice interface to NFC applications
CN101843124A (en) * 2007-10-31 2010-09-22 摩托罗拉公司 Negotiation of a short range wireless communication parameters using configuration data received through RFID
CN102694849A (en) * 2012-05-14 2012-09-26 中国科学院计算机网络信息中心 IOT (Internet of Things) resource information acquiring method, terminal equipment and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968805A (en) * 2018-09-30 2020-04-07 上海掌门科技有限公司 Application sharing method and device and readable storage medium
CN113938479A (en) * 2021-10-09 2022-01-14 维沃移动通信有限公司 Resource sharing method and resource sharing device

Also Published As

Publication number Publication date
CN105530590A (en) 2016-04-27

Similar Documents

Publication Publication Date Title
WO2016050143A1 (en) Method for sharing resources between devices and electronic device
JP6114834B2 (en) Information presentation method, apparatus, program, and recording medium
US11864248B2 (en) Application function implementation method and electronic device
US10003633B2 (en) Method and device for resuming file download
CN107105001B (en) System for transferring status between electronic devices
US20220075518A1 (en) Fast Data Copying Method and Electronic Device
WO2017162043A1 (en) Access method, configuration method and apparatus used for inter-device service
US9600567B2 (en) Local context search results improvements
CN104980414B (en) File transmission method and terminal
US10135954B2 (en) Access dock device content on a remote client device wirelessly
CN112119623B (en) Method for sharing content based on account group and electronic device for executing the method
KR20150032152A (en) Method and apparatus for performing edit operations between electronic devices
WO2015096597A1 (en) Method and device for browsing document by multiple devices
WO2024037032A1 (en) Account login method and electronic device
EP2897053B1 (en) Device management method and apparatus
US20150200835A1 (en) Method for providing status messaging service in electronic device and the electronic device thereof
WO2015062234A1 (en) Mobile terminal resource processing method, device and apparatus
US8631125B2 (en) Network device and mobile device with state capture services
CN111868714A (en) Locating files using persistent and universal file identifiers
US20230216732A1 (en) Network Configuration Method and Device
JP7319431B2 (en) Application function implementation method and electronic device
US20150135092A1 (en) Apparatus and method for exchanging data
US20140085486A1 (en) Information processing terminal, information processing method, and apparatus control system
US11522870B2 (en) Method for URL analysis and electronic device thereof
CN107623753B (en) Information processing method and information processing apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15846436

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15846436

Country of ref document: EP

Kind code of ref document: A1