[go: up one dir, main page]

CN111193805B - Resource discovery method and device - Google Patents

Resource discovery method and device Download PDF

Info

Publication number
CN111193805B
CN111193805B CN202010008393.6A CN202010008393A CN111193805B CN 111193805 B CN111193805 B CN 111193805B CN 202010008393 A CN202010008393 A CN 202010008393A CN 111193805 B CN111193805 B CN 111193805B
Authority
CN
China
Prior art keywords
resource
resource discovery
group
request message
uri
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010008393.6A
Other languages
Chinese (zh)
Other versions
CN111193805A (en
Inventor
高莹
张永靖
殷佳欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010008393.6A priority Critical patent/CN111193805B/en
Publication of CN111193805A publication Critical patent/CN111193805A/en
Application granted granted Critical
Publication of CN111193805B publication Critical patent/CN111193805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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的第一响应消息。本发明实施例提供的方案适于资源发现的过程中。

Figure 202010008393

The invention discloses a method and a device for resource discovery, which relate to the technical field of communication networks and can solve the problem of high network overhead. In this embodiment of the present invention, the server receives the first resource discovery request message sent by the client, searches for resources according to the first resource discovery request message, and when creating a group is instructed to create a static group, creates a static group, and retrieves the found resource. As a member of a static group, when creating a group is instructed to create a dynamic group, create a dynamic group, set the filter condition in the first resource discovery request message as the filter condition for determining the dynamic group, and find the The resources that satisfy the filtering conditions are regarded as dynamic group members, and finally send a first response message carrying the URI of the created group to the client. The solutions provided by the embodiments of the present invention are suitable for the process of resource discovery.

Figure 202010008393

Description

Resource discovery method and device
Technical Field
The present invention relates to the field of communications network technologies, and in particular, to a method and an apparatus for resource discovery.
Background
With the rapid development of the internet of things technology, M2M (Machine-to-Machine Communications) has been abundantly applied in more and more industries and fields, and in order to meet the needs of application services in different industries, a unified M2M platform is developed to realize partial public capabilities, such as a resource discovery function.
The M2M platform may be a oneM2M platform, and a method for performing Resource discovery in a oneM2M architecture at present is that when a CSE (Common service Entity) in the oneM2M system receives a Resource discovery request message, a Resource discovery range is determined according to a destination address of the request message, and then resources meeting a filtering condition are searched for, and a URI (Universal Resource Identifier) of the Resource meeting the condition is returned in a response message, and then a requester sends a specific operation request to each Resource according to the URI, and the requester needs to send an operation request to each Resource each time when needing to operate the resources. Or the requester can send the request for creating the group after receiving the URI, and the requester sends the operation request to the group after creating the group by taking the resource meeting the condition as the group member. Whether a group is created or not, information interaction between the requester and the CSE needs to be performed for many times, resulting in large network overhead.
Disclosure of Invention
The embodiment of the invention provides a method and a device for discovering resources, which can solve the problem of high network overhead in the resource discovery process in the prior art.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for resource discovery, including:
a server receives a first resource discovery request message sent by a client, wherein the first resource discovery request message carries a group creation instruction and a filtering condition;
the server searches resources according to the first resource discovery request message;
when the created group indication is the created static group, creating the static group, and taking the searched resource as a member of the static group;
when the created group indication is a created dynamic group, creating the dynamic group, setting the filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group members, and taking the searched resources meeting the filtering condition as the dynamic group members;
and the server sends a first response message to the client, wherein the first response message carries the Universal Resource Identifier (URI) of the created group.
In a first possible embodiment, with reference to the first aspect, the method further includes:
and when the group creating indication indicates that the group is not created, the server sends a second response message to the client, wherein the second response message carries the found URI of the resource.
In a second possible embodiment, with reference to the first possible embodiment of the first aspect, the sending, by the server, a first response message to the client includes:
the server judges whether a result type parameter exists in the first resource discovery request message or not;
when a result type parameter exists and the result type parameter is a URI, the server sends a first response message carrying the URI of the created group and the URI of the searched resource to the client;
when a result type parameter exists and the result type parameter is content, the server sends a first response message carrying the URI of the created group and the content of the searched resource to the client;
and when the result type parameter does not exist in the first resource discovery request message, the server sends a first response message carrying the URI of the created group to the client.
In a third possible embodiment, with reference to the second possible embodiment of the first aspect, the sending, by the server, a second response message to the client includes:
the server judges whether a result type parameter exists in the first resource discovery request message or not;
when the result type parameter exists and the result type parameter is content, the server sends a second response message carrying the searched content of the resource to the client;
and when the result type parameter exists and is the 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 searched resource to the client.
In a fourth possible embodiment, with reference to the third possible embodiment of the first aspect, the first resource discovery request message further includes a resource discovery range, and the server searches for a resource according to the first resource discovery request message, including:
the server determines a resource discovery range according to the first resource discovery request message;
when the resource discovery range comprises a local address, the server searches for the resource meeting the filtering condition in the local range;
executing the operation specified by the first resource discovery request message on the resources meeting the filtering condition;
when the resource discovery range comprises a remote address, the server sends a second resource discovery request message to a remote address server, wherein 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 receives a third response message sent by the remote server, where the third response message carries a remote resource discovery result, and the remote resource discovery result includes the URI of the group created by the remote server and/or the URI of the resource found by the remote server, or the remote resource discovery result includes the URI of the group created by the remote server and/or the content of the resource found by the remote server.
In a fifth possible embodiment, with reference to the fourth possible embodiment of the first aspect, the determining, by the server, a resource discovery range according to the first resource discovery request message includes:
when the server determines that the first resource discovery request message comprises a range parameter, determining that the resource discovery range is a range specified by the range parameter;
when the server determines that the first resource discovery request message does not include the scope parameter, determining that the resource discovery scope is a scope included in a destination address of the first resource discovery request message.
In a sixth possible embodiment, with reference to the first aspect or any one of the above possible embodiments of the first aspect, the attributes of the dynamic group include at least any one of the following attributes:
a designated range for instructing the server to search for dynamic group members within the designated range;
the filtering condition is used for indicating a condition which should be met by the dynamic group member;
a refresh period for instructing the server to search and update the dynamic group members once every other refresh period;
and the group member list is used for storing the URI of the dynamic group member searched each time.
In a second aspect, an embodiment of the present invention provides an apparatus for resource discovery, including:
a receiving unit, configured to receive a first resource discovery request message sent by a client, where the first resource discovery request message carries a group creation instruction and a filtering condition;
a searching unit, configured to search for a resource according to the first resource discovery request message received by the receiving unit;
the creating unit is used for creating the static group when the creating group indicates that the static group is created, and taking the resource searched by the searching unit as a member of the static group; when the created group indication is a created dynamic group, creating the dynamic group, setting the filtering condition in the first resource discovery request message received by the receiving unit as a filtering condition for determining the dynamic group members, and taking the resources which are searched by the searching unit and meet the filtering condition as the dynamic group members;
a sending unit, 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.
In a first possible embodiment, in combination with the second aspect,
the creating unit is further configured to send a second response message to the client when the created group indicates that the group is not created, where the second response message carries the found URI of the resource.
In a second possible embodiment, in combination with the first possible embodiment of the second aspect,
the sending unit is further configured to determine whether a result type parameter exists in the first resource discovery request message; when a result type parameter exists and the result type parameter is a URI, sending a first response message carrying the URI of the created group and the URI of the searched resource to the client; when a result type parameter exists and the result type parameter is content, sending a first response message carrying the URI of the created group and the content of the searched resource; and when the result type parameter does not exist in the first resource discovery request message, sending a first response message carrying the URI of the created group to the client.
In a third possible embodiment, in combination with the second possible embodiment of the second aspect,
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 a second response message carrying the content of the searched resource to the client; and when the result type parameter exists and is the URI, or the result type parameter does not exist in the first resource discovery request message, sending a second response message carrying the URI of the searched resource to the client.
In a fourth possible embodiment, with reference to the third possible embodiment of the second aspect, the first resource discovery request message further includes a resource discovery range; the search unit includes:
a determining module, configured to determine a resource discovery range according to the first resource discovery request message;
the searching module is used for searching the resources meeting the filtering condition in the local range when the resource discovery range comprises the local address;
the execution module is used for executing the operation specified by the first resource discovery request message on the resources meeting the filtering condition;
a sending module, configured to send a second resource discovery request message to a remote address server when the resource discovery range includes a remote address, where a filtering condition in the second resource discovery request message is the same as a filtering condition in the first resource discovery request;
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, and the remote resource discovery result includes a URI of a group created by the remote server and/or a URI of a resource found by the remote server, or the remote resource discovery result includes a URI of a group created by the remote server and/or content of a resource found by the remote server.
In a fifth possible embodiment, in combination with the fourth possible embodiment of the second aspect,
the determining module is further configured to determine, when the first resource discovery request message includes a range parameter, that the resource discovery range is a range specified by the range parameter; when the first resource discovery request message does not include the scope parameter, determining that the resource discovery scope is a scope included in a destination address of the first resource discovery request message.
In a sixth possible embodiment, in combination with the second aspect or any one of the above possible embodiments of the second aspect, the attributes of the dynamic group include at least any one of the following attributes:
a designated range for instructing the server to search for dynamic group members within the designated range;
the filtering condition is used for indicating a condition which should be met by the dynamic group member;
a refresh period for instructing the server to search and update the dynamic group members once every other refresh period;
and the group member list is used for storing the URI of the dynamic group member searched each time.
In a third aspect, an embodiment of the present invention provides an apparatus for resource discovery, where the apparatus is a server or is integrated in a server, and the apparatus includes:
a memory for storing information including program instructions;
the system comprises a receiver and a server, wherein the receiver is used for receiving a first resource discovery request message sent by a client, and the first resource discovery request message carries a group creation instruction and a filtering condition;
a processor, coupled to the memory, the receiver and the transmitter, for controlling execution of the program instructions, in particular for looking up resources according to the first resource discovery request message; when the created group indication is the created static group, creating the static group, and taking the searched resource as a member of the static group; when the created group indication is a created dynamic group, creating the dynamic group, setting the filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group members, and taking the searched resources meeting the filtering condition as the dynamic group members;
the sender 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.
In a first possible embodiment, in combination with the third aspect,
the sender is further configured to send a second response message to the client when the creation group indicates that the group is not created, where the second response message carries the found URI of the resource.
In a second possible embodiment, in combination with the first possible embodiment of the third aspect,
the processor is further configured to determine whether a result type parameter exists in the first resource discovery request message, and send a determination result to the sender;
the sender is further configured to send a first response message carrying the URI of the created group and the URI of the found resource to the client when the result type parameter exists and the result type parameter is the URI; when a result type parameter exists and the result type parameter is content, sending a first response message carrying the URI of the created group and the content of the searched resource; and when the result type parameter does not exist in the first resource discovery request message, sending a first response message carrying the URI of the created group to the client.
In a third possible embodiment, in combination with the second possible embodiment of the third aspect,
the processor is further configured to determine whether a result type parameter exists in the first resource discovery request message, and send a determination result to the sender;
the transmitter is further configured to send a second response message carrying the content of the found resource to the client when a result type parameter exists and the result type parameter is content; and when the result type parameter exists and is the URI, or the result type parameter does not exist in the first resource discovery request message, sending a second response message carrying the URI of the searched resource to the client.
In a fourth possible embodiment, with reference to the third possible embodiment of the third aspect, the first resource discovery request message further includes a resource discovery range;
the processor is further configured to determine a resource discovery range according to the first resource discovery request message; when the resource discovery range comprises a local address, searching for the resource meeting the filtering condition in the local range; executing the operation specified by the first resource discovery request message on the resources meeting the filtering condition;
the transmitter is further configured to transmit a second resource discovery request message to a remote address server when a remote address is included in the resource discovery range, where a filtering condition in the second resource discovery request message is the same as a filtering condition in the first resource discovery request;
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, and the remote resource discovery result includes a URI of a group created by the remote server and/or a URI of a resource found by the remote server, or the remote resource discovery result includes a URI of a group created by the remote server and/or content of a resource found by the remote server.
In a fifth possible embodiment, in combination with the fourth possible embodiment of the third aspect,
the processor is further configured to determine, when the first resource discovery request message includes a scope parameter, that the resource discovery scope is a scope specified by the scope parameter; when the first resource discovery request message does not include the scope parameter, determining that the resource discovery scope is a scope included in a destination address of the first resource discovery request message.
In a sixth possible embodiment, with reference to the third aspect or any one of the above possible embodiments of the third aspect, the attributes of the dynamic group include at least any one of the following attributes:
a designated range for instructing the server to search for dynamic group members within the designated range;
the filtering condition is used for indicating a condition which should be met by the dynamic group member;
a refresh period for instructing the server to search and update the dynamic group members once every other refresh period;
and the group member list is used for storing the URI of the dynamic group member searched each time.
In the method and the device for discovering the resource, provided by the embodiment of the invention, the server receives a first resource discovery request message sent by the client, searches for the resource according to the first resource discovery request message, creates a static group when the creation group indicates that the static group is created, takes the searched resource as a member of the static group, creates a dynamic group when the creation group indicates that the dynamic group is created, sets a filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group, and finally sends a first response message carrying the URI of the created group to the client. Compared with the prior art that the network overhead is large due to multiple information interactions, the embodiment of the invention can complete the work of resource discovery and group creation according to the first resource discovery request message, does not need to perform information interaction between the server and the client for multiple times, and can save the network overhead.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
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 logic diagram of an apparatus for resource discovery according to an embodiment of the present invention;
fig. 6 is a schematic logic diagram of another apparatus for resource discovery according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a logic structure of a server in the resource discovery method according to the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to reduce network overhead in the resource discovery process, an embodiment of the present invention provides a method for resource discovery, where the method is applied in a process in which a server in an oneM2M system discovers a resource according to a request of a client, and as shown in fig. 1, the method includes:
101. 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 indicates whether to create a group, and whether to create a dynamic group or a static group. The filtering condition is used for resource discovery, and the server needs to discover the resources meeting the filtering condition.
It should be noted that, when the request message received by the server carries a filter Usage parameter, it may be determined that the request message is a first resource discovery request message, or the first resource discovery request message is a request message sent to a discovery resource.
102. And the server searches the resource according to the first resource discovery request message.
103. And when the group creating indication is static group creating, the static group is created, and the searched resources are used as members of the static group.
The method comprises the steps of loading a creation group indication by expanding a filter Usage parameter, wherein when the filter Usage parameter value is create Grp or create DycGrp, the server is indicated to need to further create a creation group after executing a resource discovery operation, the create Grp represents that a static group needs to be created, and the create DycGrp represents that a dynamic group needs to be created.
Or, the embodiment of the present invention may further add an Is Create Grp parameter in the first resource discovery request message, and when the value of the Is Create Grp parameter Is true, the representing server needs to further Create a group after performing the resource discovery operation.
In addition, by adding a Group Type parameter in the first resource discovery request message, it may be indicated that a static Group is created when the Group Type parameter is a static Group, and a dynamic Group is created when the Group Type is a dynamic Group.
104. And when the group creating indication is that the dynamic group is created, creating the dynamic group, setting the filtering condition in the first resource discovery request message as the filtering condition for determining the dynamic group members, and taking the searched resources meeting the filtering condition as the dynamic group members.
It should be noted that, because the dynamic group is not defined in the existing oneM2M standard, the embodiment of the present invention may add a filter criterion attribute on the basis of the existing group resource to identify the dynamic group resource, and when the group resource includes the filter criterion attribute, the group is represented as a dynamic group.
Wherein the attributes of the dynamic group at least comprise any one of the following attributes:
and the specified range is used for instructing the server to search the dynamic group members in the specified range.
A filter condition for indicating a condition that the dynamic group member should satisfy.
And the refreshing period is used for indicating the server to search and update the dynamic group members once every refreshing period.
And the group member list is used for storing the URI of the dynamic group member searched each time.
It is further noted that the dynamic group members are the resources that satisfy the filtering condition and are found in the specified range, and then the resources are taken as the members of the dynamic group.
105. And the server sends a first response message to the client, wherein the first response message carries the universal resource identifier URI of the created group.
It should be noted that, when the result type parameter exists in the first resource discovery request message, the server needs to send the first response message to the client according to the result type parameter. The specific implementation mode is as follows:
the server judges whether the result type parameter exists in the first resource discovery request message or not.
When the result type parameter exists and is a URI, the server sends a first response message carrying the URI of the created group and the URI of the searched resource to the client;
when the result type parameter exists and the result type parameter is the content, the server sends a first response message carrying the URI of the created group and the content of the searched resource to the client;
and when the result type parameter does not exist in the first resource discovery request message, the server sends a first response message carrying the URI of the created group to the client.
In the method for discovering resources provided by the embodiment of the present invention, a server receives a first resource discovery request message sent by a client, searches for resources according to the first resource discovery request message, creates a static group when a group creation instruction is to create the static group, uses the searched resources as members of the static group, creates a dynamic group when the group creation instruction is to create the dynamic group, sets a filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group, and finally sends a first response message carrying a URI of the created group to the client. Compared with the prior art that the network overhead is large due to multiple information interactions, the embodiment of the invention can complete the work of resource discovery and group creation according to the first resource discovery request message, does not need to perform information interaction between the server and the client for multiple times, and can save the network overhead.
With reference to the method flow shown in fig. 1, in another implementation manner of the embodiment of the present invention, an operation that should be performed by a server when a group does not need to be created is further provided, as shown in fig. 2, on the basis of fig. 1, the method further includes step 106.
106. And when the group creating indication is that the group is not created, the server sends a second response message to the client, wherein the second response message carries the found URI of the resource.
It should be noted that this step may be implemented by another implementation manner, when a group does not need to be created, the server does not receive a group creation instruction sent by the client, that is, after the server receives the first resource discovery request message sent by the client, it is detected whether the first resource discovery request message includes the group creation instruction, if so, the above step 103 or 104 is executed, a corresponding group is created according to the group creation instruction, and if not, a second response message is sent to the client.
When the result type parameter exists in the first resource discovery request message, the server needs to send a second response message to the client according to the result type parameter. The specific implementation mode is as follows:
the server judges whether a result type parameter exists in the first resource discovery request message or not;
when the result type parameter exists and the result type parameter is content, the server sends a second response message carrying the searched content of the resource to the client;
and when the result type parameter exists and is the 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 searched resource to the client.
With reference to fig. 1 or fig. 2, in order to provide a method for a server to discover resources according to a first resource discovery request message, in another implementation manner provided in an embodiment of the present invention, the first resource discovery request message further includes a resource discovery range, as shown in fig. 3, the step 102 may be specifically implemented as step 301 to step 304.
301. The server determines a resource discovery range according to the first resource discovery request message.
When the server determines that the first resource discovery request message comprises the range parameter, determining that the resource discovery range is a range specified by the range parameter;
when the server determines that the scope parameter is not included in the first resource discovery request message, the server determines that the resource discovery scope is a scope included in a destination address of the first resource discovery request message.
302. When the local address is included in the resource discovery range, the server searches the resource meeting the filtering condition in the local range.
Assuming that the filter condition is create and Resource Type is Container, the server will find the Resource meeting the conditions of create attribute being SAM and Resource Type being Container in the specified local scope according to the request message. When the filtering condition is empty, all resources within the resource discovery range are eligible resources.
It should be noted that the filtering condition in this step may be a filtering condition in the first resource discovery request message, or when the destination address of the first resource discovery request message is a dynamic group, the filtering condition may be a combination of the filtering condition carried in the first resource discovery request message and the filtering condition of the dynamic group.
303. And executing the operation specified by the first resource discovery request message on the qualified resource.
The operation specified by the first resource discovery request message includes any one of resource acquisition, resource update, resource deletion, and resource creation, when the specified operation is resource acquisition, the step 105 may be directly performed, and when the specified operation is resource update, resource deletion, or resource creation, the operation of updating, deleting, or resource creation of a sub-resource is performed on the resource meeting the filtering condition.
304. When the remote address is included in the resource discovery range, the server sends a second resource discovery request message to the remote address server, wherein 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.
It should be noted that, in another implementation manner of this step, when it is determined that the resource discovery range includes the remote address, it is further required to further determine whether remote resource discovery needs to be performed according to the filtering condition, for example, when it is indicated that at most two resources meeting the filtering condition are needed in the filtering condition, if two resources meeting the filtering condition have been found in step 302, the server does not need to send a second resource discovery request message to the remote address server. Furthermore, if both the local address and the remote address are included in the resource discovery range, the server needs to both discover the resource within the local range and send a second resource discovery request message to the remote address server.
It should be further noted that, when the first resource discovery request message includes the result type parameter and the group creation instruction, the second resource discovery request message needs to include the same result type parameter and the same group creation instruction.
When the remote address server receives the second resource discovery request message, the method is the same as the method for discovering resources by the server according to the first resource discovery request message.
305. And the server receives a third response message sent by the remote server, wherein the third response message carries the remote resource discovery result.
The remote resource discovery result comprises the URI of the group created by the remote server and/or the URI of the resource found by the remote server, or the remote resource discovery result comprises the URI of the group created by the remote server and/or the content of the resource found by the remote server.
When the result type parameter is not contained in the second resource discovery request message and the contained group creation indication is to create a dynamic group or to create a static group, the remote resource discovery result is the URI of the created group.
When the second resource discovery request message does not contain the result type parameter and contains a group creation indication that no group is created or does not contain a group creation indication, the remote resource discovery result is the URI of the discovered resource.
When the second resource discovery request includes the result type parameter, the method for determining the remote resource discovery result carried in the third response message is the same as the method described in the above step 105 and step 106, and is not described herein again.
According to the resource discovery method provided by the embodiment of the invention, the server determines the resource discovery range according to the first resource discovery request message, searches the resource meeting the condition in the resource discovery range, further executes the operation specified by the first resource discovery request on the resource meeting the condition, and when the resource discovery range contains the remote address, the server can also send the second resource discovery request to the remote address server, so that the resource discovery and the operation on the resource can be completed only by receiving one message of the client, multiple times of information interaction is not needed, and the network overhead can be saved.
The method for discovering resources provided by the embodiment of the present invention is described below by taking a flow of requesting resource discovery from a server CSE1 by a client as an example, as shown in fig. 4, and the method includes:
401. the client sends a first resource discovery request message to CSE1.
Wherein, the destination address carried in the first resource discovery request message is: http:// cse1.example. org/myGroup, with the range parameters: http:// cse1.example. org/myGroup, http:// cse2.example. org/myAPP1, http:// cse3.example. org/smartaPP, filtration conditions were: creator SAM, createdbeore 2014-12-20, and filterUsage CreateGrp. From the filter criteria and scope parameters, it may be determined that the client wishes to discover the resources that the SAM created before 2014-12-20 within the mygroup of CSE1, the myAPP1 of CSE2, and the smartPP scope of CSE3.
Since the client sends the first resource discovery request message to the CSE1, for CSE1, the address of CSE1 is a local address and the addresses of CSE2 and CSE3 are remote addresses.
402. The CSE1 sends a second resource discovery request message to the CSE2 and CSE3, respectively.
403. The CSE1, CSE2, and CSE3 respectively search for resources according to the respectively received resource discovery request message.
The process of searching for resources refers to the method flow shown in fig. 3, and is not described herein again.
It should be noted that the process of searching for resources by the CSE1 may also be performed before step 402 or simultaneously with step 402, which is not limited by the present invention.
404. And the CSE2 and the CSE3 respectively send a third response message to the CSE1, wherein the third response message carries the resource discovery result.
For example, the resources discovered by CSE1 are CSE 1/smarttApp/A, the resources discovered by CSE2 are CSE2/myAPP1/a, CSE2/myAPP1/B, and the resources discovered by CSE3 are CSE 3/smarttApp/B, CSE 3/smarttApp/C.
When the second resource discovery request message does not carry the create group indication, the third response message received by the CSE1 carries the URI of the resource discovered by the CSE2 and the CSE2.
When the second resource discovery request message carries the create group indication, the third response messages sent by the CSE2 and the CSE3 received by the CSE1 both carry the group URI, for example, the group URI in the CSE2 is CSE2/myAPP1/< groupName >, and the group URI in the CSE3 is CSE 3/smarttapp/< groupName >.
405. The CSE1 creates a group according to the group creation indication in the first resource discovery request message.
Taking the group creation indication as an example of creating a static group, in conjunction with the description in step 404, when no group is created by CSE2 and CSE3, the group resource created by CSE1 includes 5 group members, which are: CSE 1/smartTAPP/A, CSE2/myAPP1/a, CSE2/myAPP1/B, CSE 3/smartTAPP/B, CSE 3/smartTAPP. The URI of the group is http:// cse1.example. org/myGroup/< groupName >.
When a group has been created by CSE2 and CSE3, the group resource created by CSE1 includes two subgroup members, in addition to group member CSE1/smartAPP/a, respectively: CSE2/myAPP1/< groupName >, CSE 3/smarttAPPP/< groupName >.
406. The CSE1 sends a first response message to the client, where the URI of the group created by the CSE1 is carried in the first response message.
In the method for discovering resources provided by the embodiment of the present invention, a server receives a first resource discovery request message sent by a client, searches for resources according to the first resource discovery request message, creates a static group when a group creation instruction is to create the static group, uses the searched resources as members of the static group, creates a dynamic group when the group creation instruction is to create the dynamic group, sets a filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group, and finally sends a first response message carrying a URI of the created group to the client. Compared with the prior art that the network overhead is large due to multiple information interactions, the embodiment of the invention can complete the work of resource discovery and group creation according to the first resource discovery request message, does not need to perform information interaction between the server and the client for multiple times, and can save the network overhead.
With reference to the above method flow, an embodiment of the present invention further provides an apparatus for resource discovery, where the apparatus is applied in a server, and as shown in fig. 5, the apparatus includes: a receiving unit 501, a searching unit 502, a creating unit 503 and a sending unit 504.
A receiving unit 501, configured to receive a first resource discovery request message sent by a client, where the first resource discovery request message carries a group creation instruction and a filtering condition;
a searching unit 502, configured to search for a resource according to the first resource discovery request message received by the receiving unit 501;
a creating unit 503, configured to create a static group when the creating group indicates that the static group is created, and use the resource found by the searching unit 502 as a member of the static group; when the creating group indicates that the creating of the dynamic group is performed, the dynamic group is created, the filtering condition in the first resource discovery request message received by the receiving unit 501 is set as the filtering condition for determining the dynamic group members, and the resource meeting the filtering condition found by the searching unit 502 is used as the dynamic group member;
the attributes of the dynamic group include at least any one of the following attributes:
the appointed range is used for indicating the server to search the dynamic group members in the appointed range;
a filtering condition for indicating a condition that a dynamic group member should satisfy;
a refresh period for instructing the server to search and update the dynamic group members once every other refresh period;
and the group member list is used for storing the URI of the dynamic group member searched each time.
A sending unit 504, 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.
In another embodiment of the present invention, the sending unit 504 is further configured to send a second response message to the client when the group creation instruction indicates that the group is not created, where the second response message carries the URI of the found resource.
In another embodiment of the present invention, 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 is a URI, sending a first response message carrying the URI of the created group and the URI of the searched resource to the client; when the result type parameter exists and the result type parameter is the content, sending a first response message carrying the URI of the created group and the content of the searched resource; and when the result type parameter does not exist in the first resource discovery request message, sending a first response message carrying the URI of the created group to the client.
In another embodiment of the present invention, 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 content, sending a second response message carrying the searched content of the resource to the client; and when the result type parameter exists and is the URI, or the result type parameter does not exist in the first resource discovery request message, sending a second response message carrying the URI of the searched resource to the client.
In another embodiment of the present invention, as shown in fig. 6, the first resource discovery request message further includes a resource discovery range; the search unit 502 includes: the determining module 5021, the searching module 5022, the executing module 5023, the sending module 5024, and the receiving module 5025.
A determining module 5021, configured to determine a resource discovery range according to the first resource discovery request message;
a searching module 5022, configured to search a resource meeting a filtering condition in the local range when the resource discovery range determined by the determining module 5021 includes the local address;
an executing module 5023, configured to execute the operation specified by the first resource discovery request message on the resource meeting the filtering condition;
a sending module 5024, configured to send a second resource discovery request message to the remote address server when the remote address is included in the resource discovery range determined by the determining module 5021, where a filtering condition in the second resource discovery request message is the same as a filtering condition in the first resource discovery request;
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, and the remote resource discovery result includes a URI of a group created by the remote server and/or a URI of a resource found by the remote server, or the remote resource discovery result includes a URI of a group created by the remote server and/or content of a resource found by the remote server.
A determining module 5021, configured to determine, when the first resource discovery request message includes the range parameter, that the resource discovery range is a range specified by the range parameter; when the scope parameter is not included in the first resource discovery request message, it is determined that the resource discovery scope is a scope included in a destination address of the first resource discovery request message.
In the device for discovering resources provided in the embodiments of the present invention, the receiving unit receives a first resource discovery request message sent by a client, the searching unit searches for resources according to the first resource discovery request message, when a group creation instruction indicates that a static group is created, the creating unit creates the static group, uses the searched resources as members of the static group, when the group creation instruction indicates that a dynamic group is created, the creating unit creates the dynamic group, sets a filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group, and finally, the sending unit sends a first response message carrying a URI of the created group to the client. Compared with the prior art that the network overhead is large due to multiple information interactions, the embodiment of the invention can complete the work of resource discovery and group creation according to the first resource discovery request message, does not need to perform information interaction between the server and the client for multiple times, and can save the network overhead.
An embodiment of the present invention further provides a device for discovering a resource, as shown in fig. 7, where fig. 7 is a schematic diagram of a hardware structure of a server described in fig. 5. 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 communicatively connected via the bus 704.
The Memory 701 may be a Read Only Memory (ROM), a static Memory device, a dynamic Memory device, or a Random Access Memory (RAM). The memory 701 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present invention is implemented by software or firmware, a 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 for communication between the apparatus and other devices or communication networks (such as, but not limited to, ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.).
The processor 703 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, configured to execute related programs to implement the technical solutions provided by the embodiments of the present invention.
It should be noted that although the hardware shown in fig. 7 only shows the memory 701, the transmitter 702, the receiver 705 and the processor 703 as well as the bus 704, in a specific implementation, a person skilled in the art will understand that the first base station also contains other components necessary for achieving a normal operation. Also, hardware components for performing other functions may be included, as would be apparent to one skilled in the art, according to particular needs.
Specifically, when the server shown in fig. 7 is used to implement the apparatus shown in the embodiment of fig. 5, the memory 701 in the apparatus is used to store information including program instructions;
a receiver 705, configured to receive a first resource discovery request message sent by a client, where the first resource discovery request message carries a create group indication and a filtering condition;
a processor 703, coupled to the memory 701, the receiver 705, and the transmitter 702, for controlling execution of program instructions, in particular for searching for resources according to the first resource discovery request message; when the group creating indication is static group creating, the static group is created, and the searched resources are used as members of the static group; when the group creating indication is that a dynamic group is created, creating the dynamic group, setting the filtering condition in the first resource discovery request message as a filtering condition for determining dynamic group members, and taking the searched resources meeting the filtering condition as the dynamic group members;
wherein the attributes of the dynamic group at least comprise any one of the following attributes:
the appointed range is used for indicating the server to search the dynamic group members in the appointed range;
a filtering condition for indicating a condition that a dynamic group member should satisfy;
a refresh period for instructing the server to search and update the dynamic group members once every other refresh period;
and the group member list is used for storing the URI of the dynamic group member searched each time.
A sender 702, 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.
In another embodiment of the present invention, the sender 702 is further configured to send a second response message to the client when the group creation indication indicates that the group is not created, where the second response message carries the URI of the found resource.
In another embodiment of the present invention, 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 send, to the client, a first response message carrying the URI of the created group and the URI of the found resource when the result type parameter exists and the result type parameter is the URI; when the result type parameter exists and the result type parameter is the content, sending a first response message carrying the URI of the created group and the content of the searched resource; and when the result type parameter does not exist in the first resource discovery request message, sending a first response message carrying the URI of the created group to the client.
In another embodiment of the present invention, 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 transmitter 702 is further configured to send, to the client, a second response message carrying the content of the found resource when the result type parameter exists and the result type parameter is content; and when the result type parameter exists and is the URI, or the result type parameter does not exist in the first resource discovery request message, sending a second response message carrying the URI of the searched resource to the client.
In another embodiment of the present invention, the first resource discovery request message further includes a resource discovery range;
the processor 703 is further configured to determine a resource discovery range according to the first resource discovery request message; when the resource discovery range comprises a local address, searching for the resource meeting the filtering condition in the local range; executing the operation specified by the first resource discovery request message on the resources meeting the filtering condition;
a transmitter 702, configured to transmit a second resource discovery request message to the remote address server when the remote address is included in the resource discovery range, where a filtering condition in the second resource discovery request message is the same as a 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, and the remote resource discovery result includes a URI of a group created by the remote server and/or a URI of a resource found by the remote server, or the remote resource discovery result includes a URI of a group created by the remote server and/or content of a resource found by the remote server.
In another embodiment of the present invention, the processor 703 is further configured to determine, when the first resource discovery request message includes a scope parameter, that the resource discovery scope is a scope specified by the scope parameter; when the scope parameter is not included in the first resource discovery request message, it is determined that the resource discovery scope is a scope included in a destination address of the first resource discovery request message.
In the device for resource discovery provided in the embodiment of the present invention, the receiver receives a first resource discovery request message sent by the client, the processor searches for a resource according to the first resource discovery request message, creates a static group when a group creation instruction indicates that a static group is created, takes the searched resource as a member of the static group, creates a dynamic group when the group creation instruction indicates that a dynamic group is created, sets a filtering condition in the first resource discovery request message as a filtering condition for determining the dynamic group, and finally sends a first response message carrying a URI of the created group to the client. Compared with the prior art that the network overhead is large due to multiple information interactions, the embodiment of the invention can complete the work of resource discovery and group creation according to the first resource discovery request message, does not need to perform information interaction between the server and the client for multiple times, and can save the network overhead.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by software plus necessary general hardware, and certainly may also be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present invention may be substantially implemented or a part of the technical solutions contributing to the prior art may be embodied in the form of a software product, which is stored in a readable storage medium, such as a floppy disk, a hard disk, or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (24)

1.一种资源发现的方法,其特征在于,包括:1. a method for resource discovery, is characterized in that, comprises: 服务器接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;The server receives a first resource discovery request message sent by the client, where the first resource discovery request message carries a group creation instruction and filter conditions; 所述服务器根据所述第一资源发现请求消息查找资源;The server searches for resources according to the first resource discovery request message; 当所述创建群组指示为创建动态群组时,创建动态群组,将所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将查找到的满足过滤条件的资源作为动态群组成员;When the group creation instruction is to create a dynamic group, create a dynamic group, set the filter condition in the first resource discovery request message as the filter condition for determining the members of the dynamic group, and find the The resources that meet the filter conditions are used as dynamic group members; 所述服务器向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。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. 2.根据权利要求1所述的资源发现的方法,其特征在于,所述方法还包括:2. The method for resource discovery according to claim 1, wherein the method further comprises: 当所述创建群组指示为不创建群组时,所述服务器向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。When the group creation instruction is not to create a group, the server sends a second response message to the client, where the second response message carries the URI of the found resource. 3.根据权利要求2所述的资源发现的方法,其特征在于,所述服务器向所述客户端发送第一响应消息,包括:3. The method for resource discovery according to claim 2, wherein the server sends a first response message to the client, comprising: 所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;The server determines whether there is a result type parameter in the first resource discovery request message; 当存在结果类型参数,且所述结果类型参数为URI时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;When there is a result type parameter and the result type parameter is a URI, the server sends a first response message carrying the URI of the created group and the URI of the found resource to the client; 当存在结果类型参数,且所述结果类型参数为内容content时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;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; 当所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带已创建群组的URI的第一响应消息。When the result type parameter does not exist in the first resource discovery request message, the server sends a first response message carrying the URI of the created group to the client. 4.根据权利要求3所述的资源发现的方法,其特征在于,所述服务器向所述客户端发送第二响应消息,包括:4. The method for resource discovery according to claim 3, wherein the server sends a second response message to the client, comprising: 所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;The server determines whether there is a result type parameter in the first resource discovery request message; 当存在结果类型参数,且所述结果类型参数为content时,所述服务器向所述客户端发送携带查找到的资源的内容的第二响应消息;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; 当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带查找到的资源的URI的第二响应消息。When there is a result type parameter, and the result type parameter is a URI, or the first resource discovery request message does not have a result type parameter, the server sends to the client the first resource carrying the URI of the found resource. 2. Response message. 5.根据权利要求4所述的资源发现的方法,其特征在于,所述第一资源发现请求消息中还包括资源发现范围,所述服务器根据所述第一资源发现请求消息查找资源,包括:5. The method for resource discovery according to claim 4, wherein the first resource discovery request message further includes a resource discovery scope, and the server searches for resources according to the first resource discovery request message, comprising: 所述服务器根据所述第一资源发现请求消息确定资源发现范围;determining, by the server, a resource discovery scope according to the first resource discovery request message; 当所述资源发现范围中包括本地地址时,所述服务器在本地范围内查找符合过滤条件的资源;When the resource discovery scope includes a local address, the server searches for a resource that meets the filtering condition within the local scope; 对符合过滤条件的资源执行第一资源发现请求消息指定的操作;Perform the operation specified by the first resource discovery request message on the resources that meet the filtering conditions; 当所述资源发现范围中包括远程地址时,所述服务器向远程地址服务器发送第二资源发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;When the resource discovery scope includes a remote address, the server sends a second resource discovery request message to the remote address server, where the filter condition in the second resource discovery request message is the same as the filter condition in the first resource discovery request the same conditions; 所述服务器接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。The server receives 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 the URI of the group created by the remote server 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 created by the remote server and/or the content of the resource found by the remote server. 6.根据权利要求5所述的资源发现的方法,其特征在于,所述服务器根据所述第一资源发现请求消息确定资源发现范围,包括:6. The method for resource discovery according to claim 5, wherein the server determines a resource discovery scope according to the first resource discovery request message, comprising: 当所述服务器确定所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;When the server determines that the first resource discovery request message includes a scope parameter, determine that the resource discovery scope is the scope specified by the scope parameter; 当所述服务器确定所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。When the server determines that the first resource discovery request message does not include a range parameter, it determines that the resource discovery range is a range included in the destination address of the first resource discovery request message. 7.根据权利要求1至6中任一项所述的资源发现的方法,其特征在于,所述动态群组的属性至少包括以下属性中的任一种:7. The method for resource discovery according to any one of claims 1 to 6, wherein the attributes of the dynamic group at least include any one of the following attributes: 指定范围,用于指示所述服务器在所述指定范围内查找动态群组成员;a specified range for instructing the server to search for dynamic group members within the specified range; 所述过滤条件,用于指示动态群组成员应满足的条件;The filter conditions are used to indicate the conditions that the dynamic group members should meet; 刷新周期,用于指示所述服务器每隔所述刷新周期查找并更新一次动态群组成员;a refresh period, used to instruct the server to search for and update a dynamic group member every time the refresh period; 群组成员列表,用于存储每次查找到的动态群组成员的URI。A list of group members, used to store the URIs of dynamic group members found each time. 8.一种资源发现的装置,其特征在于,包括:8. A device for resource discovery, comprising: 接收单元,用于接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;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 group creation instruction and filter conditions; 查找单元,用于根据所述接收单元接收到的所述第一资源发现请求消息查找资源;a search unit, configured to search for resources according to the first resource discovery request message received by the receiving unit; 创建单元,用于当所述创建群组指示为创建动态群组时,创建动态群组,将所述接收单元接收到的所述第一资源发现请求消息中的过滤条件设置为用于确定所述动态群组成员的过滤条件,将所述查找单元查找到的满足过滤条件的资源作为动态群组成员;The creating unit is configured to create a dynamic group when the creation group is indicated as creating a dynamic group, and set the filter condition in the first resource discovery request message received by the receiving unit to be used to determine the The filter conditions of the dynamic group members, and the resources that meet the filter conditions found by the search unit are used as dynamic group members; 发送单元,用于向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。A sending unit, 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. 9.根据权利要求8所述的资源发现的装置,其特征在于,9. The device for resource discovery according to claim 8, wherein, 所述发送单元,还用于当所述创建群组指示为不创建群组时,向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。The sending unit is further configured to send a second response message to the client when the group creation instruction is not to create a group, where the second response message carries the URI of the found resource. 10.根据权利要求9所述的资源发现的装置,其特征在于,10. The device for resource discovery according to claim 9, wherein, 所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为URI时,向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且所述结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带已创建群组的URI的第一响应消息。The sending unit is further configured to judge whether there is a result type parameter in the first resource discovery request message; when there is a result type parameter and the result type parameter is a URI, send a message carrying the created group to the client The 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 content content, send the first response message carrying the URI of the created group and the content of the found resource. A response message; when the result type parameter does not exist in the first resource discovery request message, send a first response message carrying the URI of the created group to the client. 11.根据权利要求10所述的资源发现的装置,其特征在于,11. The apparatus for resource discovery according to claim 10, wherein, 所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为content时,向所述客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带查找到的资源的URI的第二响应消息。The sending unit is further configured to judge whether there is a result type parameter in the first resource discovery request message; when there is a result type parameter and the result type parameter is content, send the search result to the client. The 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 first resource discovery request message does not have a result type parameter, send a message to the client that carries the search result. The URI of the resource in the second response message. 12.根据权利要求11所述的资源发现的装置,其特征在于,所述第一资源发现请求消息中还包括资源发现范围;所述查找单元,包括:12. The apparatus for resource discovery according to claim 11, wherein the first resource discovery request message further includes a resource discovery scope; and the search unit comprises: 确定模块,用于根据所述第一资源发现请求消息确定资源发现范围;a determining module, configured to determine a resource discovery scope according to the first resource discovery request message; 查找模块,用于当所述资源发现范围中包括本地地址时,在本地范围内查找符合过滤条件的资源;a search module, configured to search for resources that meet the filtering conditions within the local scope when the resource discovery scope includes a local address; 执行模块,用于对符合过滤条件的资源执行第一资源发现请求消息指定的操作;an execution module, configured to execute the operation specified by the first resource discovery request message on the resources that meet the filtering conditions; 发送模块,用于当所述资源发现范围中包括远程地址时,向远程地址服务器发送第二资源发现请求消息,所述第二资源发现请求消息中的过滤条件与所述第一资源发现请求中的过滤条件相同;A sending module, configured to send a second resource discovery request message to the remote address server when the resource discovery scope includes a remote address, where the filter conditions in the second resource discovery request message are the same as those in the first resource discovery request The filter conditions are the same; 接收模块,用于接收所述远程服务器发送的第三响应消息,所述第三响应消息中携带远程资源发现结果,所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的URI,或者所述远程资源发现结果包括所述远程服务器已创建群组的URI和/或所述远程服务器查找到的资源的内容。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, and the remote resource discovery result includes the URI of the group created by the remote server and/or The URI of the resource found by the remote server, or the remote resource discovery result includes the URI of the group created by the remote server and/or the content of the resource found by the remote server. 13.根据权利要求12所述的资源发现的装置,其特征在于,13. The apparatus for resource discovery according to claim 12, wherein, 所述确定模块,还用于当所述第一资源发现请求消息中包括范围参数时,确定所述资源发现范围为所述范围参数指定的范围;当所述第一资源发现请求消息中不包括范围参数时,确定所述资源发现范围为所述第一资源发现请求消息的目的地址所包含的范围。The determining module is further configured to, when a range parameter is included in the first resource discovery request message, determine that the resource discovery range is the range specified by the range parameter; when the first resource discovery request message does not include a range parameter When the range parameter is set, it is determined that the resource discovery range is the range included in the destination address of the first resource discovery request message. 14.根据权利要求8至13中任一项所述的资源发现的装置,其特征在于,所述动态群组的属性至少包括以下属性中的任一种:14. The device for resource discovery according to any one of claims 8 to 13, wherein the attributes of the dynamic group at least include any one of the following attributes: 指定范围,用于指示服务器在所述指定范围内查找动态群组成员;a specified range for instructing the server to search for dynamic group members within the specified range; 所述过滤条件,用于指示动态群组成员应满足的条件;The filter conditions are used to indicate the conditions that the dynamic group members should meet; 刷新周期,用于指示服务器每隔所述刷新周期查找并更新一次动态群组成员;A refresh period, used to instruct the server to search for and update a dynamic group member every said refresh period; 群组成员列表,用于存储每次查找到的动态群组成员的URI。A list of group members, used to store the URIs of dynamic group members found each time. 15.一种资源发现的方法,其特征在于,包括:15. A method for resource discovery, comprising: 服务器接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示;The server receives a first resource discovery request message sent by the client, where the first resource discovery request message carries a group creation instruction; 所述服务器根据所述第一资源发现请求消息查找资源;The server searches 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; 所述服务器向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。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. 16.根据权利要求15所述的资源发现的方法,其特征在于,所述方法还包括:16. The method for resource discovery according to claim 15, wherein the method further comprises: 当所述创建群组指示为不创建群组时,所述服务器向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。When the group creation instruction is not to create a group, the server sends a second response message to the client, where the second response message carries the URI of the found resource. 17.根据权利要求16所述的资源发现的方法,其特征在于,所述服务器向所述客户端发送第一响应消息,包括:17. The method for resource discovery according to claim 16, wherein the server sends a first response message to the client, comprising: 所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;The server determines whether there is a result type parameter in the first resource discovery request message; 当存在结果类型参数,且所述结果类型参数为URI时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;When there is a result type parameter and the result type parameter is a URI, the server sends a first response message carrying the URI of the created group and the URI of the found resource to the client; 当存在结果类型参数,且所述结果类型参数为内容content时,所述服务器向所述客户端发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;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; 当所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带已创建群组的URI的第一响应消息。When the result type parameter does not exist in the first resource discovery request message, the server sends a first response message carrying the URI of the created group to the client. 18.根据权利要求17所述的资源发现的方法,其特征在于,所述服务器向所述客户端发送第二响应消息,包括:18. The method for resource discovery according to claim 17, wherein the server sends a second response message to the client, comprising: 所述服务器判断所述第一资源发现请求消息中是否存在结果类型参数;The server determines whether there is a result type parameter in the first resource discovery request message; 当存在结果类型参数,且所述结果类型参数为content时,所述服务器向所述客户端发送携带查找到的资源的内容的第二响应消息;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; 当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,所述服务器向所述客户端发送携带查找到的资源的URI的第二响应消息。When there is a result type parameter, and the result type parameter is a URI, or the first resource discovery request message does not have a result type parameter, the server sends to the client the first resource carrying the URI of the found resource. 2. Response message. 19.一种资源发现的装置,其特征在于,包括:19. An apparatus for resource discovery, comprising: 接收单元,用于接收客户端发送的第一资源发现请求消息,所述第一资源发现请求消息中携带创建群组指示和过滤条件;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 group creation instruction and filter conditions; 查找单元,用于根据所述接收单元接收到的所述第一资源发现请求消息查找资源;a search unit, configured to search for resources according to the first resource discovery request message received by the receiving unit; 创建单元,用于当所述创建群组指示为创建静态群组时,创建静态群组,将所述查找单元查找到的资源作为静态群组的成员;A creation unit, configured to create a static group when the creation group is instructed to create a static group, and use the resource found by the search unit as a member of the static group; 发送单元,用于向所述客户端发送第一响应消息,所述第一响应消息中携带已创建群组的通用资源标识符URI。A sending unit, 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. 20.根据权利要求19所述的资源发现的装置,其特征在于,20. The apparatus for resource discovery according to claim 19, wherein, 所述发送单元,还用于当所述创建群组指示为不创建群组时,向所述客户端发送第二响应消息,所述第二响应消息中携带查找到的资源的URI。The sending unit is further configured to send a second response message to the client when the group creation instruction is not to create a group, where the second response message carries the URI of the found resource. 21.根据权利要求20所述的资源发现的装置,其特征在于,21. The apparatus for resource discovery according to claim 20, wherein, 所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为URI时,向所述客户端发送携带已创建群组的URI和查找到的资源的URI的第一响应消息;当存在结果类型参数,且所述结果类型参数为内容content时,发送携带已创建群组的URI和查找到的资源的内容的第一响应消息;当所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带已创建群组的URI的第一响应消息。The sending unit is further configured to judge whether there is a result type parameter in the first resource discovery request message; when there is a result type parameter and the result type parameter is a URI, send a message carrying the created group to the client The 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 content content, send the first response message carrying the URI of the created group and the content of the found resource. A response message; when the result type parameter does not exist in the first resource discovery request message, send a first response message carrying the URI of the created group to the client. 22.根据权利要求21所述的资源发现的装置,其特征在于,22. The apparatus for resource discovery according to claim 21, wherein, 所述发送单元,还用于判断所述第一资源发现请求消息中是否存在结果类型参数;当存在结果类型参数,且所述结果类型参数为content时,向所述客户端发送携带查找到的资源的内容的第二响应消息;当存在结果类型参数,且所述结果类型参数为URI,或者所述第一资源发现请求消息中不存在结果类型参数时,向所述客户端发送携带查找到的资源的URI的第二响应消息。The sending unit is further configured to judge whether there is a result type parameter in the first resource discovery request message; when there is a result type parameter and the result type parameter is content, send the search result to the client. The 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 first resource discovery request message does not have a result type parameter, send a message to the client that carries the search result. The URI of the resource in the second response message. 23.一种服务器,其特征在于,所述服务器包括处理器和存储器,其中:23. A server comprising a processor and a memory, wherein: 所述存储器中存储有程序代码;A program code is stored in the memory; 所述处理器执行所述程序代码,以实现所述权利要求1至7中任一项所述的方法或者权利要求15至18中任一项所述的方法。The processor executes the program code to implement the method of any one of claims 1 to 7 or the method of any one of claims 15 to 18. 24.一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令在计算机上运行时,使得计算机执行如权利要求1至7中任一项所述的方法或者权利要求15至18中任一项所述的方法。24. A computer-readable storage medium, characterized in that, at least one instruction is stored in the storage medium, and when the instruction is executed on a computer, the computer executes the method according to any one of claims 1 to 7. The method or the method of any one of claims 15 to 18.
CN202010008393.6A 2015-11-19 2015-11-19 Resource discovery method and device Active CN111193805B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010008393.6A CN111193805B (en) 2015-11-19 2015-11-19 Resource discovery method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510808314.9A CN106790323B (en) 2015-11-19 2015-11-19 Resource discovery method and device
CN202010008393.6A CN111193805B (en) 2015-11-19 2015-11-19 Resource discovery method and device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201510808314.9A Division CN106790323B (en) 2015-11-19 2015-11-19 Resource discovery method and device

Publications (2)

Publication Number Publication Date
CN111193805A CN111193805A (en) 2020-05-22
CN111193805B true CN111193805B (en) 2021-12-31

Family

ID=58717372

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201510808314.9A Active CN106790323B (en) 2015-11-19 2015-11-19 Resource discovery method and device
CN202010008393.6A Active CN111193805B (en) 2015-11-19 2015-11-19 Resource discovery method and device

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201510808314.9A Active CN106790323B (en) 2015-11-19 2015-11-19 Resource discovery method and device

Country Status (2)

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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109819006B (en) * 2017-11-22 2022-08-09 京东方科技集团股份有限公司 Method for operating target resource, node equipment and terminal device
WO2020231060A1 (en) * 2019-05-13 2020-11-19 현대자동차주식회사 Method and device for deleting resource in m2m system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098267A (en) * 2006-06-28 2008-01-02 华为技术有限公司 A method and system for establishing a group conversation
US8392567B2 (en) * 2009-03-16 2013-03-05 International Business Machines Corporation Discovering and identifying manageable information technology resources
CN103200209A (en) * 2012-01-06 2013-07-10 华为技术有限公司 Access method of member resources, group server and member devices
CN103327568A (en) * 2012-03-21 2013-09-25 中国移动通信集团公司 Resource allocation message sending method, equipment discovering method and related equipment
CN103518350A (en) * 2012-05-14 2014-01-15 华为技术有限公司 Method and system for group communication, group server and group member device
CN102256211B (en) * 2010-05-19 2014-04-30 中兴通讯股份有限公司 Group-based method and system for application realization of M2M terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101873542B (en) * 2009-04-21 2012-12-19 华为技术有限公司 Selecting method of URI (Uniform Resource Identifiers) based on conditions, server and communication system
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
JP6260131B2 (en) * 2013-07-26 2018-01-17 株式会社リコー Communication management system, communication terminal, communication system, and program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098267A (en) * 2006-06-28 2008-01-02 华为技术有限公司 A method and system for establishing a group conversation
US8392567B2 (en) * 2009-03-16 2013-03-05 International Business Machines Corporation Discovering and identifying manageable information technology resources
CN102256211B (en) * 2010-05-19 2014-04-30 中兴通讯股份有限公司 Group-based method and system for application realization of M2M terminal
CN103200209A (en) * 2012-01-06 2013-07-10 华为技术有限公司 Access method of member resources, group server and member devices
CN103327568A (en) * 2012-03-21 2013-09-25 中国移动通信集团公司 Resource allocation message sending method, equipment discovering method and related equipment
CN103518350A (en) * 2012-05-14 2014-01-15 华为技术有限公司 Method and system for group communication, group server and group member device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Discovery for Public Safety;Intel;《SA WG2 Meeting #101bis》;20140221;全文 *

Also Published As

Publication number Publication date
CN106790323B (en) 2020-02-14
CN106790323A (en) 2017-05-31
CN111193805A (en) 2020-05-22
WO2017084584A1 (en) 2017-05-26

Similar Documents

Publication Publication Date Title
KR102116401B1 (en) Cross resource subscription to M2M service layer
CN109936843B (en) Subscription updating method, device and system
US11646939B2 (en) Network function NF management method and NF management device
CN112953774B (en) Network topology generation method, system, equipment and computer storage medium
EP4408042A2 (en) Lightweight iot information model
WO2019200714A1 (en) Server connection method, computer readable storage medium, terminal device, and apparatus
CN107566233B (en) Resource sharing method and device for household electrical appliance
US10674349B2 (en) Subscription update method, device, and system
WO2015027406A1 (en) Method and apparatus for selecting preferred parent node in wireless sensor network
KR102631288B1 (en) Subscription server, subscription terminal, information subscription method, and system
CN109155939B (en) Load migration method, device and system
CN105722040B (en) Method, device and system for transmitting business messages
JP2017506480A (en) Information processing method and apparatus in M2M
CN110474960B (en) A method and device for service deployment in a virtualized network
KR20200047720A (en) Service layer message templates in telecommunication networks
EP3174318A1 (en) Method for realizing resource attribute notification, and common service entity
CN105100002A (en) Attribute operation method and device
CN105827424A (en) Data acquisition method and data acquisition device
CN106899444A (en) A kind of end-probing method and device for many LANs
CN111193805B (en) Resource discovery method and device
CN103973747B (en) A kind of method and apparatus for obtaining content
CN109905645A (en) Video surveillance equipment directory exchange method and networking platform
CN108112007B (en) Information notification method, device and system
WO2024012406A1 (en) Binding information discovery method and system, and network device and storage medium
CN104967967B (en) Method and device for multi-hop resource discovery

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220221

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.