WO2017084584A1 - 一种资源发现的方法及装置 - Google Patents

一种资源发现的方法及装置 Download PDF

Info

Publication number
WO2017084584A1
WO2017084584A1 PCT/CN2016/106126 CN2016106126W WO2017084584A1 WO 2017084584 A1 WO2017084584 A1 WO 2017084584A1 CN 2016106126 W CN2016106126 W CN 2016106126W WO 2017084584 A1 WO2017084584 A1 WO 2017084584A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
resource discovery
group
request message
server
Prior art date
Application number
PCT/CN2016/106126
Other languages
English (en)
French (fr)
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 WO2017084584A1 publication Critical patent/WO2017084584A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1061Peer-to-peer [P2P] networks using node-based peer discovery mechanisms

Definitions

  • the present invention relates to the field of communication network technologies, and in particular, to a method and an apparatus for resource discovery.
  • M2M Machine-to-Machine Communications
  • the platform implements some common capabilities, such as resource discovery.
  • the M2M platform may be a oneM2M platform.
  • the method for performing resource discovery in the oneM2M architecture is to determine the resource discovery according to the destination address of the request message when the CSE (Common Service Entity) in the oneM2M system receives the resource discovery request message.
  • the scope finds the resource that meets the filtering condition, returns the URI (Universal Resource Identifier) of the qualified resource in the response message, and then the requester sends a specific operation request to each resource according to the URI, requesting Each time you need to operate on these resources, you need to send an operation request to each resource separately.
  • URI Universal Resource Identifier
  • the requester may send a request to create a group, and after the qualified resource is created as a group member, the requester sends an operation request to the group. Regardless of whether a group is created or not, the requester and the CSE need to perform information interaction multiple times, resulting in large network overhead.
  • the embodiments of the present invention provide a method and an apparatus for resource discovery, which can solve the problem of large network overhead in the prior art resource discovery process.
  • an embodiment of the present invention provides a method for resource discovery, including:
  • the server searches for a resource according to the first resource discovery request message
  • the creating group When the creating group indicates to create a static group, create a static group, and use the found resource as a member of the static group;
  • creating a dynamic group When the creating group indicates to create a dynamic group, creating a dynamic group, setting a filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group member, and searching for The resource that satisfies the filter condition as a dynamic group member;
  • the server sends a first response message to the client, where the first response message carries a universal resource identifier URI of the created group.
  • the method further includes:
  • the server sends a second response message to the client, where the second response message carries the URI of the found resource.
  • the server sends the first response message to the client, including:
  • the server sends a first response message carrying the URI of the created group and the URI of the found resource to the client;
  • the server When there is a result type parameter, and the result type parameter is content content, the server sends a first response message carrying the URI of the created group and the content of the found resource to the client;
  • the server sends a first response message carrying the URI of the created group to the client.
  • the server sends a second response message to the client, including:
  • the server When there is a result type parameter, and the result type parameter is content, the server sends a second response message carrying the content of the found resource to the client;
  • the server When there is a result type parameter, and the result type parameter is a URI, or the result type parameter does not exist in the first resource discovery request message, the server sends the URI that carries the found resource to the client. Second response message.
  • the first resource discovery request message further includes a resource discovery range, and the server is configured according to the first resource discovery request.
  • Message lookup resources including:
  • the server searches for a resource that meets the filtering condition in the local scope
  • the server sends the second resource to the remote address server.
  • a request message where the filtering condition in the second resource discovery request message is the same as the filtering condition in the first resource discovery request;
  • the server Receiving, by the server, a third response message sent by the remote server, where the third response message carries a remote resource discovery result, where the remote resource discovery result includes a URI of the group that the remote server has created and/or the The URI of the resource found by the remote server, or the remote resource discovery result includes the URI of the group that the remote server has created and/or the content of the resource found by the remote server.
  • the server determines, according to the first resource discovery request message, a resource discovery range, including:
  • the server determines that the first resource discovery request message includes a range parameter, determining that the resource discovery range is a range specified by the range parameter;
  • the server determines that the range parameter is not included in the first resource discovery request message, determining that the resource discovery range is a range included in a destination address of the first resource discovery request message.
  • the attribute of the dynamic group includes at least one of the following attributes:
  • the filtering condition is used to indicate a condition that a dynamic group member should satisfy
  • a refresh period configured to instruct the server to find and update a dynamic group member every the refresh cycle
  • an embodiment of the present invention provides a device for resource discovery, including:
  • a receiving unit configured to receive a first resource discovery request message sent by the client, where the first resource discovery request message carries a create group indication and a filter condition;
  • a searching unit configured to search for a resource according to the first resource discovery request message received by the receiving unit
  • a creating unit configured to: when the creating group indicates to create a static group, create a static group, and use the resource found by the searching unit as a member of the static group; when the creating group indicates to create a dynamic group a group, the dynamic group is created, and the filtering condition in the first resource discovery request message received by the receiving unit is set as a filtering condition for determining the dynamic group member, and the searching unit is configured to search The resource that meets the filter condition is taken as a dynamic group member;
  • a sending unit configured to send a first response message to the client, where the first response message carries a universal resource identifier URI of the created group.
  • the creating unit is further configured to: when the creating group indicates that the group is not to be created, send a second response message to the client, where the second response message carries a URI of the found resource.
  • the sending unit is further configured to determine whether a result type parameter exists in the first resource discovery request message, and when the result type parameter is present, and the result type parameter is a URI, sending the created group to the client a first response message of the URI of the group and the URI of the found resource; when there is a result type parameter, and the result type parameter is the content content, sending the URI carrying the created group and the content of the found resource a response message; when there is no result type parameter in the first resource discovery request message, sending a first response message carrying the URI of the created group to the client.
  • the sending unit is further configured to determine whether a result type parameter exists in the first resource discovery request message; when the result type parameter exists, and the result type parameter is content, sending, by the client, the search result a second response message of the content of the resource; when there is a result type parameter, and the result type parameter is a URI, or the result type parameter does not exist in the first resource discovery request message, sending a carry search to the client The second response message of the resource's URI.
  • the first resource discovery request message further includes a resource discovery range
  • the searching unit includes:
  • a determining module configured to determine a resource discovery range according to the first resource discovery request message
  • a searching module configured to search for a resource that meets the filtering condition in the local scope when the local resource address is included in the resource discovery range;
  • An execution module configured to perform an operation specified by the first resource discovery request message on the resource that meets the filtering condition
  • a sending module configured to send a second resource discovery request message to the remote address server when the resource discovery range includes the remote address, where the filtering condition in the second resource discovery request message is in the first resource discovery request The same filter conditions;
  • a receiving module configured to receive a third response message sent by the remote server, where the third response message carries a remote resource discovery result, where the remote resource discovery result includes a URI of the group that the remote server has created and/or The URI of the resource found by the remote server, or the remote resource discovery result includes the URI of the group that the remote server has created and/or the content of the resource found by the remote server.
  • the determining module is further configured to: when the first resource discovery request message includes a range parameter, determine that the resource discovery range is a range specified by the range parameter; when the first resource discovery request message is not included And determining, by the range parameter, the resource discovery range is a range included in a destination address of the first resource discovery request message.
  • the attribute of the dynamic group includes at least one of the following attributes:
  • the filtering condition is used to indicate a condition that a dynamic group member should satisfy
  • a refresh period configured to instruct the server to find and update a dynamic group member every the refresh cycle
  • an embodiment of the present invention provides a device for resource discovery, where the device is a server or integrated in a server, and the device includes:
  • a memory for storing information including program instructions
  • a receiver configured to receive a first resource discovery request message sent by the client, where the first resource discovery request message carries a create group indication and a filter condition;
  • a processor coupled to the memory, the receiver, and the transmitter, for controlling execution of the program instruction, specifically for searching for a resource according to the first resource discovery request message;
  • a static group is created, a static group is created, and the found resource is used as a member of the static group;
  • the created group is instructed to create a dynamic group, a dynamic group is created, and the first resource discovery request is generated.
  • the filtering condition in the message is set to determine a filtering condition of the dynamic group member, and the found resource that meets the filtering condition is used as a dynamic group member;
  • the sender is configured to send a first response message to the client, where the first response message carries a universal resource identifier URI of the created group.
  • the sender is further configured to: when the creating group indicates that the group is not to be created, send a second response message to the client, where the second response message carries a URI of the found resource.
  • the processor is further configured to determine whether a result type parameter exists in the first resource discovery request message, and send the determination result to the sender;
  • the transmitter is further configured to: when the result type parameter exists, and the result type parameter is a URI, send, to the client, a first response message that carries a URI of the created group and a URI of the found resource; When there is a result type parameter, and the result type parameter is content content, sending a first response message carrying the URI of the created group and the content of the found resource; when the first resource discovery request message does not exist When the type parameter is obtained, the first response message carrying the URI of the created group is sent to the client.
  • the processor is further configured to determine whether a result type parameter exists in the first resource discovery request message, and send the determination result to the sender;
  • the transmitter is further configured to: when the result type parameter exists, and the result type parameter is content, send, to the client, a second response message that carries the content of the found resource; when the result type parameter exists, and When the result type parameter is a URI, or the result type parameter does not exist in the first resource discovery request message, the second response message carrying the URI of the found resource is sent to the client.
  • the first resource is sent The resource request scope is also included in the request message;
  • the processor is further configured to: determine, according to the first resource discovery request message, a resource discovery range; when the resource discovery range includes a local address, search for a resource that meets the filtering condition in the local scope; The resource performs an operation specified by the first resource discovery request message;
  • the transmitter is further configured to: when the resource discovery range includes a remote address, send a second resource discovery request message to the remote address server, where the filtering condition in the second resource discovery request message is related to the first resource
  • the filter conditions in the discovery request are the same;
  • the receiver is further configured to receive a third response message sent by the remote server, where the third response message carries a remote resource discovery result, where the remote resource discovery result includes a URI of the group that the remote server has created. And/or a URI of the resource found by the remote server, or the remote resource discovery result includes a URI of the group that the remote server has created and/or content of the resource found by the remote server.
  • the processor is further configured to: when the first resource discovery request message includes a range parameter, determine that the resource discovery range is a range specified by the range parameter; when the first resource discovery request message is not included And determining, by the range parameter, the resource discovery range is a range included in a destination address of the first resource discovery request message.
  • the attribute of the dynamic group includes at least one of the following attributes:
  • the filtering condition is used to indicate a condition that a dynamic group member should satisfy
  • a refresh period configured to instruct the server to find and update a dynamic group member every the refresh cycle
  • the server receives the first resource discovery request message sent by the client, searches for the resource according to the first resource discovery request message, and creates a static when the group instruction is created to create a static group.
  • a group the discovered resource is a member of the static group.
  • the filtering condition in the first resource discovery request message is set to be used to determine the dynamic group.
  • the filtering condition of the group finally sends a first response message carrying the URI of the created group to the client.
  • the network overhead is large, and the embodiment of the present invention can complete resource discovery and create a group according to the first resource discovery request message, without requiring multiple interactions between the server and the client. Can save network overhead.
  • FIG. 1 is a flowchart of a method for resource discovery according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for resource discovery according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another method for resource discovery according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of another method for resource discovery according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a logical structure of an apparatus for resource discovery according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a logical structure of another device for resource discovery according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a logical structure of a server in a method for resource discovery according to an embodiment of the present invention.
  • the embodiment of the present invention provides a method for resource discovery, which is applied to a process in which a server performs resource discovery according to a request of a client in a oneM2M system, as shown in FIG. 1 .
  • a server performs resource discovery according to a request of a client in a oneM2M system, as shown in FIG. 1 .
  • the server receives a first resource discovery request message sent by the client.
  • the first resource discovery request message includes a create group indication and a filter condition.
  • the Create Group indication is used to indicate whether to create a group, and whether to create a dynamic group or create a static group.
  • the filter condition is a filter condition for resource discovery, and the server needs to find a resource that satisfies the filter condition.
  • the request message received by the server carries the filter usage parameter
  • the request message may be determined to be the first resource discovery request message, or the first resource discovery request message is sent to the discovery (discovery). ) The request message in the resource.
  • the server searches for a resource according to the first resource discovery request message.
  • the extension of the filter usage parameter can be used to create a group indication.
  • the filter usage parameter value is create Grp or create DycGrp
  • the server needs to further create a group after performing the resource discovery operation, and create Grp represents a static creation.
  • create DycGrp represents the need to create a dynamic group.
  • the embodiment of the present invention may further add a Is Create Grp parameter in the first resource discovery request message.
  • the representative server further needs to create a group after performing the resource discovery operation.
  • the group type parameter may be added to the first resource discovery request message.
  • the group type parameter is static group
  • the static group is created.
  • the group type is dynamic Grp
  • the dynamic group is created. .
  • create a dynamic group When creating a group indication to create a dynamic group, create a dynamic group, set a filtering condition in the first resource discovery request message to a filtering condition for determining a dynamic group member, and find the satisfied filtering condition. Resources as a dynamic group member.
  • the embodiment of the present invention may add a filter Criteria attribute to the existing group resource to identify the dynamic group resource.
  • the filter Criteria attribute is included, it indicates that the group is a dynamic group.
  • the attribute of the dynamic group includes at least one of the following attributes:
  • dynamic group members find resources that meet the filtering conditions within the specified scope, and then use these resources as members of the dynamic group.
  • the server sends a first response message to the client, where the first response message carries the universal resource identifier URI of the created group.
  • the server needs to send the first response message to the client according to the result type parameter.
  • the specific implementation is:
  • the server determines whether a result type parameter exists in the first resource discovery request message.
  • the server sends a first response message carrying the URI of the created group and the URI of the found resource to the client;
  • the server When there is a result type parameter, and the result type parameter is content content, the server sends a first response message carrying the URI of the created group and the content of the found resource to the client;
  • the server sends a first response message carrying the URI of the created group to the client.
  • the server receives the first resource discovery request message sent by the client, searches for the resource according to the first resource discovery request message, and creates a static group when the group instruction is created to create a static group.
  • the discovered resource is a member of the static group.
  • the created group indicates to create a dynamic group
  • the dynamic group is created, and the filtering condition in the first resource discovery request message is set to be used to determine the dynamic group. Filtering conditions, and finally sending a first response message carrying the URI of the created group to the client.
  • the embodiment of the present invention can complete resource discovery and create a group according to the first resource discovery request message, which is compared with the information in the prior art. The work does not require multiple interactions between the server and the client, which can save network overhead.
  • an operation that the server should perform when the group is not created is also provided, as shown in FIG. 2 , on the basis of FIG. 1 .
  • the method also includes step 106.
  • the server sends a second response message to the client, where the second response message carries the URI of the found resource.
  • this step can be implemented by another implementation manner.
  • the server does not receive the creation group indication sent by the client, that is, the server receives the first resource discovery request sent by the client. After the message, the first resource discovery request message is detected to include the group creation indication. If yes, the foregoing step 103 or 104 is executed, and the corresponding group is created according to the group creation indication. If not, the client is sent to the client. Second response message.
  • the server needs to send the second response message to the client according to the result type parameter.
  • the specific implementation is:
  • the server determines whether a result type parameter exists in the first resource discovery request message
  • the server sends a second response message carrying the content of the found resource to the client;
  • the server When there is a result type parameter, and the result type parameter is a URI, or the result type parameter does not exist in the first resource discovery request message, the server sends a second response message carrying the URI of the found resource to the client.
  • the first resource discovery request message further includes a resource discovery range, such as As shown in FIG. 3, the foregoing step 102 may be specifically implemented as steps 301 to 304.
  • the server determines a resource discovery range according to the first resource discovery request message.
  • the server determines that the range parameter is included in the first resource discovery request message, determining that the resource discovery range is a range specified by the range parameter;
  • the server determines that the range parameter is not included in the first resource discovery request message, determining that the resource discovery range is a range included in the destination address of the first resource discovery request message.
  • the server searches for a resource that meets the filtering condition in the local scope.
  • the server will find a resource that satisfies the condition that the creator attribute is SAM and the Resource Type is Container in the specified local scope according to the request message.
  • the filter condition is empty, all resources within the scope of resource discovery are eligible resources.
  • the filtering condition in the step may be the filtering condition in the first resource discovery request message, or the filtering condition may be the first resource discovery when the destination address of the first resource discovery request message is a dynamic group.
  • the operation specified by the first resource discovery request message includes: acquiring the resource, updating the resource, deleting the resource, and creating the resource.
  • the step 105 may be directly performed when the specified operation is performed.
  • an operation of updating, deleting, or creating a sub-resource is performed on the resource that meets the filtering condition.
  • the server sends a second resource discovery request message to the remote address server, where the filtering condition in the second resource discovery request message is the same as the filtering condition in the first discovery request.
  • the remote address server is a server corresponding to the remote address, and the destination address of the second resource discovery request message is the remote address.
  • the server when it is determined that the remote address is included in the resource discovery range, it is further determined whether the remote resource discovery is required according to the filtering condition, for example, when the filtering condition indicates that at most When two resources comply with the filter condition, if two resources that meet the filter condition have been found in step 302, the server does not need to send the second resource discovery request message to the remote address server.
  • the resource discovery range includes both the local address and the remote address, the server needs to discover the resource in the local scope and send the second resource discovery request message to the remote address server.
  • the second resource discovery request message needs to include the same result type parameter and the group creation indication.
  • the remote address server When the remote address server receives the second resource discovery request message, it is the same as the method for the server to discover the resource according to the first resource discovery request message.
  • the server receives a third response message sent by the remote server, where the third response message carries a remote resource discovery result.
  • the remote resource discovery result includes the URI of the group that the remote server has created and/or the URI of the resource that the remote server finds, or the remote resource discovery result includes the URI of the group that the remote server has created and/or the resource that the remote server finds. Content.
  • the remote resource discovery result is the URI of the created group.
  • the remote resource discovery result is the URI of the discovered resource.
  • the method for determining the remote resource discovery result carried in the third response message is the same as the method described in the foregoing steps 105 and 106, and is not described here.
  • the server determines a resource discovery range according to the first resource discovery request message, and searches for a resource that meets the condition in the resource discovery range, and then performs the first resource discovery request specified by the qualified resource. Operation, when the resource discovery range includes a remote address, the server can also send a second resource discovery request to the remote address server, and only need to receive a message from the client to complete resource discovery and resource operation. This eliminates the need for multiple information interactions and saves network overhead.
  • the method for requesting resource discovery by the client to the server CSE1 is taken as an example to describe the method for resource discovery provided by the embodiment of the present invention. As shown in FIG. 4, the method includes:
  • the client sends a first resource discovery request message to CSE1.
  • the destination address carried in the first resource discovery request message is: http://cse1.example.org/myGroup
  • the range parameter is: http://cse1.example.org/myGroup, http://cse2. example.org/myAPP1, http://cse3.example.org/smartAPP
  • the address of CSE1 is the local address
  • the addresses of CSE2 and CSE3 are the remote addresses.
  • the CSE1 sends a second resource discovery request message to the CSE2 and the CSE3, respectively.
  • CSE1, CSE2, and CSE3 respectively search for resources according to the respective resource discovery request messages received.
  • step 402 the process of the CSE1 searching for resources may also be performed before step 402 or concurrently with step 402, which is not limited by the present invention.
  • CSE2 and CSE3 respectively send a third response message to the CSE1, where the third response message carries the resource discovery result.
  • the resources discovered by CSE1 are CSE1/smartAPP/A
  • the resources discovered by CSE2 are CSE2/myAPP1/a
  • the resources discovered by CSE3 are CSE3/smartAPP/B and CSE3/smartAPP/C.
  • the third response message received by the CSE1 carries the URI of the resource discovered by the CSE2 and the CSE2.
  • the third response message sent by the CSE2 and the CSE3 received by the CSE1 carries the URI of the group, for example, the URI of the group in the CSE2 is CSE2/myAPP1/ ⁇ groupName>, the URI of the group in CSE3 is CSE3/smartAPP/ ⁇ groupName>.
  • the CSE1 creates a group according to the group creation indication in the first resource discovery request message.
  • the group creation instruction is used to create a static group.
  • the group resource created by CSE1 includes five group members, namely: CSE1/smartAPP. /A, CSE2/myAPP1/a, CSE2/myAPP1/b, CSE3/smartAPP/B, CSE3/smartAPP.
  • the URI for this group is http://cse1.example.org/myGroup/ ⁇ groupName>.
  • the group resource created by CSE1 contains two sub-group members in addition to the group member CSE1/smartAPP/A, namely: CSE2/myAPP1/ ⁇ groupName>, CSE3/ smartAPP/ ⁇ groupName>.
  • the CSE1 sends a first response message to the client, where the first response message carries the URI of the group created by the CSE1.
  • the server receives the first resource discovery request message sent by the client, searches for the resource according to the first resource discovery request message, and creates a static group when the group instruction is created to create a static group.
  • the discovered resource is a member of the static group.
  • the created group indicates to create a dynamic group
  • the dynamic group is created, and the filtering condition in the first resource discovery request message is set to be used to determine the dynamic group. Filtering conditions, and finally sending a first response message carrying the URI of the created group to the client.
  • the network overhead is large, and the embodiment of the present invention can complete resource discovery and create a group according to the first resource discovery request message, without requiring multiple interactions between the server and the client. Can save network overhead.
  • the embodiment of the present invention further provides a device for resource discovery, which is applied to a server.
  • the device includes: a receiving unit 501, a searching unit 502, a creating unit 503, and a sending unit 504. .
  • the receiving unit 501 is configured to receive a first resource discovery request message sent by the client, where the first resource discovery request message carries a create group indication and a filter condition;
  • the searching unit 502 is configured to search for a resource according to the first resource discovery request message received by the receiving unit 501.
  • the creating unit 503 is configured to: when the creating group indicates to create a static group, create a static group, and use the resource found by the searching unit 502 as a member of the static group; when the creating group indicates to create a dynamic group, The dynamic group is created, and the filtering condition in the first resource discovery request message received by the receiving unit 501 is set as a filtering condition for determining the dynamic group member, and the resource that meets the filtering condition found by the searching unit 502 is used as the dynamic group.
  • the attributes of a dynamic group include at least one of the following attributes:
  • a refresh period which is used to instruct the server to find and update dynamic group members every refresh cycle
  • the sending unit 504 is configured to send a first response message to the client, where the first response message carries the universal resource identifier URI of the created group.
  • the sending unit 504 is further configured to: when the group is created to not create a group, send a second response message to the client, where the second response message carries the URI of the found resource.
  • the sending unit 504 is further configured to determine whether a result type parameter exists in the first resource discovery request message; when the result type parameter exists, and the result type parameter is a URI, sending the carried to the client Creating a first response message of the URI of the group and the URI of the found resource; when there is a result type parameter, and the result type parameter is the content content, sending the URI carrying the created group and the content of the found resource a response message; when there is no result type parameter in the first resource discovery request message, sending a first response message carrying the URI of the created group to the client.
  • the sending unit 504 is further configured to determine whether the first resource discovery request message exists. a result type parameter; when there is a result type parameter, and the result type parameter is content, sending a second response message carrying the content of the found resource to the client; when there is a result type parameter, and the result type parameter is a URI, or When the result type parameter does not exist in the resource discovery request message, the second response message carrying the URI of the found resource is sent to the client.
  • the first resource discovery request message further includes a resource discovery range.
  • the searching unit 502 includes: a determining module 5021, a searching module 5022, an executing module 5023, and a sending module 5024. Receive module 5025.
  • a determining module 5021 configured to determine a resource discovery range according to the first resource discovery request message
  • the searching module 5022 is configured to: when the local resource address is included in the resource discovery range determined by the determining module 5021, search for a resource that meets the filtering condition in the local scope;
  • the executing module 5023 is configured to perform an operation specified by the first resource discovery request message on the resource that meets the filtering condition;
  • the sending module 5024 is configured to: when the remote resource address is included in the resource discovery range determined by the determining module 5021, send a second resource discovery request message to the remote address server, and the filtering condition and the first resource discovery request in the second resource discovery request message The same filter conditions;
  • the receiving module 5025 is configured to receive a third response message sent by the remote server, where the third response message carries a remote resource discovery result, where the remote resource discovery result includes a URI of the group that the remote server has created and/or a resource that is found by the remote server.
  • the URI, or remote resource discovery results include the URI of the group that the remote server has created and/or the content of the resource that the remote server has found.
  • the determining module 5021 is further configured to: when the range parameter is included in the first resource discovery request message, determine that the resource discovery range is a range specified by the range parameter; when the range parameter is not included in the first resource discovery request message, determine that the resource discovery range is The range of the destination address of the first resource discovery request message.
  • the receiving unit receives the first resource discovery request message sent by the client, and the searching unit searches for the resource according to the first resource discovery request message, and creates a static group when the group instruction is created.
  • the unit creates a static group and uses the found resource as a member of the static group.
  • the creating unit creates a dynamic group, and sets the filtering condition in the first resource discovery request message to The filtering condition is used to determine the dynamic group, and finally the sending unit sends a first response message carrying the URI of the created group to the client.
  • the network overhead is large, and the embodiment of the present invention can complete resource discovery and create a group according to the first resource discovery request message, without requiring multiple interactions between the server and the client. Can save network overhead.
  • FIG. 7 is a schematic structural diagram of a hardware of the server described in FIG.
  • the server may include a memory 701, a transmitter 702, a processor 703, a bus 704, and a receiver 705, wherein the memory 701, the transmitter 702, the processor 703, and the receiver 705 are communicably connected by a bus 704.
  • the memory 701 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 701 can store an operating system and other applications.
  • the program code for implementing the technical solution provided by the embodiment of the present invention is stored in the memory 701 and executed by the processor 703.
  • the transmitter 702 and the receiver 705 are used between the device and other devices or communication networks (such as, but not limited to, Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.) Communication.
  • devices or communication networks such as, but not limited to, Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
  • the processor 703 can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • FIG. 7 only shows the memory 701, the transmitter 702, the receiver 705 and the processor 703, and the bus 704, in the specific implementation process, those skilled in the art should understand that the first The base station also contains other components necessary to achieve proper operation. At the same time, those skilled in the art will appreciate that hardware devices that implement other functions may also be included, depending on the particular needs.
  • the memory 701 in the apparatus is configured to store information including program instructions.
  • the receiver 705 is configured to receive a first resource discovery request message sent by the client, where the first resource discovery request message carries a create group indication and a filter condition.
  • the processor 703 is coupled to the memory 701, the receiver 705, and the transmitter 702, and is configured to control execution of the program instructions, specifically, to search for resources according to the first resource discovery request message; when the group creation instruction is to create a static group, Create a static group, and use the found resource as a member of the static group; when the created group indicates to create a dynamic group, create a dynamic group, and set the filtering condition in the first resource discovery request message to be used for determining A dynamic group member filter condition, and the found resource that meets the filter condition is used as a dynamic group member;
  • the attribute of the dynamic group includes at least one of the following attributes:
  • a refresh period which is used to instruct the server to find and update dynamic group members every refresh cycle
  • the sender 702 is configured to send a first response message to the client, where the first response message carries a universal resource identifier URI of the created group.
  • the sender 702 is further configured to: when the group is created to not create a group, send a second response message to the client, where the second response message carries the URI of the found resource.
  • the processor 703 is further configured to determine whether a junction exists in the first resource discovery request message. a type parameter, and the judgment result is sent to the transmitter 702;
  • the sender 702 is further configured to: when the result type parameter exists, and the result type parameter is a URI, send, to the client, a first response message that carries the URI of the created group and the URI of the found resource; when the result type parameter exists When the result type parameter is the content content, the first response message that carries the URI of the created group and the content of the found resource is sent; when the result type parameter does not exist in the first resource discovery request message, the method sends the message to the client.
  • the first response message carrying the URI of the created group.
  • the processor 703 is further configured to determine whether a result type parameter exists in the first resource discovery request message, and send the determination result to the transmitter 702;
  • the sender 702 is further configured to: when the result type parameter exists, and the result type parameter is content, send a second response message carrying the content of the found resource to the client; when the result type parameter exists, and the result type parameter is a URI Or, when the result type parameter does not exist in the first resource discovery request message, send a second response message carrying the URI of the found resource to the client.
  • the first resource discovery request message further includes a resource discovery range
  • the processor 703 is further configured to: determine, according to the first resource discovery request message, a resource discovery range; when the resource discovery range includes the local address, search for a resource that meets the filtering condition in the local scope; and execute the first resource on the resource that meets the filtering condition. Discover the operation specified by the request message;
  • the sender 702 is further configured to: when the remote address is included in the resource discovery range, send a second resource discovery request message to the remote address server, where the filtering condition in the second resource discovery request message is the same as the filtering condition in the first resource discovery request ;
  • the receiver 705 is further configured to receive a third response message sent by the remote server, where the third response message carries a remote resource discovery result, where the remote resource discovery result includes a URI of the group that the remote server has created and/or a resource that is found by the remote server.
  • the URI, or remote resource discovery results include the URI of the group that the remote server has created and/or the content of the resource that the remote server has found.
  • the processor 703 is further configured to: when the first resource discovery request message includes the range parameter, determine that the resource discovery range is a range specified by the range parameter; when the first resource discovery request message is not included When the range parameter is determined, the resource discovery range is determined to be the range included in the destination address of the first resource discovery request message.
  • the receiver receives the first resource discovery request message sent by the client, and the processor searches for the resource according to the first resource discovery request message, and creates a static group when the group instruction is created.
  • a static group the discovered resource is a member of the static group, and when the group is created to create a dynamic group, the dynamic group is created, and the filtering condition in the first resource discovery request message is set to determine the dynamic The filtering condition of the group, and finally the sender sends a first response message carrying the URI of the created group to the client.
  • the network overhead is large, and the embodiment of the present invention can complete resource discovery and create a group according to the first resource discovery request message, without requiring multiple interactions between the server and the client. Can save network overhead.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. .
  • the technical solution of the present invention which is essential or contributes to the prior art, can be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk, etc. includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开一种资源发现的方法及装置,涉及通信网络技术领域,可以解决网络开销大的问题。本发明实施例通过服务器接收客户端发送的第一资源发现请求消息,根据第一资源发现请求消息查找资源,当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员,当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员,最后向客户端发送携带已创建群组的URI的第一响应消息。本发明实施例提供的方案适于资源发现的过程中。

Description

一种资源发现的方法及装置
本申请要求于2015年11月19日提交中国专利局、申请号为201510808314.9、发明名称为“一种资源发现的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信网络技术领域,尤其涉及一种资源发现的方法及装置。
背景技术
随着物联网技术的快速发展,M2M(Machine-to-Machine Communications,机器通信)已经在越来越多的行业和领域得到丰富的应用,为满足对不同行业应用服务的需要,开发了统一的M2M平台实现部分公共能力,例如资源发现功能。
M2M平台具体可以为oneM2M平台,目前oneM2M架构中进行资源发现的方法为当oneM2M系统中的CSE(Common service Entity,公共业务实体)接收到资源发现请求消息时,根据请求消息的目的地址确定资源发现的范围,进而查找符合过滤条件的资源,在响应消息中返回符合条件的资源的URI(Universal Resource Identifier,通用资源标识符),然后请求者会根据URI向每个资源发送具体的操作请求,请求者每次需要对这些资源进行操作时,都需分别向每个资源发送操作请求。或者请求者可以在接收到URI后,再发送创建群组的请求,将符合条件的资源作为群组成员创建群组后,请求者再向群组发送操作请求。无论是否创建了群组,请求者与CSE之间都需多次进行信息交互,导致网络开销大。
发明内容
本发明的实施例提供一种资源发现的方法及装置,可以解决现有技术资源发现过程中网络开销大的问题。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,本发明实施例提供一种资源发现的方法,包括:
服务器接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;
所述服务器根据所述第一资源发现请求消息查找资源;
当所述创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员;
当所述创建群组指示为创建动态群组时,创建动态群组,将所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员;
所述服务器向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。
在第一种可能的实施例中,结合第一方面,所述方法还包括:
当所述创建群组指示为不创建群组时,所述服务器向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。
在第二种可能的实施例中,结合第一方面中的第一种可能的实施例,所述服务器向所述客户端发送第一响应消息,包括:
所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;
当存在结果类型参数,且所述结果类型参数为URI时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;
当存在结果类型参数,且所述结果类型参数为内容content时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;
当所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带已创建群组的URI的第一响应消息。
在第三种可能的实施例中,结合第一方面中的第二种可能的实施例,所述服务器向所述客户端发送第二响应消息,包括:
所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;
当存在结果类型参数,且所述结果类型参数为content时,所述服务器向所述客户端发送携带查找到的资源的内容的第二响应消息;
当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带查找到的资源的URI的第二响应消息。
在第四种可能的实施例中,结合第一方面中的第三种可能的实施例,所述第一资源发现请求消息中还包括资源发现范围,所述服务器根据所述第一资源发现请求消息查找资源,包括:
所述服务器根据所述第一资源发现请求消息确定资源发现范围;
当所述资源发现范围中包括本地地址时,所述服务器在本地范围内查找符合过滤条件的资源;
对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
当所述资源发现范围中包括远程地址时,所述服务器向远程地址服务器发送第二资源 发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;
所述服务器接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。
在第五种可能的实施例中,结合第一方面中的第四种可能的实施例,所述服务器根据所述第一资源发现请求消息确定资源发现范围,包括:
当所述服务器确定所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;
当所述服务器确定所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。
在第六种可能的实施例中,结合第一方面或第一方面中上述任一种可能的实施例,所述动态群组的属性至少包括以下属性中的任一种:
指定范围,用于指示所述服务器在所述指定范围内查找动态群组成员;
所述过滤条件,用于指示动态群组成员应满足的条件;
刷新周期,用于指示所述服务器每隔所述刷新周期查找并更新一次动态群组成员;
群组成员列表,用于存储每次查找到的动态群组成员的URI。
第二方面,本发明实施例提供一种资源发现的装置,包括:
接收单元,用于接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;
查找单元,用于根据所述接收单元接收到的所述第一资源发现请求消息查找资源;
创建单元,用于当所述创建群组指示为创建静态群组时,创建静态群组,将所述查找单元查找到的资源作为静态群组的成员;当所述创建群组指示为创建动态群组时,创建动态群组,将所述接收单元接收到的所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将所述查找单元查找到的满足过滤条件的资源作为动态群组成员;
发送单元,用于向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。
在第一种可能的实施例中,结合第二方面,
所述创建单元,还用于当所述创建群组指示为不创建群组时,向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。
在第二种可能的实施例中,结合第二方面中的第一种可能的实施例,
所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为URI时,向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且所述结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带已创建群组的URI的第一响应消息。
在第三种可能的实施例中,结合第二方面中的第二种可能的实施例,
所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为content时,向所述客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带查找到的资源的URI的第二响应消息。
在第四种可能的实施例中,结合第二方面中的第三种可能的实施例,所述第一资源发现请求消息中还包括资源发现范围;所述查找单元,包括:
确定模块,用于根据所述第一资源发现请求消息确定资源发现范围;
查找模块,用于当所述资源发现范围中包括本地地址时,在本地范围内查找符合过滤条件的资源;
执行模块,用于对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
发送模块,用于当所述资源发现范围中包括远程地址时,向远程地址服务器发送第二资源发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;
接收模块,用于接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。
在第五种可能的实施例中,结合第二方面中的第四种可能的实施例,
所述确定模块,还用于当所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;当所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。
在第六种可能的实施例中,结合第二方面或第二方面中上述任一种可能的实施例,所述动态群组的属性至少包括以下属性中的任一种:
指定范围,用于指示所述服务器在所述指定范围内查找动态群组成员;
所述过滤条件,用于指示动态群组成员应满足的条件;
刷新周期,用于指示所述服务器每隔所述刷新周期查找并更新一次动态群组成员;
群组成员列表,用于存储每次查找到的动态群组成员的URI。
第三方面,本发明实施例提供一种资源发现的装置,所述装置为服务器或集成在服务器中,所述装置包括:
存储器,用于存储包括程序指令的信息;
接收器,用于接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;
处理器,与所述存储器、所述接收器和发送器耦合,用于控制所述程序指令的执行,具体用于根据所述第一资源发现请求消息查找资源;当所述创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员;当所述创建群组指示为创建动态群组时,创建动态群组,将所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员;
所述发送器,用于向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。
在第一种可能的实施例中,结合第三方面,
所述发送器,还用于当所述创建群组指示为不创建群组时,向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。
在第二种可能的实施例中,结合第三方面中的第一种可能的实施例,
所述处理器,还用于判断所述第一资源发现请求消息中是否存在结果类型参数,并将判断结果发送给所述发送器;
所述发送器,还用于当存在结果类型参数,且所述结果类型参数为URI时,向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且所述结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带已创建群组的URI的第一响应消息。
在第三种可能的实施例中,结合第三方面中的第二种可能的实施例,
所述处理器,还用于判断所述第一资源发现请求消息中是否存在结果类型参数,并将判断结果发送给所述发送器;
所述发送器,还用于当存在结果类型参数,且所述结果类型参数为content时,向所述客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带查找到的资源的URI的第二响应消息。
在第四种可能的实施例中,结合第三方面中的第三种可能的实施例,所述第一资源发 现请求消息中还包括资源发现范围;
所述处理器,还用于根据所述第一资源发现请求消息确定资源发现范围;当所述资源发现范围中包括本地地址时,在本地范围内查找符合过滤条件的资源;对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
所述发送器,还用于当所述资源发现范围中包括远程地址时,向远程地址服务器发送第二资源发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;
所述接收器,还用于接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。
在第五种可能的实施例中,结合第三方面中的第四种可能的实施例,
所述处理器,还用于当所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;当所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。
在第六种可能的实施例中,结合第三方面或第三方面中的上述任一种可能的实施例,所述动态群组的属性至少包括以下属性中的任一种:
指定范围,用于指示所述服务器在所述指定范围内查找动态群组成员;
所述过滤条件,用于指示动态群组成员应满足的条件;
刷新周期,用于指示所述服务器每隔所述刷新周期查找并更新一次动态群组成员;
群组成员列表,用于存储每次查找到的动态群组成员的URI。
本发明实施例提供的资源发现的方法及装置,服务器接收客户端发送的第一资源发现请求消息,根据第一资源发现请求消息查找资源,当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员,当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组的过滤条件,最后向客户端发送携带已创建群组的URI的第一响应消息。与现有技术中多次信息交互导致网络开销大相比,本发明实施例可根据第一资源发现请求消息完成资源发现以及创建群组的工作,无需服务器与客户端之间多次进行信息交互,可以节省网络开销。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根 据这些附图获得其他的附图。
图1为本发明实施例提供的一种资源发现的方法的流程图;
图2为本发明实施例提供的另一种资源发现的方法的流程图;
图3为本发明实施例提供的另一种资源发现的方法的流程图;
图4为本发明实施例提供的另一种资源发现的方法的流程图;
图5为本发明实施例提供的一种资源发现的装置的逻辑结构示意图;
图6为本发明实施例提供的另一种资源发现的装置的逻辑结构示意图;
图7为本发明实施例提供的资源发现的方法中服务器的逻辑结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
为了减小资源发现过程中的网络开销,本发明实施例提供一种资源发现的方法,该方法应用于oneM2M系统中服务器根据客户端的请求进行资源发现的过程中,如图1所示,该方法包括:
101、服务器接收客户端发送的第一资源发现请求消息。
其中,第一资源发现请求消息中包括创建群组指示和过滤条件。创建群组指示用于指示是否创建群组,以及创建动态群组还是创建静态群组。过滤条件为用于资源发现的过滤条件,服务器需发现满足过滤条件的资源。
值得说明的是,当服务器接收到的请求消息中携带filter Usage(过滤使用)参数时,则可确定该请求消息为第一资源发现请求消息,或者第一资源发现请求消息为发送到discovery(发现)资源中的请求消息。
102、服务器根据第一资源发现请求消息查找资源。
103、当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员。
其中,可通过扩展filter Usage参数来承载创建群组指示,当filter Usage参数值为create Grp或者为create DycGrp时表示服务器在执行资源发现操作以后还需要进一步创建创群组,create Grp代表需创建静态群组,create DycGrp代表需创建动态群组。
或者,本发明实施例还可以通过在第一资源发现请求消息中新增Is Create Grp参数,当Is Create Grp参数值为true时,代表服务器在执行资源发现操作以后还需进一步创建群组。
另外,还可以通过在第一资源发现请求消息中新增Group Type(群组类型)参数,当Group Type参数为static group时表示创建静态群组,当Group Type为dynamic Grp时表示创建动态群组。
104、当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组成员的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员。
需要说明的是,由于现有的oneM2M标准中并没有定义动态群组,所以本发明实施例可以在现有的群组资源基础上新增filter Criteria属性来标识动态群组资源,当群组资源中包含filter Criteria属性时,表示该群组为动态群组。
其中,动态群组的属性至少包括以下属性中的任一种:
指定范围,用于指示服务器在指定范围内查找动态群组成员。
过滤条件,用于指示动态群组成员应满足的条件。
刷新周期,用于指示服务器每隔刷新周期查找并更新一次动态群组成员。
群组成员列表,用于存储每次查找到的动态群组成员的URI。
进一步需要说明的是,动态群组成员是在指定范围内发现满足过滤条件的资源,然后将这些资源作为动态群组的成员。
105、服务器向客户端发送第一响应消息,第一响应消息中携带已创建群组的通用资源标识符URI。
需要说明的是,当第一资源发现请求消息中存在结果类型参数时,服务器需根据结果类型参数向客户端发送第一响应消息。具体的实现方式为:
服务器判断第一资源发现请求消息中是否存在结果类型参数。
当存在结果类型参数,且结果类型参数为URI时,服务器向客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;
当存在结果类型参数,且结果类型参数为内容content时,服务器向客户端发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;
当第一资源发现请求消息中不存在结果类型参数时,服务器向客户端发送携带已创建群组的URI的第一响应消息。
本发明实施例提供的资源发现的方法,服务器接收客户端发送的第一资源发现请求消息,根据第一资源发现请求消息查找资源,当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员,当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组的过滤条件,最后向客户端发送携带已创建群组的URI的第一响应消息。与现有技术中多次信息交互导致网络开销大相比,本发明实施例可根据第一资源发现请求消息完成资源发现以及创建群组 的工作,无需服务器与客户端之间多次进行信息交互,可以节省网络开销。
结合图1所示的方法流程,在本发明实施例的另一种实现方式中,还提供一种无需创建群组时的服务器应执行的操作,如图2所示,在图1的基础上,该方法还包括步骤106。
106、当创建群组指示为不创建群组时,服务器向客户端发送第二响应消息,第二响应消息中携带查找到的资源的URI。
值得说明的是,本步骤可由另一种实现方式实现,当无需创建群组时,服务器不会收到客户端发送的创建群组指示,即在服务器接收到客户端发送的第一资源发现请求消息之后,会检测第一资源发现请求消息中是否包含群组创建指示,若包含,则执行上述步骤103或104,根据群组创建指示创建相应的群组,若不包含,则向客户端发送第二响应消息。
当第一资源发现请求消息中存在结果类型参数时,服务器需根据结果类型参数向客户端发送第二响应消息。具体的实现方式为:
服务器判断第一资源发现请求消息中是否存在结果类型参数;
当存在结果类型参数,且结果类型参数为content时,服务器向客户端发送携带查找到的资源的内容的第二响应消息;
当存在结果类型参数,且结果类型参数为URI,或者第一资源发现请求消息中不存在结果类型参数时,服务器向客户端发送携带查找到的资源的URI的第二响应消息。
结合图1或图2,为了提供服务器根据第一资源发现请求消息发现资源的方法,在本发明实施例提供的另一种实现方式中,第一资源发现请求消息中还包括资源发现范围,如图3所示,上述步骤102具体可以实现为步骤301至步骤304。
301、服务器根据第一资源发现请求消息确定资源发现范围。
其中,当服务器确定第一资源发现请求消息中包括范围参数时,确定资源发现范围为范围参数指定的范围;
当服务器确定第一资源发现请求消息中不包括范围参数时,确定资源发现范围为第一资源发现请求消息的目的地址所包含的范围。
302、当资源发现范围中包括本地地址时,服务器在本地范围内查找符合过滤条件的资源。
假设过滤条件为creator=SAM,Resource Type=Container,服务器将根据请求消息在指定的本地范围内发现满足符合creator属性为SAM并且Resource Type为Container等条件的资源。当过滤条件为空时,资源发现范围内的所有资源都是符合条件的资源。
值得说明的是,本步骤中的过滤条件可以为第一资源发现请求消息中的过滤条件,或者,当第一资源发现请求消息的目的地址为动态群组时,过滤条件可以为第一资源发现请求消息中携带的过滤条件和动态群组的过滤条件的组合。
303、对符合条件的资源执行第一资源发现请求消息指定的操作。
其中,第一资源发现请求消息指定的操作包括获取资源、更新资源、删除资源、创建资源中的任意一种,当指定的操作为获取资源时,则可直接执行上述步骤105,当指定的操作为更新资源、删除资源或者创建资源时,则对符合过滤条件的资源执行更新、删除或者创建子资源的操作。
304、当资源发现范围中包括远程地址时,服务器向远程地址服务器发送第二资源发现请求消息,第二资源发现请求消息中的过滤条件与第一发现请求中的过滤条件相同。
其中,远程地址服务器为远程地址对应的服务器,第二资源发现请求消息的目的地址为该远程地址。
需要说明的是,在本步骤的另一种实现方式中,当确定资源发现范围中包括远程地址时,还需进一步根据过滤条件判断是否需要进行远程资源发现,例如,当过滤条件中指示至多需要两个符合过滤条件的资源时,如果步骤302中已经查找到两个符合过滤条件的资源,则服务器无需向远程地址服务器发送第二资源发现请求消息。此外,如果资源发现范围中既包括本地地址又包括远程地址,则服务器既需要在本地范围内发现资源,又需向远程地址服务器发送第二资源发现请求消息。
还需说明的是,当第一资源发现请求消息中包括结果类型参数和群组创建指示时,则第二资源发现请求消息中需包括相同的结果类型参数和群组创建指示。
远程地址服务器接收到第二资源发现请求消息时,与服务器根据第一资源发现请求消息发现资源的方法相同。
305、服务器接收远程服务器发送的第三响应消息,第三响应消息中携带远程资源发现结果。
其中,远程资源发现结果包括远程服务器已创建群组的URI和/或远程服务器查找到的资源的URI,或者远程资源发现结果包括远程服务器已创建群组的URI和/或远程服务器查找到的资源的内容。
当第二资源发现请求消息中不包含结果类型参数,且包含的群组创建指示为创建动态群组或者创建静态群组时,远程资源发现结果为创建的群组的URI。
当第二资源发现请求消息中不包含结果类型参数,且包含的群组创建指示为不创建群组,或者不包含群组创建指示时,远程资源发现结果为发现的资源的URI。
当第二资源发现请求中包括结果类型参数时,确定第三响应消息中携带的远程资源发现结果的方法与上述步骤105与步骤106中描述的方法相同,此处不再赘述。
本发明实施例提供的资源发现的方法,服务器根据第一资源发现请求消息确定资源发现范围,并在资源发现范围内查找符合条件的资源,进而对符合条件的资源执行第一资源发现请求指定的操作,当资源发现范围中包含远程地址时,服务器也能向远程地址服务器发送第二资源发现请求,只需接收客户端的一个消息就能够完成资源发现以及对资源的操 作,无需进行多次信息交互,可以节省网络开销。
以下以客户端向服务器CSE1请求资源发现的流程为例描述本发明实施例提供的资源发现的方法,如图4所示,该方法包括:
401、客户端向CSE1发送第一资源发现请求消息。
其中,该第一资源发现请求消息中携带的目的地址为:http://cse1.example.org/myGroup,范围参数为:http://cse1.example.org/myGroup、http://cse2.example.org/myAPP1、http://cse3.example.org/smartAPP,过滤条件为:creator=SAM,createdBefore=2014-12-20,并且filterUsage=CreateGrp。根据过滤条件和范围参数可以确定客户端希望在CSE1的mygroup、CSE2的myAPP1以及CSE3的smartAPP范围内发现SAM在2014-12-20之前创建的资源。
由于客户端将第一资源发现请求消息发送至CSE1,对于CSE1而言,CSE1的地址为本地地址,CSE2和CSE3的地址为远程地址。
402、CSE1分别向CSE2和CSE3发送第二资源发现请求消息。
403、CSE1、CSE2和CSE3分别根据各自接收到的资源发现请求消息查找资源。
其中,查找资源的过程参见图3所示的方法流程,此处不再赘述。
需要说明的是,CSE1查找资源的过程也可以执行于步骤402之前,或者与步骤402同时进行,本发明对此不作限制。
404、CSE2和CSE3分别向CSE1发送第三响应消息,第三响应消息中携带资源发现结果。
例如,CSE1发现的资源为CSE1/smartAPP/A,CSE2发现的资源为CSE2/myAPP1/a,CSE2/myAPP1/b,CSE3发现的资源为CSE3/smartAPP/B,CSE3/smartAPP/C。
当第二资源发现请求消息中未携带创建群组指示时,CSE1接收到的第三响应消息中携带上述CSE2和CSE2发现的资源的URI。
当第二资源发现请求消息中携带创建群组指示时,则CSE1接收到的CSE2和CSE3发送的第三响应消息中都会携带群组的URI,例如CSE2中群组的URI为CSE2/myAPP1/<groupName>,CSE3中群组的URI为CSE3/smartAPP/<groupName>。
405、CSE1根据第一资源发现请求消息中的群组创建指示创建群组。
以群组创建指示为创建静态群组为例,结合步骤404中的描述,当CSE2和CSE3未创建群组时,CSE1创建的群组资源中包括5个群组成员,分别为:CSE1/smartAPP/A,CSE2/myAPP1/a,CSE2/myAPP1/b,CSE3/smartAPP/B,CSE3/smartAPP。该群组的URI为http://cse1.example.org/myGroup/<groupName>。
当CSE2和CSE3已创建群组时,CSE1创建的群组资源中除了包含群组成员CSE1/smartAPP/A外,还包含两个子群组成员,分别为:CSE2/myAPP1/<groupName>,CSE3/smartAPP/<groupName>。
406、CSE1向客户端发送第一响应消息,第一响应消息中携带CSE1创建的群组的URI。
本发明实施例提供的资源发现的方法,服务器接收客户端发送的第一资源发现请求消息,根据第一资源发现请求消息查找资源,当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员,当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组的过滤条件,最后向客户端发送携带已创建群组的URI的第一响应消息。与现有技术中多次信息交互导致网络开销大相比,本发明实施例可根据第一资源发现请求消息完成资源发现以及创建群组的工作,无需服务器与客户端之间多次进行信息交互,可以节省网络开销。
结合上述方法流程,本发明实施例还提供一种资源发现的装置,该装置应用于服务器中,如图5所示,该装置包括:接收单元501,查找单元502,创建单元503,发送单元504。
接收单元501,用于接收客户端发送的第一资源发现请求消息,第一资源发现请求消息中携带创建群组指示和过滤条件;
查找单元502,用于根据接收单元501接收到的第一资源发现请求消息查找资源;
创建单元503,用于当创建群组指示为创建静态群组时,创建静态群组,将查找单元502查找到的资源作为静态群组的成员;当创建群组指示为创建动态群组时,创建动态群组,将接收单元501接收到的第一资源发现请求消息中的过滤条件设置为用于确定动态群组成员的过滤条件,将查找单元502查找到的满足过滤条件的资源作为动态群组成员;
动态群组的属性至少包括以下属性中的任一种:
指定范围,用于指示服务器在指定范围内查找动态群组成员;
过滤条件,用于指示动态群组成员应满足的条件;
刷新周期,用于指示服务器每隔刷新周期查找并更新一次动态群组成员;
群组成员列表,用于存储每次查找到的动态群组成员的URI。
发送单元504,用于向客户端发送第一响应消息,第一响应消息中携带已创建群组的通用资源标识符URI。
在本发明另一实施例中,发送单元504,还用于当创建群组指示为不创建群组时,向客户端发送第二响应消息,第二响应消息中携带查找到的资源的URI。
在本发明另一实施例中,发送单元504,还用于判断第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且结果类型参数为URI时,向客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当第一资源发现请求消息中不存在结果类型参数时,向客户端发送携带已创建群组的URI的第一响应消息。
在本发明另一实施例中,发送单元504,还用于判断第一资源发现请求消息中是否存在 结果类型参数;当存在结果类型参数,且结果类型参数为content时,向客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且结果类型参数为URI,或者第一资源发现请求消息中不存在结果类型参数时,向客户端发送携带查找到的资源的URI的第二响应消息。
在本发明另一实施例中,如图6所示,第一资源发现请求消息中还包括资源发现范围;查找单元502,包括:确定模块5021,查找模块5022,执行模块5023,发送模块5024,接收模块5025。
确定模块5021,用于根据第一资源发现请求消息确定资源发现范围;
查找模块5022,用于当确定模块5021确定的资源发现范围中包括本地地址时,在本地范围内查找符合过滤条件的资源;
执行模块5023,用于对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
发送模块5024,用于当确定模块5021确定的资源发现范围中包括远程地址时,向远程地址服务器发送第二资源发现请求消息,第二资源发现请求消息中的过滤条件与第一资源发现请求中的过滤条件相同;
接收模块5025,用于接收远程服务器发送的第三响应消息,第三响应消息中携带远程资源发现结果,远程资源发现结果包括远程服务器已创建群组的URI和/或远程服务器查找到的资源的URI,或者远程资源发现结果包括远程服务器已创建群组的URI和/或远程服务器查找到的资源的内容。
确定模块5021,还用于当第一资源发现请求消息中包括范围参数时,确定资源发现范围为范围参数指定的范围;当第一资源发现请求消息中不包括范围参数时,确定资源发现范围为第一资源发现请求消息的目的地址所包含的范围。
本发明实施例提供的资源发现的装置,接收单元接收客户端发送的第一资源发现请求消息,查找单元根据第一资源发现请求消息查找资源,当创建群组指示为创建静态群组时,创建单元创建静态群组,将查找到的资源作为静态群组的成员,当创建群组指示为创建动态群组时,创建单元创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组的过滤条件,最后发送单元向客户端发送携带已创建群组的URI的第一响应消息。与现有技术中多次信息交互导致网络开销大相比,本发明实施例可根据第一资源发现请求消息完成资源发现以及创建群组的工作,无需服务器与客户端之间多次进行信息交互,可以节省网络开销。
本发明实施例还提供一种资源发现的装置,如图7所示,图7为图5描述的服务器的硬件结构示意图。其中,服务器可包括存储器701、发送器702、处理器703、总线704和接收器705,其中,存储器701、发送器702、处理器703、接收器705通过总线704通信连接。
存储器701可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器701可以存储操作系统和其他应用程序。在通过软件或者固件来实现本发明实施例提供的技术方案时,用于实现本发明实施例提供的技术方案的程序代码保存在存储器701中,并由处理器703来执行。
发送器702和接收器705用于装置与其他设备或通信网络(例如但不限于以太网,无线接入网(Radio Access Network,RAN),无线局域网(Wireless Local Area Network,WLAN)等)之间的通信。
处理器703可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现本发明实施例所提供的技术方案。
应注意,尽管图7所示的硬件仅仅示出了存储器701、发送器702、接收器705和处理器703以及总线704,但是在具体实现过程中,本领域的技术人员应当明白,该第一基站还包含实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当明白,还可包含实现其他功能的硬件器件。
具体的,图7所示的服务器用于实现图5实施例所示的装置时,该装置中的存储器701,用于存储包括程序指令的信息;
接收器705,用于接收客户端发送的第一资源发现请求消息,第一资源发现请求消息中携带创建群组指示和过滤条件;
处理器703,与存储器701、接收器705和发送器702耦合,用于控制程序指令的执行,具体用于根据第一资源发现请求消息查找资源;当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员;当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组成员的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员;
其中,动态群组的属性至少包括以下属性中的任一种:
指定范围,用于指示服务器在指定范围内查找动态群组成员;
过滤条件,用于指示动态群组成员应满足的条件;
刷新周期,用于指示服务器每隔刷新周期查找并更新一次动态群组成员;
群组成员列表,用于存储每次查找到的动态群组成员的URI。
发送器702,用于向客户端发送第一响应消息,第一响应消息中携带已创建群组的通用资源标识符URI。
在本发明另一实施例中,发送器702,还用于当创建群组指示为不创建群组时,向客户端发送第二响应消息,第二响应消息中携带查找到的资源的URI。
在本发明另一实施例中,处理器703,还用于判断第一资源发现请求消息中是否存在结 果类型参数,并将判断结果发送给发送器702;
发送器702,还用于当存在结果类型参数,且结果类型参数为URI时,向客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当第一资源发现请求消息中不存在结果类型参数时,向客户端发送携带已创建群组的URI的第一响应消息。
在本发明另一实施例中,处理器703,还用于判断第一资源发现请求消息中是否存在结果类型参数,并将判断结果发送给发送器702;
发送器702,还用于当存在结果类型参数,且结果类型参数为content时,向客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且结果类型参数为URI,或者第一资源发现请求消息中不存在结果类型参数时,向客户端发送携带查找到的资源的URI的第二响应消息。
在本发明另一实施例中,第一资源发现请求消息中还包括资源发现范围;
处理器703,还用于根据第一资源发现请求消息确定资源发现范围;当资源发现范围中包括本地地址时,在本地范围内查找符合过滤条件的资源;对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
发送器702,还用于当资源发现范围中包括远程地址时,向远程地址服务器发送第二资源发现请求消息,第二资源发现请求消息中的过滤条件与第一资源发现请求中的过滤条件相同;
接收器705,还用于接收远程服务器发送的第三响应消息,第三响应消息中携带远程资源发现结果,远程资源发现结果包括远程服务器已创建群组的URI和/或远程服务器查找到的资源的URI,或者远程资源发现结果包括远程服务器已创建群组的URI和/或远程服务器查找到的资源的内容。
在本发明另一实施例中,处理器703,还用于当第一资源发现请求消息中包括范围参数时,确定资源发现范围为范围参数指定的范围;当第一资源发现请求消息中不包括范围参数时,确定资源发现范围为第一资源发现请求消息的目的地址所包含的范围。
本发明实施例提供的资源发现的装置,接收器接收客户端发送的第一资源发现请求消息,处理器根据第一资源发现请求消息查找资源,当创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员,当创建群组指示为创建动态群组时,创建动态群组,将第一资源发现请求消息中的过滤条件设置为用于确定动态群组的过滤条件,最后发送器向客户端发送携带已创建群组的URI的第一响应消息。与现有技术中多次信息交互导致网络开销大相比,本发明实施例可根据第一资源发现请求消息完成资源发现以及创建群组的工作,无需服务器与客户端之间多次进行信息交互,可以节省网络开销。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘,硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (14)

  1. 一种资源发现的方法,其特征在于,包括:
    服务器接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;
    所述服务器根据所述第一资源发现请求消息查找资源;
    当所述创建群组指示为创建静态群组时,创建静态群组,将查找到的资源作为静态群组的成员;
    当所述创建群组指示为创建动态群组时,创建动态群组,将所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员;
    所述服务器向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。
  2. 根据权利要求1所述的资源发现的方法,其特征在于,所述方法还包括:
    当所述创建群组指示为不创建群组时,所述服务器向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。
  3. 根据权利要求2所述的资源发现的方法,其特征在于,所述服务器向所述客户端发送第一响应消息,包括:
    所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;
    当存在结果类型参数,且所述结果类型参数为URI时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;
    当存在结果类型参数,且所述结果类型参数为内容content时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;
    当所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带已创建群组的URI的第一响应消息。
  4. 根据权利要求3所述的资源发现的方法,其特征在于,所述服务器向所述客户端发送第二响应消息,包括:
    所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;
    当存在结果类型参数,且所述结果类型参数为content时,所述服务器向所述客户端发送携带查找到的资源的内容的第二响应消息;
    当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带查找到的资源的URI的第二响应消息。
  5. 根据权利要求4所述的资源发现的方法,其特征在于,所述第一资源发现请求消息中 还包括资源发现范围,所述服务器根据所述第一资源发现请求消息查找资源,包括:
    所述服务器根据所述第一资源发现请求消息确定资源发现范围;
    当所述资源发现范围中包括本地地址时,所述服务器在本地范围内查找符合过滤条件的资源;
    对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
    当所述资源发现范围中包括远程地址时,所述服务器向远程地址服务器发送第二资源发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;
    所述服务器接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。
  6. 根据权利要求5所述的资源发现的方法,其特征在于,所述服务器根据所述第一资源发现请求消息确定资源发现范围,包括:
    当所述服务器确定所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;
    当所述服务器确定所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。
  7. 根据权利要求1至6中任一项所述的资源发现的方法,其特征在于,所述动态群组的属性至少包括以下属性中的任一种:
    指定范围,用于指示所述服务器在所述指定范围内查找动态群组成员;
    所述过滤条件,用于指示动态群组成员应满足的条件;
    刷新周期,用于指示所述服务器每隔所述刷新周期查找并更新一次动态群组成员;
    群组成员列表,用于存储每次查找到的动态群组成员的URI。
  8. 一种资源发现的装置,其特征在于,包括:
    接收单元,用于接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;
    查找单元,用于根据所述接收单元接收到的所述第一资源发现请求消息查找资源;
    创建单元,用于当所述创建群组指示为创建静态群组时,创建静态群组,将所述查找单元查找到的资源作为静态群组的成员;当所述创建群组指示为创建动态群组时,创建动态群组,将所述接收单元接收到的所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将所述查找单元查找到的满足过滤条件的资源作为动态群组成员;
    发送单元,用于向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。
  9. 根据权利要求8所述的资源发现的装置,其特征在于,
    所述发送单元,还用于当所述创建群组指示为不创建群组时,向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。
  10. 根据权利要求9所述的资源发现的装置,其特征在于,
    所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为URI时,向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且所述结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带已创建群组的URI的第一响应消息。
  11. 根据权利要求10所述的资源发现的装置,其特征在于,
    所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为content时,向所述客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带查找到的资源的URI的第二响应消息。
  12. 根据权利要求11所述的资源发现的装置,其特征在于,所述第一资源发现请求消息中还包括资源发现范围;所述查找单元,包括:
    确定模块,用于根据所述第一资源发现请求消息确定资源发现范围;
    查找模块,用于当所述资源发现范围中包括本地地址时,在本地范围内查找符合过滤条件的资源;
    执行模块,用于对符合过滤条件的资源执行第一资源发现请求消息指定的操作;
    发送模块,用于当所述资源发现范围中包括远程地址时,向远程地址服务器发送第二资源发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;
    接收模块,用于接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。
  13. 根据权利要求12所述的资源发现的装置,其特征在于,
    所述确定模块,还用于当所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;当所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。
  14. 根据权利要求8至13中任一项所述的资源发现的装置,其特征在于,所述动态群组 的属性至少包括以下属性中的任一种:
    指定范围,用于指示所述服务器在所述指定范围内查找动态群组成员;
    所述过滤条件,用于指示动态群组成员应满足的条件;
    刷新周期,用于指示所述服务器每隔所述刷新周期查找并更新一次动态群组成员;
    群组成员列表,用于存储每次查找到的动态群组成员的URI。
PCT/CN2016/106126 2015-11-19 2016-11-16 一种资源发现的方法及装置 WO2017084584A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510808314.9 2015-11-19
CN201510808314.9A CN106790323B (zh) 2015-11-19 2015-11-19 一种资源发现的方法及装置

Publications (1)

Publication Number Publication Date
WO2017084584A1 true WO2017084584A1 (zh) 2017-05-26

Family

ID=58717372

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/106126 WO2017084584A1 (zh) 2015-11-19 2016-11-16 一种资源发现的方法及装置

Country Status (2)

Country Link
CN (2) CN106790323B (zh)
WO (1) WO2017084584A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819006B (zh) * 2017-11-22 2022-08-09 京东方科技集团股份有限公司 对目标资源进行操作的方法、节点设备和终端装置
CN113875209A (zh) * 2019-05-13 2021-12-31 现代自动车株式会社 用于在m2m系统中删除资源的方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098267A (zh) * 2006-06-28 2008-01-02 华为技术有限公司 一种建立群组会话的方法和系统
CN101873542A (zh) * 2009-04-21 2010-10-27 华为技术有限公司 基于条件的统一资源标识的选择方法、服务器及通信系统
CN102256211A (zh) * 2010-05-19 2011-11-23 中兴通讯股份有限公司 M2m终端基于群组实现应用的方法和系统
US20150029937A1 (en) * 2013-07-26 2015-01-29 Hideki Tamura Communication management system, communication terminal, communication system, and recording medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8392567B2 (en) * 2009-03-16 2013-03-05 International Business Machines Corporation Discovering and identifying manageable information technology resources
CN103200209B (zh) * 2012-01-06 2018-05-25 华为技术有限公司 成员资源的访问方法、群组服务器和成员设备
CN103327568B (zh) * 2012-03-21 2016-12-14 中国移动通信集团公司 资源分配消息发送方法、设备发现方法及相关设备
US20150055557A1 (en) * 2012-03-22 2015-02-26 Interdigital Patent Holdings, Inc. Method and apparatus for supporting machine-to-machine caching at a service capability layer
CA2869505C (en) * 2012-05-14 2020-09-29 Huawei Technologies Co., Ltd. Method and system for group communication, group server, and group member device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098267A (zh) * 2006-06-28 2008-01-02 华为技术有限公司 一种建立群组会话的方法和系统
CN101873542A (zh) * 2009-04-21 2010-10-27 华为技术有限公司 基于条件的统一资源标识的选择方法、服务器及通信系统
CN102256211A (zh) * 2010-05-19 2011-11-23 中兴通讯股份有限公司 M2m终端基于群组实现应用的方法和系统
US20150029937A1 (en) * 2013-07-26 2015-01-29 Hideki Tamura Communication management system, communication terminal, communication system, and recording medium

Also Published As

Publication number Publication date
CN106790323A (zh) 2017-05-31
CN111193805A (zh) 2020-05-22
CN106790323B (zh) 2020-02-14
CN111193805B (zh) 2021-12-31

Similar Documents

Publication Publication Date Title
US11159606B2 (en) Lightweight IoT information model
CN108353094B (zh) 用于m2m服务层的跨资源订阅
JP7139522B2 (ja) ローカルエリアネットワーク通信方法、装置、およびシステム
EP3790315B1 (en) Handover methods, apparatuses,communication system and computer-readable storage medium
US10241839B2 (en) Method and system for generating a virtual device resource accessible by an application
JP6768976B2 (ja) サブスクリプション更新方法、装置、及びシステム
US8918528B2 (en) Operating group resources in sub-groups and nested groups
US11237888B2 (en) Message processing method and system, storage medium and electronic device
US10674349B2 (en) Subscription update method, device, and system
WO2016101780A1 (zh) 一种虚拟化网络中业务部署的方法和装置
US11228537B2 (en) Resource processing method and system, storage medium and electronic device
WO2017084584A1 (zh) 一种资源发现的方法及装置
KR102631288B1 (ko) 가입 서버, 가입 단말기, 정보 가입 방법, 및 시스템
US20180159740A1 (en) Device discovery service
JP2024503412A (ja) コアネットワークにおいてサービングネットワークノードを動的に発見するための方法、ネットワークノード、及びコンピュータ読取可能媒体
WO2020009797A1 (en) Efficient resource representation exchange between service layers
WO2024012406A1 (zh) 绑定信息发现方法和系统、网络设备和存储介质
WO2018095325A1 (zh) 信息通知方法、装置及系统
KR101453205B1 (ko) 유피엔피 기반 서비스 발견 방법 및 그 장치

Legal Events

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

Ref document number: 16865761

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16865761

Country of ref document: EP

Kind code of ref document: A1