WO2017157176A1 - Resource distribution method and apparatus - Google Patents

Resource distribution method and apparatus Download PDF

Info

Publication number
WO2017157176A1
WO2017157176A1 PCT/CN2017/075452 CN2017075452W WO2017157176A1 WO 2017157176 A1 WO2017157176 A1 WO 2017157176A1 CN 2017075452 W CN2017075452 W CN 2017075452W WO 2017157176 A1 WO2017157176 A1 WO 2017157176A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
information
service discovery
distribution
module
Prior art date
Application number
PCT/CN2017/075452
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 WO2017157176A1 publication Critical patent/WO2017157176A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a resource distribution method and apparatus.
  • the Application Management Center is a client application installed on the terminal. It is responsible for storing and maintaining the application's file resources (such as the application installation package download address and other information) and meta information (such as the application name, version, etc.). ). The App Management Center lets you know the latest version of the applications available on your terminal and download the latest version of the application's installation package for installation. This application management model requires high service and storage capabilities.
  • This application management mode enables centralized management of applications, but on the one hand, in many scenarios, such as non-Wi-Fi environments, installations for large applications may not be fast, or even through cellular networks. However, the network resource overhead is large, resulting in a poor user experience. On the other hand, the application management mode can only be managed for the application, and the resource type is single, which cannot meet the needs of users for more resource distribution and sharing.
  • the embodiment of the present application provides a resource distribution method and device.
  • the service discovery information includes device information and resource information provided by the corresponding device
  • the resource distribution information is generated according to the received service discovery information, and the resource distribution information includes one or more resource information.
  • receiving the service discovery information includes: sending a query request message, where the query is requested
  • the request message includes the resource information of the request query; the query response message corresponding to the query request message is received, and the service response information is included in the query response message.
  • the query request message is sent according to the set multicast address, and the query response message is received in a unicast manner.
  • the method before sending the query request message, the method further includes: acquiring a current network state; and determining, according to the current network state, the resource requested to be queried in the current network state.
  • the receiving the service discovery information includes: receiving the notification message, where the service discovery information included in the notification message includes the notification message sender device information and the resource information provided by the device.
  • the receiving destination address is a notification message for setting a multicast address.
  • generating the resource distribution information according to the received service discovery information includes: performing distribution authority authentication on the resource information in the received service discovery information according to the resource distribution authority control policy; and if the authentication is passed, receiving the The resource information in the service discovery information is added to the resource distribution information.
  • performing the right authentication on the resource information in the received service discovery information according to the resource distribution authority control policy including: performing, according to the resource distribution authority control policy, the resource information in the received service discovery information, or one of the following or Any combination of judgments:
  • the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
  • generating the resource distribution information according to the received service discovery information includes: obtaining a current network state; determining, according to the current network state, whether the resource information included in the service discovery information is allowed to be distributed in the current network state, if not allowed And rejecting the addition of the resource information to the resource distribution information.
  • the method further includes: displaying the resource distribution information on a user interface.
  • the method further includes: deleting the timeout resource information in the resource distribution information according to the set period or time; and/or deleting the resource distribution according to the resource failure notification message when receiving the resource failure notification message Corresponding resource information in the information.
  • the method further includes: determining the selected resource information in the resource distribution information; and sending, according to the selected resource information, the requesting acquisition to the device providing the corresponding resource.
  • a resource acquisition request for the corresponding resource is generated according to the received service discovery information.
  • performing, according to the resource distribution authority control policy, performing distribution authority authentication on the selected resource information including: performing, according to the resource distribution authority control policy, one or any combination of the following for the selected resource information: the selected resource Whether the resource corresponding to the information is a resource that is allowed to be distributed; and whether the sender device of the selected resource information is allowed to request to acquire the resource provided by the device.
  • the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
  • the method further includes: receiving the resource that is sent by the device that provides the resource information according to the resource acquisition request.
  • the resource distribution information includes resource information obtained according to service information sent by at least one device.
  • the resource comprises one or more combinations of applications, services, and data.
  • the service discovery information includes a sender device identifier and resource information provided by the sender device.
  • the sending service discovery information includes: receiving a query request message, where the query request message includes resource information of the request query; and returning a query response message according to the query request message, where the query response message includes the service discovery information.
  • the query request message is received according to the set multicast address, and the query response message is returned in a unicast manner.
  • the query response message is returned according to the query request message, including: performing distribution authority authentication on the resource requested by the acquisition request message according to the resource distribution authority control policy; and returning the query if the authentication is passed Response message.
  • the distribution authority for the resource requested by the acquisition request message including one or any combination of the following:
  • the resource requested by the query request message is a resource that the query request message sender device allows access to.
  • the sending of the service discovery information includes: sending a notification message, where the service discovery information included in the notification message includes the notification message sender device information and resource information provided by the device.
  • the notification message is sent according to the set multicast address.
  • the method further includes: performing distribution authority authentication on the resource in the sender device according to the resource distribution authority control policy; and sending the notification message if the authentication is passed.
  • the distribution authority authentication is performed on the resources in the sender device according to the resource distribution authority control policy, including one or any combination of the following:
  • the method further includes: acquiring a current network state; and determining, according to the current network state, resource information that needs to be included in the notification message in the current network state.
  • the method further includes: receiving a resource acquisition request; and returning, to the resource acquisition request sender, the requested resource according to the resource acquisition request.
  • the method further includes: performing a distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy.
  • the distribution authority authentication is performed on the resource acquisition request according to the resource distribution authority control policy, including one or any combination of the following:
  • the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
  • the resource acquisition request carries a parameter
  • the resource that is requested to be sent by the resource acquisition request to the resource acquisition request according to the resource acquisition request includes: a resource and a request according to the resource acquisition request
  • the parameter is processed, and the resource acquisition request sender returns a processing result.
  • the resource comprises one or more combinations of applications, services, and data.
  • a service discovery module configured to receive service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
  • a distribution management module configured to generate resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
  • the service discovery module is specifically configured to: send a query request message, where the query request message includes resource information of the request query; and receive a query response message corresponding to the query request message, where the query response message includes Service discovery information.
  • the service discovery module is specifically configured to: send the query request message according to the set multicast address, and receive the query response message in a unicast manner.
  • the method further includes: a network state acquiring module, configured to acquire a current network state; the service discovery module is further configured to: obtain, according to the network state acquiring module, before acquiring the query request message The current network status determines the resources that are requested to be queried in the current network state.
  • a network state acquiring module configured to acquire a current network state
  • the service discovery module is further configured to: obtain, according to the network state acquiring module, before acquiring the query request message
  • the current network status determines the resources that are requested to be queried in the current network state.
  • the service discovery module is specifically configured to: receive a notification message, where the service discovery information included in the notification message includes the notification message sender device information and the device Prepare the resource information provided.
  • the service discovery module is specifically configured to: receive a notification message whose destination address is a set multicast address.
  • the method further includes: an authority control module, configured to: perform resource authorization authentication on the resource information in the received service discovery information according to the resource distribution authority control policy; the distribution management module is specifically configured to: And: if the authorization control module authenticates, the resource information in the received service discovery information is added to the resource distribution information.
  • an authority control module configured to: perform resource authorization authentication on the resource information in the received service discovery information according to the resource distribution authority control policy
  • the distribution management module is specifically configured to: And: if the authorization control module authenticates, the resource information in the received service discovery information is added to the resource distribution information.
  • the distribution management module is specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following on the resource information in the received service discovery information:
  • the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
  • the method further includes: a network state obtaining module; the network state acquiring module, configured to acquire a current network state; the distribution management module is specifically configured to: determine, according to the current network state acquired by the network state acquiring module, Whether the resource information included in the service discovery information is allowed to be distributed in the current network state, and if not allowed, the resource information is refused to be added to the resource distribution information.
  • a network state obtaining module configured to acquire a current network state
  • the distribution management module is specifically configured to: determine, according to the current network state acquired by the network state acquiring module, Whether the resource information included in the service discovery information is allowed to be distributed in the current network state, and if not allowed, the resource information is refused to be added to the resource distribution information.
  • the distribution management module is further configured to: display the resource distribution information on a user interface.
  • the distribution management module is further configured to: delete timeout resource information in the resource distribution information according to a set period or time; and/or, when receiving the resource failure notification message, according to the resource failure notification The message deletes the corresponding resource information in the resource distribution information.
  • the method further includes: a resource obtaining module, configured to: after the resource distribution information is generated according to the received service discovery information, determine the selected resource information in the resource distribution information; and provide the resource information according to the selected resource information
  • the device of the corresponding resource sends a resource acquisition request for requesting acquisition of the corresponding resource.
  • the method further includes: an authority control module; and the authority control module is configured to allocate resources according to resources Sending a permission control policy, performing distribution authority authentication on the selected resource information; the resource obtaining module is specifically configured to: if the authorization control module passes the authentication, send the device for providing the corresponding resource to request to obtain the corresponding Resource acquisition request for the resource.
  • the permission control module is specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following determinations on the selected resource information:
  • the resource corresponding to the selected resource information is a resource that is allowed to be distributed
  • the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
  • the resource obtaining module is further configured to: after sending a resource acquisition request for requesting acquisition of a corresponding resource to the device that provides the resource information, receiving a resource that is sent by the device that provides the resource information according to the resource acquisition request.
  • the resource distribution information includes resource information obtained according to service information sent by at least one device.
  • the resource comprises one or more combinations of applications, services, and data.
  • a generating module configured to generate service discovery information according to resources that the sending device can provide
  • the service discovery module is configured to send the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
  • the service discovery module is specifically configured to: receive a query request message, where the query request message includes resource information of the request query; and return a query response message according to the query request message, where the query response message includes the Service discovery information.
  • the service discovery module is specifically configured to: receive the query request message according to the set multicast address, and return the query response message in a unicast manner.
  • the method further includes: a rights control module; the rights control module, configured to The distribution authority control policy is configured to perform the distribution authority authentication on the resource that is requested by the acquisition request message; the service discovery module is specifically configured to: if the authorization control module passes the authentication, return the query response message.
  • a rights control module configured to The distribution authority control policy is configured to perform the distribution authority authentication on the resource that is requested by the acquisition request message; the service discovery module is specifically configured to: if the authorization control module passes the authentication, return the query response message.
  • the permission control module is specifically configured to: perform one or any combination of the following determinations when performing resource authorization authentication on the resource requested by the acquisition request message according to the resource distribution authority control policy:
  • the resource requested by the query request message is a resource that the query request message sender device allows access to.
  • the service discovery module is specifically configured to: send a notification message, where the service discovery information included in the notification message includes the notification message sender device information and resource information provided by the device.
  • the service discovery module is specifically configured to: send the notification message according to a set multicast address.
  • the method further includes: an authority control module, configured to: before the sending the notification message, perform a distribution authority authentication on the resource in the sender device according to the resource distribution authority control policy; the service discovery module further And configured to: if the authorization control module authenticates, pass the notification message.
  • an authority control module configured to: before the sending the notification message, perform a distribution authority authentication on the resource in the sender device according to the resource distribution authority control policy
  • the service discovery module further And configured to: if the authorization control module authenticates, pass the notification message.
  • the privilege control module is specifically configured to perform one or any combination of the following when determining the distribution authority of the resource in the sender device according to the resource distribution authority control policy: whether the device allows the resource distribution service to be provided; Resources that the device allows or does not allow distribution.
  • the method further includes: a network state acquiring module, configured to acquire a current network state; the service discovery module is further configured to: obtain, according to the network state acquiring module, before acquiring the notification message The current network status determines the resource information that needs to be included in the notification message in the current network state.
  • a network state acquiring module configured to acquire a current network state
  • the service discovery module is further configured to: obtain, according to the network state acquiring module, before acquiring the notification message
  • the current network status determines the resource information that needs to be included in the notification message in the current network state.
  • the method further includes: a resource providing module, configured to receive a resource acquisition request, and return, according to the resource acquisition request, the resource that is requested by the sender to the resource that is requested to be acquired.
  • a resource providing module configured to receive a resource acquisition request, and return, according to the resource acquisition request, the resource that is requested by the sender to the resource that is requested to be acquired.
  • the privilege control module is configured to: perform the privilege authentication on the resource acquisition request according to the resource distribution privilege control policy; the resource providing module is further configured to: acquire according to the resource Requesting the resource acquisition request sender to return the requested resource before instructing the rights control module to perform authentication.
  • the permission control module is specifically configured to: perform one or any combination of the following determinations when performing the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy:
  • the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
  • the resource acquisition request carries a parameter
  • the resource providing module is specifically configured to: process, according to the resource requested by the resource acquisition request, and the parameter, and send the processing result to the resource acquisition request sender.
  • the resource comprises one or more combinations of applications, services, and data.
  • a memory for storing computer program instructions
  • a processor coupled to the memory for reading computer program instructions stored by the memory and, in response, performing the following operations:
  • the service discovery information includes device information and resource information provided by the corresponding device
  • the resource distribution information is generated according to the received service discovery information, and the resource distribution information includes one or more resource information.
  • a memory for storing computer program instructions
  • a processor coupled to the memory for reading the computer program of the memory storage Command, and in response, do the following:
  • the service discovery information includes a sender device identifier and resource information provided by the sender device.
  • one device may receive service discovery information sent by other devices, and may generate resource distribution information according to the resource information included in the received service discovery information.
  • a device can receive service discovery information sent by multiple other devices, so that resource distribution information can be generated according to service information sent by multiple other devices, so that resource information provided by multiple devices can be obtained, and then, as needed, The required resources are obtained from different devices.
  • the embodiment of the present application can perform resource distribution based on the service discovery process, and avoids problems caused by resource distribution through the cellular network.
  • FIG. 1 is a schematic diagram of a service discovery process provided by an embodiment of the present application
  • FIG. 2 is a second schematic diagram of a service discovery process according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a resource distribution process according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a resource distribution list user interface provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a resource distribution apparatus according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a resource distribution apparatus according to another embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a terminal according to another embodiment of the present disclosure.
  • the embodiment of the present application provides a solution for resource distribution based on a service discovery technology.
  • the “resource” in this embodiment includes one or more combinations of applications, services, and data.
  • the “resource” may be an installation package of an application, and may be a static service (such as a photo service, specifically, providing image data for shooting), or It is a dynamic service (such as real-time video surveillance service, which can provide real-time video surveillance data captured by a camera).
  • Page is an abstraction of local and remote services, that is, the basic unit of services. By encapsulating data and methods, various services can be provided.
  • a service scene can include multiple Pages.
  • a Page can be a UI (user interface), a photo or other service, or a background service, such as account authentication.
  • the running state Page is called the Page instance. It is the running carrier of the local service or the remote service. It can be created, scheduled, and managed by the DPMS (Dynamic Page Manager Service).
  • the DPMS can maintain the life cycle of the Page instance.
  • PageLink is an information entity that flows between Pages and can pass information between Pages, such as events and/or data.
  • the specific data can be transferred using the set API (Application Programming Interface).
  • the resource may be identified by using an identifier, which may be a URI (Uniform Resource Identifier).
  • a URI Uniform Resource Identifier
  • a URI can be understood as an address link by which a corresponding resource can be uniquely determined.
  • the resource may also have other attributes, such as a domain to which the resource belongs, a resource type, a resource name, and the like.
  • a device may obtain related information of resources provided by other devices based on a service discovery process. Specifically, a device may obtain information about resources provided by other devices in the local network in which the device is located in the following manner. For example, the device A obtains the information about the resources provided by the device B.
  • the specific implementation process of the first mode and the second mode is as follows:
  • the process of the first method may include:
  • Step 101 Device A sends a query request message. Specifically, the device A may send a query request message after accessing the network (such as a wireless local area network), or may send a query request message according to a set period, where the set period may be set according to requirements, for example, may be seconds. cycle.
  • the network such as a wireless local area network
  • the query request message may include information about the device A, such as the address or identifier of the device A, and may also include the type information of the device A.
  • the device A may send the query request message according to the configured transmit power, so as to discover a device capable of providing resources within the signal coverage range that is compatible with the transmit power.
  • the sending power of the query request message of device A can be configured as required. The larger the sending power is, the larger the query range is, but the power consumption of device A is also larger.
  • device A may send the query request message in a multicast manner, such as multicast or broadcast.
  • the multicast address may be preset, and the port may further be set, and the device A may use the multicast address and the port to send a query request message (ie, the multicast address is used as the destination address, and the port is sent as the destination port.
  • Query request message other devices (such as device B) can listen to the multicast address and port to receive a query request message whose destination address is the multicast address.
  • Step 102 After receiving the query request message sent by the device A, if the device B can provide the resource information, the device B generates the service discovery information according to the resources that the device can provide, and returns a query response message to the device A, where the query response message is sent.
  • the service discovery information includes the information of the device B (such as the address or identifier of the device B, and may also include the type information of the device B) and the resource information provided by the device B (such as the resource type and the resource). One or a combination of information such as identifiers).
  • the service discovery information may be in the form of PageLink, or the resource information included in the service discovery information may be in the form of PageLink.
  • device B may return a query response message to device A in a unicast manner.
  • the query request message sent by the device A in step 101 may further include resource information (such as one or a combination of resource type, resource identifier, and the like) requested by the device A;
  • resource information such as one or a combination of resource type, resource identifier, and the like
  • the device B if the device B can provide the resource requested by the device A, the device B returns a query response message to the device A.
  • device A can determine the resources of the requested query in various ways.
  • device A determines all or part of the applications in these applications as resources that need to be queried according to the application installed thereon, so that it can query these application resources (such as application upgrade packages) near device A. device of.
  • device A may carry information about the video resource (such as the address of the camera or the video) in the query request message.
  • the name of the service so that the device capable of providing the video monitoring service near the device A can be queried.
  • the embodiment of the present application allows the user to set the resource for requesting the query as needed.
  • device A may send an "ssdp:discover" message to the SSDP (Simple Service Discovery Protocol) port of a specific multicast address using the M-SEARCH method.
  • SSDP Simple Service Discovery Protocol
  • device B listens to the "ssdp:discover" message sent by device A on the multicast address, device B analyzes the resource requested by device A. If device B itself can provide the resource requested by device A, device B Respond to device A's "ssdp:discover" message in unicast mode.
  • the resource distribution rights control policy can be configured on the device B.
  • the resource distribution authority control policy may specify one or any combination of the following:
  • Device B allows or disallows the provision of resources for the distribution service, for example, may specify that device B allows or disallows resources for which domains to provide resource distribution services; for example, may specify which types are allowed or not allowed for device B
  • the resource provides a resource distribution service; for example, it may be specified that the device B allows or disallows resources for which URIs to provide a resource distribution service.
  • the device B may determine whether to respond to the query request of the device A according to the resource distribution right control policy. For example, according to the resource distribution authority control policy, when the resource for querying the query request message is authenticated, the one or any combination of the following is determined:
  • the resource requested to be queried is a resource that the query request message sender device allows access to.
  • device A can obtain the current network status, according to the current network.
  • the network status determines the resource requesting the query in the current network state, and further generates a query request message according to the determined resource of the request query.
  • resource query is allowed; for example, if the current network status is Wi-Fi network status and the network performance is good (network performance evaluation can be performed through various network performance parameters) ), allows the query of the dynamic service type resources, otherwise, the dynamic service type resources are not allowed to query.
  • the process of the second method may include:
  • Step 201 The device B generates the service discovery information according to the resources that the device can provide, and sends a notification message, where the notification message may include the service discovery information, where the service discovery information may include the information of the device B (such as the identifier of the device B). One or a combination of information such as types, and related information of resources provided by device B (such as one or a combination of resource type, resource identifier, etc.).
  • the device B may send a notification message after accessing the network, or may send a notification message according to a set period, where the setting period may be set according to requirements, such as a period of a second level.
  • the service discovery information may be in the form of PageLink, or the resource information included in the service discovery information may be in the form of PageLink.
  • the device B may send the notification message according to the configured sending power, so that other devices in the signal coverage area compatible with the sending power can discover the device B.
  • the sending power of the notification message of the device B can be configured as needed. The larger the transmission power, the larger the notification range, but the power consumption of the device B is also larger.
  • device B may send the notification message in a multicast manner, such as multicast or broadcast.
  • the multicast address may be set in advance, and the port may be further set.
  • the device B may use the multicast address as the destination address, and send the notification message as the destination port.
  • Other devices (such as device A) may The broadcast address and port are monitored to receive a notification message whose destination address is the multicast address.
  • the device B may obtain a current network state, determine, according to the current network state, resource information that needs to be included in the notification message in the current network state, and further generate a notification according to the determined resource. Message.
  • the current network status is a Wi-Fi network connection
  • resource information notification is allowed; for example, if the current network is The status of the Wi-Fi network is good and the network performance is good (the network performance can be evaluated through various network performance parameters), which allows the notification of the resource information of the dynamic service type. Otherwise, the dynamic service type resource is not allowed to be notified.
  • Step 202 After receiving the notification message sent by the device B, the device A obtains the resource information that the device B can provide according to the message.
  • device B sends a "ssdp:alive" message to the SSDP port of a particular multicast address using the NOTIFY method.
  • Device A can listen to the SSDP port of the multicast address and can process the monitored message according to its own policy.
  • the resource distribution authority control policy can be configured on the device B.
  • the resource distribution authority control policy may specify that the device B allows or disallows the resources for providing the distribution service, for example, may specify that the device B allows or disallows resources for which domains to provide resource distribution services; for example, It is specified that the device B allows or disallows for which types of resources to provide resource distribution services; for example, it may be specified that the device B allows or disallows resources for which URIs to provide resource distribution services.
  • the device B may determine which resource information is carried in the notification message according to the resource distribution authority control policy. Specifically, when the device B performs the right to authenticate the resources in the device according to the resource distribution authority control policy, the device B may perform one or any combination of the following determinations:
  • the first mode or the second mode may follow a service discovery protocol, such as the mDNS protocol.
  • the foregoing mode 1 and mode 2 may be used independently or in combination.
  • An example of cooperation may be: device A may send a query request message to discover a device that can provide a resource distribution service nearby, and may also send a notification message to notify nearby. The device that the device A can provide.
  • FIG. 3 is a schematic diagram of a resource distribution process according to an embodiment of the present application. For the sake of clarity, the process is described below with device A as the execution body.
  • the process can include the following steps:
  • Step 301 The device A receives service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device.
  • the device A may receive the service discovery information sent by the other device based on the service discovery process.
  • the resource information provided by the other device may be obtained in the manner shown in FIG. 1 or FIG. 2, and is not repeated here.
  • Step 302 The device A generates resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
  • the data structure of the resource distribution information may adopt a list, that is, the device A generates a resource distribution list according to the received service discovery information, and the list includes one or more resource information.
  • resource distribution information can also adopt other data structures.
  • the following process uses "resource distribution information" as a “resource distribution list” as an example for description.
  • the device A may add the resource information contained therein to the resource distribution list after receiving the service discovery information.
  • the same resource may already be queried in the resource distribution list before the addition. The information, if it already exists, will not be added again.
  • the device A may be configured with a resource distribution authority control policy, and the device A may perform the distribution authority authentication on the resource information in the received service discovery information according to the resource distribution authority control policy, and if the authentication is passed, the device will receive The resource information in the service discovery information is added to the resource distribution list, and if the authentication fails, the resource information is not added to the resource distribution list. This ensures that the resource information in the resource distribution list has access to device A.
  • the resource distribution right control policy set on the device A may define one or any combination of the following:
  • the policy may be embodied as a resource list, and the resource list includes one or more resource information, and the resource corresponding to the resource information is allowed or not allowed to be distributed by the device A.
  • the resource information in the resource list may specifically include one or more of a resource type, a resource identifier, and a domain to which the resource belongs.
  • the policy may also be expressed as a conditional expression, such as a resource including a wildcard. Identifier expression, The resource corresponding to the resource identifier matching the expression is allowed or not allowed to be distributed by the device A;
  • the policy may be embodied as a device list, where the device list includes one or more device information, and the resource information provided by the device corresponding to the device information is allowed or not allowed to be Device A accepts and distributes.
  • the device information in the device list may include one or more of the device type, the device identifier, and the device address.
  • the policy may also be expressed as a conditional expression, such as a device IP address expression including a wildcard. The device corresponding to the IP address matching the expression, the resource information provided by it allows or is not allowed to be accepted and distributed by the device A.
  • the device A performing the rights authentication on the resource information in the received service discovery information according to the resource distribution authority control policy may include performing one or any combination of the following:
  • the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed. In actual implementation, for each application, you can configure which resources can be distributed externally and which resources are not allowed to be distributed.
  • the device A may obtain the current network status, and determine, according to the current network status, whether the resource information included in the received service discovery information is allowed to be distributed in the current network state, if not allowed, The resource information is refused to be added to the resource distribution list; if allowed, the resource information may be added to the resource distribution list or further combined with other policies for judgment.
  • the current network status is a Wi-Fi network connection
  • resource distribution is allowed; for example, if the current network status is a Wi-Fi network status and the network performance is good (network performance evaluation can be performed through various network performance parameters) ), allowing resources of the dynamic service type to be distributed; otherwise, resources of the dynamic service type are not allowed to be distributed.
  • One or more resource information may be included in the “resource distribution list” in the above process, and the resource information may be from multiple devices. This is because the device A can receive the service discovery information sent by other devices in a certain range (for example, the service discovery process provided by the foregoing mode 1 or mode 2), so the device A can obtain the resource information provided by the different devices.
  • device A may process the resource information, add the processed resource information to the resource distribution list, and distribute the resource distribution column.
  • the relevant content of the table is displayed in the user interface.
  • the processing of the resource information may include, but is not limited to, one or any combination of the following operations:
  • the aggregation operation that is, the aggregation of the same resource information provided by different devices, can be aggregated into one resource information, that is, added as an entry to the resource distribution list, or as a resource distribution list added by different entries. In this way, resources distributed externally can be aggregated to form a service view.
  • the content of one of the foregoing resource distribution lists may specifically include one or any combination of the following:
  • the resource information may specifically include a resource identifier, and further, may also include one or any combination of the following: a resource type, a domain to which the resource belongs, a resource name, and resource description information (for example, for description The content of the services provided, etc.).
  • a resource type for example, for description The content of the services provided, etc.
  • the above is only an example, and other information may not be excluded.
  • the resource type can be divided from different angles according to needs.
  • the resource type may include: an application, a service, and of course, further subdivided on the basis of the application, such as an application including a system application, a game, a gadget, and the like;
  • the device information may specifically include device identification and/or address information, and further, may also include one or any combination of the following: device type, device model, device description information, and the like;
  • a validity identifier that identifies the validity of the corresponding resource. This information is optional.
  • FIG. 4 exemplarily shows a resource distribution list presented in a user interface, in which four entries are shown, each of which includes the following contents: resource description (including resource name and resource type), resource provisioning Party device description.
  • the device A in order to improve the availability of a resource distribution list, in view of the fact that the device may stop or unload from the network without notification, in some preferred embodiments, the device A can read the resource distribution list for maintenance to ensure the validity of the resource information in the resource distribution list. Specifically, the device A may maintain the resource distribution list in one or any combination of the following manners:
  • Manner A records the creation or update time of each entry in the resource distribution list or maintains a timer, and may distribute the resource to the resource according to the creation time of the entry or the corresponding timer according to the set period or time. The entry in the timeout is deleted. If the device A receives the service discovery information sent by the device B, and the resource information provided by the device B is already found in the resource distribution list, the device A may not repeatedly add the resource information, but may update the resource information. Create time or update time or reset the timer corresponding to the resource information;
  • Mode B After receiving the resource failure notification message sent by another device (such as device B), the device A queries the resource information provided by the device B in the resource list according to the notification message, and deletes the queried entry.
  • the resource failure notification message may include: stopping the notification message of providing the resource (in this case, the resource failure notification message may be used to indicate deletion of the resource information that has been discontinued), and exiting the notification message of the network (in this case, The resource failure notification message may be used to indicate one or a combination of messages such as deleting the resource information provided by the device B, disconnecting the notification message of the connection with the device A, and the like.
  • step 302 in the foregoing process shown in FIG. 3 the following steps 303 to 305 may be further included:
  • Step 303 The device A determines the selected resource information in the resource distribution list.
  • device A can display a resource distribution list on the user interface for the user to select.
  • the user can select a resource in the resource distribution list displayed by the user interface through a screen operation or a button operation, and submit a resource acquisition request, and the device A can determine the resource information selected by the user according to the resource acquisition request submitted by the user.
  • Step 304 The device A sends a resource acquisition request for requesting acquisition of the corresponding resource to the device that provides the corresponding resource according to the selected resource information.
  • the device A can send the resource acquisition request message to the device that provides the corresponding resource according to the selected resource information.
  • the resource acquisition request message may include the resource information requested to be acquired, such as one of a resource identifier, a resource type, a domain to which the resource belongs, and a resource name, or any combination thereof.
  • the device A is provided with a resource distribution authority control policy.
  • the device A may select the selected resource according to the resource distribution authority control policy. The information is used for the authentication of the distribution authority. If the authentication is passed, the resource acquisition request for requesting the acquisition of the corresponding resource is sent to the device providing the corresponding resource.
  • the resource distribution permission control policy set on the device A may define one or any combination of the following:
  • the policy may be embodied as a resource list, and the resource list includes one or more resource information, and the resource corresponding to the resource information is allowed or not allowed to be distributed by the device A.
  • the resource information in the resource list may specifically include one or more of a resource type, a resource identifier, and a domain to which the resource belongs.
  • the policy may also be expressed as a conditional expression, such as a resource including a wildcard. An identifier expression, a resource corresponding to the resource identifier matching the expression is allowed or not allowed to be distributed by the device A;
  • the policy may be embodied as a device list, where the device list includes one or more device information, and the resource information provided by the device corresponding to the device information is allowed or not allowed to be Device A is distributed, that is, device A has the right or no right to request the resources provided by these devices.
  • the device information in the device list may include one or more of the device type, the device identifier, and the device address.
  • the policy may also be expressed as a conditional expression, such as a device IP address expression including a wildcard. The device corresponding to the IP address matching the expression, the resource information provided by it is allowed or not allowed to be distributed by the device A.
  • the device A performing the rights authentication on the resource information in the received service discovery information according to the resource distribution authority control policy may include performing one or any combination of the following:
  • the resource corresponding to the resource information (such as the selected resource information) included in the service discovery information is a resource that is allowed to be distributed;
  • Step 305 After receiving the resource acquisition request sent by the device A, the device B acquires the requested resource according to the resource acquisition request, and sends the requested resource to the device A.
  • the device A sends the installation package of the application to the device A; for example, if the resource acquisition request is used to request to obtain a shooting service of a certain camera. Then, the device B transmits the video data captured by the camera to the device A, wherein since the camera shooting process is continuous, the device B can continuously transmit the data captured by the camera to the device A until the service is terminated.
  • the device B before transmitting the resource to the device A, can establish a connection with the device A, and then the device B can send the resource to the device A through the connection, and the connection can be independent of the cellular network, for example, a point-to-point connection can be established.
  • the connection can be independent of the cellular network, for example, a point-to-point connection can be established.
  • the device B may first perform the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy. If the authentication is passed, the requested resource is returned to the device A. Otherwise, the resource acquisition request is not responded, and the resource acquisition failure information may be further returned.
  • the device B may perform one or any combination of the following when determining the distribution authority for the resource acquisition request according to the resource distribution authority control policy:
  • the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
  • the resource acquisition request message sent by the device A may carry parameters, such as when the device A requests to acquire the resource type is a service type, such as a payment service, the parameter may be a user payment.
  • the information of the account preferably, after receiving the resource acquisition request message, the device B may process the resource according to the requested resource and the parameter, and return the processing result to the device A, for example, using the user payment account information. Pay online and return the payment result to Device A.
  • the device A may first perform an integrity check. If the integrity check fails, the device abandons the resource. If the integrity check passes, the device can receive the integrity check. The resource.
  • the integrity check may be performed by using a CRC (Cyclic Redundancy Check) or an MD5 check algorithm. The present invention does not limit this.
  • the device A may perform a security check. If the security check passes, the resource may be presented to the user or processed, otherwise the received resource is discarded. .
  • each resource may carry a signature, so that the security check may be performed according to the signature of the resource; on the other hand, the device A may also perform a general packet scan to check whether there is a suspected threat content. Further, after the suspected security risk is found in the security check, the device A may pop up a window on the screen, and the reminder information is displayed in the window, and the user may be further asked whether to allow the current resource distribution operation.
  • a device may receive service discovery information sent by other devices, and may generate a resource distribution list according to the resource information included in the received service discovery information.
  • a device can receive service discovery information sent by multiple other devices, so that a resource distribution list can be generated according to service information sent by multiple other devices, so that resource information provided by multiple devices can be obtained, and then, as needed, The required resources are obtained from different devices.
  • the embodiment of the present application can perform resource distribution based on the service discovery process, and avoids problems caused by resource distribution through the cellular network.
  • Embodiments can aggregate various types of resources for distribution and access, and can improve user experience and meet user needs as compared with single type of resource distribution and access.
  • the information exchanged between the devices may adopt the PageLink method.
  • the embodiment of the present application provides a resource distribution device, which can implement the resource distribution process provided by the foregoing embodiment. .
  • the apparatus may include: a service discovery module 51, a distribution management module 52, and further, an access control module 53, a network state acquisition module 54, and resources. Obtain one or more of the modules 55, wherein:
  • the service discovery module 51 is configured to receive service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
  • the distribution management module 52 is configured to generate resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
  • the service discovery module 51 is specifically configured to: send a query request message, where the query request message includes resource information of the request query; and receive a query response message corresponding to the query request message, where the query response message includes Service discovery information.
  • the service discovery module 51 may send the query request message according to the set multicast address, and receive the query response message in a unicast manner.
  • the network state obtaining module 54 can be configured to obtain the current network state. Accordingly, the service discovery module 51 can be configured to determine the current network state according to the current network state acquired by the network state acquiring module 54 before sending the query request message. The resource that requested the query.
  • the service discovery module 51 is specifically configured to: receive a notification message, where the service discovery information included in the notification message includes the notification message sender device information and the device provides Resource information.
  • the service discovery module 51 can receive the notification message whose destination address is the set multicast address.
  • the privilege control module 53 is configured to perform the privilege authentication on the resource information in the received service discovery information according to the resource distribution privilege control policy.
  • the distribution management module 52 may be specifically configured to: if the privilege control module 53 After the authentication is passed, the resource information in the received service discovery information is added to the resource distribution information.
  • the distribution management module 52 may be specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following on the resource information in the received service discovery information:
  • the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
  • the distribution management module 52 is specifically configured to: determine, according to the current network state acquired by the network state acquiring module 54, whether the resource information included in the service discovery information is allowed to be distributed in the current network state, if not allowed, The resource information is refused to be added to the resource distribution information.
  • the distribution management module 52 is further configured to display the resource distribution information on the user interface.
  • the distribution management module 52 is further configured to: delete timeout resource information in the resource distribution information according to a set period or time; and/or, according to the resource failure notification message, when receiving the resource failure notification message The corresponding resource information in the resource distribution information is deleted.
  • the resource obtaining module 55 is configured to: after the resource distribution information is generated according to the received service discovery information, determine the selected resource information in the resource distribution information; and provide the corresponding resource according to the selected resource information.
  • the device sends a resource acquisition request for requesting to acquire the corresponding resource.
  • the privilege control module 53 can be configured to perform the privilege authentication on the selected resource information according to the resource distribution privilege control policy. Accordingly, the resource obtaining module 55 can be specifically configured to: if the privilege control module 53 passes the authentication, The device providing the corresponding resource sends a resource acquisition request for requesting acquisition of the corresponding resource.
  • the rights control module 53 is specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following determinations on the selected resource information:
  • the resource corresponding to the selected resource information is a resource that is allowed to be distributed
  • the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
  • the resource obtaining module 55 is further configured to: after sending the resource acquisition request for requesting acquisition of the corresponding resource to the device that provides the resource information, receive the resource that is sent by the device that provides the resource information according to the resource acquisition request.
  • the resource distribution information includes resource information obtained according to service information sent by at least one device.
  • the resource comprises one or more combinations of applications, services, and data.
  • the embodiment of the present application provides a resource distribution device, which can implement the resource distribution process provided by the foregoing embodiment.
  • FIG. 6 is a schematic structural diagram of a resource distribution apparatus according to an embodiment of the present disclosure.
  • the apparatus may include: a generating module 61 and a service discovery module 62. Further, the method may further include: a rights control module 63, a resource providing module 64, and a network.
  • One or more of the state acquisition modules 65 wherein:
  • the generating module 61 is configured to generate service discovery information according to resources that the sender device can provide;
  • the service discovery module 62 is configured to send the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
  • the service discovery module 62 is specifically configured to: receive a query request message, where the query request message includes resource information of the request query; and return a query response message according to the query request message, where the query response message includes the Service discovery information.
  • the service discovery module 62 is specifically configured to: receive the query request message according to the set multicast address, and return the query response message in a unicast manner.
  • the privilege control module 63 is configured to: perform the privilege authentication on the resource that is requested by the queried request message according to the resource distribution privilege control policy; and correspondingly, the privilege control module 62 is specifically configured to: if the privilege control module 63 When the right passes, the query response message is returned.
  • the permission control module 63 may be specifically configured to perform one or any combination of the following determinations when performing the distribution authority authentication on the resource requested by the acquisition request message according to the resource distribution authority control policy:
  • the resource requested by the query request message is a resource that the query request message sender device allows access to.
  • the service discovery module 62 is specifically configured to: send a notification message, where the service discovery information included in the notification message includes the notification message sender device information and resource information provided by the device.
  • the service discovery module 62 is specifically configured to: send the notification message according to the set multicast address.
  • the privilege control module 63 is configured to: before the sending the notification message, perform the privilege authentication on the resource that is requested by the queried request message according to the resource distribution privilege control policy; accordingly, the service discovery module 62 is further configured to: Before the notification message is sent, if the authorization control module 63 passes the authentication, the notification message is sent.
  • the permission control module 63 is specifically configured to perform one or any combination of the following determinations when performing resource authorization authentication on the resources in the sender device according to the resource distribution authority control policy:
  • the network state obtaining module 65 can obtain the current network state; correspondingly, the service discovery module 62 can be further configured to determine, according to the current network state acquired by the network state acquiring module 65, before the notification message is sent, in the current network state. The resource information contained in the notification message is required.
  • the resource providing module 64 is configured to receive a resource acquisition request, and return the requested resource to the resource acquisition request sender according to the resource acquisition request.
  • the resource providing module 64 is further configured to: before the resource acquisition request returns the requested resource to the resource acquisition request, instruct the permission control module 63 to obtain the resource acquisition request according to the resource distribution authority control policy. Perform distribution authority authentication.
  • the permission control module 63 is specifically configured to perform one or any combination of the following determinations when performing the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy:
  • the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
  • the resource acquisition request carries a parameter
  • the resource providing module 64 may be specifically configured to: process, according to the resource requested by the resource acquisition request, and the parameter, and send the processing result to the resource acquisition request sender. .
  • the resource comprises one or more combinations of applications, services, and data.
  • the embodiment of the present application further provides a device, and the device can implement the resource distribution described in the foregoing process.
  • FIG. 7 is a schematic structural diagram of a device according to an embodiment of the present application.
  • the device may generally include a processor 701, a memory 702, and a display 703.
  • the processor 701 can be a general purpose processor (such as a microprocessor or any conventional processor, etc.), a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic. Devices, discrete hardware components.
  • Memory 702 may specifically include internal memory and/or external memory, such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like, which are well established in the art.
  • Display 703 can include touch screen control circuitry.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 701 and various circuits of memory represented by memory 702.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides an interface.
  • the processor 701 is responsible for managing the bus architecture and general processing, and the memory 702 can store data used by the processor 701 in performing operations.
  • each step of the picture search process may be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the processor 701 is coupled to the memory 702 for reading computer program instructions stored by the memory 702 and, in response, performing the following operations:
  • the service discovery information includes device information and resource information provided by the corresponding device
  • Generating resource distribution information according to the received service discovery information, in the resource distribution information includes one or more resource information.
  • the embodiment of the present application further provides a device, and the device can implement the resource distribution described in the foregoing process.
  • FIG. 8 is a schematic structural diagram of a device according to an embodiment of the present application.
  • the device may generally include a processor 801, a memory 802, and a display 803.
  • the processor 801 can be a general purpose processor (such as a microprocessor or any conventional processor, etc.), a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic. Devices, discrete hardware components.
  • Memory 802 may specifically include internal memory and/or external memory, such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like, which are well established in the art.
  • Display 803 can include touch screen control circuitry.
  • the bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 801 and various circuits of memory represented by memory 802.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein.
  • the bus interface provides an interface.
  • the processor 801 is responsible for managing the bus architecture and general processing, and the memory 802 can store data used by the processor 801 in performing operations.
  • each step of the picture search process may be completed by an integrated logic circuit of hardware in the processor 801 or an instruction in the form of software.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the processor 801 is coupled to the memory 802 for reading the storage of the memory 802.
  • the computer program instructions and in response, perform the following operations:
  • the service discovery information includes a sender device identifier and resource information provided by the sender device.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

Disclosed in the present application are a resource distribution method and apparatus. In the present application, a device can receive service discovery information sent by another device, and can generate resource distribution information according to resource information comprised by said received service discovery information. Since, on the one hand, a device can receive service discovery information sent by multiple other devices, it can therefore generate resource distribution information according to service information sent by multiple devices, and can thereby obtain resource information provided by multiple devices, acquiring needed resources from different devices according to need; on the other hand, an embodiment of the present application can implement resource distribution on the basis of the service discovery process, avoiding problems caused by a cellular network implementing resource distribution.

Description

一种资源分发方法及装置Resource distribution method and device 技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种资源分发方法及装置。The present application relates to the field of communications technologies, and in particular, to a resource distribution method and apparatus.
背景技术Background technique
随着通信技术的发展,为了满足日益增长和多种多样的业务需求,基于移动终端的应用越来越多。With the development of communication technologies, in order to meet the growing and diverse business needs, more and more applications based on mobile terminals.
目前,应用程序安装、升级等管理功能可由终端上的“应用管理中心”实现。“应用管理中心”是安装在终端上的客户端应用程序,负责存储和维护应用程序的文件资源(如应用程序的安装包下载地址等信息)和元信息(如应用程序的名称、版本等信息)。通过“应用管理中心”可以了解终端上可用的应用程序的最新版本并可下载应用程序的最新版本的安装包进行安装。这种应用管理模式对服务和存储能力要求较高。Currently, management functions such as application installation and upgrade can be implemented by the Application Management Center on the terminal. The Application Management Center is a client application installed on the terminal. It is responsible for storing and maintaining the application's file resources (such as the application installation package download address and other information) and meta information (such as the application name, version, etc.). ). The App Management Center lets you know the latest version of the applications available on your terminal and download the latest version of the application's installation package for installation. This application management model requires high service and storage capabilities.
这种应用管理模式可以实现应用程序的集中管理,但是,一方面,在很多场景下,比如非Wi-Fi环境下,针对大型应用程序的安装,可能无法快速进行,或者即使能够通过蜂窝网络进行但会导致网络资源开销较大,造成用户体验较差;另一方面,这种应用管理模式仅能针对应用程序进行管理,资源类型单一,无法满足用户更多的资源分发、共享等需求。This application management mode enables centralized management of applications, but on the one hand, in many scenarios, such as non-Wi-Fi environments, installations for large applications may not be fast, or even through cellular networks. However, the network resource overhead is large, resulting in a poor user experience. On the other hand, the application management mode can only be managed for the application, and the resource type is single, which cannot meet the needs of users for more resource distribution and sharing.
申请内容Application content
本申请实施例提供了一种资源分发方法及装置。The embodiment of the present application provides a resource distribution method and device.
本申请实施例提供的一种资源分发方法,包括:A resource distribution method provided by an embodiment of the present application includes:
接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;Receiving service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。The resource distribution information is generated according to the received service discovery information, and the resource distribution information includes one or more resource information.
优选地,接收服务发现信息,包括:发送查询请求消息,所述查询请 求消息中包含请求查询的资源信息;接收所述查询请求消息对应的查询响应消息,所述查询响应消息中包含所述服务发现信息。Preferably, receiving the service discovery information includes: sending a query request message, where the query is requested The request message includes the resource information of the request query; the query response message corresponding to the query request message is received, and the service response information is included in the query response message.
其中,根据设定的多播地址发送所述查询请求消息,采用单播方式接收所述查询响应消息。The query request message is sent according to the set multicast address, and the query response message is received in a unicast manner.
优选地,发送查询请求消息之前,还包括:获取当前网络状态;根据当前网络状态,确定在当前网络状态下请求查询的资源。Preferably, before sending the query request message, the method further includes: acquiring a current network state; and determining, according to the current network state, the resource requested to be queried in the current network state.
优选地,接收服务发现信息,包括:接收通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。Preferably, the receiving the service discovery information includes: receiving the notification message, where the service discovery information included in the notification message includes the notification message sender device information and the resource information provided by the device.
其中,接收目的地址为设定多播地址的通知消息。The receiving destination address is a notification message for setting a multicast address.
优选地,根据接收到的服务发现信息生成资源分发信息,包括:根据资源分发权限控制策略,对接收到的服务发现信息中的资源信息进行分发权限鉴权;若鉴权通过,则将接收到的服务发现信息中的资源信息添加到所述资源分发信息中。Preferably, generating the resource distribution information according to the received service discovery information includes: performing distribution authority authentication on the resource information in the received service discovery information according to the resource distribution authority control policy; and if the authentication is passed, receiving the The resource information in the service discovery information is added to the resource distribution information.
其中,根据资源分发权限控制策略对接收到的服务发现信息中的资源信息进行权限鉴权,包括:根据资源分发权限控制策略,针对接收到的服务发现信息中的资源信息,进行以下之一或任意组合判断:And performing the right authentication on the resource information in the received service discovery information according to the resource distribution authority control policy, including: performing, according to the resource distribution authority control policy, the resource information in the received service discovery information, or one of the following or Any combination of judgments:
所述服务发现信息中包含的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
是否允许接受和分发所述服务发现信息的发送方设备所提供的资源。Whether to allow the resources provided by the sender device of the service discovery information to be accepted and distributed.
优选地,根据接收到的服务发现信息生成资源分发信息,包括:获取当前网络状态;根据当前网络状态,判断所述服务发现信息中包括的资源信息是否允许在当前网络状态下分发,若不允许,则拒绝将该资源信息添加到所述资源分发信息中。Preferably, generating the resource distribution information according to the received service discovery information includes: obtaining a current network state; determining, according to the current network state, whether the resource information included in the service discovery information is allowed to be distributed in the current network state, if not allowed And rejecting the addition of the resource information to the resource distribution information.
进一步地,还包括:将所述资源分发信息显示于用户界面。Further, the method further includes: displaying the resource distribution information on a user interface.
进一步地,还包括:根据设定周期或时间,删除所述资源分发信息中的超时资源信息;和/或,在接收到资源失效通知消息时,根据所述资源失效通知消息删除所述资源分发信息中对应的资源信息。 Further, the method further includes: deleting the timeout resource information in the resource distribution information according to the set period or time; and/or deleting the resource distribution according to the resource failure notification message when receiving the resource failure notification message Corresponding resource information in the information.
优选地,根据接收到的服务发现信息生成资源分发信息之后,还包括:确定所述资源分发信息中被选择的资源信息;根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求。Preferably, after the resource distribution information is generated according to the received service discovery information, the method further includes: determining the selected resource information in the resource distribution information; and sending, according to the selected resource information, the requesting acquisition to the device providing the corresponding resource. A resource acquisition request for the corresponding resource.
其中,根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求,包括:根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权;若鉴权通过,则向提供该相应资源的设备发送用于请求获取相应资源的资源获取请求。And sending, by the device that provides the corresponding resource, a resource acquisition request for requesting to acquire the corresponding resource according to the selected resource information, including: performing a distribution authority authentication on the selected resource information according to the resource distribution authority control policy; When the right passes, the device that provides the corresponding resource sends a resource acquisition request for requesting to acquire the corresponding resource.
其中,根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权,包括:根据资源分发权限控制策略,针对被选择的资源信息,进行以下之一或任意组合判断:被选择的资源信息所对应的资源是否为被允许分发的资源;对于被选择的资源信息的发送方设备,是否允许请求获取该设备提供的资源。And performing, according to the resource distribution authority control policy, performing distribution authority authentication on the selected resource information, including: performing, according to the resource distribution authority control policy, one or any combination of the following for the selected resource information: the selected resource Whether the resource corresponding to the information is a resource that is allowed to be distributed; and whether the sender device of the selected resource information is allowed to request to acquire the resource provided by the device.
优选地,所述资源获取请求中携带有参数,以使所述资源获取请求的接收方根据该参数返回处理结果。Preferably, the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
优选地,向提供该资源信息的设备发送用于请求获取相应资源的资源获取请求之后,还包括:接收提供该资源信息的设备根据所述资源获取请求发送的资源。Preferably, after the device that provides the resource information sends the resource acquisition request for requesting to acquire the corresponding resource, the method further includes: receiving the resource that is sent by the device that provides the resource information according to the resource acquisition request.
优选地,所述资源分发信息中包括根据至少一个设备发送的服务信息得到的资源信息。Preferably, the resource distribution information includes resource information obtained according to service information sent by at least one device.
优选地,所述资源包括应用、服务、数据中的一种或多种组合。Preferably, the resource comprises one or more combinations of applications, services, and data.
本申请实施例提供的另一种资源分发方法,包括:Another resource distribution method provided by the embodiment of the present application includes:
根据发送方设备所能提供的资源,生成服务发现信息;Generating service discovery information according to resources that the sender device can provide;
发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。And sending the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
优选地,发送服务发现信息,包括:接收查询请求消息,所述查询请求消息中包含请求查询的资源信息;根据所述查询请求消息返回查询响应消息,所述查询响应消息中包含所述服务发现信息。 Preferably, the sending service discovery information includes: receiving a query request message, where the query request message includes resource information of the request query; and returning a query response message according to the query request message, where the query response message includes the service discovery information.
其中,根据设定的多播地址接收所述查询请求消息,采用单播方式返回所述查询响应消息。The query request message is received according to the set multicast address, and the query response message is returned in a unicast manner.
优选地,根据所述查询请求消息返回查询响应消息,包括:根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权;若鉴权通过,则返回所述查询响应消息。Preferably, the query response message is returned according to the query request message, including: performing distribution authority authentication on the resource requested by the acquisition request message according to the resource distribution authority control policy; and returning the query if the authentication is passed Response message.
其中,根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权,包括以下之一或任意组合判断:And performing, according to the resource distribution authority control policy, the distribution authority for the resource requested by the acquisition request message, including one or any combination of the following:
是否允许向查询请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to be provided to the sender device of the query request message;
所述查询请求消息所请求查询的资源是否为该查询请求消息发送方设备允许访问的资源。Whether the resource requested by the query request message is a resource that the query request message sender device allows access to.
优选地,发送服务发现信息,包括:发送通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。Preferably, the sending of the service discovery information includes: sending a notification message, where the service discovery information included in the notification message includes the notification message sender device information and resource information provided by the device.
其中,根据设定多播地址发送所述通知消息。The notification message is sent according to the set multicast address.
优选地,发送通知消息之前,还包括:根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权;若鉴权通过,则发送所述通知消息。Preferably, before the sending the notification message, the method further includes: performing distribution authority authentication on the resource in the sender device according to the resource distribution authority control policy; and sending the notification message if the authentication is passed.
其中,根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权,包括以下之一或任意组合判断:The distribution authority authentication is performed on the resources in the sender device according to the resource distribution authority control policy, including one or any combination of the following:
发送方设备是否允许提供资源分发服务;Whether the sender device allows the resource distribution service;
确定发送方设备允许或不允许分发的资源。Determine which resources the sender device allows or disallows to distribute.
进一步地,发送通知消息之前,还包括:获取当前网络状态;根据当前网络状态,确定在当前网络状态下需要在所述通知消息中包含的资源信息。Further, before the sending the notification message, the method further includes: acquiring a current network state; and determining, according to the current network state, resource information that needs to be included in the notification message in the current network state.
优选地,还包括:接收资源获取请求;根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源。Preferably, the method further includes: receiving a resource acquisition request; and returning, to the resource acquisition request sender, the requested resource according to the resource acquisition request.
其中,根据所述资源获取请求向所述资源获取请求发送方返回所请求 获取的资源之前,还包括:根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权。Returning the requested request to the resource acquisition request sender according to the resource acquisition request. Before the obtained resource, the method further includes: performing a distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy.
其中,根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权,包括以下之一或任意组合判断:The distribution authority authentication is performed on the resource acquisition request according to the resource distribution authority control policy, including one or any combination of the following:
是否允许向资源获取请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to the sender device of the resource acquisition request message;
所述资源获取请求消息所请求获取的资源是否为该资源获取请求消息发送方设备允许访问的资源。Whether the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
优选地,所述资源获取请求中携带有参数,所述根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源,包括:根据所述资源获取请求所请求的资源以及所述参数进行处理,向所述资源获取请求发送方返回处理结果。Preferably, the resource acquisition request carries a parameter, and the resource that is requested to be sent by the resource acquisition request to the resource acquisition request according to the resource acquisition request includes: a resource and a request according to the resource acquisition request The parameter is processed, and the resource acquisition request sender returns a processing result.
优选地,所述资源包括应用、服务、数据中的一种或多种组合。Preferably, the resource comprises one or more combinations of applications, services, and data.
本申请实施例提供的一种资源分发装置,包括:A resource distribution apparatus provided by an embodiment of the present application includes:
服务发现模块,用于接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;a service discovery module, configured to receive service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
分发管理模块,用于根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。And a distribution management module, configured to generate resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
优选地,所述服务发现模块具体用于:发送查询请求消息,所述查询请求消息中包含请求查询的资源信息;接收所述查询请求消息对应的查询响应消息,所述查询响应消息中包含所述服务发现信息。Preferably, the service discovery module is specifically configured to: send a query request message, where the query request message includes resource information of the request query; and receive a query response message corresponding to the query request message, where the query response message includes Service discovery information.
其中,所述服务发现模块具体用于:根据设定的多播地址发送所述查询请求消息,采用单播方式接收所述查询响应消息。The service discovery module is specifically configured to: send the query request message according to the set multicast address, and receive the query response message in a unicast manner.
优选地,还包括:网络状态获取模块;所述网络状态获取模块,用于获取当前网络状态;所述服务发现模块还用于:在发送查询请求消息之前,根据所述网络状态获取模块获取到的当前网络状态,确定在当前网络状态下请求查询的资源。Preferably, the method further includes: a network state acquiring module, configured to acquire a current network state; the service discovery module is further configured to: obtain, according to the network state acquiring module, before acquiring the query request message The current network status determines the resources that are requested to be queried in the current network state.
优选地,所述服务发现模块具体用于:接收通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设 备所提供的资源信息。Preferably, the service discovery module is specifically configured to: receive a notification message, where the service discovery information included in the notification message includes the notification message sender device information and the device Prepare the resource information provided.
其中,所述服务发现模块具体用于:接收目的地址为设定多播地址的通知消息。The service discovery module is specifically configured to: receive a notification message whose destination address is a set multicast address.
优选地,还包括:权限控制模块;所述权限控制模块,用于根据资源分发权限控制策略,对接收到的服务发现信息中的资源信息进行分发权限鉴权;所述分发管理模块具体用于:若所述权限控制模块鉴权通过,则将接收到的服务发现信息中的资源信息添加到所述资源分发信息中。Preferably, the method further includes: an authority control module, configured to: perform resource authorization authentication on the resource information in the received service discovery information according to the resource distribution authority control policy; the distribution management module is specifically configured to: And: if the authorization control module authenticates, the resource information in the received service discovery information is added to the resource distribution information.
其中,所述分发管理模块具体用于:根据资源分发权限控制策略,针对接收到的服务发现信息中的资源信息,进行以下之一或任意组合判断:The distribution management module is specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following on the resource information in the received service discovery information:
所述服务发现信息中包含的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
是否允许接受和分发所述服务发现信息的发送方设备所提供的资源。Whether to allow the resources provided by the sender device of the service discovery information to be accepted and distributed.
优选地,还包括:网络状态获取模块;所述网络状态获取模块,用于获取当前网络状态;所述分发管理模块具体用于:根据所述网络状态获取模块获取到的当前网络状态,判断所述服务发现信息中包括的资源信息是否允许在当前网络状态下分发,若不允许,则拒绝将该资源信息添加到所述资源分发信息中。Preferably, the method further includes: a network state obtaining module; the network state acquiring module, configured to acquire a current network state; the distribution management module is specifically configured to: determine, according to the current network state acquired by the network state acquiring module, Whether the resource information included in the service discovery information is allowed to be distributed in the current network state, and if not allowed, the resource information is refused to be added to the resource distribution information.
优选地,所述分发管理模块还用于:将所述资源分发信息显示于用户界面。Preferably, the distribution management module is further configured to: display the resource distribution information on a user interface.
优选地,所述分发管理模块还用于:根据设定周期或时间,删除所述资源分发信息中的超时资源信息;和/或,在接收到资源失效通知消息时,根据所述资源失效通知消息删除所述资源分发信息中对应的资源信息。Preferably, the distribution management module is further configured to: delete timeout resource information in the resource distribution information according to a set period or time; and/or, when receiving the resource failure notification message, according to the resource failure notification The message deletes the corresponding resource information in the resource distribution information.
优选地,还包括:资源获取模块,用于在根据接收到的服务发现信息生成资源分发信息之后,确定所述资源分发信息中被选择的资源信息;以及,根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求。Preferably, the method further includes: a resource obtaining module, configured to: after the resource distribution information is generated according to the received service discovery information, determine the selected resource information in the resource distribution information; and provide the resource information according to the selected resource information The device of the corresponding resource sends a resource acquisition request for requesting acquisition of the corresponding resource.
其中,还包括:权限控制模块;所述权限控制模块,用于根据资源分 发权限控制策略,对被选择的资源信息进行分发权限鉴权;所述资源获取模块具体用于:若所述权限控制模块鉴权通过,则向提供该相应资源的设备发送用于请求获取相应资源的资源获取请求。The method further includes: an authority control module; and the authority control module is configured to allocate resources according to resources Sending a permission control policy, performing distribution authority authentication on the selected resource information; the resource obtaining module is specifically configured to: if the authorization control module passes the authentication, send the device for providing the corresponding resource to request to obtain the corresponding Resource acquisition request for the resource.
其中,所述权限控制模块具体用于:根据资源分发权限控制策略,针对被选择的资源信息,进行以下之一或任意组合判断:The permission control module is specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following determinations on the selected resource information:
被选择的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the selected resource information is a resource that is allowed to be distributed;
对于被选择的资源信息的发送方设备,是否允许请求获取该设备提供的资源。Whether the sender device of the selected resource information is allowed to request the resource provided by the device.
优选地,所述资源获取请求中携带有参数,以使所述资源获取请求的接收方根据该参数返回处理结果。Preferably, the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
优选地,所述资源获取模块还用于:在向提供该资源信息的设备发送用于请求获取相应资源的资源获取请求之后,接收提供该资源信息的设备根据所述资源获取请求发送的资源。Preferably, the resource obtaining module is further configured to: after sending a resource acquisition request for requesting acquisition of a corresponding resource to the device that provides the resource information, receiving a resource that is sent by the device that provides the resource information according to the resource acquisition request.
优选地,所述资源分发信息中包括根据至少一个设备发送的服务信息得到的资源信息。Preferably, the resource distribution information includes resource information obtained according to service information sent by at least one device.
优选地,所述资源包括应用、服务、数据中的一种或多种组合。Preferably, the resource comprises one or more combinations of applications, services, and data.
本申请实施例提供的另一种资源分发装置,包括:Another resource distribution device provided by the embodiment of the present application includes:
生成模块,用于根据发送方设备所能提供的资源,生成服务发现信息;a generating module, configured to generate service discovery information according to resources that the sending device can provide;
服务发现模块,用于发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。The service discovery module is configured to send the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
优选地,所述服务发现模块具体用于:接收查询请求消息,所述查询请求消息中包含请求查询的资源信息;根据所述查询请求消息返回查询响应消息,所述查询响应消息中包含所述服务发现信息。Preferably, the service discovery module is specifically configured to: receive a query request message, where the query request message includes resource information of the request query; and return a query response message according to the query request message, where the query response message includes the Service discovery information.
其中,所述服务发现模块具体用于:根据设定的多播地址接收所述查询请求消息,采用单播方式返回所述查询响应消息。The service discovery module is specifically configured to: receive the query request message according to the set multicast address, and return the query response message in a unicast manner.
优选地,还包括:权限控制模块;所述权限控制模块,用于根据资源 分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权;所述服务发现模块具体用于:若所述权限控制模块鉴权通过,则返回所述查询响应消息。Preferably, the method further includes: a rights control module; the rights control module, configured to The distribution authority control policy is configured to perform the distribution authority authentication on the resource that is requested by the acquisition request message; the service discovery module is specifically configured to: if the authorization control module passes the authentication, return the query response message.
其中,所述权限控制模块具体用于:根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权时,执行以下之一或任意组合判断:The permission control module is specifically configured to: perform one or any combination of the following determinations when performing resource authorization authentication on the resource requested by the acquisition request message according to the resource distribution authority control policy:
是否允许向查询请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to be provided to the sender device of the query request message;
所述查询请求消息所请求查询的资源是否为该查询请求消息发送方设备允许访问的资源。Whether the resource requested by the query request message is a resource that the query request message sender device allows access to.
优选地,所述服务发现模块具体用于:发送通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。Preferably, the service discovery module is specifically configured to: send a notification message, where the service discovery information included in the notification message includes the notification message sender device information and resource information provided by the device.
其中,所述服务发现模块具体用于:根据设定多播地址发送所述通知消息。The service discovery module is specifically configured to: send the notification message according to a set multicast address.
优选地,还包括:权限控制模块;所述权限控制模块,用于在发送通知消息之前,根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权;所述服务发现模块还用于:若所述权限控制模块鉴权通过,则发送所述通知消息。Preferably, the method further includes: an authority control module, configured to: before the sending the notification message, perform a distribution authority authentication on the resource in the sender device according to the resource distribution authority control policy; the service discovery module further And configured to: if the authorization control module authenticates, pass the notification message.
其中,所述权限控制模块具体用于:根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权时,执行以下之一或任意组合判断:本设备是否允许提供资源分发服务;确定本设备允许或不允许分发的资源。The privilege control module is specifically configured to perform one or any combination of the following when determining the distribution authority of the resource in the sender device according to the resource distribution authority control policy: whether the device allows the resource distribution service to be provided; Resources that the device allows or does not allow distribution.
优选地,还包括:网络状态获取模块;所述网络状态获取模块,用于获取当前网络状态;所述服务发现模块还用于:在发送通知消息之前,根据所述网络状态获取模块获取到的当前网络状态,确定在当前网络状态下需要在所述通知消息中包含的资源信息。Preferably, the method further includes: a network state acquiring module, configured to acquire a current network state; the service discovery module is further configured to: obtain, according to the network state acquiring module, before acquiring the notification message The current network status determines the resource information that needs to be included in the notification message in the current network state.
优选地,还包括:资源提供模块,用于接收资源获取请求,根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源。 Preferably, the method further includes: a resource providing module, configured to receive a resource acquisition request, and return, according to the resource acquisition request, the resource that is requested by the sender to the resource that is requested to be acquired.
其中,还包括:权限控制模块;所述权限控制模块,用于根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权;所述资源提供模块还用于:根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源之前,指示所述权限控制模块进行鉴权。And the privilege control module is configured to: perform the privilege authentication on the resource acquisition request according to the resource distribution privilege control policy; the resource providing module is further configured to: acquire according to the resource Requesting the resource acquisition request sender to return the requested resource before instructing the rights control module to perform authentication.
其中,所述权限控制模块具体用于:根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权时,执行以下之一或任意组合判断:The permission control module is specifically configured to: perform one or any combination of the following determinations when performing the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy:
是否允许向资源获取请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to the sender device of the resource acquisition request message;
所述资源获取请求消息所请求获取的资源是否为该资源获取请求消息发送方设备允许访问的资源。Whether the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
优选地,所述资源获取请求中携带有参数,所述资源提供模块具体用于:根据所述资源获取请求所请求的资源以及所述参数进行处理,向所述资源获取请求发送方返回处理结果。Preferably, the resource acquisition request carries a parameter, and the resource providing module is specifically configured to: process, according to the resource requested by the resource acquisition request, and the parameter, and send the processing result to the resource acquisition request sender. .
优选地,所述资源包括应用、服务、数据中的一种或多种组合。Preferably, the resource comprises one or more combinations of applications, services, and data.
本申请实施例提供的一种设备,包括:An apparatus provided by an embodiment of the present application includes:
显示器;monitor;
存储器,用于存储计算机程序指令;a memory for storing computer program instructions;
处理器,耦合到所述存储器,用于读取所述存储器存储的计算机程序指令,并作为响应,执行如下操作:a processor coupled to the memory for reading computer program instructions stored by the memory and, in response, performing the following operations:
接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;Receiving service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。The resource distribution information is generated according to the received service discovery information, and the resource distribution information includes one or more resource information.
本申请实施例提供的另一种设备,包括:Another device provided by the embodiment of the present application includes:
显示器;monitor;
存储器,用于存储计算机程序指令;a memory for storing computer program instructions;
处理器,耦合到所述存储器,用于读取所述存储器存储的计算机程序 指令,并作为响应,执行如下操作:a processor coupled to the memory for reading the computer program of the memory storage Command, and in response, do the following:
根据发送方设备所能提供的资源,生成服务发现信息;Generating service discovery information according to resources that the sender device can provide;
发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。And sending the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
本申请的上述实施例中,一个设备可接收其他设备发送的服务发现信息,并可根据接收到的服务发现信息中包括的资源信息生成资源分发信息。由于一方面,一个设备可接收多个其他设备发送的服务发现信息,因此可以根据多个其他设备发送的服务信息生成资源分发信息,从而可获得多个设备所提供的资源信息,进而可以根据需要从不同的设备获取需要的资源;另一方面,本申请实施例可以基于服务发现过程进行资源分发,避免了通过蜂窝网络进行资源分发所带来的问题。In the foregoing embodiment of the present application, one device may receive service discovery information sent by other devices, and may generate resource distribution information according to the resource information included in the received service discovery information. In one aspect, a device can receive service discovery information sent by multiple other devices, so that resource distribution information can be generated according to service information sent by multiple other devices, so that resource information provided by multiple devices can be obtained, and then, as needed, The required resources are obtained from different devices. On the other hand, the embodiment of the present application can perform resource distribution based on the service discovery process, and avoids problems caused by resource distribution through the cellular network.
附图说明DRAWINGS
图1为本申请实施例提供的服务发现流程示意图之一;FIG. 1 is a schematic diagram of a service discovery process provided by an embodiment of the present application;
图2为本申请实施例提供的服务发现流程示意图之二;2 is a second schematic diagram of a service discovery process according to an embodiment of the present application;
图3为本申请实施例提供的资源分发流程示意图;FIG. 3 is a schematic diagram of a resource distribution process according to an embodiment of the present application;
图4为本申请实施例提供的资源分发列表用户界面的示意图;4 is a schematic diagram of a resource distribution list user interface provided by an embodiment of the present application;
图5为本申请实施例提供的资源分发装置结构示意图;FIG. 5 is a schematic structural diagram of a resource distribution apparatus according to an embodiment of the present application;
图6为本申请另一实施例提供的资源分发装置结构示意图;FIG. 6 is a schematic structural diagram of a resource distribution apparatus according to another embodiment of the present disclosure;
图7为本申请实施例提供的终端的结构示意图;FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application;
图8为本申请另一实施例提供的终端的结构示意图。FIG. 8 is a schematic structural diagram of a terminal according to another embodiment of the present disclosure.
具体实施方式detailed description
本申请实施例提供了一种基于服务发现技术进行资源分发的方案。The embodiment of the present application provides a solution for resource distribution based on a service discovery technology.
本实施例中的“资源”包括应用(Application)、服务、数据中的一种或多种组合。举例来说,所述“资源”可以是应用程序的安装包,可以是静态服务(比如拍照服务,具体可以是提供拍摄的图像数据),也可以 是动态服务(比如实时视频监控服务,具体可以是提供一个摄像头拍摄的实时视频监控数据)。The "resource" in this embodiment includes one or more combinations of applications, services, and data. For example, the “resource” may be an installation package of an application, and may be a static service (such as a photo service, specifically, providing image data for shooting), or It is a dynamic service (such as real-time video surveillance service, which can provide real-time video surveillance data captured by a camera).
在云操作系统中,比如YunOS系统中,上述“资源”可表述为“Page”。Page是对本地服务和远程服务的抽象,也即服务的基本单元,通过对数据和方法的封装,可以提供各种服务。一个服务场景可以包括多个Page。举例来说,一个Page可以是UI(用户界面)、拍照等服务,也可以是后台服务,如账户认证。运行态Page称为Page实例,是本地服务或远程服务的运行载体,可由DPMS(Dynamic Page Manager Service,动态Page管理服务)创建、调度、管理,DPMS可维护Page实例的生命周期。In a cloud operating system, such as a YunOS system, the above "resources" can be expressed as "Page". Page is an abstraction of local and remote services, that is, the basic unit of services. By encapsulating data and methods, various services can be provided. A service scene can include multiple Pages. For example, a Page can be a UI (user interface), a photo or other service, or a background service, such as account authentication. The running state Page is called the Page instance. It is the running carrier of the local service or the remote service. It can be created, scheduled, and managed by the DPMS (Dynamic Page Manager Service). The DPMS can maintain the life cycle of the Page instance.
Page之间可以基于PageLink传递事件和/或数据。PageLink是Page之间流转的信息实体,可以在Page间传递信息,例如,事件和/或数据等。具体传递数据可以使用设定的API(Application Programming Interface,应用程序编程接口)。Events and/or data can be passed between Pages based on PageLink. PageLink is an information entity that flows between Pages and can pass information between Pages, such as events and/or data. The specific data can be transferred using the set API (Application Programming Interface).
所述资源可使用标识符进行标识,该标识符具体可以是URI(Uniform Resource Identifier,统一资源标识符)。URI可以理解为一个地址链接,通过该URI可以唯一地确定出其对应的资源。The resource may be identified by using an identifier, which may be a URI (Uniform Resource Identifier). A URI can be understood as an address link by which a corresponding resource can be uniquely determined.
所述资源还可以具有其他属性,比如资源所属的域(domain),资源类型,资源名称等。The resource may also have other attributes, such as a domain to which the resource belongs, a resource type, a resource name, and the like.
本申请实施例中,一个设备可以基于服务发现过程获得其他设备提供的资源的相关信息。具体来说,一个设备可以采用以下方式一或方式二获得自己所在的局部网络中其他设备提供的资源的相关信息。以设备A获得设备B提供的资源的相关信息为例,方式一和方式二的具体实现过程如下所述:In this embodiment of the present application, a device may obtain related information of resources provided by other devices based on a service discovery process. Specifically, a device may obtain information about resources provided by other devices in the local network in which the device is located in the following manner. For example, the device A obtains the information about the resources provided by the device B. The specific implementation process of the first mode and the second mode is as follows:
方式一method one
如图1所示,方式一的流程可包括:As shown in FIG. 1, the process of the first method may include:
步骤101:设备A发送查询请求消息。具体地,设备A可在接入网络(如无线局域网)后发送查询请求消息,也可按照设定周期发送查询请求消息,其中,该设定周期可根据需要来设置,比如可以是秒级的周期。 Step 101: Device A sends a query request message. Specifically, the device A may send a query request message after accessing the network (such as a wireless local area network), or may send a query request message according to a set period, where the set period may be set according to requirements, for example, may be seconds. cycle.
其中,查询请求消息中可包含设备A的信息,比如设备A的地址或标识等信息,还可以包括设备A的类型信息。The query request message may include information about the device A, such as the address or identifier of the device A, and may also include the type information of the device A.
该步骤中,设备A可根据配置的发送功率,发送该查询请求消息,以便发现与该发送功率相适应的信号覆盖范围内能够提供资源的设备。设备A的查询请求消息的发送功率大小可根据需要进行配置,发送功率越大则查询范围越大,但设备A的电源消耗也越大。In this step, the device A may send the query request message according to the configured transmit power, so as to discover a device capable of providing resources within the signal coverage range that is compatible with the transmit power. The sending power of the query request message of device A can be configured as required. The larger the sending power is, the larger the query range is, but the power consumption of device A is also larger.
该步骤中,设备A可采用多播方式(比如组播或广播)发送该查询请求消息。具体地,可预先设置多播地址,进一步地还可设置端口,设备A可使用该多播地址和端口发送查询请求消息(即,将该多播地址作为目的地址,将该端口作为目的端口发送查询请求消息),其他设备(如设备B)可对该多播地址和端口进行监听,以便接收目的地址为该多播地址的查询请求消息。In this step, device A may send the query request message in a multicast manner, such as multicast or broadcast. Specifically, the multicast address may be preset, and the port may further be set, and the device A may use the multicast address and the port to send a query request message (ie, the multicast address is used as the destination address, and the port is sent as the destination port. Query request message), other devices (such as device B) can listen to the multicast address and port to receive a query request message whose destination address is the multicast address.
步骤102:设备B接收到设备A发送的查询请求消息后,如果设备B能够提供资源信息,则根据本设备所能提供的资源生成服务发现信息,向设备A返回查询响应消息,该查询响应消息中携带有服务发现信息,该服务发现信息中包括设备B的信息(如设备B的地址或标识等信息,还可以包括设备B的类型信息)以及设备B提供的资源信息(比如资源类型、资源标识符等信息中的一种或组合)。以云YunOS为例,该服务发现信息可以是PageLink的形式,或者该服务发现信息中包含的资源信息可以是PageLink的形式。Step 102: After receiving the query request message sent by the device A, if the device B can provide the resource information, the device B generates the service discovery information according to the resources that the device can provide, and returns a query response message to the device A, where the query response message is sent. The service discovery information includes the information of the device B (such as the address or identifier of the device B, and may also include the type information of the device B) and the resource information provided by the device B (such as the resource type and the resource). One or a combination of information such as identifiers). Taking Yun YunOS as an example, the service discovery information may be in the form of PageLink, or the resource information included in the service discovery information may be in the form of PageLink.
该步骤中,设备B可以采用单播方式向设备A返回查询响应消息。In this step, device B may return a query response message to device A in a unicast manner.
在一些实施例中,进一步地,步骤101中设备A发送的查询请求消息中还可包括设备A请求的资源信息(比如资源类型、资源标识符等信息中的一种或组合);相应地,步骤102中,设备B如果能够提供设备A所请求查询的资源,则向设备A返回查询响应消息。其中,设备A可采用多种方式确定其所请求查询的资源。In some embodiments, further, the query request message sent by the device A in step 101 may further include resource information (such as one or a combination of resource type, resource identifier, and the like) requested by the device A; In step 102, if the device B can provide the resource requested by the device A, the device B returns a query response message to the device A. Among them, device A can determine the resources of the requested query in various ways.
比如,设备A根据其上所安装的应用程序,将这些应用程序中的全部或部分应用程序确定为需要查询的资源,从而可以查询设备A附近能够提供这些应用程序资源(比如应用程序升级包)的设备。 For example, device A determines all or part of the applications in these applications as resources that need to be queried according to the application installed thereon, so that it can query these application resources (such as application upgrade packages) near device A. device of.
再比如,设备A上的某个应用程序需要获取某个视频监控摄像头监控到的视频数据,则设备A可在查询请求消息中携带该视频资源的相关信息(比如摄像头的地址,或者是该视频服务的名称),从而可以查询设备A附近能够提供该视频监控服务的设备。For example, if an application on device A needs to obtain video data monitored by a video surveillance camera, device A may carry information about the video resource (such as the address of the camera or the video) in the query request message. The name of the service), so that the device capable of providing the video monitoring service near the device A can be queried.
当然,本申请实施例允许用户根据需要设置请求查询的资源。Of course, the embodiment of the present application allows the user to set the resource for requesting the query as needed.
作为一个例子,设备A可以向一个特定的多播地址的SSDP(Simple Service Discovery Protocol,简单服务发现协议)端口使用M-SEARCH(查询)方法发送“ssdp:discover”消息,该消息中可携带设备A请求的资源信息。当设备B监听到该多播地址上由设备A发送的“ssdp:discover”消息的时候,设备B分析设备A所请求的资源,如果设备B自身能够提供设备A所请求的资源,则设备B通过单播的方式响应设备A的“ssdp:discover”消息。As an example, device A may send an "ssdp:discover" message to the SSDP (Simple Service Discovery Protocol) port of a specific multicast address using the M-SEARCH method. A requested resource information. When device B listens to the "ssdp:discover" message sent by device A on the multicast address, device B analyzes the resource requested by device A. If device B itself can provide the resource requested by device A, device B Respond to device A's "ssdp:discover" message in unicast mode.
在一些实施例中,进一步地,设备B上可配置资源分发权限控制策略。比如,该资源分发权限控制策略可以规定以下内容之一或任意组合:In some embodiments, further, the resource distribution rights control policy can be configured on the device B. For example, the resource distribution authority control policy may specify one or any combination of the following:
-对所允许或不允许的服务接受方设备进行规定,也就是说,规定了设备B允许或不允许向哪些类型的设备提供资源分发服务;- Provision of service recipient devices that are allowed or not allowed, that is, specifying which types of devices are allowed or not allowed to provide resource distribution services by device B;
-设备B允许或不允许提供分发服务的资源,比如,可规定设备B允许或不允许针对哪些域(domain)的资源提供资源分发服务;再比如,可规定设备B允许或不允许针对哪些类型的资源提供资源分发服务;再比如,可规定设备B允许或不允许针对哪些URI的资源提供资源分发服务。- Device B allows or disallows the provision of resources for the distribution service, for example, may specify that device B allows or disallows resources for which domains to provide resource distribution services; for example, may specify which types are allowed or not allowed for device B The resource provides a resource distribution service; for example, it may be specified that the device B allows or disallows resources for which URIs to provide a resource distribution service.
设备B在接收到设备A发送的查询请求消息后,可根据该资源分发权限控制策略确定是否响应设备A的查询请求。比如根据资源分发权限控制策略,对查询请求消息所请求查询的资源进行分发权限鉴权时,包括以下之一或任意组合判断:After receiving the query request message sent by the device A, the device B may determine whether to respond to the query request of the device A according to the resource distribution right control policy. For example, according to the resource distribution authority control policy, when the resource for querying the query request message is authenticated, the one or any combination of the following is determined:
-是否允许向查询请求消息的发送方设备提供资源分发服务;- Whether to allow the resource distribution service to be provided to the sender device of the inquiry request message;
-所请求查询的资源是否为该查询请求消息发送方设备允许访问的资源。- Whether the resource requested to be queried is a resource that the query request message sender device allows access to.
在一些实施例中,可选地,设备A可获取当前网络状态,根据当前网 络状态,确定在当前网络状态下请求查询的资源,并进一步根据确定出的请求查询的资源生成查询请求消息。作为例子,如果当前网络状态为Wi-Fi网络连接,则允许进行资源查询;再例如,如果当前网络状态为Wi-Fi网络状态且网络性能较好(可通过多种网络性能参数进行网络性能评估),则允许对动态服务类型的资源进行查询,否则,不允许对动态服务类型的资源进行查询。In some embodiments, optionally, device A can obtain the current network status, according to the current network. The network status determines the resource requesting the query in the current network state, and further generates a query request message according to the determined resource of the request query. As an example, if the current network status is a Wi-Fi network connection, resource query is allowed; for example, if the current network status is Wi-Fi network status and the network performance is good (network performance evaluation can be performed through various network performance parameters) ), allows the query of the dynamic service type resources, otherwise, the dynamic service type resources are not allowed to query.
方式二Way two
如图2所示,方式二的流程可包括:As shown in FIG. 2, the process of the second method may include:
步骤201:设备B根据本设备所能提供的资源生成服务发现信息,并发送通知消息,该通知消息中可包含服务发现信息,该服务发现信息中可包含设备B的信息(比如设备B的标识、类型等信息中的一种或组合)以及设备B提供的资源的相关信息(比如资源类型、资源标识符等信息中的一种或组合)。具体地,设备B可在接入网络后发送通知消息,也可按照设定周期发送通知消息,其中,该设定周期可根据需要来设置,比如可以是秒级的周期。以云YunOS为例,该服务发现信息可以是PageLink的形式,或者该服务发现信息中包含的资源信息可以是PageLink的形式。Step 201: The device B generates the service discovery information according to the resources that the device can provide, and sends a notification message, where the notification message may include the service discovery information, where the service discovery information may include the information of the device B (such as the identifier of the device B). One or a combination of information such as types, and related information of resources provided by device B (such as one or a combination of resource type, resource identifier, etc.). Specifically, the device B may send a notification message after accessing the network, or may send a notification message according to a set period, where the setting period may be set according to requirements, such as a period of a second level. Taking Yun YunOS as an example, the service discovery information may be in the form of PageLink, or the resource information included in the service discovery information may be in the form of PageLink.
该步骤中,设备B可根据配置的发送功率,发送该通知消息,以便使与该发送功率相适应的信号覆盖范围内的其他设备能够发现设备B。设备B的通知消息的发送功率大小可根据需要进行配置,发送功率越大则通知范围越大,但设备B的电源消耗也越大。In this step, the device B may send the notification message according to the configured sending power, so that other devices in the signal coverage area compatible with the sending power can discover the device B. The sending power of the notification message of the device B can be configured as needed. The larger the transmission power, the larger the notification range, but the power consumption of the device B is also larger.
该步骤中,设备B可采用多播方式(比如组播或广播)发送该通知消息。具体地,可预先设置多播地址,进一步地还可设置端口,设备B可将该多播地址作为目的地址,将该端口作为目的端口发送通知消息,其他设备(如设备A)可对该多播地址和端口进行监听,以便接收目的地址为该多播地址的通知消息。In this step, device B may send the notification message in a multicast manner, such as multicast or broadcast. Specifically, the multicast address may be set in advance, and the port may be further set. The device B may use the multicast address as the destination address, and send the notification message as the destination port. Other devices (such as device A) may The broadcast address and port are monitored to receive a notification message whose destination address is the multicast address.
可选地,在一些实施例中,设备B可获取当前网络状态,根据当前网络状态,确定在当前网络状态下需要在所述通知消息中包含的资源信息,并进一步根据确定出的资源生成通知消息。作为例子,如果当前网络状态为Wi-Fi网络连接,则允许进行资源信息通知;再例如,如果当前网络状 态为Wi-Fi网络状态且网络性能较好(可通过多种网络性能参数进行网络性能评估),则允许对动态服务类型的资源信息进行通知,否则,不允许对动态服务类型的资源进行通知。Optionally, in some embodiments, the device B may obtain a current network state, determine, according to the current network state, resource information that needs to be included in the notification message in the current network state, and further generate a notification according to the determined resource. Message. As an example, if the current network status is a Wi-Fi network connection, resource information notification is allowed; for example, if the current network is The status of the Wi-Fi network is good and the network performance is good (the network performance can be evaluated through various network performance parameters), which allows the notification of the resource information of the dynamic service type. Otherwise, the dynamic service type resource is not allowed to be notified. .
步骤202:设备A接收到设备B发送的通知消息后,根据该消息得到设备B能够提供的资源信息。Step 202: After receiving the notification message sent by the device B, the device A obtains the resource information that the device B can provide according to the message.
作为一个例子,设备B向一个特定的多播地址的SSDP端口使用NOTIFY(通知)方法发送“ssdp:alive”消息。设备A可对该多播地址的该SSDP端口进行监听,并可根据自己的策略处理监听到的消息。As an example, device B sends a "ssdp:alive" message to the SSDP port of a particular multicast address using the NOTIFY method. Device A can listen to the SSDP port of the multicast address and can process the monitored message according to its own policy.
进一步地,设备B上可配置资源分发权限控制策略。比如,该资源分发权限控制策略可以规定:设备B允许或不允许提供分发服务的资源,比如,可规定设备B允许或不允许针对哪些域(domain)的资源提供资源分发服务;再比如,可规定设备B允许或不允许针对哪些类型的资源提供资源分发服务;再比如,可规定设备B允许或不允许针对哪些URI的资源提供资源分发服务。Further, the resource distribution authority control policy can be configured on the device B. For example, the resource distribution authority control policy may specify that the device B allows or disallows the resources for providing the distribution service, for example, may specify that the device B allows or disallows resources for which domains to provide resource distribution services; for example, It is specified that the device B allows or disallows for which types of resources to provide resource distribution services; for example, it may be specified that the device B allows or disallows resources for which URIs to provide resource distribution services.
设备B在发送通知消息之前,可根据该资源分发权限控制策略确定在该通知消息中携带哪些资源信息。具体地,设备B根据资源分发权限控制策略,对本设备中的资源进行分发权限鉴权时,可执行以下之一或任意组合判断:Before sending the notification message, the device B may determine which resource information is carried in the notification message according to the resource distribution authority control policy. Specifically, when the device B performs the right to authenticate the resources in the device according to the resource distribution authority control policy, the device B may perform one or any combination of the following determinations:
-本设备是否允许提供资源分发服务;- Whether the device is allowed to provide resource distribution services;
-确定本设备允许或不允许分发的资源。- Determine which resources the device allows or does not allow for distribution.
上述方式一或方式二可遵循服务发现协议,比如mDNS协议。The first mode or the second mode may follow a service discovery protocol, such as the mDNS protocol.
上述方式一和方式二可以独立使用也可以配合使用,一种配合使用的例子是:设备A可发送查询请求消息,以便发现附近能够提供资源分发服务的设备,还可发送通知消息,以便通知附近的设备该设备A能够提供的资源。The foregoing mode 1 and mode 2 may be used independently or in combination. An example of cooperation may be: device A may send a query request message to discover a device that can provide a resource distribution service nearby, and may also send a notification message to notify nearby. The device that the device A can provide.
参见图3,为本申请实施例提供的资源分发流程示意图。为了清楚起见,下面以设备A作为执行主体描述该流程。FIG. 3 is a schematic diagram of a resource distribution process according to an embodiment of the present application. For the sake of clarity, the process is described below with device A as the execution body.
如图所示,该流程可包括如下步骤: As shown, the process can include the following steps:
步骤301:设备A接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息。Step 301: The device A receives service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device.
该步骤中,设备A可基于服务发现过程接收其他设备发送的服务发现信息,具体地,可采用图1或图2所示的方式获得其他设备所提供的资源信息,在此不再重复。In this step, the device A may receive the service discovery information sent by the other device based on the service discovery process. Specifically, the resource information provided by the other device may be obtained in the manner shown in FIG. 1 or FIG. 2, and is not repeated here.
步骤302:设备A根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。Step 302: The device A generates resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
实际应用中,为实现方便,该资源分发信息的数据结构可采用列表,即,设备A根据接收到的服务发现信息生成资源分发列表,该列表中包含一个或多个资源信息。当然,资源分发信息也可以采用其他数据结构。为描述方便,以下流程中以“资源分发信息”表现为“资源分发列表”为例进行描述。In an actual application, for the convenience of implementation, the data structure of the resource distribution information may adopt a list, that is, the device A generates a resource distribution list according to the received service discovery information, and the list includes one or more resource information. Of course, resource distribution information can also adopt other data structures. For the convenience of description, the following process uses "resource distribution information" as a "resource distribution list" as an example for description.
该步骤中,设备A可在接收到服务发现信息之后将其中包含的资源信息添加到资源分发列表中,优选地,为了避免重复添加,可在添加之前查询资源分发列表中是否已经存在相同的资源信息,若已存在,则不再重复添加。In this step, the device A may add the resource information contained therein to the resource distribution list after receiving the service discovery information. Preferably, in order to avoid repeated addition, the same resource may already be queried in the resource distribution list before the addition. The information, if it already exists, will not be added again.
优选地,设备A上可设置有资源分发权限控制策略,设备A可根据资源分发权限控制策略,对接收到的服务发现信息中的资源信息进行分发权限鉴权,若鉴权通过,则将接收到的服务发现信息中的资源信息添加到资源分发列表中,若鉴权不通过,则不会将该资源信息添加到资源分发列表中。这样可以保证资源分发列表中的资源信息,对于设备A来说均有权访问。Preferably, the device A may be configured with a resource distribution authority control policy, and the device A may perform the distribution authority authentication on the resource information in the received service discovery information according to the resource distribution authority control policy, and if the authentication is passed, the device will receive The resource information in the service discovery information is added to the resource distribution list, and if the authentication fails, the resource information is not added to the resource distribution list. This ensures that the resource information in the resource distribution list has access to device A.
其中,设备A上设置的资源分发权项控制策略可定义以下内容之一或任意组合:The resource distribution right control policy set on the device A may define one or any combination of the following:
-允许或不允许分发的资源;该条策略具体可以表现为资源列表,该资源列表中包括一个或多个资源信息,这些资源信息所对应的资源允许或不允许被设备A进行分发。该资源列表中的资源信息具体可以包括资源类型、资源标识符、资源所属域(domain)等信息中的一种或多种;该条策略还可以具体表现为条件表达式,比如包含通配符的资源标识符表达式, 与该表达式匹配的资源标识符所对应的资源允许或不允许被设备A分发;- A resource that is allowed or not allowed to be distributed; the policy may be embodied as a resource list, and the resource list includes one or more resource information, and the resource corresponding to the resource information is allowed or not allowed to be distributed by the device A. The resource information in the resource list may specifically include one or more of a resource type, a resource identifier, and a domain to which the resource belongs. The policy may also be expressed as a conditional expression, such as a resource including a wildcard. Identifier expression, The resource corresponding to the resource identifier matching the expression is allowed or not allowed to be distributed by the device A;
-允许或不允许的资源提供方设备;该条策略具体可以表现为设备列表,该设备列表中包括一个或多个设备信息,这些设备信息所对应的设备所提供的资源信息允许或不允许被设备A接受和分发。该设备列表中的设备信息具体可以包括设备类型、设备标识、设备地址等信息中的一种或多种;该条策略还可以具体表现为条件表达式,比如包含通配符的设备IP地址表达式,与该表达式匹配的IP地址所对应的设备,其提供的资源信息允许或不允许被设备A接受和分发。- a resource provider device that is allowed or disallowed; the policy may be embodied as a device list, where the device list includes one or more device information, and the resource information provided by the device corresponding to the device information is allowed or not allowed to be Device A accepts and distributes. The device information in the device list may include one or more of the device type, the device identifier, and the device address. The policy may also be expressed as a conditional expression, such as a device IP address expression including a wildcard. The device corresponding to the IP address matching the expression, the resource information provided by it allows or is not allowed to be accepted and distributed by the device A.
相应地,设备A根据资源分发权限控制策略对接收到的服务发现信息中的资源信息进行权限鉴权可包括进行以下之一或任意组合判断:Correspondingly, the device A performing the rights authentication on the resource information in the received service discovery information according to the resource distribution authority control policy may include performing one or any combination of the following:
-服务发现信息中包含的资源信息所对应的资源是否为被允许分发的资源;实际实施时,针对每个应用,均可以配置哪些资源可以对外分发,哪些资源不允许对外分发。- Whether the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed. In actual implementation, for each application, you can configure which resources can be distributed externally and which resources are not allowed to be distributed.
-是否允许接受和分发所述服务发现信息的发送方设备所提供的资源。- Whether to allow the resources provided by the sender device of the service discovery information to be accepted and distributed.
可选地,在一些实施例中,设备A可获取当前网络状态,根据当前网络状态,判断接收到的服务发现信息中所包括的资源信息是否允许在当前网络状态下分发,若不允许,则拒绝将该资源信息添加到资源分发列表中;若允许,则可以将该资源信息添加到资源分发列表中,或者进一步结合其他策略进行判断。作为例子,如果当前网络状态为Wi-Fi网络连接,则允许进行资源分发;再例如,如果当前网络状态为Wi-Fi网络状态且网络性能较好(可通过多种网络性能参数进行网络性能评估),则允许动态服务类型的资源进行分发,否则,不允许动态服务类型的资源进行分发。Optionally, in some embodiments, the device A may obtain the current network status, and determine, according to the current network status, whether the resource information included in the received service discovery information is allowed to be distributed in the current network state, if not allowed, The resource information is refused to be added to the resource distribution list; if allowed, the resource information may be added to the resource distribution list or further combined with other policies for judgment. As an example, if the current network status is a Wi-Fi network connection, resource distribution is allowed; for example, if the current network status is a Wi-Fi network status and the network performance is good (network performance evaluation can be performed through various network performance parameters) ), allowing resources of the dynamic service type to be distributed; otherwise, resources of the dynamic service type are not allowed to be distributed.
上述流程中的“资源分发列表”中可包括一个或多个资源信息,且这些资源信息可来自于多个设备。这是因为设备A可接收其周围一定范围内的其他设备发送的服务发现信息(比如采用上述方式一或方式二提供的服务发现过程),因此设备A可获得不同设备所提供的资源信息。One or more resource information may be included in the “resource distribution list” in the above process, and the resource information may be from multiple devices. This is because the device A can receive the service discovery information sent by other devices in a certain range (for example, the service discovery process provided by the foregoing mode 1 or mode 2), so the device A can obtain the resource information provided by the different devices.
设备A获取其他设备发送的服务发现信息之后,可对这些资源信息进行处理,将处理后的资源信息添加到资源分发列表中,并将该资源分发列 表的相关内容在用户界面中展示。其中,对资源信息进行处理可包括但不限于以下操作内容中的一种或任意组合:After acquiring the service discovery information sent by other devices, device A may process the resource information, add the processed resource information to the resource distribution list, and distribute the resource distribution column. The relevant content of the table is displayed in the user interface. The processing of the resource information may include, but is not limited to, one or any combination of the following operations:
-查重操作,即,查询资源分发列表中是否有重复的资源信息,若有,则不再重复添加;- Check the operation, that is, whether there is duplicate resource information in the resource distribution list, and if so, the addition is not repeated;
-聚合操作,即,将不同设备提供的相同资源信息进行聚合,可以聚合为一条资源信息,即作为一个表项添加到资源分发列表中,也可以作为不同的表项添加的资源分发列表中。这样,可将对外分发的资源进行聚合,形成服务视图。The aggregation operation, that is, the aggregation of the same resource information provided by different devices, can be aggregated into one resource information, that is, added as an entry to the resource distribution list, or as a resource distribution list added by different entries. In this way, resources distributed externally can be aggregated to form a service view.
上述资源分发列表中的一个表项的内容可具体包含以下内容之一或任意组合:The content of one of the foregoing resource distribution lists may specifically include one or any combination of the following:
-资源信息;所述资源信息具体可包括资源标识符,进一步地,还可包括以下内容之一或任意组合:资源类型、资源所属域(domain)、资源名称、资源描述信息(比如用于描述所提供的服务内容等)。以上仅为示例,不排除还可以包含其他信息。其中,资源类型可根据需要从不同角度进行划分,比如资源类型可包括:应用程序、服务,当然还可在此基础上进一步细分,比如应用程序包括系统应用程序、游戏、小工具等;- resource information; the resource information may specifically include a resource identifier, and further, may also include one or any combination of the following: a resource type, a domain to which the resource belongs, a resource name, and resource description information (for example, for description The content of the services provided, etc.). The above is only an example, and other information may not be excluded. The resource type can be divided from different angles according to needs. For example, the resource type may include: an application, a service, and of course, further subdivided on the basis of the application, such as an application including a system application, a game, a gadget, and the like;
-设备信息;所述设备信息具体可包括设备标识和/或地址信息,进一步地,还可包括以下内容之一或任意组合:设备类型、设备型号、设备描述信息等;- device information; the device information may specifically include device identification and/or address information, and further, may also include one or any combination of the following: device type, device model, device description information, and the like;
-有效性标识,用于标识对应资源的有效性。该信息为可选项。- A validity identifier that identifies the validity of the corresponding resource. This information is optional.
上述资源分发列表中的部分内容或全部内容可呈现于用户界面,比如可仅将资源信息的条目呈现于用户界面,也可将资源信息条目和设备信息条目呈现于用户界面。图4示例性地示出了一种呈现于用户界面的资源分发列表,其中示出了4个表项,每个表项中包括以下内容:资源描述(包括资源名称和资源类型)、资源提供方设备描述。Some or all of the content in the resource distribution list may be presented in the user interface, for example, the item of the resource information may be presented to the user interface, and the resource information item and the device information item may be presented to the user interface. FIG. 4 exemplarily shows a resource distribution list presented in a user interface, in which four entries are shown, each of which includes the following contents: resource description (including resource name and resource type), resource provisioning Party device description.
进一步地,考虑到设备可能在没有通知的情况下停止服务或者从网络上卸载,为了提高资源分发列表的可用性,在一些优选的实施例中,设备 A可读该资源分发列表进行维护,以保证该资源分发列表中的资源信息的有效性。具体地,设备A可采用以下方式中的一种或任意组合,对资源分发列表进行维护:Further, in some preferred embodiments, in order to improve the availability of a resource distribution list, in view of the fact that the device may stop or unload from the network without notification, in some preferred embodiments, the device A can read the resource distribution list for maintenance to ensure the validity of the resource information in the resource distribution list. Specifically, the device A may maintain the resource distribution list in one or any combination of the following manners:
方式A:对资源分发列表中的每个表项记录其创建或更新时间或者维护一个定时器,并可根据设定周期或时间,根据表项的创建时间或对应的定时器对该资源分发列表中超时的表项进行删除。其中,如果设备A接收到设备B发送的服务发现信息,且查询到该资源分发列表中已存在设备B提供的资源信息,则设备A可不再重复添加该资源信息,但可更新该资源信息对应的创建时间或更新时间或者重置该资源信息对应的定时器;Manner A: records the creation or update time of each entry in the resource distribution list or maintains a timer, and may distribute the resource to the resource according to the creation time of the entry or the corresponding timer according to the set period or time. The entry in the timeout is deleted. If the device A receives the service discovery information sent by the device B, and the resource information provided by the device B is already found in the resource distribution list, the device A may not repeatedly add the resource information, but may update the resource information. Create time or update time or reset the timer corresponding to the resource information;
方式B:设备A接收到其他设备(比如设备B)发送的资源失效通知消息后,根据该通知消息查询资源列表中该设备B所提供的资源信息,将查询到的表项进行删除。其中,所述资源失效通知消息可包括:停止提供资源的通知消息(此种情况下,资源失效通知消息可用于指示删除已经停止提供的资源信息),退出网络的通知消息(此种情况下,资源失效通知消息可用于指示删除设备B提供的资源信息),断开与设备A的连接的通知消息等消息中的一种或组合。Mode B: After receiving the resource failure notification message sent by another device (such as device B), the device A queries the resource information provided by the device B in the resource list according to the notification message, and deletes the queried entry. The resource failure notification message may include: stopping the notification message of providing the resource (in this case, the resource failure notification message may be used to indicate deletion of the resource information that has been discontinued), and exiting the notification message of the network (in this case, The resource failure notification message may be used to indicate one or a combination of messages such as deleting the resource information provided by the device B, disconnecting the notification message of the connection with the device A, and the like.
进一步地,在上述图3所示的流程中的步骤302之后,还可包括以下步骤303至步骤305:Further, after step 302 in the foregoing process shown in FIG. 3, the following steps 303 to 305 may be further included:
步骤303:设备A确定资源分发列表中被选择的资源信息。Step 303: The device A determines the selected resource information in the resource distribution list.
如前所述,设备A可将资源分发列表显示在用户界面上,以供用户选取。用户可通过屏幕操作或按键操作选取该用户界面所显示的资源分发列表中的资源,并提交资源获取请求,设备A可根据用户提交的资源获取请求确定被用户选择的资源信息。As previously mentioned, device A can display a resource distribution list on the user interface for the user to select. The user can select a resource in the resource distribution list displayed by the user interface through a screen operation or a button operation, and submit a resource acquisition request, and the device A can determine the resource information selected by the user according to the resource acquisition request submitted by the user.
步骤304:设备A根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求。Step 304: The device A sends a resource acquisition request for requesting acquisition of the corresponding resource to the device that provides the corresponding resource according to the selected resource information.
该步骤中,由于资源分发列表中可包含资源信息的提供方设备的信息,因此设备A可根据被选择的资源信息,向提供相应资源的设备发送资源获取请求消息。该资源获取请求消息中可包含所请求获取的资源信息,比如资源标识符、资源类型、资源所属域、资源名称中的一种或任意组合。 In this step, because the information of the provider device that can include the resource information in the resource distribution list, the device A can send the resource acquisition request message to the device that provides the corresponding resource according to the selected resource information. The resource acquisition request message may include the resource information requested to be acquired, such as one of a resource identifier, a resource type, a domain to which the resource belongs, and a resource name, or any combination thereof.
进一步地,在一些优选实施例中,设备A上设置有资源分发权限控制策略,在步骤304中,设备A在获取被选择的资源信息之后,可根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权,若鉴权通过,则向提供该相应资源的设备发送用于请求获取相应资源的资源获取请求。Further, in some preferred embodiments, the device A is provided with a resource distribution authority control policy. In step 304, after acquiring the selected resource information, the device A may select the selected resource according to the resource distribution authority control policy. The information is used for the authentication of the distribution authority. If the authentication is passed, the resource acquisition request for requesting the acquisition of the corresponding resource is sent to the device providing the corresponding resource.
其中,设备A上设置的资源分发权限控制策略可定义以下内容之一或任意组合:The resource distribution permission control policy set on the device A may define one or any combination of the following:
-允许或不允许分发的资源;该条策略具体可以表现为资源列表,该资源列表中包括一个或多个资源信息,这些资源信息所对应的资源允许或不允许被设备A进行分发。该资源列表中的资源信息具体可以包括资源类型、资源标识符、资源所属域(domain)等信息中的一种或多种;该条策略还可以具体表现为条件表达式,比如包含通配符的资源标识符表达式,与该表达式匹配的资源标识符所对应的资源允许或不允许被设备A分发;- A resource that is allowed or not allowed to be distributed; the policy may be embodied as a resource list, and the resource list includes one or more resource information, and the resource corresponding to the resource information is allowed or not allowed to be distributed by the device A. The resource information in the resource list may specifically include one or more of a resource type, a resource identifier, and a domain to which the resource belongs. The policy may also be expressed as a conditional expression, such as a resource including a wildcard. An identifier expression, a resource corresponding to the resource identifier matching the expression is allowed or not allowed to be distributed by the device A;
-允许或不允许的资源提供方设备;该条策略具体可以表现为设备列表,该设备列表中包括一个或多个设备信息,这些设备信息所对应的设备所提供的资源信息允许或不允许被设备A分发,即设备A有权或无权请求获取这些设备提供的资源。该设备列表中的设备信息具体可以包括设备类型、设备标识、设备地址等信息中的一种或多种;该条策略还可以具体表现为条件表达式,比如包含通配符的设备IP地址表达式,与该表达式匹配的IP地址所对应的设备,其提供的资源信息允许或不允许被设备A分发。- a resource provider device that is allowed or disallowed; the policy may be embodied as a device list, where the device list includes one or more device information, and the resource information provided by the device corresponding to the device information is allowed or not allowed to be Device A is distributed, that is, device A has the right or no right to request the resources provided by these devices. The device information in the device list may include one or more of the device type, the device identifier, and the device address. The policy may also be expressed as a conditional expression, such as a device IP address expression including a wildcard. The device corresponding to the IP address matching the expression, the resource information provided by it is allowed or not allowed to be distributed by the device A.
相应地,设备A根据资源分发权限控制策略对接收到的服务发现信息中的资源信息进行权限鉴权可包括进行以下之一或任意组合判断:Correspondingly, the device A performing the rights authentication on the resource information in the received service discovery information according to the resource distribution authority control policy may include performing one or any combination of the following:
-服务发现信息中包含的资源信息(如被选择的资源信息)所对应的资源是否为被允许分发的资源;- whether the resource corresponding to the resource information (such as the selected resource information) included in the service discovery information is a resource that is allowed to be distributed;
-对于被选择的资源信息的发送方设备,是否允许请求获取该设备所提供的资源。- Whether the request is made to obtain the resources provided by the device for the sender device of the selected resource information.
步骤305:设备B接收到设备A发送的资源获取请求后,根据该资源获取请求获取所请求的资源,并发送给设备A。 Step 305: After receiving the resource acquisition request sent by the device A, the device B acquires the requested resource according to the resource acquisition request, and sends the requested resource to the device A.
比如,如果资源获取请求用于请求获取某个应用程序的安装包,则设备A将该应用程序的安装包发送给设备A;再比如,如果资源获取请求用于请求获取某个摄像头的拍摄服务,则设备B将该摄像头拍摄的视频数据发送给设备A,其中,由于摄像头拍摄过程是连续的,因此设备B可不断地将摄像头拍摄的数据发送给设备A,直到该服务终止。For example, if the resource acquisition request is used to request to obtain an installation package of an application, the device A sends the installation package of the application to the device A; for example, if the resource acquisition request is used to request to obtain a shooting service of a certain camera. Then, the device B transmits the video data captured by the camera to the device A, wherein since the camera shooting process is continuous, the device B can continuously transmit the data captured by the camera to the device A until the service is terminated.
该步骤305中,设备B在向设备A发送资源之前,可与设备A建立连接,之后设备B可通过该连接向设备A发送资源,该连接可不依赖于蜂窝网络,比如可建立点对点连接。设备A与设备B之间可采用多种方式建立连接,或者说可以建立多种类型的通信连接,比如可建立蓝牙传输连接。In step 305, before transmitting the resource to the device A, the device B can establish a connection with the device A, and then the device B can send the resource to the device A through the connection, and the connection can be independent of the cellular network, for example, a point-to-point connection can be established. There are various ways to establish a connection between device A and device B, or multiple types of communication connections can be established, such as establishing a Bluetooth transmission connection.
在一些实施例中,优选地,设备B接收到设备A发送的资源获取请求消息后,可首先根据资源分发权限控制策略,对该资源获取请求进行分发权限鉴权。如果鉴权通过,则向设备A返回所请求获取的资源,否则,不响应该资源获取请求,并可进一步返回资源获取失败信息。其中,设备B在根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权时,可执行以下之一或任意组合判断:In some embodiments, after receiving the resource acquisition request message sent by the device A, the device B may first perform the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy. If the authentication is passed, the requested resource is returned to the device A. Otherwise, the resource acquisition request is not responded, and the resource acquisition failure information may be further returned. The device B may perform one or any combination of the following when determining the distribution authority for the resource acquisition request according to the resource distribution authority control policy:
-是否允许向资源获取请求消息的发送方设备提供资源分发服务;- Whether to allow the resource distribution service to be provided to the sender device of the resource acquisition request message;
-资源获取请求消息所请求获取的资源是否为该资源获取请求消息发送方设备允许访问的资源。- Whether the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
在一些实施例中,优选地,设备A发送的资源获取请求消息中可携带有参数,比如当设备A所请求获取的是资源类型是服务类型时,比如支付服务,则该参数可以是用户支付账户的信息,这种情况下,设备B可在接收到该资源获取请求消息后,根据所请求的资源和该参数进行处理,并将处理结果返回给设备A,比如使用上述用户支付账户信息进行网上支付,并将支付结果返回给设备A。In some embodiments, preferably, the resource acquisition request message sent by the device A may carry parameters, such as when the device A requests to acquire the resource type is a service type, such as a payment service, the parameter may be a user payment. The information of the account. In this case, after receiving the resource acquisition request message, the device B may process the resource according to the requested resource and the parameter, and return the processing result to the device A, for example, using the user payment account information. Pay online and return the payment result to Device A.
在一些实施例中,优选地,设备A在接收到设备B发送的资源后,可首先进行完整性检查,若完整性检查不通过,则放弃接收该资源,若完整性检查通过,则可接收该资源。其中,可采用基于CRC(Cyclical Redundancy Check,循环冗余校验)或者MD5的校验算法进行完整性检查,本发明对此不做限制。 In some embodiments, after receiving the resource sent by the device B, the device A may first perform an integrity check. If the integrity check fails, the device abandons the resource. If the integrity check passes, the device can receive the integrity check. The resource. The integrity check may be performed by using a CRC (Cyclic Redundancy Check) or an MD5 check algorithm. The present invention does not limit this.
在一些实施例中,优选地,设备A在接收到设备B发送资源后,可进行安全性检查,若安全性检查通过,则可将该资源呈现给用户或者进行处理,否则放弃接收到的资源。具体地,一方面,每个资源可以携带有签名,这样可根据资源的签名进行安全性检查;另一方面,设备A还可进行一般性数据包扫描,以查看是否有疑似威胁内容存在。进一步地,在安全性检查中发现疑似安全风险后,设备A可在其屏幕上弹出窗口,该窗口中显示提醒信息,并可进一步征询用户是否允许本次资源分发操作。In some embodiments, after receiving the resource sent by the device B, the device A may perform a security check. If the security check passes, the resource may be presented to the user or processed, otherwise the received resource is discarded. . Specifically, on the one hand, each resource may carry a signature, so that the security check may be performed according to the signature of the resource; on the other hand, the device A may also perform a general packet scan to check whether there is a suspected threat content. Further, after the suspected security risk is found in the security check, the device A may pop up a window on the screen, and the reminder information is displayed in the window, and the user may be further asked whether to allow the current resource distribution operation.
通过以上描述可以看出,一个设备可接收其他设备发送的服务发现信息,并可根据接收到的服务发现信息中包括的资源信息生成资源分发列表。由于一方面,一个设备可接收多个其他设备发送的服务发现信息,因此可以根据多个其他设备发送的服务信息生成资源分发列表,从而可获得多个设备所提供的资源信息,进而可以根据需要从不同的设备获取需要的资源;另一方面,本申请实施例可以基于服务发现过程进行资源分发,避免了通过蜂窝网络进行资源分发所带来的问题。As can be seen from the above description, a device may receive service discovery information sent by other devices, and may generate a resource distribution list according to the resource information included in the received service discovery information. In one aspect, a device can receive service discovery information sent by multiple other devices, so that a resource distribution list can be generated according to service information sent by multiple other devices, so that resource information provided by multiple devices can be obtained, and then, as needed, The required resources are obtained from different devices. On the other hand, the embodiment of the present application can perform resource distribution based on the service discovery process, and avoids problems caused by resource distribution through the cellular network.
尤其在将本申请实施例应用于云操作系统,比如YunOS时,由于在YunOS中,所有类型资源均称为Page,且所有Page使用同一的资源标识符(URI)来标识,这样,通过本申请实施例可聚合各种类型的资源进行分发和访问,与单一类型的资源分发和访问相比,可提高用户感受,更能满足用户需求。In particular, when the embodiment of the present application is applied to a cloud operating system, such as YunOS, since all types of resources are referred to as Pages in YunOS, and all pages are identified by the same resource identifier (URI), thus, the present application is adopted. Embodiments can aggregate various types of resources for distribution and access, and can improve user experience and meet user needs as compared with single type of resource distribution and access.
需要说明的是,在将上述实施例应用于云操作系统,特别是YunOS时,设备间交互的信息可采用PageLink方式。It should be noted that, when the foregoing embodiment is applied to the cloud operating system, especially the YunOS, the information exchanged between the devices may adopt the PageLink method.
基于相同的技术构思,本申请实施例提供了一种资源分发装置,该装置可实现上述实施例提供的资源分发流程。。Based on the same technical concept, the embodiment of the present application provides a resource distribution device, which can implement the resource distribution process provided by the foregoing embodiment. .
参见图5,为本申请实施例提供的资源分发装置的结构示意图,该装置可包括:服务发现模块51、分发管理模块52,进一步地还可包括权限控制模块53、网络状态获取模块54、资源获取模块55中的一种或多种,其中:5 is a schematic structural diagram of a resource distribution apparatus according to an embodiment of the present disclosure. The apparatus may include: a service discovery module 51, a distribution management module 52, and further, an access control module 53, a network state acquisition module 54, and resources. Obtain one or more of the modules 55, wherein:
服务发现模块51,用于接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息; The service discovery module 51 is configured to receive service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
分发管理模块52,用于根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。The distribution management module 52 is configured to generate resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
优选地,服务发现模块51可具体用于:发送查询请求消息,所述查询请求消息中包含请求查询的资源信息;接收所述查询请求消息对应的查询响应消息,所述查询响应消息中包含所述服务发现信息。Preferably, the service discovery module 51 is specifically configured to: send a query request message, where the query request message includes resource information of the request query; and receive a query response message corresponding to the query request message, where the query response message includes Service discovery information.
其中,服务发现模块51可根据设定的多播地址发送所述查询请求消息,采用单播方式接收所述查询响应消息。The service discovery module 51 may send the query request message according to the set multicast address, and receive the query response message in a unicast manner.
进一步地,网络状态获取模块54可用于获取当前网络状态,相应地,服务发现模块51可用于:在发送查询请求消息之前,根据网络状态获取模块54获取到的当前网络状态,确定在当前网络状态下请求查询的资源。Further, the network state obtaining module 54 can be configured to obtain the current network state. Accordingly, the service discovery module 51 can be configured to determine the current network state according to the current network state acquired by the network state acquiring module 54 before sending the query request message. The resource that requested the query.
优选地,在另一实施例中,服务发现模块51可具体用于:接收通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。Preferably, in another embodiment, the service discovery module 51 is specifically configured to: receive a notification message, where the service discovery information included in the notification message includes the notification message sender device information and the device provides Resource information.
其中,服务发现模块51可接收目的地址为设定多播地址的通知消息。The service discovery module 51 can receive the notification message whose destination address is the set multicast address.
优选地,权限控制模块53可用于根据资源分发权限控制策略,对接收到的服务发现信息中的资源信息进行分发权限鉴权;相应地,分发管理模块52可具体用于:若权限控制模块53鉴权通过,则将接收到的服务发现信息中的资源信息添加到所述资源分发信息中。Preferably, the privilege control module 53 is configured to perform the privilege authentication on the resource information in the received service discovery information according to the resource distribution privilege control policy. The distribution management module 52 may be specifically configured to: if the privilege control module 53 After the authentication is passed, the resource information in the received service discovery information is added to the resource distribution information.
其中,分发管理模块52可具体用于:根据资源分发权限控制策略,针对接收到的服务发现信息中的资源信息,进行以下之一或任意组合判断:The distribution management module 52 may be specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following on the resource information in the received service discovery information:
所述服务发现信息中包含的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
是否允许接受和分发所述服务发现信息的发送方设备所提供的资源。Whether to allow the resources provided by the sender device of the service discovery information to be accepted and distributed.
优选地,分发管理模块52可具体用于:根据网络状态获取模块54获取到的当前网络状态,判断所述服务发现信息中包括的资源信息是否允许在当前网络状态下分发,若不允许,则拒绝将该资源信息添加到所述资源分发信息中。 Preferably, the distribution management module 52 is specifically configured to: determine, according to the current network state acquired by the network state acquiring module 54, whether the resource information included in the service discovery information is allowed to be distributed in the current network state, if not allowed, The resource information is refused to be added to the resource distribution information.
优选地,分发管理模块52还可用于:将所述资源分发信息显示于用户界面。Preferably, the distribution management module 52 is further configured to display the resource distribution information on the user interface.
优选地,分发管理模块52还可用于:根据设定周期或时间,删除所述资源分发信息中的超时资源信息;和/或,在接收到资源失效通知消息时,根据所述资源失效通知消息删除所述资源分发信息中对应的资源信息。Preferably, the distribution management module 52 is further configured to: delete timeout resource information in the resource distribution information according to a set period or time; and/or, according to the resource failure notification message, when receiving the resource failure notification message The corresponding resource information in the resource distribution information is deleted.
优选地,资源获取模块55,用于在根据接收到的服务发现信息生成资源分发信息之后,确定所述资源分发信息中被选择的资源信息;以及,根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求。Preferably, the resource obtaining module 55 is configured to: after the resource distribution information is generated according to the received service discovery information, determine the selected resource information in the resource distribution information; and provide the corresponding resource according to the selected resource information. The device sends a resource acquisition request for requesting to acquire the corresponding resource.
其中,权限控制模块53可用于根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权;相应地,资源获取模块55可具体用于:若权限控制模块53鉴权通过,则向提供该相应资源的设备发送用于请求获取相应资源的资源获取请求。The privilege control module 53 can be configured to perform the privilege authentication on the selected resource information according to the resource distribution privilege control policy. Accordingly, the resource obtaining module 55 can be specifically configured to: if the privilege control module 53 passes the authentication, The device providing the corresponding resource sends a resource acquisition request for requesting acquisition of the corresponding resource.
优选地,权限控制模块53可具体用于:根据资源分发权限控制策略,针对被选择的资源信息,进行以下之一或任意组合判断:Preferably, the rights control module 53 is specifically configured to: according to the resource distribution authority control policy, perform one or any combination of the following determinations on the selected resource information:
被选择的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the selected resource information is a resource that is allowed to be distributed;
对于被选择的资源信息的发送方设备,是否允许请求获取该设备提供的资源。Whether the sender device of the selected resource information is allowed to request the resource provided by the device.
优选地,所述资源获取请求中携带有参数,以使所述资源获取请求的接收方根据该参数返回处理结果。Preferably, the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
优选地,资源获取模块55还可用于:在向提供该资源信息的设备发送用于请求获取相应资源的资源获取请求之后,接收提供该资源信息的设备根据所述资源获取请求发送的资源。Preferably, the resource obtaining module 55 is further configured to: after sending the resource acquisition request for requesting acquisition of the corresponding resource to the device that provides the resource information, receive the resource that is sent by the device that provides the resource information according to the resource acquisition request.
优选地,所述资源分发信息中包括根据至少一个设备发送的服务信息得到的资源信息。Preferably, the resource distribution information includes resource information obtained according to service information sent by at least one device.
优选地,所述资源包括应用、服务、数据中的一种或多种组合。Preferably, the resource comprises one or more combinations of applications, services, and data.
基于相同的技术构思,本申请实施例提供了一种资源分发装置,该装置可实现上述实施例提供的资源分发流程。 Based on the same technical concept, the embodiment of the present application provides a resource distribution device, which can implement the resource distribution process provided by the foregoing embodiment.
参见图6,为本申请实施例提供的资源分发装置的结构示意图,该装置可包括:生成模块61、服务发现模块62,进一步地,还可包括:权限控制模块63、资源提供模块64、网络状态获取模块65中的一种或多种,其中:FIG. 6 is a schematic structural diagram of a resource distribution apparatus according to an embodiment of the present disclosure. The apparatus may include: a generating module 61 and a service discovery module 62. Further, the method may further include: a rights control module 63, a resource providing module 64, and a network. One or more of the state acquisition modules 65, wherein:
生成模块61,用于根据发送方设备所能提供的资源,生成服务发现信息;The generating module 61 is configured to generate service discovery information according to resources that the sender device can provide;
服务发现模块62,用于发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。The service discovery module 62 is configured to send the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
优选地,服务发现模块62可具体用于:接收查询请求消息,所述查询请求消息中包含请求查询的资源信息;根据所述查询请求消息返回查询响应消息,所述查询响应消息中包含所述服务发现信息。Preferably, the service discovery module 62 is specifically configured to: receive a query request message, where the query request message includes resource information of the request query; and return a query response message according to the query request message, where the query response message includes the Service discovery information.
其中,服务发现模块62可具体用于:根据设定的多播地址接收所述查询请求消息,采用单播方式返回所述查询响应消息。The service discovery module 62 is specifically configured to: receive the query request message according to the set multicast address, and return the query response message in a unicast manner.
优选地,权限控制模块63可用于根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权;相应地,服务发现模块62具体用于:若权限控制模块63鉴权通过,则返回所述查询响应消息。Preferably, the privilege control module 63 is configured to: perform the privilege authentication on the resource that is requested by the queried request message according to the resource distribution privilege control policy; and correspondingly, the privilege control module 62 is specifically configured to: if the privilege control module 63 When the right passes, the query response message is returned.
其中,权限控制模块63可具体用于根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权时,执行以下之一或任意组合判断:The permission control module 63 may be specifically configured to perform one or any combination of the following determinations when performing the distribution authority authentication on the resource requested by the acquisition request message according to the resource distribution authority control policy:
是否允许向查询请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to be provided to the sender device of the query request message;
所述查询请求消息所请求查询的资源是否为该查询请求消息发送方设备允许访问的资源。Whether the resource requested by the query request message is a resource that the query request message sender device allows access to.
优选地,服务发现模块62可具体用于:发送通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。Preferably, the service discovery module 62 is specifically configured to: send a notification message, where the service discovery information included in the notification message includes the notification message sender device information and resource information provided by the device.
其中,服务发现模块62可具体用于:根据设定多播地址发送所述通知消息。 The service discovery module 62 is specifically configured to: send the notification message according to the set multicast address.
优选地,权限控制模块63可用于在发送通知消息之前,根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权;相应地,服务发现模块62还可用于:在发送通知消息之前,若权限控制模块63鉴权通过,则发送所述通知消息。Preferably, the privilege control module 63 is configured to: before the sending the notification message, perform the privilege authentication on the resource that is requested by the queried request message according to the resource distribution privilege control policy; accordingly, the service discovery module 62 is further configured to: Before the notification message is sent, if the authorization control module 63 passes the authentication, the notification message is sent.
其中,权限控制模块63具体用于:根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权时,执行以下之一或任意组合判断:The permission control module 63 is specifically configured to perform one or any combination of the following determinations when performing resource authorization authentication on the resources in the sender device according to the resource distribution authority control policy:
本设备是否允许提供资源分发服务;Whether the device is allowed to provide resource distribution services;
确定本设备允许或不允许分发的资源。Determine which resources the device allows or does not allow for distribution.
优选地,网络状态获取模块65可获取当前网络状态;相应地,服务发现模块62还可用于:在发送通知消息之前,根据网络状态获取模块65获取到的当前网络状态,确定在当前网络状态下需要在所述通知消息中包含的资源信息。Preferably, the network state obtaining module 65 can obtain the current network state; correspondingly, the service discovery module 62 can be further configured to determine, according to the current network state acquired by the network state acquiring module 65, before the notification message is sent, in the current network state. The resource information contained in the notification message is required.
优选地,资源提供模块64可用于接收资源获取请求,根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源。Preferably, the resource providing module 64 is configured to receive a resource acquisition request, and return the requested resource to the resource acquisition request sender according to the resource acquisition request.
其中,资源提供模块64还可用于:根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源之前,指示权限控制模块63根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权。The resource providing module 64 is further configured to: before the resource acquisition request returns the requested resource to the resource acquisition request, instruct the permission control module 63 to obtain the resource acquisition request according to the resource distribution authority control policy. Perform distribution authority authentication.
其中,权限控制模块63具体用于:根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权时,执行以下之一或任意组合判断:The permission control module 63 is specifically configured to perform one or any combination of the following determinations when performing the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy:
是否允许向资源获取请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to the sender device of the resource acquisition request message;
所述资源获取请求消息所请求获取的资源是否为该资源获取请求消息发送方设备允许访问的资源。Whether the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
优选地,所述资源获取请求中携带有参数,资源提供模块64可具体用于:根据所述资源获取请求所请求的资源以及所述参数进行处理,向所述资源获取请求发送方返回处理结果。Preferably, the resource acquisition request carries a parameter, and the resource providing module 64 may be specifically configured to: process, according to the resource requested by the resource acquisition request, and the parameter, and send the processing result to the resource acquisition request sender. .
优选地,所述资源包括应用、服务、数据中的一种或多种组合。Preferably, the resource comprises one or more combinations of applications, services, and data.
基于相同的技术构思,本申请实施例还提供了一种设备,可设备可实现上述流程所述的资源分发。 Based on the same technical concept, the embodiment of the present application further provides a device, and the device can implement the resource distribution described in the foregoing process.
参见图7,为本申请实施例提供的一种设备的结构示意图。该设备总体来说可包括:处理器701,存储器702、显示器703。FIG. 7 is a schematic structural diagram of a device according to an embodiment of the present application. The device may generally include a processor 701, a memory 702, and a display 703.
其中,处理器701可以是通用处理器(比如微处理器或者任何常规的处理器等)、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。存储器702具体可包括内部存储器和/或外部存储器,比如随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质。显示器703可包括触摸屏控制电路。The processor 701 can be a general purpose processor (such as a microprocessor or any conventional processor, etc.), a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic. Devices, discrete hardware components. Memory 702 may specifically include internal memory and/or external memory, such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like, which are well established in the art. Display 703 can include touch screen control circuitry.
处理器701与其他各模块之间存在数据通信连接,比如可基于总线架构进行数据通信。总线架构可以包括任意数量的互联的总线和桥,具体由处理器701代表的一个或多个处理器和存储器702代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。处理器701负责管理总线架构和通常的处理,存储器702可以存储处理器701在执行操作时所使用的数据。There is a data communication connection between the processor 701 and other modules, such as data communication based on the bus architecture. The bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 701 and various circuits of memory represented by memory 702. The bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein. The bus interface provides an interface. The processor 701 is responsible for managing the bus architecture and general processing, and the memory 702 can store data used by the processor 701 in performing operations.
本申请实施例揭示的流程,可以应用于处理器701中,或者由处理器701实现。在实现过程中,图片搜索流程的各步骤可以通过处理器701中的硬件的集成逻辑电路或者软件形式的指令完成。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。The flow disclosed in the embodiment of the present application may be applied to the processor 701 or implemented by the processor 701. In the implementation process, each step of the picture search process may be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
具体地,处理器701,耦合到存储器702,用于读取存储器702存储的计算机程序指令,并作为响应,执行如下操作:Specifically, the processor 701 is coupled to the memory 702 for reading computer program instructions stored by the memory 702 and, in response, performing the following operations:
接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;Receiving service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中 包括一个或多个资源信息。Generating resource distribution information according to the received service discovery information, in the resource distribution information Includes one or more resource information.
上述流程的具体实现过程可参见前述实施例,在此不再详述。For the specific implementation process of the foregoing process, refer to the foregoing embodiment, and details are not described herein.
基于相同的技术构思,本申请实施例还提供了一种设备,可设备可实现上述流程所述的资源分发。Based on the same technical concept, the embodiment of the present application further provides a device, and the device can implement the resource distribution described in the foregoing process.
参见图8,为本申请实施例提供的一种设备的结构示意图。该设备总体来说可包括:处理器801,存储器802、显示器803。FIG. 8 is a schematic structural diagram of a device according to an embodiment of the present application. The device may generally include a processor 801, a memory 802, and a display 803.
其中,处理器801可以是通用处理器(比如微处理器或者任何常规的处理器等)、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。存储器802具体可包括内部存储器和/或外部存储器,比如随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质。显示器803可包括触摸屏控制电路。The processor 801 can be a general purpose processor (such as a microprocessor or any conventional processor, etc.), a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or a transistor logic. Devices, discrete hardware components. Memory 802 may specifically include internal memory and/or external memory, such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like, which are well established in the art. Display 803 can include touch screen control circuitry.
处理器801与其他各模块之间存在数据通信连接,比如可基于总线架构进行数据通信。总线架构可以包括任意数量的互联的总线和桥,具体由处理器801代表的一个或多个处理器和存储器802代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。处理器801负责管理总线架构和通常的处理,存储器802可以存储处理器801在执行操作时所使用的数据。There is a data communication connection between the processor 801 and other modules, such as data communication based on the bus architecture. The bus architecture may include any number of interconnected buses and bridges, specifically linked by one or more processors represented by processor 801 and various circuits of memory represented by memory 802. The bus architecture can also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be further described herein. The bus interface provides an interface. The processor 801 is responsible for managing the bus architecture and general processing, and the memory 802 can store data used by the processor 801 in performing operations.
本申请实施例揭示的流程,可以应用于处理器801中,或者由处理器801实现。在实现过程中,图片搜索流程的各步骤可以通过处理器801中的硬件的集成逻辑电路或者软件形式的指令完成。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。The flow disclosed in the embodiment of the present application may be applied to the processor 801 or implemented by the processor 801. In the implementation process, each step of the picture search process may be completed by an integrated logic circuit of hardware in the processor 801 or an instruction in the form of software. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The steps of the method disclosed in the embodiments of the present application may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
具体地,处理器801,耦合到存储器802,用于读取存储器802存储的 计算机程序指令,并作为响应,执行如下操作:Specifically, the processor 801 is coupled to the memory 802 for reading the storage of the memory 802. The computer program instructions, and in response, perform the following operations:
根据发送方设备所能提供的资源,生成服务发现信息;Generating service discovery information according to resources that the sender device can provide;
发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。And sending the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
上述流程的具体实现过程可参见前述实施例,在此不再详述。For the specific implementation process of the foregoing process, refer to the foregoing embodiment, and details are not described herein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiment of the present application has been described, it will be apparent that those skilled in the art can make further changes and modifications to the embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 It will be apparent to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit and scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the present invention.

Claims (68)

  1. 一种资源分发方法,其特征在于,包括:A resource distribution method, comprising:
    接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;Receiving service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
    根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。The resource distribution information is generated according to the received service discovery information, and the resource distribution information includes one or more resource information.
  2. 如权利要求1所述的方法,其特征在于,接收服务发现信息,包括:The method of claim 1 wherein receiving service discovery information comprises:
    发送查询请求消息,所述查询请求消息中包含请求查询的资源信息;Sending a query request message, where the query request message includes resource information of the request query;
    接收所述查询请求消息对应的查询响应消息,所述查询响应消息中包含所述服务发现信息。Receiving a query response message corresponding to the query request message, where the query response message includes the service discovery information.
  3. 如权利要求2所述的方法,其特征在于,根据设定的多播地址发送所述查询请求消息,采用单播方式接收所述查询响应消息。The method according to claim 2, wherein the query request message is sent according to the set multicast address, and the query response message is received in a unicast manner.
  4. 如权利要求2所述的方法,其特征在于,发送查询请求消息之前,还包括:The method of claim 2, further comprising: before sending the query request message:
    获取当前网络状态;Get the current network status;
    根据当前网络状态,确定在当前网络状态下请求查询的资源。According to the current network status, the resource requesting the query in the current network state is determined.
  5. 如权利要求1所述的方法,其特征在于,接收服务发现信息,包括:The method of claim 1 wherein receiving service discovery information comprises:
    接收通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。And receiving the notification message, where the service discovery information included in the notification message includes the notification message sender device information and the resource information provided by the device.
  6. 如权利要求5所述的方法,其特征在于,接收目的地址为设定多播地址的通知消息。The method of claim 5, wherein the receiving the destination address is a notification message for setting a multicast address.
  7. 如权利要求1所述的方法,其特征在于,根据接收到的服务发现信息生成资源分发信息,包括:The method of claim 1, wherein the generating the resource distribution information according to the received service discovery information comprises:
    根据资源分发权限控制策略,对接收到的服务发现信息中的资源信息 进行分发权限鉴权;According to the resource distribution authority control policy, the resource information in the received service discovery information Perform distribution authority authentication;
    若鉴权通过,则将接收到的服务发现信息中的资源信息添加到所述资源分发信息中。If the authentication is passed, the resource information in the received service discovery information is added to the resource distribution information.
  8. 如权利要求7所述的方法,其特征在于,根据资源分发权限控制策略对接收到的服务发现信息中的资源信息进行权限鉴权,包括:The method according to claim 7, wherein the authenticating the resource information in the received service discovery information according to the resource distribution authority control policy comprises:
    根据资源分发权限控制策略,针对接收到的服务发现信息中的资源信息,进行以下之一或任意组合判断:According to the resource distribution authority control policy, one or any combination of the following is determined for the resource information in the received service discovery information:
    所述服务发现信息中包含的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
    是否允许接受和分发所述服务发现信息的发送方设备所提供的资源。Whether to allow the resources provided by the sender device of the service discovery information to be accepted and distributed.
  9. 如权利要求1至8中任一项所述的方法,其特征在于,根据接收到的服务发现信息生成资源分发信息,包括:The method according to any one of claims 1 to 8, wherein the generating the resource distribution information according to the received service discovery information comprises:
    获取当前网络状态;Get the current network status;
    根据当前网络状态,判断所述服务发现信息中包括的资源信息是否允许在当前网络状态下分发,若不允许,则拒绝将该资源信息添加到所述资源分发信息中。According to the current network status, it is determined whether the resource information included in the service discovery information is allowed to be distributed in the current network state, and if not allowed, the resource information is refused to be added to the resource distribution information.
  10. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    将所述资源分发信息显示于用户界面。The resource distribution information is displayed on a user interface.
  11. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    根据设定周期或时间,删除所述资源分发信息中的超时资源信息;和/或,Deleting timeout resource information in the resource distribution information according to a set period or time; and/or,
    在接收到资源失效通知消息时,根据所述资源失效通知消息删除所述资源分发信息中对应的资源信息。When the resource failure notification message is received, the resource information corresponding to the resource distribution information is deleted according to the resource failure notification message.
  12. 如权利要求1所述的方法,其特征在于,根据接收到的服务发现信息生成资源分发信息之后,还包括:The method of claim 1, after the generating the resource distribution information according to the received service discovery information, further comprising:
    确定所述资源分发信息中被选择的资源信息;Determining the selected resource information in the resource distribution information;
    根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相 应资源的资源获取请求。Sending a request for obtaining the phase to the device providing the corresponding resource according to the selected resource information The resource should be requested by the resource.
  13. 如权利要求12所述的方法,其特征在于,根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求,包括:The method according to claim 12, wherein, according to the selected resource information, the resource acquisition request for requesting acquisition of the corresponding resource is sent to the device that provides the corresponding resource, including:
    根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权;Performing distribution authority authentication on the selected resource information according to the resource distribution authority control policy;
    若鉴权通过,则向提供该相应资源的设备发送用于请求获取相应资源的资源获取请求。If the authentication is passed, a resource acquisition request for requesting acquisition of the corresponding resource is sent to the device providing the corresponding resource.
  14. 如权利要求13所述的方法,其特征在于,根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权,包括:The method according to claim 13, wherein the distributing the right of the selected resource information according to the resource distribution authority control policy comprises:
    根据资源分发权限控制策略,针对被选择的资源信息,进行以下之一或任意组合判断:According to the resource distribution authority control policy, one or any combination of the following is determined for the selected resource information:
    被选择的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the selected resource information is a resource that is allowed to be distributed;
    对于被选择的资源信息的发送方设备,是否允许请求获取该设备提供的资源。Whether the sender device of the selected resource information is allowed to request the resource provided by the device.
  15. 如权利要求12所述的方法,其特征在于,所述资源获取请求中携带有参数,以使所述资源获取请求的接收方根据该参数返回处理结果。The method according to claim 12, wherein the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
  16. 如权利要求12所述的方法,其特征在于,向提供该资源信息的设备发送用于请求获取相应资源的资源获取请求之后,还包括:The method according to claim 12, further comprising: after transmitting the resource acquisition request for requesting acquisition of the corresponding resource to the device that provides the resource information, further comprising:
    接收提供该资源信息的设备根据所述资源获取请求发送的资源。Receiving a resource that is sent by the device that provides the resource information according to the resource acquisition request.
  17. 如权利要求1至16中任一项所述的方法,其特征在于,所述资源分发信息中包括根据至少一个设备发送的服务信息得到的资源信息。The method according to any one of claims 1 to 16, wherein the resource distribution information includes resource information obtained from service information transmitted by at least one device.
  18. 如权利要求1至16中任一项所述的方法,其特征在于,所述资源包括应用、服务、数据中的一种或多种组合。The method of any of claims 1 to 16, wherein the resource comprises one or more combinations of applications, services, data.
  19. 一种资源分发方法,其特征在于,包括:A resource distribution method, comprising:
    根据发送方设备所能提供的资源,生成服务发现信息;Generating service discovery information according to resources that the sender device can provide;
    发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和 发送方设备所提供的资源信息。Sending the service discovery information, where the service discovery information includes a sender device identifier and Resource information provided by the sender device.
  20. 如权利要求19所述的方法,其特征在于,发送服务发现信息,包括:The method of claim 19, wherein the transmitting the service discovery information comprises:
    接收查询请求消息,所述查询请求消息中包含请求查询的资源信息;Receiving a query request message, where the query request message includes resource information of the request query;
    根据所述查询请求消息返回查询响应消息,所述查询响应消息中包含所述服务发现信息。And returning a query response message according to the query request message, where the query response message includes the service discovery information.
  21. 如权利要求20所述的方法,其特征在于,根据设定的多播地址接收所述查询请求消息,采用单播方式返回所述查询响应消息。The method according to claim 20, wherein the query request message is received according to the set multicast address, and the query response message is returned in a unicast manner.
  22. 如权利要求20所述的方法,其特征在于,根据所述查询请求消息返回查询响应消息,包括:The method of claim 20, wherein the returning the query response message according to the query request message comprises:
    根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权;And performing distribution authority authentication on the resource requested by the obtaining request message according to the resource distribution authority control policy;
    若鉴权通过,则返回所述查询响应消息。If the authentication is passed, the query response message is returned.
  23. 如权利要求22所述的方法,其特征在于,根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权,包括以下之一或任意组合判断:The method according to claim 22, wherein the resource authorization request is performed on the resource requested by the acquisition request message according to the resource distribution authority control policy, including one or any combination of the following:
    是否允许向查询请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to be provided to the sender device of the query request message;
    所述查询请求消息所请求查询的资源是否为该查询请求消息发送方设备允许访问的资源。Whether the resource requested by the query request message is a resource that the query request message sender device allows access to.
  24. 如权利要求19所述的方法,其特征在于,发送服务发现信息,包括:The method of claim 19, wherein the transmitting the service discovery information comprises:
    发送通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。And sending the notification message, where the service discovery information included in the notification message includes the notification message sender device information and the resource information provided by the device.
  25. 如权利要求24所述的方法,其特征在于,根据设定多播地址发送所述通知消息。The method of claim 24 wherein said notification message is sent in accordance with a set multicast address.
  26. 如权利要求24所述的方法,其特征在于,发送通知消息之前,还包括: The method of claim 24, further comprising: before sending the notification message,
    根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权;Performing distribution authority authentication on resources in the sender device according to the resource distribution authority control policy;
    若鉴权通过,则发送所述通知消息。If the authentication is passed, the notification message is sent.
  27. 如权利要求26所述的方法,其特征在于,根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权,包括以下之一或任意组合判断:The method according to claim 26, wherein the distribution authority authentication is performed on the resources in the sender device according to the resource distribution authority control policy, including one or any combination of the following:
    发送方设备是否允许提供资源分发服务;Whether the sender device allows the resource distribution service;
    确定发送方设备允许或不允许分发的资源。Determine which resources the sender device allows or disallows to distribute.
  28. 如权利要求24所述的方法,其特征在于,发送通知消息之前,还包括:The method of claim 24, further comprising: before sending the notification message,
    获取当前网络状态;Get the current network status;
    根据当前网络状态,确定在当前网络状态下需要在所述通知消息中包含的资源信息。According to the current network status, the resource information that needs to be included in the notification message in the current network state is determined.
  29. 如权利要求19所述的方法,其特征在于,还包括:The method of claim 19, further comprising:
    接收资源获取请求;Receiving a resource acquisition request;
    根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源。And returning, to the resource acquisition request, the resource requested by the resource acquisition request according to the resource acquisition request.
  30. 如权利要求29所述的方法,其特征在于,根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源之前,还包括:The method of claim 29, further comprising: before the resource acquisition request sender returns the requested resource according to the resource acquisition request, further comprising:
    根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权。According to the resource distribution authority control policy, the resource acquisition request is subjected to distribution authority authentication.
  31. 如权利要求30所述的方法,其特征在于,根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权,包括以下之一或任意组合判断:The method according to claim 30, wherein the distribution authority authentication is performed on the resource acquisition request according to the resource distribution authority control policy, including one or any combination of the following:
    是否允许向资源获取请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to the sender device of the resource acquisition request message;
    所述资源获取请求消息所请求获取的资源是否为该资源获取请求消息发送方设备允许访问的资源。 Whether the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
  32. 如权利要求29所述的方法,其特征在于,所述资源获取请求中携带有参数,所述根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源,包括:The method of claim 29, wherein the resource acquisition request carries a parameter, and the returning the requested resource to the resource acquisition request sender according to the resource acquisition request comprises:
    根据所述资源获取请求所请求的资源以及所述参数进行处理,向所述资源获取请求发送方返回处理结果。Processing according to the resource requested by the resource acquisition request and the parameter, and returning the processing result to the resource acquisition request sender.
  33. 如权利要求19至32中任一项所述的方法,其特征在于,所述资源包括应用、服务、数据中的一种或多种组合。The method of any of claims 19 to 32, wherein the resource comprises one or more combinations of applications, services, data.
  34. 一种资源分发装置,其特征在于,包括:A resource distribution device, comprising:
    服务发现模块,用于接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;a service discovery module, configured to receive service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
    分发管理模块,用于根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中包括一个或多个资源信息。And a distribution management module, configured to generate resource distribution information according to the received service discovery information, where the resource distribution information includes one or more resource information.
  35. 如权利要求34所述的装置,其特征在于,所述服务发现模块具体用于:The device of claim 34, wherein the service discovery module is specifically configured to:
    发送查询请求消息,所述查询请求消息中包含请求查询的资源信息;Sending a query request message, where the query request message includes resource information of the request query;
    接收所述查询请求消息对应的查询响应消息,所述查询响应消息中包含所述服务发现信息。Receiving a query response message corresponding to the query request message, where the query response message includes the service discovery information.
  36. 如权利要求35所述的装置,其特征在于,所述服务发现模块具体用于:根据设定的多播地址发送所述查询请求消息,采用单播方式接收所述查询响应消息。The device according to claim 35, wherein the service discovery module is configured to: send the query request message according to the set multicast address, and receive the query response message in a unicast manner.
  37. 如权利要求35所述的装置,其特征在于,还包括:网络状态获取模块;The device according to claim 35, further comprising: a network state acquisition module;
    所述网络状态获取模块,用于获取当前网络状态;The network status obtaining module is configured to acquire a current network status;
    所述服务发现模块还用于:在发送查询请求消息之前,根据所述网络状态获取模块获取到的当前网络状态,确定在当前网络状态下请求查询的资源。The service discovery module is further configured to: before the sending the query request message, determine, according to the current network state acquired by the network state acquiring module, the resource requested to be queried in the current network state.
  38. 如权利要求34所述的装置,其特征在于,所述服务发现模块具 体用于:The device of claim 34, wherein said service discovery module has Body for:
    接收通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。And receiving the notification message, where the service discovery information included in the notification message includes the notification message sender device information and the resource information provided by the device.
  39. 如权利要求38所述的装置,其特征在于,所述服务发现模块具体用于:接收目的地址为设定多播地址的通知消息。The device according to claim 38, wherein the service discovery module is specifically configured to: receive a notification message whose destination address is a set multicast address.
  40. 如权利要求34所述的装置,其特征在于,还包括:权限控制模块;The device according to claim 34, further comprising: an authority control module;
    所述权限控制模块,用于根据资源分发权限控制策略,对接收到的服务发现信息中的资源信息进行分发权限鉴权;The permission control module is configured to perform distribution authority authentication on the resource information in the received service discovery information according to the resource distribution authority control policy;
    所述分发管理模块具体用于:若所述权限控制模块鉴权通过,则将接收到的服务发现信息中的资源信息添加到所述资源分发信息中。The distribution management module is specifically configured to: if the authorization control module authenticates, pass the resource information in the received service discovery information to the resource distribution information.
  41. 如权利要求40所述的装置,其特征在于,所述分发管理模块具体用于:The device of claim 40, wherein the distribution management module is specifically configured to:
    根据资源分发权限控制策略,针对接收到的服务发现信息中的资源信息,进行以下之一或任意组合判断:According to the resource distribution authority control policy, one or any combination of the following is determined for the resource information in the received service discovery information:
    所述服务发现信息中包含的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the resource information included in the service discovery information is a resource that is allowed to be distributed;
    是否允许接受和分发所述服务发现信息的发送方设备所提供的资源。Whether to allow the resources provided by the sender device of the service discovery information to be accepted and distributed.
  42. 如权利要求34至41中任一项所述的装置,其特征在于,还包括:网络状态获取模块;The device according to any one of claims 34 to 41, further comprising: a network state acquisition module;
    所述网络状态获取模块,用于获取当前网络状态;The network status obtaining module is configured to acquire a current network status;
    所述分发管理模块具体用于:根据所述网络状态获取模块获取到的当前网络状态,判断所述服务发现信息中包括的资源信息是否允许在当前网络状态下分发,若不允许,则拒绝将该资源信息添加到所述资源分发信息中。The distribution management module is specifically configured to: determine, according to the current network state acquired by the network state acquiring module, whether the resource information included in the service discovery information is allowed to be distributed in a current network state, and if not, reject the The resource information is added to the resource distribution information.
  43. 如权利要求34所述的装置,其特征在于,所述分发管理模块还用于: The device of claim 34, wherein the distribution management module is further configured to:
    将所述资源分发信息显示于用户界面。The resource distribution information is displayed on a user interface.
  44. 如权利要求34所述的装置,其特征在于,所述分发管理模块还用于:The device of claim 34, wherein the distribution management module is further configured to:
    根据设定周期或时间,删除所述资源分发信息中的超时资源信息;和/或,Deleting timeout resource information in the resource distribution information according to a set period or time; and/or,
    在接收到资源失效通知消息时,根据所述资源失效通知消息删除所述资源分发信息中对应的资源信息。When the resource failure notification message is received, the resource information corresponding to the resource distribution information is deleted according to the resource failure notification message.
  45. 如权利要求34所述的装置,其特征在于,还包括:The device of claim 34, further comprising:
    资源获取模块,用于在根据接收到的服务发现信息生成资源分发信息之后,确定所述资源分发信息中被选择的资源信息;以及a resource obtaining module, configured to determine the selected resource information in the resource distribution information after generating the resource distribution information according to the received service discovery information;
    根据被选择的资源信息,向提供相应资源的设备发送用于请求获取相应资源的资源获取请求。And according to the selected resource information, a resource acquisition request for requesting acquisition of the corresponding resource is sent to the device that provides the corresponding resource.
  46. 如权利要求45所述的装置,其特征在于,还包括:权限控制模块;The device according to claim 45, further comprising: an authority control module;
    所述权限控制模块,用于根据资源分发权限控制策略,对被选择的资源信息进行分发权限鉴权;The authority control module is configured to perform distribution authority authentication on the selected resource information according to the resource distribution authority control policy;
    所述资源获取模块具体用于:若所述权限控制模块鉴权通过,则向提供该相应资源的设备发送用于请求获取相应资源的资源获取请求。The resource obtaining module is specifically configured to: if the authorization control module passes the authentication, send a resource acquisition request for requesting acquisition of the corresponding resource to the device that provides the corresponding resource.
  47. 如权利要求46所述的装置,其特征在于,所述权限控制模块具体用于:The device according to claim 46, wherein the authority control module is specifically configured to:
    根据资源分发权限控制策略,针对被选择的资源信息,进行以下之一或任意组合判断:According to the resource distribution authority control policy, one or any combination of the following is determined for the selected resource information:
    被选择的资源信息所对应的资源是否为被允许分发的资源;Whether the resource corresponding to the selected resource information is a resource that is allowed to be distributed;
    对于被选择的资源信息的发送方设备,是否允许请求获取该设备提供的资源。Whether the sender device of the selected resource information is allowed to request the resource provided by the device.
  48. 如权利要求45所述的装置,其特征在于,所述资源获取请求中携带有参数,以使所述资源获取请求的接收方根据该参数返回处理结果。 The device according to claim 45, wherein the resource acquisition request carries a parameter, so that the receiver of the resource acquisition request returns a processing result according to the parameter.
  49. 如权利要求45所述的装置,其特征在于,所述资源获取模块还用于:The device according to claim 45, wherein the resource obtaining module is further configured to:
    在向提供该资源信息的设备发送用于请求获取相应资源的资源获取请求之后,接收提供该资源信息的设备根据所述资源获取请求发送的资源。After transmitting the resource acquisition request for requesting acquisition of the corresponding resource to the device providing the resource information, the resource that is sent by the device that provides the resource information according to the resource acquisition request is received.
  50. 如权利要求34至49中任一项所述的装置,其特征在于,所述资源分发信息中包括根据至少一个设备发送的服务信息得到的资源信息。The apparatus according to any one of claims 34 to 49, wherein the resource distribution information includes resource information obtained from service information transmitted by at least one device.
  51. 如权利要求34至49中任一项所述的装置,其特征在于,所述资源包括应用、服务、数据中的一种或多种组合。The apparatus of any one of claims 34 to 49, wherein the resource comprises one or more combinations of applications, services, data.
  52. 一种资源分发装置,其特征在于,包括:A resource distribution device, comprising:
    生成模块,用于根据发送方设备所能提供的资源,生成服务发现信息;a generating module, configured to generate service discovery information according to resources that the sending device can provide;
    服务发现模块,用于发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。The service discovery module is configured to send the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
  53. 如权利要求52所述的装置,其特征在于,所述服务发现模块具体用于:The device of claim 52, wherein the service discovery module is specifically configured to:
    接收查询请求消息,所述查询请求消息中包含请求查询的资源信息;Receiving a query request message, where the query request message includes resource information of the request query;
    根据所述查询请求消息返回查询响应消息,所述查询响应消息中包含所述服务发现信息。And returning a query response message according to the query request message, where the query response message includes the service discovery information.
  54. 如权利要求53所述的装置,其特征在于,所述服务发现模块具体用于:根据设定的多播地址接收所述查询请求消息,采用单播方式返回所述查询响应消息。The device according to claim 53, wherein the service discovery module is configured to: receive the query request message according to the set multicast address, and return the query response message in a unicast manner.
  55. 如权利要求53所述的装置,其特征在于,还包括:权限控制模块;The device according to claim 53, further comprising: an authority control module;
    所述权限控制模块,用于根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权;The rights control module is configured to perform, according to the resource distribution authority control policy, the distribution authority for the resource requested by the acquisition request message;
    所述服务发现模块具体用于:若所述权限控制模块鉴权通过,则返回所述查询响应消息。The service discovery module is specifically configured to: if the authorization control module passes the authentication, return the query response message.
  56. 如权利要求55所述的装置,其特征在于,所述权限控制模块具体 用于:根据资源分发权限控制策略,对所述获取请求消息所请求查询的资源进行分发权限鉴权时,执行以下之一或任意组合判断:The device according to claim 55, wherein said authority control module is specific And: performing, according to the resource distribution authority control policy, performing one or any combination of the following determinations when performing the distribution authority authentication on the resource requested by the acquisition request message:
    是否允许向查询请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to be provided to the sender device of the query request message;
    所述查询请求消息所请求查询的资源是否为该查询请求消息发送方设备允许访问的资源。Whether the resource requested by the query request message is a resource that the query request message sender device allows access to.
  57. 如权利要求52所述的装置,其特征在于,所述服务发现模块具体用于:The device of claim 52, wherein the service discovery module is specifically configured to:
    发送通知消息,所述通知消息中包含的所述服务发现信息中包括所述通知消息发送方设备信息和该设备所提供的资源信息。And sending the notification message, where the service discovery information included in the notification message includes the notification message sender device information and the resource information provided by the device.
  58. 如权利要求57所述的装置,其特征在于,所述服务发现模块具体用于:根据设定多播地址发送所述通知消息。The device according to claim 57, wherein the service discovery module is specifically configured to: send the notification message according to a set multicast address.
  59. 如权利要求57所述的装置,其特征在于,还包括:权限控制模块;The device according to claim 57, further comprising: an authority control module;
    所述权限控制模块,用于在发送通知消息之前,根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权;The permission control module is configured to perform distribution authority authentication on resources in the sender device according to the resource distribution authority control policy before sending the notification message;
    所述服务发现模块还用于:若所述权限控制模块鉴权通过,则发送所述通知消息。The service discovery module is further configured to: if the authorization control module authenticates, pass the notification message.
  60. 如权利要求59所述的装置,其特征在于,所述权限控制模块具体用于:根据资源分发权限控制策略,对发送方设备中的资源进行分发权限鉴权时,执行以下之一或任意组合判断:The device according to claim 59, wherein the authority control module is configured to: perform one or any combination of the following determinations when authenticating the rights of the resources in the sender device according to the resource distribution authority control policy; :
    本设备是否允许提供资源分发服务;Whether the device is allowed to provide resource distribution services;
    确定本设备允许或不允许分发的资源。Determine which resources the device allows or does not allow for distribution.
  61. 如权利要求57所述的装置,其特征在于,还包括:网络状态获取模块;The device according to claim 57, further comprising: a network status acquisition module;
    所述网络状态获取模块,用于获取当前网络状态;The network status obtaining module is configured to acquire a current network status;
    所述服务发现模块还用于:在发送通知消息之前,根据所述网络状态获取模块获取到的当前网络状态,确定在当前网络状态下需要在所述通知消息中包含的资源信息。 The service discovery module is further configured to: before the sending the notification message, determine, according to the current network state acquired by the network state acquiring module, the resource information that needs to be included in the notification message in the current network state.
  62. 如权利要求52所述的装置,其特征在于,还包括:The device of claim 52, further comprising:
    资源提供模块,用于接收资源获取请求,根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源。And a resource providing module, configured to receive a resource acquisition request, and return, according to the resource acquisition request, the resource that is requested by the sender to the resource that is requested to be acquired.
  63. 如权利要求62所述的装置,其特征在于,还包括:权限控制模块;The device according to claim 62, further comprising: an authority control module;
    所述权限控制模块,用于根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权;The permission control module is configured to perform distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy;
    所述资源提供模块还用于:根据所述资源获取请求向所述资源获取请求发送方返回所请求获取的资源之前,指示所述权限控制模块进行鉴权。The resource providing module is further configured to: after the resource acquisition request returns the requested resource to the resource acquisition request, instruct the permission control module to perform authentication.
  64. 如权利要求63所述的装置,其特征在于,所述权限控制模块具体用于:根据资源分发权限控制策略,对所述资源获取请求进行分发权限鉴权时,执行以下之一或任意组合判断:The apparatus according to claim 63, wherein the authority control module is configured to: perform one or any combination of the following determinations when performing the distribution authority authentication on the resource acquisition request according to the resource distribution authority control policy:
    是否允许向资源获取请求消息的发送方设备提供资源分发服务;Whether to allow the resource distribution service to the sender device of the resource acquisition request message;
    所述资源获取请求消息所请求获取的资源是否为该资源获取请求消息发送方设备允许访问的资源。Whether the resource requested by the resource acquisition request message is a resource that the resource acquisition request message is allowed to be accessed by the sender device.
  65. 如权利要求63所述的装置,其特征在于,所述资源获取请求中携带有参数,所述资源提供模块具体用于:根据所述资源获取请求所请求的资源以及所述参数进行处理,向所述资源获取请求发送方返回处理结果。The device according to claim 63, wherein the resource acquisition request carries a parameter, and the resource providing module is specifically configured to: process, according to the resource requested by the resource acquisition request, and the parameter, to The resource acquisition request sender returns a processing result.
  66. 如权利要求52至65中任一项所述的装置,其特征在于,所述资源包括应用、服务、数据中的一种或多种组合。The apparatus of any one of claims 52 to 65, wherein the resource comprises one or more combinations of applications, services, data.
  67. 一种设备,其特征在于,包括:An apparatus, comprising:
    显示器;monitor;
    存储器,用于存储计算机程序指令;a memory for storing computer program instructions;
    处理器,耦合到所述存储器,用于读取所述存储器存储的计算机程序指令,并作为响应,执行如下操作:a processor coupled to the memory for reading computer program instructions stored by the memory and, in response, performing the following operations:
    接收服务发现信息,所述服务发现信息中包括设备信息和对应的设备所提供的资源信息;Receiving service discovery information, where the service discovery information includes device information and resource information provided by the corresponding device;
    根据接收到的服务发现信息生成资源分发信息,所述资源分发信息中 包括一个或多个资源信息。Generating resource distribution information according to the received service discovery information, in the resource distribution information Includes one or more resource information.
  68. 一种设备,其特征在于,包括:An apparatus, comprising:
    显示器;monitor;
    存储器,用于存储计算机程序指令;a memory for storing computer program instructions;
    处理器,耦合到所述存储器,用于读取所述存储器存储的计算机程序指令,并作为响应,执行如下操作:a processor coupled to the memory for reading computer program instructions stored by the memory and, in response, performing the following operations:
    根据发送方设备所能提供的资源,生成服务发现信息;Generating service discovery information according to resources that the sender device can provide;
    发送所述服务发现信息,所述服务发现信息中包括发送方设备标识和发送方设备所提供的资源信息。 And sending the service discovery information, where the service discovery information includes a sender device identifier and resource information provided by the sender device.
PCT/CN2017/075452 2016-03-15 2017-03-02 Resource distribution method and apparatus WO2017157176A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610146465.7 2016-03-15
CN201610146465.7A CN107196983A (en) 2016-03-15 2016-03-15 A kind of resource distribution method and device

Publications (1)

Publication Number Publication Date
WO2017157176A1 true WO2017157176A1 (en) 2017-09-21

Family

ID=59850173

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075452 WO2017157176A1 (en) 2016-03-15 2017-03-02 Resource distribution method and apparatus

Country Status (2)

Country Link
CN (1) CN107196983A (en)
WO (1) WO2017157176A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113159521A (en) * 2021-03-26 2021-07-23 珠海大横琴科技发展有限公司 Service scheduling method and device
CN113168323A (en) * 2019-05-05 2021-07-23 Oppo广东移动通信有限公司 Resource adding method, management device and computer storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115334146A (en) * 2018-12-11 2022-11-11 Oppo广东移动通信有限公司 Resource publishing method, device, equipment and storage medium of Internet of things
CN111163127B (en) * 2019-12-02 2021-12-14 聚好看科技股份有限公司 Media asset attribute pushing method and server
CN112637351B (en) * 2020-12-25 2023-09-05 珠海金山数字网络科技有限公司 File downloading method and device
CN114051214A (en) * 2021-11-15 2022-02-15 杭州老板电器股份有限公司 Method, device and system for sharing terminal functions

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101584187A (en) * 2006-12-05 2009-11-18 诺基亚公司 Software distribution via peer-to-peer networks
CN101764726A (en) * 2008-12-23 2010-06-30 埃森哲环球服务有限公司 Enhanced content sharing framework
CN103227832A (en) * 2013-04-28 2013-07-31 华为终端有限公司 Shared resource processing method and device
CN103782542A (en) * 2011-07-12 2014-05-07 Lg电子株式会社 Method for device discovery and method for downloading content

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100352218C (en) * 2004-04-28 2007-11-28 联想(北京)有限公司 Method of resource discovery in dynamic network environment
CN102316139B (en) * 2010-07-07 2014-12-31 中国移动通信集团公司 Peer-to-peer (P2P) content resource distribution system and content resource processing method
CN102387180B (en) * 2010-09-02 2014-12-24 中国人民解放军国防科学技术大学 Self-adopting communication system and method thereof
CN102315864B (en) * 2011-09-07 2015-11-25 百度在线网络技术(北京)有限公司 For the method and apparatus of mobile device Point-to-Point Data Transmission
CN103490800A (en) * 2013-09-25 2014-01-01 深圳市欧珀通信软件有限公司 Method and device for transmitting files through Bluetooth
CN104753973B (en) * 2013-12-25 2016-06-08 珠海金山办公软件有限公司 A kind of document sharing browsing method and system
CN103986696B (en) * 2014-04-24 2017-04-26 华为技术有限公司 Multimedia file transmission device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101584187A (en) * 2006-12-05 2009-11-18 诺基亚公司 Software distribution via peer-to-peer networks
CN101764726A (en) * 2008-12-23 2010-06-30 埃森哲环球服务有限公司 Enhanced content sharing framework
CN103782542A (en) * 2011-07-12 2014-05-07 Lg电子株式会社 Method for device discovery and method for downloading content
CN103227832A (en) * 2013-04-28 2013-07-31 华为终端有限公司 Shared resource processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113168323A (en) * 2019-05-05 2021-07-23 Oppo广东移动通信有限公司 Resource adding method, management device and computer storage medium
CN113159521A (en) * 2021-03-26 2021-07-23 珠海大横琴科技发展有限公司 Service scheduling method and device

Also Published As

Publication number Publication date
CN107196983A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
WO2017157176A1 (en) Resource distribution method and apparatus
CN108353094B (en) Cross-resource subscription for M2M service layer
WO2019242574A1 (en) Method for routing internet of things service
US10230696B2 (en) System, apparatus and method for managing lifecycle of secure publish-subscribe system
KR102166992B1 (en) Enable multicast for service layer group operation
KR102095436B1 (en) Request handling at the service layer
JP7179836B2 (en) Automatic service registration in communication networks
KR102059257B1 (en) Methods and apparatuses for analyzing and grouping service layer subscriptions and notifications for enhanced efficiency
EP3861706B1 (en) Framework for dynamic brokerage and management of topics and data at the service layer
KR102245367B1 (en) Method and apparatus for authenticating access authority for specific resource in wireless communication system
EP3308497A1 (en) A self-configuring key management system for an internet of things network
US10194417B2 (en) Method for processing notification message in wireless communication system and apparatus therefor
KR20150107720A (en) Method and apparatus for controlling access in wireless communication system
US10142805B2 (en) Method for managing child resource of group member in wireless communication system and device for same
EP3163798B1 (en) Method for processing request messages in wireless communication system, and device for same
US20180115552A1 (en) Methods, systems, and apparatuses of service provisioning for resource management in a constrained environment
KR102500594B1 (en) Service Layer Message Templates in Communication Networks
WO2015117446A1 (en) Method and device for sending control resource change notification message
KR20200055106A (en) Service registration based on service capability requirements and preferences
JP7474302B2 (en) Automatic service registration in a communications network - Patents.com
WO2023142072A1 (en) Encryption configuration method and apparatus, and device, storage medium and program product
WO2023108653A1 (en) Subscription access information processing method and apparatus, computer device and storage medium
WO2021223835A1 (en) Method and device for service composition
CN113169965A (en) Resource allocation method, equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 17765718

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17765718

Country of ref document: EP

Kind code of ref document: A1