WO2021146960A1 - Message endpoint discovery method and related apparatus - Google Patents

Message endpoint discovery method and related apparatus Download PDF

Info

Publication number
WO2021146960A1
WO2021146960A1 PCT/CN2020/073636 CN2020073636W WO2021146960A1 WO 2021146960 A1 WO2021146960 A1 WO 2021146960A1 CN 2020073636 W CN2020073636 W CN 2020073636W WO 2021146960 A1 WO2021146960 A1 WO 2021146960A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
parameter
endpoint
information
endpoint information
Prior art date
Application number
PCT/CN2020/073636
Other languages
French (fr)
Chinese (zh)
Inventor
茹昭
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2020/073636 priority Critical patent/WO2021146960A1/en
Priority to CN202080077882.5A priority patent/CN114651423B/en
Publication of WO2021146960A1 publication Critical patent/WO2021146960A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • This application relates to the field of communication technology, and in particular to a method and related devices for discovering message endpoints.
  • the Open Connectivity Foundation (OCF) message endpoint is used to exchange request and response messages.
  • the specific definition of the message endpoint depends on the transmission protocol used.
  • the device's CoAP resources (resources accessible using the CoAP protocol, such as /oic/res resources, /oic/p resources) can use the default UDP port 5683
  • the device's CoAPS resources (accessible using the CoAP+DTLS protocol) Resources, such as /oic/acl resources, /oic/cred resources) can use the default UDP port 5684.
  • the discovery of the message endpoint is used by the client to obtain the endpoint information of the OCF device or resource, which is divided into implicit discovery and explicit discovery.
  • Implicit discovery means that if a device is the source of a CoAP message (for example: "/oic/res" response), then the source IP address and port number can be combined to form the message endpoint information of the device.
  • the "/oic/res" response message of CoAP can implicitly convey the endpoint information of the responding device, and convert all its carried resources into resources that can be accessed by the CoAP transmission protocol.
  • Explicit discovery means that the message endpoint information is explicitly represented by the "eps" parameter of the Links attribute in the "/oic/res" resource, and the client can access the target resource of the Link (Link is also called resource reference) through the message endpoint.
  • the embodiment of the present application provides a message endpoint discovery method and related device, in order to realize the problem of determining the endpoint information of any resource.
  • an embodiment of the present application provides a message endpoint discovery method, including:
  • the client sends a multicast request, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource;
  • the client receives the first resource information from the first server, and the OCF resource of the first resource information refers to the Link parameter indicating the resource carried by the first server in the form of Links array.
  • Each Link in the Links array The parameter corresponds to a resource;
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • an embodiment of the present application provides a message endpoint discovery method, including:
  • the first server receives a multicast request from the client, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource;
  • the first server sends first resource information to the client, and the OCF resource of the first resource information refers to the Link parameter to indicate the resource carried by the first server in the form of an array of Links, and each link in the array of Links Each Link parameter corresponds to one resource;
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • an embodiment of the present application provides a message endpoint discovery device, which is applied to a client, and the device includes a processing unit and a communication unit, where:
  • the processing unit is configured to send a multicast request through the communication unit, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic/res Resources; and receiving first resource information from the first server through the communication unit, the OCF resource of the first resource information references the Link parameter to indicate the resources carried by the first server in the form of an array of Links, the array of Links Each Link parameter corresponds to a resource;
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • an embodiment of the present application provides a message endpoint discovery device, which is applied to a first server, and the device includes a processing unit and a communication unit, where:
  • the processing unit is configured to receive a multicast request from a client through the communication unit, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is/ oic/res resources; and sending first resource information to the client through the communication unit, the OCF resource of the first resource information references the Link parameter to indicate the resources carried by the first server in the form of an array of Links, so Each Link parameter in the Links array corresponds to a resource;
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • embodiments of the present application provide a client, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured by The processor executes, and the program includes instructions for executing the steps in any method in the first aspect of the embodiments of the present application.
  • embodiments of the present application provide a first server, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are The configuration is executed by the processor, and the program includes instructions for executing steps in any method in the second aspect of the embodiments of the present application.
  • an embodiment of the present application provides a chip, including a processor, configured to call and run a computer program from a memory, so that the device installed with the chip executes the first aspect or the second aspect of the embodiment of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the For example, part or all of the steps described in any method of the first aspect or the second aspect.
  • an embodiment of the present application provides a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps described in any method of the first aspect or the second aspect of the embodiment of the present application .
  • the computer program may be a software installation package.
  • the client sends a multicast request
  • the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI
  • the corresponding CoAP resource is the /oic/res resource.
  • the OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource.
  • the resource includes CoAP resources and/or CoAPS resources.
  • the resource attribute of the first resource information includes a first parameter.
  • the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource.
  • the endpoint information resource is used to indicate the value of the resource carried by the first server.
  • the endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
  • FIG. 1A is a system architecture diagram of an OCF example communication system provided by an embodiment of the present application.
  • FIG. 1B is a schematic diagram of a relay in V2X provided by an embodiment of the present application.
  • FIG. 1C is a schematic diagram of a second device accessing a network device through a client according to an embodiment of the present application
  • 2A is a schematic flowchart of a method for discovering message endpoints according to an embodiment of the present application
  • 2B is an example diagram of a parameter of first resource information provided by an embodiment of the present application.
  • 2C is an example diagram of parameters of an endpoint information resource provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a client provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • FIG. 5 is a block diagram of functional units of a message endpoint discovery device provided by an embodiment of the present application.
  • Fig. 6 is a block diagram of functional units of a message endpoint discovery device provided by an embodiment of the present application.
  • the technical solutions of the embodiments of the present application can be applied to the exemplary communication system 100 shown in FIG. 1A.
  • the exemplary communication system 100 includes a client 110 and a server 120 (the example in the figure is server 1, server p), and the client 110 is connected to the server 120 in communication.
  • the client 110 can be various electronic devices such as mobile phones
  • the server 120 can be an OCF device
  • the server 120 is provided with OCF message endpoints and OCF resources.
  • Each OCF resource can be accessed through at least one OCF message endpoint. Multiple OCF resources can be associated with the message endpoint.
  • Link can refer to a resource of itself (assuming it is server 1).
  • the endpoint information of the Link is a certain endpoint of server 1, or it can be referenced A certain resource on another server p.
  • the endpoint information in the Link is an endpoint of server p.
  • GSM global system for mobile communications
  • CDMA code division multiple access
  • WCDMA broadband code division multiple access
  • GPRS general packet radio service
  • LTE long term evolution
  • FDD frequency division duplex
  • TDD LTE Time division duplex
  • UMTS universal mobil et communication system
  • WiMAX worldwide interoperability for microwave access
  • the client 110 in the embodiment of the present application may refer to user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent Or user device.
  • the terminal can also be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), and a wireless communication function Handheld devices, computing devices or other processing devices connected to wireless modems, relay devices, in-vehicle devices, wearable devices, terminals in the future 5G network, or public land mobile network (PLMN) that will evolve in the future This is not limited in this embodiment of the application.
  • SIP session initiation protocol
  • WLL wireless local loop
  • PDA personal digital assistant
  • PLMN public land mobile network
  • the server 120 in the embodiment of the present application may be a device for communicating with the client 110, and the network device may be a global system for mobile communications (GSM) system or code division multiple access
  • the base station (transceiver station, BTS) in CDMA) can also be the base station (NodeB, NB) in the wideband code division multiple access (WCDMA) system, or the evolved base station in the LTE system (evoled NodeB, eNB or eNodeB), can also be a wireless controller in a cloud radio access network (cloud radio access network, CRAN) scenario, or the server 120 can be a relay device, an access point, a vehicle device, Wearable devices and network devices in the future 5G network or network devices in the future evolved PLMN network, one or a group of (including multiple antenna panels) antenna panels of the base station in the 5G system, or can also form a gNB or
  • the network node of the transmission point such as a baseband unit (BBU), or a distributed unit (DU), etc
  • the gNB may include a centralized unit (CU) and a DU.
  • the gNB may also include an active antenna unit (AAU).
  • the CU implements some of the functions of the gNB, and the DU implements some of the functions of the gNB.
  • the CU is responsible for processing non-real-time protocols and services, and implements radio resource control (radio resource control, RRC) and packet data convergence protocol (packet data convergence protocol, PDCP) layer functions.
  • RRC radio resource control
  • PDCP packet data convergence protocol
  • the DU is responsible for processing physical layer protocols and real-time services, and implements the functions of the radio link control (RLC) layer, media access control (MAC) layer, and physical (physical, PHY) layer.
  • RLC radio link control
  • MAC media access control
  • PHY physical
  • AAU realizes some physical layer processing functions, radio frequency processing and related functions of active antennas. Since the information of the RRC layer will eventually become the information of the PHY layer, or be transformed from the information of the PHY layer, under this architecture, high-level signaling, such as RRC layer signaling, can also be considered to be sent by the DU , Or, sent by DU+AAU.
  • the server 120 may be a device including one or more of the CU node, the DU node, and the AAU node.
  • the CU can be divided into the server 120 in the access network (radio access network, RAN), or the CU can be divided into the server 120 in the core network (core network, CN), which is not limited in this application .
  • the client 110 or the server 120 includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer.
  • the hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also referred to as main memory).
  • the operating system can be any one or more computer operating systems that implement business processing through processes, for example, Linux operating systems, Unix operating systems, Android operating systems, iOS operating systems, or windows operating systems.
  • the application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
  • the embodiments of the application do not specifically limit the specific structure of the execution body of the method provided in the embodiments of the application, as long as the program that records the codes of the methods provided in the embodiments of the application can be provided in accordance with the embodiments of the application.
  • the execution subject of the method provided in the embodiment of the present application may be the client 110, or a functional module in the client 110 that can call and execute the program.
  • resources are logical functional entities that represent information about each device, each functional service of the device, and the status of the device. These logical functional entities are exposed by the server to the client for access and operation, and the client uses the resource Operate the CRUDN and interact with the server.
  • the parameters of OCF resources mainly include URI, attributes, resource references and interfaces.
  • Each resource has its own URI, and some resources have predefined URIs. This resource can be obtained by accessing the corresponding URI.
  • Each resource contains properties, which are used to describe related information of the resource.
  • OCF property appears in the form of ⁇ Key:Value> key-value pairs, expressed in JSON as "property name”: “property value”, and the property definition includes the following characteristics:
  • 3Value type The type of the attribute value, which can be a simple data type or a complex data type.
  • 4Value rules The constraint conditions of the attribute value, such as the maximum value, the minimum value, and the value range of the enumeration value.
  • 6Mandatory Indicate whether the attribute is mandatory in a certain resource type.
  • the access mode of the attribute value which can be readable (R), writable (W), or readable and writable (R, W).
  • the attribute definition format is the attribute format shown in Table 1 taking the resource name "n" attribute as an example.
  • Resource Type is used to describe the specific application type of a type of resource.
  • a resource can have multiple resource type definitions, that is, the "rt” attribute can have multiple attribute values, such as "rt”:["oic. wk.d”,”oic.d.light”]
  • Pre-defined URI (optional): OCF pre-defines a fixed resource URI for a specific resource, such as /oic/res
  • 3Resource Type ID the identifier of the resource type, that is, the value of the "rt" attribute
  • the resource type definition format is the resource type format taking the switch resource "Binary Switch" as an example.
  • a collection resource (also called a combination resource) includes OCF Links, which represents a collection of one or more link resources, and multiple target resources or other collection resources can be referenced through the collection resource.
  • OCF Links represents a collection of one or more link resources, and multiple target resources or other collection resources can be referenced through the collection resource.
  • a Collection resource contains the switch resource of device A (light) and the switch resource of device B (fan), forming a centralized resource group.
  • the client can request multiple resources at the same time by accessing the oic.if.b interface of the Collection resource.
  • the Collection will send the request to each resource in the links, collect the response returned by each resource, and return it to the client in a unified manner.
  • OCF refers to IETF RFC5988 (web linking) to define OCF Link.
  • OCF Link is composed of key-value pairs and is used to represent the connection relationship between resources.
  • Context URI Context URI.
  • the anchor When the anchor is implicit, it actually means the hosting resource that contains the Link.
  • the anchor When the anchor is explicit, it is generally used to cover the hosting resource URI of the Link, providing non-hosting resource URI as the context URI, which is the link's available Select attributes.
  • Target URI that is, the target resource referenced by Link, which can be a relative path or an absolute path
  • href is a required attribute of Link.
  • the set of interfaces supported by the target resource is a mandatory attribute of Link.
  • bitmap indicates whether the target resource is discoverable and observable, which is an optional attribute of Link.
  • Endpoints IP address + port number
  • IP address + port number the message endpoints that can access the target resource are optional attributes of Link.
  • the OCF message endpoint is used to exchange request and response messages, and the specific definition of the message endpoint depends on the transmission protocol used.
  • Each device must be associated with at least one message endpoint. When a message is sent to the message endpoint, it will be delivered to the device associated with the message endpoint. When the message is sent to the endpoint, the target resource is addressed through the resource identifier.
  • a device can be associated with multiple message endpoints. For example, an OCF device supports CoAP and TCP at the same time and has two different endpoints.
  • the message endpoint is represented by the endpoint information "eps", and the "eps" endpoint information includes two keys "ep" and "pri”.
  • the /oic/res resource is a fixed collection resource for device resource discovery specified by the protocol. As shown in Figure 1C, it contains links to all discoverable resources on the device.
  • the resource message endpoint discovery process is as follows:
  • the server uses the multicast address of "all OCF nodes" (OCF does not use the default CoAP multicast address, uses the multicast service address registered with OCF: ff0x::158, port 5683) to perform information multicast
  • the client sends a multicast request (CoAP GET) to all servers, and the request URI corresponds to "/oic/res"
  • the server returns a list of carried resources in the form of an array of Links. Each link corresponds to a resource. Links provides the following information:
  • link resource URI can be a relative path or an absolute path.
  • the device when the device supports implicit discovery, if the device responds to a request for a certain resource (usually a CoAP resource that supports multicast, such as /oic/res resource), then the endpoint information of all its resources Same as the resource.
  • a certain resource usually a CoAP resource that supports multicast, such as /oic/res resource
  • the endpoint information of all its resources Same as the resource.
  • a certain resource usually a CoAP resource that supports multicast, such as /oic/res resource
  • CoAP resources use one port (probably not the default port)
  • CoAPS resources use another port (probably not the default port)
  • the endpoint information of its resource is included in the "eps" parameter of each link under the Links attribute in the "/oic/res" resource, and all links include the "eps” parameter to make the data redundant High, in addition, the "eps” parameter is optional. Link references that do not contain the "eps" parameter implicitly find the source port of the response message with "/oic/res".
  • all links can only contain the "eps" parameter.
  • CoAP resources and CoAPS resources are a grouping situation. If there are CoAP resources and CoAPS resources at the same time, all links must contain the "eps" parameter. If all links include the "eps" parameter, the data redundancy is relatively high.
  • an embodiment of the present application proposes a method for discovering message endpoints, which will be described in detail below with reference to the drawings.
  • FIG. 2A is a schematic flowchart of a message endpoint discovery method provided by an embodiment of the present application. As shown in the figure, the method includes:
  • Step 2a01 the client sends a multicast request (for example: CoAP GET), the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource .
  • a multicast request for example: CoAP GET
  • the multicast request includes a first uniform resource identifier URI
  • the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource .
  • the /oic/res resource is a resource that can be accessed using the CoAP protocol
  • the /oic/res resource is a fixed collection resource for device resource discovery specified by the protocol. It contains Links of all discoverable resources on the device.
  • the client needs to discover the specified resource type, it can specify the "rt" parameter, and only the server that matches the resource type will respond to the request.
  • the "rt" query parameter is omitted, the client is in the OCF multicast group All servers within will respond to the multicast request.
  • Step 2a02 The first server receives a multicast request from the client, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource.
  • the server can use the multicast address of "all OCF nodes" (OCF does not use the default CoAP multicast address, but uses the multicast service address registered with OCF: ff0x::158, port 5683) to perform more information. broadcast. When the client needs to discover resources, it joins the "All OCF Nodes" multicast group.
  • OCF OCF does not use the default CoAP multicast address, but uses the multicast service address registered with OCF: ff0x::158, port 5683
  • Step 2a03 The first server sends first resource information to the client, and the OCF resource of the first resource information refers to the Link parameter in the form of an array of Links indicating the resources carried by the first server, and the Links Each Link parameter in the array corresponds to a resource.
  • the first resource information may specifically be resource information of the /oic/res resource.
  • Step 2a04 the client receives the first resource information from the first server, the OCF resource of the first resource information references the Link parameter in the form of Links array to indicate the resources carried by the first server, and the Links array Each Link parameter corresponds to a resource.
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • the first parameter may be named "ex" parameter, for example.
  • the client sends a multicast request
  • the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI
  • the corresponding CoAP resource is the /oic/res resource.
  • the OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource.
  • the resource includes CoAP resources and/or CoAPS resources.
  • the resource attribute of the first resource information includes a first parameter.
  • the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource.
  • the endpoint information resource is used to indicate the value of the resource carried by the first server.
  • the endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
  • the pre-defined resource URI (Pre-defined URI) of the endpoint information resource is /oic/eps;
  • the resource type display name (Title) of the endpoint information resource is Endpoint Info
  • the resource type (rt) of the endpoint information resource is oic.wk.eps;
  • the interface list (interfaces) supported by the endpoint information resource is oic.if.baseline;
  • the mandatory selection of the endpoint information resource is mandatory CM, where the mandatory selection includes three options: M (Mandatory, mandatory), CM (Conditional Mandatory, conditionally mandatory), and O (Optional, optional) .
  • the resource type of the endpoint information resource may be named oic.wk.eps, and the attribute format of the oic.wk.eps is shown in Table 4.
  • the resource attribute of the endpoint information resource further includes at least one of the following:
  • the format of the resource attribute of the endpoint information resource is shown in Table 5.
  • each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the second parameter is an "eps" parameter (the eps key value shown in FIG. 1C).
  • the resource attribute part includes the following parameters: “rt”, “if”, “ex”, “eps”, and each Link parameter includes the following parameters: “Href”, “anchor”, “rel”, “rt”, “if”, "p”.
  • each Link parameter of the first resource information no longer contains the "eps" parameter, only a single "eps" parameter key value is included in the resource attribute part, so that the first resource information is in /oic/res
  • the "eps" data is reduced, effectively reducing the data redundancy of the first resource information.
  • the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the default port configuration is as follows: CoAP resources use UDP port 5683, and CoAPS resources use UDP port 5684.
  • the first parameter "ex" parameter value can be false, then the endpoint information of the CoAP resource and the endpoint information of the CoAPS resource can be expressed as: (“eps":[ ⁇ "ep”:"coap://IP:5683” ⁇ , ⁇ "ep":"coaps://IP:5684” ⁇ ]): That is, the port uses the default ports 5683 and 5684, and the IP is the IP address of the first server's response message.
  • the server returns "/oic/res" in "ex”
  • the parameter value is false, which clearly indicates that there is no need to obtain further endpoint information resources.
  • the terminal can accurately determine the endpoint information of the resources carried by the first server according to the port number of the default port and the IP address of the first server's response message.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the second parameter is an "eps” parameter
  • the parameters other than the second parameter may be, for example, an "rt” parameter, an "if” parameter, and so on.
  • the default port is used for all resources (CoAP resources use UDP port 5683, CoAPS resources use UDP port 5684), the value of the "ex” parameter in "/oic/res" returned by the server is false, Therefore, it is clearly indicated that there is no need to further obtain the endpoint information resource, and the terminal can accurately determine the endpoint information of the resource carried by the first server according to the port number of the default port and the IP address of the first server's response message.
  • the resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  • the function of the second parameter eps is: when all CoAP resources use the same port (denoted as port A) and all CoAPS resource resources use the same port (denoted as port B), the client is clearly informed of this
  • the two endpoint information is mainly applicable when A and/or B are not the default ports. Of course, it can also be used when A and/or B are the default ports (only redundant).
  • the default port is used for all resources (CoAP resources use UDP port 5683, CoAPS resources use UDP port 5684), the value of the "ex" parameter in "/oic/res" returned by the server is false, Therefore, it is clearly indicated that there is no need to further obtain the endpoint information resource, and the terminal can determine that the endpoint information of the resource carried by the first server is the endpoint information indicated by the second parameter "eps".
  • the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the value of the first parameter may be false, which is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resources carried by the first server include CoAP resources and CoAPS resources, and the port used by the CoAP resource is A, and the port used by the CoAPS resource is B. At least one of A and B is not the default port. In this case, the port in the endpoint information of the CoAP resource is port A, and the port in the endpoint information of the CoAPS resource is port B
  • the resources carried by the first server only include CoAP resources, and the port used by the CoAP resource is A, then the port in the endpoint information of the CoAP resource is port A.
  • the resources carried by the first server only include CoAPS resources, and the port used by the CoAPS resource is B, then the port in the endpoint information of the CoAPS resource is port B.
  • the "ex" parameter value in "/oic/res" is set to false, which clearly indicates that no further acquisition is required Endpoint information resource.
  • the terminal can determine that the endpoint information of the resource carried by the first server is the endpoint information written in the "eps" parameter.
  • the resource attribute of the first resource information further includes a second parameter
  • the second parameter is used to indicate the endpoint where the /oic/res resource itself is located
  • the second parameter uses all Describe the endpoint information of the same port.
  • the second parameter may be an "eps" parameter, and the "eps" parameter is used to indicate that CoAP resources use UDP port 44444 and that CoAPS resources use UDP port 11111.
  • the second parameter "eps" clearly indicates that the endpoint information of the current resource is the endpoint information of the endpoint where the /oic/res resource itself is located, that is, the endpoint information of the same port, to achieve clear instructions for any type of resource .
  • the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  • the parameter value of the first parameter "ex" may be true.
  • the first parameter is used to indicate that the endpoint information resource needs to be further obtained, so that each of the first resource information Link does not need to indicate the endpoint information in the current information, which can reduce the data redundancy in /oic/res.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the parameters other than the second parameter "eps" parameter may be “rt” parameters, "if” parameters, and so on.
  • the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
  • the method further includes: the client sends a unicast request to the first port of the first server, where the unicast request includes a second URI ,
  • the CoAP resource corresponding to the second URI is the endpoint information resource
  • the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located;
  • the client receives from The second resource information of the first server, where the second resource information includes endpoint information of the resource carried by the first server.
  • the method further includes: the first port of the first server receives a unicast request from the client, and the unicast The request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located;
  • the first server sends second resource information to the client, where the second resource information includes endpoint information of the resource carried by the first server.
  • the second parameter "eps" is specifically used to indicate the endpoint where the /oic/res resource itself is located, thereby restricting the port where the /oic/res resource is located, that is, the port where the /oic/eps resource is located.
  • the resource attribute part includes the following parameters: "rt”, “if”, “eps”, and each Link parameter includes the following parameters: “ep”, “hrefs” ".
  • the first parameter is used to indicate that the endpoint information resource needs to be further obtained, so that each of the first resource information Link does not need to indicate the endpoint information in the current information, which can reduce the data redundancy in /oic/res.
  • the resource attribute of the first resource information may also include an optional first parameter "ex”.
  • first parameter "ex" parameter
  • second parameter eps” parameter
  • the endpoint information resource /oic/eps resource may not be added, but the default port 5684 is used for the CoAPS resource in the explicit implicit discovery. If only one Link in /oic/res contains the "eps" parameter, the other Link parameters The endpoint information may not refer to the implicit discovery and is the same as the Link parameter by default, so that the uncertainty of the CoAPS resource port can be resolved.
  • the overall idea is: if the first resource information only contains the endpoint information of one resource, the other resources carried by the first server all use the same endpoint information as the resource containing the endpoint information. If the first resource information does not contain any endpoint information, all resources carried by the first server use the default endpoint information.
  • FIG. 3 is a schematic structural diagram of a client 300 provided in an embodiment of the present application.
  • the client 300 includes a processor 310, The memory 320, the communication interface 330, and one or more programs 321, wherein the one or more programs 321 are stored in the above-mentioned memory 320 and are configured to be executed by the above-mentioned processor 310, and the one or more programs 321 Include instructions for performing the following operations.
  • the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource; and receiving the first resource from the first server Information, the OCF resource reference Link parameter of the first resource information indicates the resource carried by the first server in the form of a Links array, and each Link parameter in the Links array corresponds to a resource; wherein, the first resource information
  • the resource attribute of the includes a first parameter, the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource, the endpoint information resource is used to indicate the endpoint information of the resource carried by the first server, the endpoint information resource Same as the endpoint where the /oic/res resource is located.
  • the client sends a multicast request
  • the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI
  • the corresponding CoAP resource is the /oic/res resource.
  • the OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource.
  • the resource includes CoAP resources and/or CoAPS resources.
  • the resource attribute of the first resource information includes a first parameter.
  • the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource.
  • the endpoint information resource is used to indicate the value of the resource carried by the first server.
  • the endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
  • the predefined resource URI of the endpoint information resource is /oic/eps
  • the resource type display name of the endpoint information resource is Endpoint Info
  • the resource type of the endpoint information resource is oic.wk.eps;
  • the interface list supported by the endpoint information resource is oic.if.baseline;
  • the mandatory selection of the endpoint information resource is mandatory CM.
  • the resource attribute of the endpoint information resource further includes at least one of the following:
  • each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
  • the resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  • the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information further includes a second parameter
  • the second parameter is used to indicate the endpoint where the /oic/res resource itself is located
  • the second parameter uses the Describe the endpoint information of the same port.
  • the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
  • the program 321 also includes instructions for performing the following operations: after receiving the first resource information from the first server, sending a unicast request to the first port of the first server, the unicast request including the first port Two URI, the CoAP resource corresponding to the second URI is the endpoint information resource, the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; The second resource information of the first server, where the second resource information includes endpoint information of the resource carried by the first server.
  • FIG. 4 is a schematic structural diagram of a server 400 provided by an embodiment of the present application.
  • the server 400 includes a processor 410, a memory 420, a communication interface 430, and one or more programs. 421, wherein the one or more programs 421 are stored in the foregoing memory 420 and configured to be executed by the foregoing processor 410, and the one or more programs 421 include instructions for performing the following operations.
  • the multicast request including a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource; and sending to the client First resource information, the OCF resource reference Link parameter of the first resource information indicates the resource carried by the first server in the form of a Links array, and each Link parameter in the Links array corresponds to one resource; and wherein, the The resource attribute of the first resource information includes a first parameter, the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource, the endpoint information resource is used to indicate the endpoint information of the resource carried by the first server, and The endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • the client sends a multicast request
  • the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI
  • the corresponding CoAP resource is the /oic/res resource.
  • the OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource.
  • the resource includes CoAP resources and/or CoAPS resources.
  • the resource attribute of the first resource information includes a first parameter.
  • the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource.
  • the endpoint information resource is used to indicate the value of the resource carried by the first server.
  • the endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
  • the predefined resource URI of the endpoint information resource is /oic/eps
  • the resource type display name of the endpoint information resource is Endpoint Info
  • the resource type of the endpoint information resource is oic.wk.eps;
  • the interface list supported by the endpoint information resource is oic.if.baseline;
  • the mandatory selection of the endpoint information resource is mandatory CM.
  • the resource attribute of the endpoint information resource further includes at least one of the following:
  • each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
  • the resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  • the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information further includes a second parameter
  • the second parameter is used to indicate the endpoint where the /oic/res resource itself is located
  • the second parameter uses the Describe the endpoint information of the same port.
  • the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
  • the program 421 also includes instructions for performing the following operations: after the first resource information is sent to the client, the first port receives a unicast request from the client, and the unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; and to the client The terminal sends second resource information, where the second resource information includes endpoint information of the resource carried by the first server.
  • the terminal includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiment of the present application may divide the terminal into functional units according to the foregoing method examples.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program modules. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 5 shows a block diagram of a possible functional unit composition of the message endpoint discovery apparatus involved in the foregoing embodiment.
  • the message endpoint discovery device 500 is applied to a terminal and specifically includes a processing unit 502 and a communication unit 503.
  • the processing unit 502 is used to control and manage the actions of the terminal.
  • the processing unit 502 is used to support the terminal to perform the process of the technology described herein.
  • the communication unit 503 is used to support communication between the terminal and other devices.
  • the terminal may also include a storage unit 501 for storing program codes and data of the terminal.
  • the processing unit 502 may be a processor or a controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), and an application-specific integrated circuit (Application-Specific Integrated Circuit). Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of this application.
  • the processor may also be a combination for realizing computing functions, for example, including a combination of one or more microprocessors, a combination of DSP and microprocessor, and so on.
  • the communication unit 503 may be a communication interface, a transceiver, a transceiving circuit, etc., and the storage unit 501 may be a memory.
  • the processing unit 502 is a processor
  • the communication unit 503 is a communication interface
  • the storage unit 501 is a memory
  • the terminal involved in the embodiment of the present application may be the terminal shown in FIG. 3.
  • the processing unit 502 is configured to perform any step performed by the terminal in the foregoing method embodiment, and when performing data transmission such as sending, the communication unit 503 can be optionally invoked to complete the corresponding operation.
  • data transmission such as sending
  • the communication unit 503 can be optionally invoked to complete the corresponding operation.
  • the processing unit 502 is configured to send a multicast request through the communication unit 503, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic /res resource; and receiving the first resource information from the first server through the communication unit 503, the OCF resource of the first resource information refers to the Link parameter and indicates the resource carried by the first server in the form of Links array, so Each Link parameter in the Links array corresponds to a resource;
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • the predefined resource URI of the endpoint information resource is /oic/eps
  • the resource type display name of the endpoint information resource is Endpoint Info
  • the resource type of the endpoint information resource is oic.wk.eps;
  • the interface list supported by the endpoint information resource is oic.if.baseline;
  • the mandatory selection of the endpoint information resource is mandatory CM.
  • the resource attribute of the endpoint information resource further includes at least one of the following:
  • each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
  • the resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  • the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information further includes a second parameter
  • the second parameter is used to indicate the endpoint where the /oic/res resource itself is located
  • the second parameter uses the Describe the endpoint information of the same port.
  • the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
  • the processing unit 502 After the processing unit 502 receives the first resource information from the first server through the communication unit 503, it is further configured to: send a unicast request to the first port of the first server through the communication unit 503,
  • the unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located
  • FIG. 6 shows a block diagram of a possible functional unit composition of the message endpoint discovery apparatus involved in the foregoing embodiment.
  • the message endpoint discovery apparatus 600 is applied to a network device, and the network device includes a processing unit 602 and a communication unit 603.
  • the processing unit 602 is used to control and manage the actions of the network device.
  • the processing unit 502 is used to support the process of the network device to perform the technology described herein.
  • the communication unit 603 is used to support communication between the network device and other devices.
  • the network device may also include a storage unit 601 for storing program codes and data of the terminal.
  • the processing unit 602 may be a processor or a controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), and an application-specific integrated circuit (Application-Specific Integrated Circuit). Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of this application.
  • the processor may also be a combination for realizing computing functions, for example, including a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
  • the communication unit 603 may be a communication interface, a transceiver, a transceiver circuit, etc., and the storage unit 601 may be a memory.
  • the processing unit 602 is a processor
  • the communication unit 603 is a communication interface
  • the storage unit 601 is a memory
  • the terminal involved in the embodiment of the present application may be the network device shown in FIG. 4.
  • the processing unit 602 is configured to receive a multicast request from a client through the communication unit 603, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic/res resources; and sending first resource information to the client through the communication unit 603, the OCF resource of the first resource information refers to the Link parameter and indicates the resources carried by the first server in the form of an array of Links , Each Link parameter in the Links array corresponds to a resource;
  • the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server.
  • Endpoint information the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  • the predefined resource URI of the endpoint information resource is /oic/eps
  • the resource type display name of the endpoint information resource is Endpoint Info
  • the resource type of the endpoint information resource is oic.wk.eps;
  • the interface list supported by the endpoint information resource is oic.if.baseline;
  • the mandatory selection of the endpoint information resource is mandatory CM.
  • the resource attribute of the endpoint information resource further includes at least one of the following:
  • each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
  • the resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  • the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  • the resource attribute of the first resource information further includes a second parameter
  • the second parameter is used to indicate the endpoint where the /oic/res resource itself is located
  • the second parameter uses the Describe the endpoint information of the same port.
  • the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  • the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
  • the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
  • the processing unit 602 After the processing unit 602 sends the first resource information to the client through the communication unit 603, it is further configured to: receive a unicast request from the client through the first port of the local terminal through the communication unit 603, and The unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located And sending second resource information to the client through the communication unit 603, the second resource information including the endpoint information of the resource carried by the first server.
  • the embodiment of the present application also provides a chip, wherein the chip includes a processor, which is used to call and run a computer program from the memory, so that the device installed with the chip executes the part described in the terminal in the above method embodiment Or all steps.
  • the embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the terminal in the above method embodiment Some or all of the steps described.
  • the embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the network in the above-mentioned method embodiment. Part or all of the steps described by the side device.
  • the embodiments of the present application also provide a computer program product, wherein the computer program product includes a computer program, and the computer program is operable to make a computer execute part or all of the steps described in the terminal in the above method embodiment.
  • the computer program product may be a software installation package.
  • the steps of the method or algorithm described in the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read Only Memory, ROM), and erasable programmable read-only memory ( Erasable Programmable ROM (EPROM), Electrically Erasable Programmable Read-Only Memory (Electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in an access network device, a target network device, or a core network device.
  • the processor and the storage medium may also exist as discrete components in the access network device, the target network device, or the core network device.
  • the functions described in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a Digital Video Disc (DVD)), or a semiconductor medium (for example, a Solid State Disk (SSD)) )Wait.

Abstract

Disclosed are a message endpoint discovery method and a related apparatus. The method comprises: a client sending a multicast request, wherein the multicast request comprises a first uniform resource identifier (URI), and a constrained application protocol (CoAP) resource corresponding to the first URI is a /oic/res resource; and the client receiving first resource information from a first server, wherein an OCF resource reference Link parameter of the first resource information indicates, in the manner of a Links array, a resource carried by the first server, each Link parameter in the Links array corresponds to a resource, a resource attribute of the first resource information comprises a first parameter, the first parameter is used to indicate whether it is necessary to further acquire an endpoint information resource, the endpoint information resource is used to indicate endpoint information of a resource carried by the first server, and the endpoint information resource is the same as an endpoint where the /oic/res resource is located. The embodiments of the present application can realize the determination of endpoint information of any resource.

Description

消息端点发现方法及相关装置Message endpoint discovery method and related device 技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种消息端点发现方法及相关装置。This application relates to the field of communication technology, and in particular to a method and related devices for discovering message endpoints.
背景技术Background technique
开放式互连基金会(Open Connectivity Foundation,OCF)消息端点(endpoint)用于交换请求和响应消息,消息端点的具体定义取决于所使用的传输协议。对于资源受限应用协议(The Constrained Application Protocol,CoAP)over用户数据报协议(User Datagram Protocol,UDP),消息端点由IPv4/IPv6地址和UDP端口号组成。一般的,设备的CoAP资源(使用CoAP协议可访问的资源,例如/oic/res资源,/oic/p资源)可以使用默认的UDP端口5683,设备的CoAPS资源(使用CoAP+DTLS协议可访问的资源,例如/oic/acl资源,/oic/cred资源)可以使用默认的UDP端口5684。The Open Connectivity Foundation (OCF) message endpoint is used to exchange request and response messages. The specific definition of the message endpoint depends on the transmission protocol used. For resource-constrained application protocol (The Constrained Application Protocol, CoAP) over user datagram protocol (User Datagram Protocol, UDP), the message endpoint consists of an IPv4/IPv6 address and a UDP port number. Generally, the device's CoAP resources (resources accessible using the CoAP protocol, such as /oic/res resources, /oic/p resources) can use the default UDP port 5683, and the device's CoAPS resources (accessible using the CoAP+DTLS protocol) Resources, such as /oic/acl resources, /oic/cred resources) can use the default UDP port 5684.
消息端点的发现用于客户端获取OCF设备或资源的端点信息,分为隐式发现和显式发现。隐式发现是指如果一个设备是CoAP消息的来源(例如:“/oic/res”响应),那么可以将源IP地址和端口号组合起来,形成该设备的消息端点信息。换句话说,CoAP的“/oic/res”响应消息可以隐式地传递响应设备的端点信息,并将其所有承载的资源都转换为可用CoAP传输协议访问的资源。显式发现是指消息端点信息用“/oic/res”资源中连接Links属性的“eps”参数显式地表示,客户端通过消息端点可以访问Link(Link又称为资源引用)的目标资源。The discovery of the message endpoint is used by the client to obtain the endpoint information of the OCF device or resource, which is divided into implicit discovery and explicit discovery. Implicit discovery means that if a device is the source of a CoAP message (for example: "/oic/res" response), then the source IP address and port number can be combined to form the message endpoint information of the device. In other words, the "/oic/res" response message of CoAP can implicitly convey the endpoint information of the responding device, and convert all its carried resources into resources that can be accessed by the CoAP transmission protocol. Explicit discovery means that the message endpoint information is explicitly represented by the "eps" parameter of the Links attribute in the "/oic/res" resource, and the client can access the target resource of the Link (Link is also called resource reference) through the message endpoint.
发明内容Summary of the invention
本申请实施例提供一种消息端点发现方法及相关装置,以期实现对于任意资源的端点信息的确定问题。The embodiment of the present application provides a message endpoint discovery method and related device, in order to realize the problem of determining the endpoint information of any resource.
第一方面,本申请实施例提供一种消息端点发现方法,包括:In the first aspect, an embodiment of the present application provides a message endpoint discovery method, including:
客户端发送多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;The client sends a multicast request, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource;
所述客户端接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The client receives the first resource information from the first server, and the OCF resource of the first resource information refers to the Link parameter indicating the resource carried by the first server in the form of Links array. Each Link in the Links array The parameter corresponds to a resource;
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
第二方面,本申请实施例提供一种消息端点发现方法,包括:In the second aspect, an embodiment of the present application provides a message endpoint discovery method, including:
第一服务端接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;The first server receives a multicast request from the client, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource;
所述第一服务端向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The first server sends first resource information to the client, and the OCF resource of the first resource information refers to the Link parameter to indicate the resource carried by the first server in the form of an array of Links, and each link in the array of Links Each Link parameter corresponds to one resource;
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
第三方面,本申请实施例提供一种消息端点发现装置,应用于客户端,所述装置包括处理单元和通信单元,其中,In a third aspect, an embodiment of the present application provides a message endpoint discovery device, which is applied to a client, and the device includes a processing unit and a communication unit, where:
所述处理单元,用于通过所述通信单元发送多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及通过所述通信单元接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The processing unit is configured to send a multicast request through the communication unit, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic/res Resources; and receiving first resource information from the first server through the communication unit, the OCF resource of the first resource information references the Link parameter to indicate the resources carried by the first server in the form of an array of Links, the array of Links Each Link parameter corresponds to a resource;
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
第四方面,本申请实施例提供一种消息端点发现装置,应用于第一服务端,所述装置包括处理单元和通信单元,其中,In a fourth aspect, an embodiment of the present application provides a message endpoint discovery device, which is applied to a first server, and the device includes a processing unit and a communication unit, where:
所述处理单元,用于通过所述通信单元接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及通过所述通信单元向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The processing unit is configured to receive a multicast request from a client through the communication unit, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is/ oic/res resources; and sending first resource information to the client through the communication unit, the OCF resource of the first resource information references the Link parameter to indicate the resources carried by the first server in the form of an array of Links, so Each Link parameter in the Links array corresponds to a resource;
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
第五方面,本申请实施例提供一种客户端,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行本申请实施例第一方面任一方法中的步骤的指令。In a fifth aspect, embodiments of the present application provide a client, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured by The processor executes, and the program includes instructions for executing the steps in any method in the first aspect of the embodiments of the present application.
第六方面,本申请实施例提供一种第一服务端,包括处理器、存储器、通信接口以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行本申请实施例第二方面任一方法中的步骤的指令。In a sixth aspect, embodiments of the present application provide a first server, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are The configuration is executed by the processor, and the program includes instructions for executing steps in any method in the second aspect of the embodiments of the present application.
第七方面,本申请实施例提供了一种芯片,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如本申请实施例第一方面或第二方面任一方法中所描述的部分或全部步骤。In a seventh aspect, an embodiment of the present application provides a chip, including a processor, configured to call and run a computer program from a memory, so that the device installed with the chip executes the first aspect or the second aspect of the embodiment of the present application. Some or all of the steps described in any method of the aspect.
第八方面,本申请实施例提供了一种计算机可读存储介质,其中,所述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如本申请实施例第一方面或第二方面任一方法中所描述的部分或全部步骤。In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the For example, part or all of the steps described in any method of the first aspect or the second aspect.
第九方面,本申请实施例提供了一种计算机程序,其中,所述计算机程序可操作来使计算机执行如本申请实施例第一方面或第二方面任一方法中所描述的部分或全部步骤。该计算机程序可以为一个软件安装包。In a ninth aspect, an embodiment of the present application provides a computer program, wherein the computer program is operable to cause a computer to execute part or all of the steps described in any method of the first aspect or the second aspect of the embodiment of the present application . The computer program may be a software installation package.
可以看出,本申请实施例中,客户端发送多播请求,第一服务端接收该多播请求,并向客户端发送第一资源信息,其中,多播请求包括第一URI,第一URI对应的CoAP资源为/oic/res资源,第一资源信息的OCF Link参数以Links数组方式指示第一服务端承载的资源,Links数组中每个Link参数对应一个资源,由于第一服务端承载的资源包括CoAP资源和/或CoAPS资源,第一资源信息的资源属性包括第一参数,第一参数用于指示是否需要进一步获取端点信息资源,端点信息资源用于指示第一服务端承载的资源的端点信息,端点信息资源与/oic/res资源所在的端点相同,因此第一参数能够明确指示CoAPS资源的端点信息,解决对于CoAPS资源的端点信息的不确定性问题,从而实现对于任意资源的端点信息的确定问题。It can be seen that, in this embodiment of the application, the client sends a multicast request, the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI The corresponding CoAP resource is the /oic/res resource. The OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource. The resource includes CoAP resources and/or CoAPS resources. The resource attribute of the first resource information includes a first parameter. The first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource. The endpoint information resource is used to indicate the value of the resource carried by the first server. The endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
附图说明Description of the drawings
下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。The following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art.
图1A是本申请实施例提供的一种OCF示例通信系统的系统架构图;FIG. 1A is a system architecture diagram of an OCF example communication system provided by an embodiment of the present application;
图1B是本申请实施例提供的一种V2X中的relay示意图;FIG. 1B is a schematic diagram of a relay in V2X provided by an embodiment of the present application;
图1C是本申请实施例提供的一种第二设备通过客户端接入到网络设备的示意图;FIG. 1C is a schematic diagram of a second device accessing a network device through a client according to an embodiment of the present application;
图2A是本申请实施例提供的一种消息端点发现方法的流程示意图;2A is a schematic flowchart of a method for discovering message endpoints according to an embodiment of the present application;
图2B是本申请实施例提供的一种第一资源信息的参数示例图;2B is an example diagram of a parameter of first resource information provided by an embodiment of the present application;
图2C是本申请实施例提供的一种端点信息资源的参数示例图;2C is an example diagram of parameters of an endpoint information resource provided by an embodiment of the present application;
图3是本申请实施例提供的一种客户端的结构示意图;FIG. 3 is a schematic structural diagram of a client provided by an embodiment of the present application;
图4是本申请实施例提供的一种网络设备的的结构示意图;FIG. 4 is a schematic structural diagram of a network device provided by an embodiment of the present application;
图5是本申请实施例提供的一种消息端点发现装置的功能单元组成框图;5 is a block diagram of functional units of a message endpoint discovery device provided by an embodiment of the present application;
图6是本申请实施例提供的一种消息端点发现装置的功能单元组成框图。Fig. 6 is a block diagram of functional units of a message endpoint discovery device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
本申请实施例的技术方案可以应用于如图1A所示的示例通信系统100,该示例通信系统100包括客户端110和服务端120(图中示例为服务端1、服务端p),客户端110与服务端120通信连接。其中,客户端110可以是手机等各类电子设备,服务端120可以是OCF设备,服务端120设置有OCF消息端点和OCF资源,每个OCF资源可以通过至少1个OCF消息端点访问,1个消息端点上可以关联多个OCF资源。The technical solutions of the embodiments of the present application can be applied to the exemplary communication system 100 shown in FIG. 1A. The exemplary communication system 100 includes a client 110 and a server 120 (the example in the figure is server 1, server p), and the client 110 is connected to the server 120 in communication. Among them, the client 110 can be various electronic devices such as mobile phones, the server 120 can be an OCF device, and the server 120 is provided with OCF message endpoints and OCF resources. Each OCF resource can be accessed through at least one OCF message endpoint. Multiple OCF resources can be associated with the message endpoint.
其中,对于Collection资源(组合资源)里的每个Link,Link可以引用自身(假设为服务端1)的某个资源,此时该Link的端点信息是服务端1的某个端点,也可以引用另一个服务端p上的某个资源,此时该Link里的端点信息是服务端p的某个端点。Among them, for each Link in the Collection resource (combined resource), Link can refer to a resource of itself (assuming it is server 1). At this time, the endpoint information of the Link is a certain endpoint of server 1, or it can be referenced A certain resource on another server p. At this time, the endpoint information in the Link is an endpoint of server p.
本申请实施例的技术方案可以应用于各种通信系统,例如:全球移动通信(global system for mobile communications,GSM)系统、码分多址(code division multiple access,CDMA)系统、宽带码分多址(wideband code division multiple access,WCDMA)系统、通用分组无线业务(general packet radio service,GPRS)、长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division duplex,TDD)、通用移动通信系统(universal mobil etelecommunication system,UMTS)、全球互联微波接入(worldwide interoperability for microwave access,WiMAX)通信系统、未来的第五代(5th generation,5G)系统或新无线(new radio,NR)等。The technical solutions of the embodiments of this application can be applied to various communication systems, such as: global system for mobile communications (GSM) system, code division multiple access (CDMA) system, broadband code division multiple access (wideband code division multiple access, WCDMA) system, general packet radio service (GPRS), long term evolution (LTE) system, LTE frequency division duplex (FDD) system, LTE Time division duplex (TDD), universal mobil et communication system (UMTS), worldwide interoperability for microwave access (WiMAX) communication system, the future fifth generation (5th generation, 5G) system or new radio (NR), etc.
本申请实施例中的客户端110可以指用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。终端还可以是蜂窝电话、无绳电话、会话启动协议(session initiation protocol,SIP)电话、无线本地环路(wireless local loop,WLL)站、个人数字助理(personal digital assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、中继设备、车载设备、可穿戴设备,未来5G网络中的终端或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的终端等,本申请实施例对此并不限定。The client 110 in the embodiment of the present application may refer to user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent Or user device. The terminal can also be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), and a wireless communication function Handheld devices, computing devices or other processing devices connected to wireless modems, relay devices, in-vehicle devices, wearable devices, terminals in the future 5G network, or public land mobile network (PLMN) that will evolve in the future This is not limited in this embodiment of the application.
本申请实施例中的服务端120可以是用于与客户端110通信的设备,该网络设备可以是全球移动通信(global system for mobile communications,GSM)系统或码分多址(code division multiple access,CDMA)中的基站(base transceiver station,BTS),也可以是宽带码分多址(wideband code division multiple access,WCDMA)系统中的基站(NodeB,NB),还可以是LTE系统中的演进型基站(evoled NodeB,eNB或eNodeB),还可以是云无线接入网络(cloud radio access network,CRAN)场景下的无线控制器,或者该服务端120可以为中继设备、接入点、车载设备、可穿戴设备以及未来5G网络中的网络设备或者未来演进的PLMN网络中的网络设备,5G系统中的基站的一个或一组(包括多个天线面板)天线面板,或者,还可以为构成gNB或传输点的网络节点,如基带单元(baseband unit,BBU),或,分布式单元(distributed unit,DU)等,本申请实施例并不限定。The server 120 in the embodiment of the present application may be a device for communicating with the client 110, and the network device may be a global system for mobile communications (GSM) system or code division multiple access, The base station (transceiver station, BTS) in CDMA) can also be the base station (NodeB, NB) in the wideband code division multiple access (WCDMA) system, or the evolved base station in the LTE system (evoled NodeB, eNB or eNodeB), can also be a wireless controller in a cloud radio access network (cloud radio access network, CRAN) scenario, or the server 120 can be a relay device, an access point, a vehicle device, Wearable devices and network devices in the future 5G network or network devices in the future evolved PLMN network, one or a group of (including multiple antenna panels) antenna panels of the base station in the 5G system, or can also form a gNB or The network node of the transmission point, such as a baseband unit (BBU), or a distributed unit (DU), etc., is not limited in the embodiment of the present application.
在一些部署中,gNB可以包括集中式单元(centralized unit,CU)和DU。gNB还可以包括有源天线单元(active antenna unit,AAU)。CU实现gNB的部分功能,DU实现gNB的部分功能。比如,CU负责处理非实时协议和服务,实现无线资源控制(radio resource control,RRC),分组数据汇聚层协议(packet data convergence protocol,PDCP)层的功能。DU负责处理物理层协议和实时服务,实现无线链路控制(radio Link control,RLC)层、媒体接入控制(media access control,MAC)层和物理(physical,PHY)层的功能。AAU实现部分物理层处理功能、射频处理及有源天线的相关功能。由于RRC层的信息最终会变成PHY层的信息,或者,由PHY层的信息转变而来,因而,在这种架构下,高层信令,如RRC层信令,也可以认为是由DU发送的,或者,由DU+AAU发送的。可以理解的是,服务端120可以为包括CU节点、DU节点、AAU节点中一项或多项的设备。此外,可以将CU划分为接入 网(radio access network,RAN)中的服务端120,也可以将CU划分为核心网(core network,CN)中的服务端120,本申请对此不做限定。In some deployments, the gNB may include a centralized unit (CU) and a DU. The gNB may also include an active antenna unit (AAU). The CU implements some of the functions of the gNB, and the DU implements some of the functions of the gNB. For example, the CU is responsible for processing non-real-time protocols and services, and implements radio resource control (radio resource control, RRC) and packet data convergence protocol (packet data convergence protocol, PDCP) layer functions. The DU is responsible for processing physical layer protocols and real-time services, and implements the functions of the radio link control (RLC) layer, media access control (MAC) layer, and physical (physical, PHY) layer. AAU realizes some physical layer processing functions, radio frequency processing and related functions of active antennas. Since the information of the RRC layer will eventually become the information of the PHY layer, or be transformed from the information of the PHY layer, under this architecture, high-level signaling, such as RRC layer signaling, can also be considered to be sent by the DU , Or, sent by DU+AAU. It is understandable that the server 120 may be a device including one or more of the CU node, the DU node, and the AAU node. In addition, the CU can be divided into the server 120 in the access network (radio access network, RAN), or the CU can be divided into the server 120 in the core network (core network, CN), which is not limited in this application .
在本申请实施例中,客户端110或服务端120包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。该硬件层包括中央处理器(central processing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。该操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。该应用层包含浏览器、通讯录、文字处理软件、即时通信软件等应用。并且,本申请实施例并未对本申请实施例提供的方法的执行主体的具体结构特别限定,只要能够通过运行记录有本申请实施例的提供的方法的代码的程序,以根据本申请实施例提供的方法进行通信即可,例如,本申请实施例提供的方法的执行主体可以是客户端110,或者,是客户端110中能够调用程序并执行程序的功能模块。In the embodiment of the present application, the client 110 or the server 120 includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also referred to as main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, for example, Linux operating systems, Unix operating systems, Android operating systems, iOS operating systems, or windows operating systems. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software. Moreover, the embodiments of the application do not specifically limit the specific structure of the execution body of the method provided in the embodiments of the application, as long as the program that records the codes of the methods provided in the embodiments of the application can be provided in accordance with the embodiments of the application. For example, the execution subject of the method provided in the embodiment of the present application may be the client 110, or a functional module in the client 110 that can call and execute the program.
下面先对OCF体系的一些基本概念做简要介绍。The following first briefly introduces some basic concepts of the OCF system.
在OCF协议中,使用资源(Resource)的方式定义设备的功能。在OCF体系中,资源是表示每一个设备、设备的每一种功能服务和设备的状态等信息的逻辑功能实体,这些逻辑功能实体由服务端公开给客户端进行访问和操作,客户端通过资源操作CRUDN和服务端进行交互。In the OCF protocol, the function of the device is defined in a resource (Resource) way. In the OCF system, resources are logical functional entities that represent information about each device, each functional service of the device, and the status of the device. These logical functional entities are exposed by the server to the client for access and operation, and the client uses the resource Operate the CRUDN and interact with the server.
OCF资源的参数主要包括URI、属性、资源引用和接口。The parameters of OCF resources mainly include URI, attributes, resource references and interfaces.
(1)URI:每个资源有自己的URI,部分资源有预定义的URI,通过访问对应的URI来获取这个资源。(1) URI: Each resource has its own URI, and some resources have predefined URIs. This resource can be obtained by accessing the corresponding URI.
(2)属性(property):每个资源包含属性,属性用于描述资源的相关信息。(2) Property: Each resource contains properties, which are used to describe related information of the resource.
(3)资源引用(link):通过链接建立资源之间的引用关系。(3) Resource reference (link): Establish a reference relationship between resources through links.
(4)接口(interface):公开资源的表述以及对应的操作方法。(4) Interface: The expression of the open resource and the corresponding operation method.
其中,OCF属性(Property)以<Key:Value>键值对的形式出现,在JSON表示为“属性名”:“属性值”,属性定义包括以下特征:Among them, the OCF property (Property) appears in the form of <Key:Value> key-value pairs, expressed in JSON as "property name": "property value", and the property definition includes the following characteristics:
①Property title:属性的显示名称。①Property title: The display name of the property.
②Property name:属性的标识名称,<Key:Value>键值对中的key。②Property name: the identifying name of the property, the key in the key-value pair <Key:Value>.
③Value type:属性值的类型,可以是简单数据的类型,也可以是复杂的数据类型。③Value type: The type of the attribute value, which can be a simple data type or a complex data type.
④Value rules:属性值的约束条件,例如最大值、最小值、枚举值的取值范围。④Value rules: The constraint conditions of the attribute value, such as the maximum value, the minimum value, and the value range of the enumeration value.
⑤Unit:属性值的单位,例如℃。⑤Unit: The unit of the attribute value, such as ℃.
⑥Mandatory:表明在某资源类型中,属性是否强制。⑥Mandatory: Indicate whether the attribute is mandatory in a certain resource type.
⑦Access mode:属性值的访问模式,可以是可读(R)、可写(W)、或者可读可写(R,W)。⑦Access mode: The access mode of the attribute value, which can be readable (R), writable (W), or readable and writable (R, W).
⑧Description:属性的可读性描述信息。⑧Description: The readability description information of the attribute.
属性定义格式,如表1所示的以资源名称“n”属性为例的属性格式。The attribute definition format is the attribute format shown in Table 1 taking the resource name "n" attribute as an example.
表1Table 1
Figure PCTCN2020073636-appb-000001
Figure PCTCN2020073636-appb-000001
其中,资源类型(Resource Type)用于描述一类资源的特定应用类型,一个资源可以有多个资源类型定义,即“rt”属性可以有多个属性值,例如"rt":[“oic.wk.d",“oic.d.light"]Among them, Resource Type is used to describe the specific application type of a type of resource. A resource can have multiple resource type definitions, that is, the "rt" attribute can have multiple attribute values, such as "rt":["oic. wk.d","oic.d.light"]
资源类型定义包括以下特征:The resource type definition includes the following characteristics:
①Pre-defined URI(可选):OCF为特定资源预定义固定的资源URI,例如/oic/res①Pre-defined URI (optional): OCF pre-defines a fixed resource URI for a specific resource, such as /oic/res
②Resource Type title(可选):资源类型的显示名称②Resource Type title (optional): the display name of the resource type
③Resource Type ID:资源类型的标识,即“rt”属性的值③Resource Type ID: the identifier of the resource type, that is, the value of the "rt" attribute
④Interfaces:该类型资源支持的接口列表④Interfaces: List of interfaces supported by this type of resource
⑤Description:资源类型的可读性描述信息,例如“oic.r.humidity”资源用于描述环境湿度⑤Description: the readable description information of the resource type, for example, "oic.r.humidity" resource is used to describe the environmental humidity
⑥Mandatory:表明在OCF体系中,该资源类型是否强制⑥Mandatory: Indicate whether the resource type is mandatory in the OCF system
⑦Properties:该资源类型相关的属性⑦Properties: Properties related to the resource type
资源类型定义格式,如表2所示的以开关资源“Binary Switch”为例的资源类型格式。The resource type definition format, as shown in Table 2 is the resource type format taking the switch resource "Binary Switch" as an example.
表2Table 2
Figure PCTCN2020073636-appb-000002
Figure PCTCN2020073636-appb-000002
“Binary Switch”资源相关属性如表3所示。The relevant attributes of the "Binary Switch" resource are shown in Table 3.
表3table 3
Figure PCTCN2020073636-appb-000003
Figure PCTCN2020073636-appb-000003
其中,集合Collection资源(又称为组合资源)包含OCF Links,表示一个或多个link资源的集合,通过Collection资源可以引用多个目标资源或其他Collection资源。如图1B例,一个Collection资源包含设备A(light)的开关资源,以及设备B(fan)的开关资源,形成了集中的资源组。客户端可以通过访问Collection资源的oic.if.b接口同时请求多个资源,Collection会把请求发送给links中的每一个资源,并收集每个资源返回的响应,集中后统一返回给客户端。Among them, a collection resource (also called a combination resource) includes OCF Links, which represents a collection of one or more link resources, and multiple target resources or other collection resources can be referenced through the collection resource. As shown in Figure 1B, a Collection resource contains the switch resource of device A (light) and the switch resource of device B (fan), forming a centralized resource group. The client can request multiple resources at the same time by accessing the oic.if.b interface of the Collection resource. The Collection will send the request to each resource in the links, collect the response returned by each resource, and return it to the client in a unified manner.
其中,OCF参考IETF RFC5988(web linking)定义了OCF Link,OCF Link由键值对组成,用于表示资源之间的连接关系。Among them, OCF refers to IETF RFC5988 (web linking) to define OCF Link. OCF Link is composed of key-value pairs and is used to represent the connection relationship between resources.
①anchor:上下文URI,当anchor隐性化时,其实是表示包含Link的hosting resource,当anchor显性化时一般用于覆盖Link的hosting resource URI,提供非hosting resource URI作为上下文URI,是Link的可选属性。①Anchor: Context URI. When the anchor is implicit, it actually means the hosting resource that contains the Link. When the anchor is explicit, it is generally used to cover the hosting resource URI of the Link, providing non-hosting resource URI as the context URI, which is the link's available Select attributes.
②href:目标URI,即Link引用的目标资源,可以是相对路径或绝对路径,href是Link的必选属性。② href: Target URI, that is, the target resource referenced by Link, which can be a relative path or an absolute path, and href is a required attribute of Link.
③rel:引用的资源URI和上下文URI的关系,当rel隐性化时默认表示“hosts”,是Link的可选属性。rt:目标资源的资源类型标识,是Link的必选属性。③rel: The relationship between the referenced resource URI and the context URI. When rel is implicit, it means "hosts" by default, which is an optional attribute of Link. rt: The resource type identifier of the target resource, which is a required attribute of Link.
④if:目标资源支持的接口集,是Link的必选属性。④if: The set of interfaces supported by the target resource is a mandatory attribute of Link.
⑤p:bitmap指示目标资源是否可发现性、是否可观察,是Link的可选属性。⑤ p: bitmap indicates whether the target resource is discoverable and observable, which is an optional attribute of Link.
⑥eps:可以访问目标资源的消息端点Endpoints(IP地址+端口号),是Link的可选属性。⑥eps: Endpoints (IP address + port number) of the message endpoints that can access the target resource are optional attributes of Link.
其中,OCF消息端点用于交换请求和响应消息,消息端点的具体定义取决于所使用的传输协议。 每个设备必须至少与一个消息端点关联,当消息发送到消息端点时,它将被传递到与消息端点关联的设备。当消息被发送到端点后,通过资源标识寻址到目标资源。设备可以与多个消息端点相关联,例如OCF设备同时支持CoAP和TCP则有两个不同的端点。消息端点由端点信息“eps”表示,“eps”端点信息包括两个键"ep","pri"。"ep"代表传输协议的端点位置,此键值是必选的,例如"ep":"coap://IP:port"。当有多个端点时,“pri”表示它们对应的优先级,此键值是可选的,值越低,优先级越高。Among them, the OCF message endpoint is used to exchange request and response messages, and the specific definition of the message endpoint depends on the transmission protocol used. Each device must be associated with at least one message endpoint. When a message is sent to the message endpoint, it will be delivered to the device associated with the message endpoint. When the message is sent to the endpoint, the target resource is addressed through the resource identifier. A device can be associated with multiple message endpoints. For example, an OCF device supports CoAP and TCP at the same time and has two different endpoints. The message endpoint is represented by the endpoint information "eps", and the "eps" endpoint information includes two keys "ep" and "pri". "ep" represents the endpoint position of the transmission protocol, this key value is required, for example, "ep":"coap://IP:port". When there are multiple endpoints, "pri" indicates their corresponding priority. This key value is optional. The lower the value, the higher the priority.
其中,/oic/res资源是协议规定的固定的用于设备资源发现的一种Collection资源。如图1C所示,它包含了设备上所有可被发现的资源的links。Among them, the /oic/res resource is a fixed collection resource for device resource discovery specified by the protocol. As shown in Figure 1C, it contains links to all discoverable resources on the device.
其中,资源消息端点发现过程如下:Among them, the resource message endpoint discovery process is as follows:
1.服务端采用”所有OCF节点”多播地址(OCF不用默认的CoAP多播地址,采用OCF注册的组播服务地址:ff0x::158,端口5683),进行信息的多播1. The server uses the multicast address of "all OCF nodes" (OCF does not use the default CoAP multicast address, uses the multicast service address registered with OCF: ff0x::158, port 5683) to perform information multicast
2.客户端需要发现资源的时候加入”所有OCF节点”多播组2. When the client needs to discover resources, join the "All OCF Nodes" multicast group
3.客户端发送多播请求(CoAP GET)给所有服务端,请求URI对应的是"/oic/res"3. The client sends a multicast request (CoAP GET) to all servers, and the request URI corresponds to "/oic/res"
4.如果需要发现指定的资源类型,可指定“rt”,则只有符合资源类型的设备响应请求,当"rt"查询参数被省略时,所有设备将响应发现请求4. If you need to discover the specified resource type, you can specify "rt", and only devices that match the resource type will respond to the request. When the "rt" query parameter is omitted, all devices will respond to the discovery request
5.服务端以Links数组方式返回承载的资源列表,每一个link对应一个资源,Links提供以下信息:5. The server returns a list of carried resources in the form of an array of Links. Each link corresponds to a resource. Links provides the following information:
href(link资源URI,可以是相对路径或绝对路径)。href (link resource URI, can be a relative path or an absolute path).
ref(link资源URI和上下文URI的关系)。ref (relationship between link resource URI and context URI).
eps(link资源绑定的端点信息)。eps (the endpoint information bound to the link resource).
if(link资源支持的接口)。if (interface supported by link resource).
obs(link资源是否可被观察Observability)。obs (whether the link resource can be observed Observability).
目前,按协议定义,设备支持隐式发现的情况下,如果设备回应了对某个资源的请求(一般是支持组播的CoAP资源,例如/oic/res资源),那么它所有资源的端点信息跟该资源的一样。对一个简单的设备来说,一般所有资源都使用同一个IP,CoAP资源的端口使用一个端口(很可能不是默认端口),CoAPS资源使用另一个端口(很可能不是默认端口),所以隐式发现只能发现CoAP资源的端口,而不支持对CoAPS资源的端口的发现,或者CoAPS资源的隐式发现只能使用固定的默认端口(OCF目前未明确这一点)。At present, as defined by the protocol, when the device supports implicit discovery, if the device responds to a request for a certain resource (usually a CoAP resource that supports multicast, such as /oic/res resource), then the endpoint information of all its resources Same as the resource. For a simple device, generally all resources use the same IP, CoAP resources use one port (probably not the default port), and CoAPS resources use another port (probably not the default port), so implicit discovery Only the ports of CoAP resources can be discovered, but the discovery of ports of CoAPS resources is not supported, or the implicit discovery of CoAPS resources can only use fixed default ports (OCF does not currently specify this).
设备支持显式发现的情况下,它的资源的端点信息包含在“/oic/res”资源中Links属性下每个Link的“eps”参数中,全部Link都包含“eps”参数使得数据冗余高,此外,该“eps”参数是可选的,未包含“eps”参数的Link参照隐式发现使用“/oic/res”回应消息的来源端口。When the device supports explicit discovery, the endpoint information of its resource is included in the "eps" parameter of each link under the Links attribute in the "/oic/res" resource, and all links include the "eps" parameter to make the data redundant High, in addition, the "eps" parameter is optional. Link references that do not contain the "eps" parameter implicitly find the source port of the response message with "/oic/res".
例如,若出现分组情况(即部分Link使用一个端点信息,另一部分或多部分使用另一个或另外多个端点信息),则只能是全部的Link都包含“eps”参数。本质上,CoAP资源和CoAPS资源是一种分组情况,如果同时有CoAP资源和CoAPS资源,则必须全部的Link都包含“eps”参数。若全部的Link都包含“eps”参数,则数据冗余比较高。For example, if there is a grouping situation (that is, part of the Link uses one endpoint information, and another part or more uses another or multiple endpoint information), all links can only contain the "eps" parameter. Essentially, CoAP resources and CoAPS resources are a grouping situation. If there are CoAP resources and CoAPS resources at the same time, all links must contain the "eps" parameter. If all links include the "eps" parameter, the data redundancy is relatively high.
针对上述问题,本申请实施例提出一种消息端点发现方法,下面结合附图进行详细说明。In response to the foregoing problems, an embodiment of the present application proposes a method for discovering message endpoints, which will be described in detail below with reference to the drawings.
请参阅图2A,图2A是本申请实施例提供的一种消息端点发现方法的流程示意图,如图所示,该方法包括:Please refer to FIG. 2A. FIG. 2A is a schematic flowchart of a message endpoint discovery method provided by an embodiment of the present application. As shown in the figure, the method includes:
步骤2a01,客户端发送多播请求(例如:CoAP GET),所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源。Step 2a01, the client sends a multicast request (for example: CoAP GET), the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource .
其中,所述/oic/res资源为使用CoAP协议可访问的资源,/oic/res资源是协议规定的固定的用于设备资源发现的一种Collection资源。它包含了设备上所有可被发现的资源的Links。Wherein, the /oic/res resource is a resource that can be accessed using the CoAP protocol, and the /oic/res resource is a fixed collection resource for device resource discovery specified by the protocol. It contains Links of all discoverable resources on the device.
具体实现中,客户端如果需要发现指定的资源类型,可指定“rt”参数,则只有符合资源类型的服务端响应请求,当"rt"查询参数被省略时,客户端所处OCF多播组内的所有服务端将响应多播请求。In specific implementation, if the client needs to discover the specified resource type, it can specify the "rt" parameter, and only the server that matches the resource type will respond to the request. When the "rt" query parameter is omitted, the client is in the OCF multicast group All servers within will respond to the multicast request.
步骤2a02,第一服务端接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源。Step 2a02: The first server receives a multicast request from the client, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource.
具体实现中,所述服务端可以采用”所有OCF节点”多播地址(OCF不用默认的CoAP多播地址, 采用OCF注册的组播服务地址:ff0x::158,端口5683),进行信息的多播。客户端需要发现资源的时候加入”所有OCF节点”多播组。In the specific implementation, the server can use the multicast address of "all OCF nodes" (OCF does not use the default CoAP multicast address, but uses the multicast service address registered with OCF: ff0x::158, port 5683) to perform more information. broadcast. When the client needs to discover resources, it joins the "All OCF Nodes" multicast group.
步骤2a03,所述第一服务端向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源。Step 2a03: The first server sends first resource information to the client, and the OCF resource of the first resource information refers to the Link parameter in the form of an array of Links indicating the resources carried by the first server, and the Links Each Link parameter in the array corresponds to a resource.
其中,所述第一资源信息具体可以是/oic/res资源的资源信息。Wherein, the first resource information may specifically be resource information of the /oic/res resource.
步骤2a04,所述客户端接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源。Step 2a04, the client receives the first resource information from the first server, the OCF resource of the first resource information references the Link parameter in the form of Links array to indicate the resources carried by the first server, and the Links array Each Link parameter corresponds to a resource.
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
其中,所述第一参数例如可以命名为“ex”参数。Wherein, the first parameter may be named "ex" parameter, for example.
可以看出,本申请实施例中,客户端发送多播请求,第一服务端接收该多播请求,并向客户端发送第一资源信息,其中,多播请求包括第一URI,第一URI对应的CoAP资源为/oic/res资源,第一资源信息的OCF Link参数以Links数组方式指示第一服务端承载的资源,Links数组中每个Link参数对应一个资源,由于第一服务端承载的资源包括CoAP资源和/或CoAPS资源,第一资源信息的资源属性包括第一参数,第一参数用于指示是否需要进一步获取端点信息资源,端点信息资源用于指示第一服务端承载的资源的端点信息,端点信息资源与/oic/res资源所在的端点相同,因此第一参数能够明确指示CoAPS资源的端点信息,解决对于CoAPS资源的端点信息的不确定性问题,从而实现对于任意资源的端点信息的确定问题。It can be seen that, in this embodiment of the application, the client sends a multicast request, the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI The corresponding CoAP resource is the /oic/res resource. The OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource. The resource includes CoAP resources and/or CoAPS resources. The resource attribute of the first resource information includes a first parameter. The first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource. The endpoint information resource is used to indicate the value of the resource carried by the first server. The endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
在一个可能的实例中,所述端点信息资源的预定义的资源URI(Pre-defined URI)为/oic/eps;In a possible example, the pre-defined resource URI (Pre-defined URI) of the endpoint information resource is /oic/eps;
所述端点信息资源的资源类型显示名称(Title)为Endpoint Info;The resource type display name (Title) of the endpoint information resource is Endpoint Info;
所述端点信息资源的资源类型(rt)为oic.wk.eps;The resource type (rt) of the endpoint information resource is oic.wk.eps;
所述端点信息资源支持的接口列表(interfaces)为oic.if.baseline;The interface list (interfaces) supported by the endpoint information resource is oic.if.baseline;
所述端点信息资源的必选性为必选CM,其中,该必选性包括M(Mandatory,必选)、CM(Conditional Mandatory,有条件必选)、O(Optional,可选)三个选项。The mandatory selection of the endpoint information resource is mandatory CM, where the mandatory selection includes three options: M (Mandatory, mandatory), CM (Conditional Mandatory, conditionally mandatory), and O (Optional, optional) .
具体实现中,所述端点信息资源的资源类型可以命名为oic.wk.eps,该oic.wk.eps的属性格式如表4所示。In specific implementation, the resource type of the endpoint information resource may be named oic.wk.eps, and the attribute format of the oic.wk.eps is shown in Table 4.
表4Table 4
Figure PCTCN2020073636-appb-000004
Figure PCTCN2020073636-appb-000004
在一个可能的实例中,所述端点信息资源的资源属性还包括以下至少一种:In a possible example, the resource attribute of the endpoint information resource further includes at least one of the following:
所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
具体实现中,所述端点信息资源的资源属性的格式如表5所示。In specific implementation, the format of the resource attribute of the endpoint information resource is shown in Table 5.
表5table 5
Figure PCTCN2020073636-appb-000005
Figure PCTCN2020073636-appb-000005
Figure PCTCN2020073636-appb-000006
Figure PCTCN2020073636-appb-000006
在一个可能的实例中,所述每个Link参数仅包括除第二参数之外的OCF Link参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
其中,所述第二参数为“eps”参数(如图1C所示的eps键值)。Wherein, the second parameter is an "eps" parameter (the eps key value shown in FIG. 1C).
举例来说,如图2B所示的第一资源信息的示例,其中,资源属性部分包括以下参数:“rt”、“if”、“ex”、“eps”,每个Link参数包括以下参数:“href”、“anchor”、“rel”、“rt”、“if”、“p”。For example, in the example of the first resource information shown in FIG. 2B, the resource attribute part includes the following parameters: "rt", "if", "ex", "eps", and each Link parameter includes the following parameters: "Href", "anchor", "rel", "rt", "if", "p".
可见,本示例中,由于第一资源信息的每个Link参数不再包含“eps”参数,仅在资源属性部分包含单个“eps”参数键值,从而使得第一资源信息即/oic/res中的“eps”数据减少,有效降低第一资源信息的数据冗余。It can be seen that in this example, since each Link parameter of the first resource information no longer contains the "eps" parameter, only a single "eps" parameter key value is included in the resource attribute part, so that the first resource information is in /oic/res The "eps" data is reduced, effectively reducing the data redundancy of the first resource information.
在一个可能的实例中,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
其中,所述默认端口配置如下:CoAP资源使用UDP端口5683,CoAPS资源使用UDP端口5684。所述第一参数“ex”参数值可以是false,则CoAP资源的端点信息和CoAPS资源的端点信息可以表示为:(”eps”:[{"ep":"coap://IP:5683"},{"ep":"coaps://IP:5684"}]):,即端口使用了默认端口5683和5684,且IP为第一服务端回应消息的IP地址。The default port configuration is as follows: CoAP resources use UDP port 5683, and CoAPS resources use UDP port 5684. The first parameter "ex" parameter value can be false, then the endpoint information of the CoAP resource and the endpoint information of the CoAPS resource can be expressed as: ("eps":[{"ep":"coap://IP:5683" },{"ep":"coaps://IP:5684"}]): That is, the port uses the default ports 5683 and 5684, and the IP is the IP address of the first server's response message.
可见,本示例中,针对第一服务端承载的所有资源都使用默认端口(CoAP资源使用UDP端口5683,CoAPS资源使用UDP端口5684)的情况,服务端返回的"/oic/res"中”ex”参数值为false,从而明确指示无需进一步获取端点信息资源,终端根据默认端口的端口号以及第一服务端回应消息的IP地址可以准确确定第一服务端承载的资源的端点信息。It can be seen that, in this example, for all resources carried by the first server use the default port (CoAP resources use UDP port 5683, CoAPS resources use UDP port 5684), the server returns "/oic/res" in "ex" The parameter value is false, which clearly indicates that there is no need to obtain further endpoint information resources. The terminal can accurately determine the endpoint information of the resources carried by the first server according to the port number of the default port and the IP address of the first server's response message.
在本可能的实例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In this possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
其中,所述第二参数为“eps”参数,所述除第二参数之外的参数例如可以是“rt”参数、“if”参数等。Wherein, the second parameter is an "eps" parameter, and the parameters other than the second parameter may be, for example, an "rt" parameter, an "if" parameter, and so on.
可见,本示例中,针对所有资源都适用默认端口(CoAP资源使用UDP端口5683,CoAPS资源使用UDP端口5684)的情况,服务端返回的"/oic/res"中”ex”参数值为false,从而明确指示无需进一步获取端点信息资源,终端根据默认端口的端口号以及第一服务端回应消息的IP地址可以准确确定第一服务端承载的资源的端点信息。It can be seen that in this example, the default port is used for all resources (CoAP resources use UDP port 5683, CoAPS resources use UDP port 5684), the value of the "ex" parameter in "/oic/res" returned by the server is false, Therefore, it is clearly indicated that there is no need to further obtain the endpoint information resource, and the terminal can accurately determine the endpoint information of the resource carried by the first server according to the port number of the default port and the IP address of the first server's response message.
在本可能的实例中,所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。In this possible example, the resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
其中,第二参数eps的作用是:在所有CoAP资源使用的端口都一样(记为端口A)并且所有CoAPS资源资源使用的端口都一样(记为端口B)的情况下,明确告知客户端这两个端点信息,主要适用A和/或B不是默认端口的情况,当然,A和/或B是默认端口的情况也可以用(只是有冗余而已)。Among them, the function of the second parameter eps is: when all CoAP resources use the same port (denoted as port A) and all CoAPS resource resources use the same port (denoted as port B), the client is clearly informed of this The two endpoint information is mainly applicable when A and/or B are not the default ports. Of course, it can also be used when A and/or B are the default ports (only redundant).
可见,本示例中,针对所有资源都适用默认端口(CoAP资源使用UDP端口5683,CoAPS资源使用UDP端口5684)的情况,服务端返回的"/oic/res"中”ex”参数值为false,从而明确指示无需进一步获取端点信息资源,终端可以确定第一服务端承载的资源的端点信息为第二参数“eps”所指示的端点信息。It can be seen that in this example, the default port is used for all resources (CoAP resources use UDP port 5683, CoAPS resources use UDP port 5684), the value of the "ex" parameter in "/oic/res" returned by the server is false, Therefore, it is clearly indicated that there is no need to further obtain the endpoint information resource, and the terminal can determine that the endpoint information of the resource carried by the first server is the endpoint information indicated by the second parameter "eps".
在一个可能的实例中,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一 参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
其中,所述第一参数的值可以是false,用于指示无需进一步获取所述端点信息资源。Wherein, the value of the first parameter may be false, which is used to indicate that there is no need to further obtain the endpoint information resource.
其中,所述第一服务端承载的资源均使用除默认端口之外的相同端口具体是指:Wherein, that the resources carried by the first server all use the same port except the default port specifically refers to:
(1)第一服务端承载的资源包括CoAP资源和CoAPS资源,且CoAP资源使用的端口为A,CoAPS资源使用的端口为B。A和B二者至少有一个不是默认端口。此种情况CoAP资源的端点信息中的端口为端口A,CoAPS资源的端点信息中的端口为端口B(1) The resources carried by the first server include CoAP resources and CoAPS resources, and the port used by the CoAP resource is A, and the port used by the CoAPS resource is B. At least one of A and B is not the default port. In this case, the port in the endpoint information of the CoAP resource is port A, and the port in the endpoint information of the CoAPS resource is port B
(2)第一服务端承载的资源仅包括CoAP资源,且CoAP资源使用的端口为A,则CoAP资源的端点信息中的端口为端口A。(2) The resources carried by the first server only include CoAP resources, and the port used by the CoAP resource is A, then the port in the endpoint information of the CoAP resource is port A.
(3)第一服务端承载的资源仅包括CoAPS资源,且CoAPS资源使用的端口为B,则CoAPS资源的端点信息中的端口为端口B。(3) The resources carried by the first server only include CoAPS resources, and the port used by the CoAPS resource is B, then the port in the endpoint information of the CoAPS resource is port B.
可见,本示例中,针对第一服务端承载的所有资源均使用除默认端口之外的相同端口的情况,"/oic/res"中”ex”参数值设置为false,从而明确指示无需进一步获取端点信息资源,终端可以确定第一服务端承载的资源的端点信息为“eps”参数里写的端点信息。It can be seen that in this example, for the case where all resources carried by the first server use the same port except the default port, the "ex" parameter value in "/oic/res" is set to false, which clearly indicates that no further acquisition is required Endpoint information resource. The terminal can determine that the endpoint information of the resource carried by the first server is the endpoint information written in the "eps" parameter.
在本可能的实例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。In this possible example, the resource attribute of the first resource information further includes a second parameter, the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and the second parameter uses all Describe the endpoint information of the same port.
其中,如图2B所示,所述第二参数可以是“eps”参数,“eps”参数用于指示CoAP资源使用UDP端口44444,以及指示CoAPS资源使用UDP端口11111。Wherein, as shown in FIG. 2B, the second parameter may be an "eps" parameter, and the "eps" parameter is used to indicate that CoAP resources use UDP port 44444 and that CoAPS resources use UDP port 11111.
可见,本示例中,通过第二参数“eps”参数明确指示当前资源的端点信息为/oic/res资源自身所在的端点的端点信息,即相同端口的端点信息,实现针对任意类型资源的明确指示。It can be seen that in this example, the second parameter "eps" clearly indicates that the endpoint information of the current resource is the endpoint information of the endpoint where the /oic/res resource itself is located, that is, the endpoint information of the same port, to achieve clear instructions for any type of resource .
在一个可能的实例中,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。In a possible example, the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
其中,所述第一参数“ex”参数值可以为true。Wherein, the parameter value of the first parameter "ex" may be true.
可见,本示例中,针对第一服务端承载的资源未使用相同端口即使用多个不同端点的情况,第一参数用于指示需要进一步获取所述端点信息资源,从而第一资源信息的每个Link无需再当前信息中进行端点信息的指示,可以减少/oic/res中的数据冗余。It can be seen that in this example, for the case where the resources carried by the first server do not use the same port, that is, multiple different endpoints are used, the first parameter is used to indicate that the endpoint information resource needs to be further obtained, so that each of the first resource information Link does not need to indicate the endpoint information in the current information, which can reduce the data redundancy in /oic/res.
在本可能的实例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In this possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
其中,所述除第二参数”eps”参数之外的参数可以是“rt”参数、“if”参数等。Wherein, the parameters other than the second parameter "eps" parameter may be "rt" parameters, "if" parameters, and so on.
在本可能的实例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;In this possible example, the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
所述客户端接收来自第一服务端的第一资源信息之后,所述方法还包括:所述客户端向所述第一服务端的第一端口发送单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;所述客户端接收来自所述第一服务端的第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。After the client receives the first resource information from the first server, the method further includes: the client sends a unicast request to the first port of the first server, where the unicast request includes a second URI , The CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; the client receives from The second resource information of the first server, where the second resource information includes endpoint information of the resource carried by the first server.
对应的,所述第一服务端向所述客户端发送第一资源信息之后,所述方法还包括:所述第一服务端的第一端口接收来自所述客户端的单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;所述第一服务端向所述客户端发送第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。Correspondingly, after the first server sends the first resource information to the client, the method further includes: the first port of the first server receives a unicast request from the client, and the unicast The request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; The first server sends second resource information to the client, where the second resource information includes endpoint information of the resource carried by the first server.
其中,所述第二参数“eps”具体用于指示所述/oic/res资源自身所在的端点,从而约束/oic/res资源所在的端口也即/oic/eps资源所在的端口。The second parameter "eps" is specifically used to indicate the endpoint where the /oic/res resource itself is located, thereby restricting the port where the /oic/res resource is located, that is, the port where the /oic/eps resource is located.
举例来说,所述端点信息资源的示例如图2C所示,资源属性部分包括以下参数:“rt”、“if”、“eps”,每个Link参数包括以下参数:“ep”、“hrefs”。For example, an example of the endpoint information resource is shown in Figure 2C, the resource attribute part includes the following parameters: "rt", "if", "eps", and each Link parameter includes the following parameters: "ep", "hrefs" ".
可见,本示例中,针对第一服务端承载的资源未使用相同端口即使用多个不同端点的情况,第一 参数用于指示需要进一步获取所述端点信息资源,从而第一资源信息的每个Link无需再当前信息中进行端点信息的指示,可以减少/oic/res中的数据冗余。It can be seen that in this example, for the case where the resources carried by the first server do not use the same port, that is, multiple different endpoints are used, the first parameter is used to indicate that the endpoint information resource needs to be further obtained, so that each of the first resource information Link does not need to indicate the endpoint information in the current information, which can reduce the data redundancy in /oic/res.
此外,本申请还提出如下方案:In addition, this application also proposes the following solutions:
所述第一资源信息的资源属性还可以包括可选的第一参数“ex”,当不包括所述第一参数(“ex”参数)和第二参数(”eps”参数)时,所述第一服务端承载的资源均使用默认端口。The resource attribute of the first resource information may also include an optional first parameter "ex". When the first parameter ("ex" parameter) and the second parameter ("eps" parameter) are not included, the The resources carried by the first server all use the default port.
进一步地,还可以不增加端点信息资源/oic/eps资源,只是明确隐式发现中CoAPS资源使用默认端口5684,若/oic/res中只有一个Link包含“eps”参数时,则其他Link参数的端点信息可以不参照隐式发现并默认跟该Link参数的一样,如此可以解决CoAPS资源端口的不确定性。总体思想是:第一资源信息中若只包含了一个资源的端点信息,则第一服务端承载的其他资源均跟该包含端点信息的资源采用相同端点信息。第一资源信息中若不包含任何端点信息,则第一服务端承载的所有资源均使用默认的端点信息。Further, the endpoint information resource /oic/eps resource may not be added, but the default port 5684 is used for the CoAPS resource in the explicit implicit discovery. If only one Link in /oic/res contains the "eps" parameter, the other Link parameters The endpoint information may not refer to the implicit discovery and is the same as the Link parameter by default, so that the uncertainty of the CoAPS resource port can be resolved. The overall idea is: if the first resource information only contains the endpoint information of one resource, the other resources carried by the first server all use the same endpoint information as the resource containing the endpoint information. If the first resource information does not contain any endpoint information, all resources carried by the first server use the default endpoint information.
与上述图2A所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种客户端300的结构示意图,如图所示,所述客户端300包括处理器310、存储器320、通信接口330以及一个或多个程序321,其中,所述一个或多个程序321被存储在上述存储器320中,并且被配置由上述处理器310执行,所述一个或多个程序321包括用于执行如下操作的指令。Consistent with the embodiment shown in FIG. 2A, please refer to FIG. 3. FIG. 3 is a schematic structural diagram of a client 300 provided in an embodiment of the present application. As shown in the figure, the client 300 includes a processor 310, The memory 320, the communication interface 330, and one or more programs 321, wherein the one or more programs 321 are stored in the above-mentioned memory 320 and are configured to be executed by the above-mentioned processor 310, and the one or more programs 321 Include instructions for performing the following operations.
发送多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Send a multicast request, where the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource; and receiving the first resource from the first server Information, the OCF resource reference Link parameter of the first resource information indicates the resource carried by the first server in the form of a Links array, and each Link parameter in the Links array corresponds to a resource; wherein, the first resource information The resource attribute of the includes a first parameter, the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource, the endpoint information resource is used to indicate the endpoint information of the resource carried by the first server, the endpoint information resource Same as the endpoint where the /oic/res resource is located.
可以看出,本申请实施例中,客户端发送多播请求,第一服务端接收该多播请求,并向客户端发送第一资源信息,其中,多播请求包括第一URI,第一URI对应的CoAP资源为/oic/res资源,第一资源信息的OCF Link参数以Links数组方式指示第一服务端承载的资源,Links数组中每个Link参数对应一个资源,由于第一服务端承载的资源包括CoAP资源和/或CoAPS资源,第一资源信息的资源属性包括第一参数,第一参数用于指示是否需要进一步获取端点信息资源,端点信息资源用于指示第一服务端承载的资源的端点信息,端点信息资源与/oic/res资源所在的端点相同,因此第一参数能够明确指示CoAPS资源的端点信息,解决对于CoAPS资源的端点信息的不确定性问题,从而实现对于任意资源的端点信息的确定问题。It can be seen that, in this embodiment of the application, the client sends a multicast request, the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI The corresponding CoAP resource is the /oic/res resource. The OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource. The resource includes CoAP resources and/or CoAPS resources. The resource attribute of the first resource information includes a first parameter. The first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource. The endpoint information resource is used to indicate the value of the resource carried by the first server. The endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
在一个可能的示例中,所述端点信息资源的预定义的资源URI为/oic/eps;In a possible example, the predefined resource URI of the endpoint information resource is /oic/eps;
所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
在一个可能的示例中,所述端点信息资源的资源属性还包括以下至少一种:In a possible example, the resource attribute of the endpoint information resource further includes at least one of the following:
所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
在一个可能的示例中,所述每个Link参数仅包括除第二参数之外的OCF Link参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
在一个可能的示例中,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。In a possible example, the resource attribute of the first resource information further includes a second parameter, the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and the second parameter uses the Describe the endpoint information of the same port.
在一个可能的示例中,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。In a possible example, the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;In a possible example, the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
所述程序321还包括用于执行以下操作的指令:所述接收来自第一服务端的第一资源信息之后,向所述第一服务端的第一端口发送单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;以及接收来自所述第一服务端的第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。The program 321 also includes instructions for performing the following operations: after receiving the first resource information from the first server, sending a unicast request to the first port of the first server, the unicast request including the first port Two URI, the CoAP resource corresponding to the second URI is the endpoint information resource, the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; The second resource information of the first server, where the second resource information includes endpoint information of the resource carried by the first server.
请参阅图4,图4是本申请实施例提供的一种服务端400的结构示意图,如图所示,所述服务端400包括处理器410、存储器420、通信接口430以及一个或多个程序421,其中,所述一个或多个程序421被存储在上述存储器420中,并且被配置由上述处理器410执行,所述一个或多个程序421包括用于执行如下操作的指令。Please refer to FIG. 4, which is a schematic structural diagram of a server 400 provided by an embodiment of the present application. As shown in the figure, the server 400 includes a processor 410, a memory 420, a communication interface 430, and one or more programs. 421, wherein the one or more programs 421 are stored in the foregoing memory 420 and configured to be executed by the foregoing processor 410, and the one or more programs 421 include instructions for performing the following operations.
接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;以及其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Receiving a multicast request from a client, the multicast request including a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource; and sending to the client First resource information, the OCF resource reference Link parameter of the first resource information indicates the resource carried by the first server in the form of a Links array, and each Link parameter in the Links array corresponds to one resource; and wherein, the The resource attribute of the first resource information includes a first parameter, the first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource, the endpoint information resource is used to indicate the endpoint information of the resource carried by the first server, and The endpoint information resource is the same as the endpoint where the /oic/res resource is located.
可以看出,本申请实施例中,客户端发送多播请求,第一服务端接收该多播请求,并向客户端发送第一资源信息,其中,多播请求包括第一URI,第一URI对应的CoAP资源为/oic/res资源,第一资源信息的OCF Link参数以Links数组方式指示第一服务端承载的资源,Links数组中每个Link参数对应一个资源,由于第一服务端承载的资源包括CoAP资源和/或CoAPS资源,第一资源信息的资源属性包括第一参数,第一参数用于指示是否需要进一步获取端点信息资源,端点信息资源用于指示第一服务端承载的资源的端点信息,端点信息资源与/oic/res资源所在的端点相同,因此第一参数能够明确指示CoAPS资源的端点信息,解决对于CoAPS资源的端点信息的不确定性问题,从而实现对于任意资源的端点信息的确定问题。It can be seen that, in this embodiment of the application, the client sends a multicast request, the first server receives the multicast request, and sends the first resource information to the client, where the multicast request includes the first URI, and the first URI The corresponding CoAP resource is the /oic/res resource. The OCF Link parameter of the first resource information indicates the resource carried by the first server in the form of Links array. Each Link parameter in the Links array corresponds to a resource. The resource includes CoAP resources and/or CoAPS resources. The resource attribute of the first resource information includes a first parameter. The first parameter is used to indicate whether it is necessary to further obtain the endpoint information resource. The endpoint information resource is used to indicate the value of the resource carried by the first server. The endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located, so the first parameter can clearly indicate the endpoint information of the CoAPS resource, solve the uncertainty problem of the endpoint information of the CoAPS resource, and realize the endpoint for any resource The problem of determining information.
在一个可能的示例中,所述端点信息资源的预定义的资源URI为/oic/eps;In a possible example, the predefined resource URI of the endpoint information resource is /oic/eps;
所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
在一个可能的示例中,所述端点信息资源的资源属性还包括以下至少一种:In a possible example, the resource attribute of the endpoint information resource further includes at least one of the following:
所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
在一个可能的示例中,所述每个Link参数仅包括除第二参数之外的OCF Link参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
在一个可能的示例中,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。In a possible example, the resource attribute of the first resource information further includes a second parameter, the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and the second parameter uses the Describe the endpoint information of the same port.
在一个可能的示例中,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。In a possible example, the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;In a possible example, the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
所述程序421还包括用于执行以下操作的指令:所述向所述客户端发送第一资源信息之后,由第一端口接收来自所述客户端的单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;以及向所述客户端发送第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。The program 421 also includes instructions for performing the following operations: after the first resource information is sent to the client, the first port receives a unicast request from the client, and the unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; and to the client The terminal sends second resource information, where the second resource information includes endpoint information of the resource carried by the first server.
上述主要从各个网元之间交互的角度对本申请实施例的方案进行了介绍。可以理解的是,终端为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solution of the embodiment of the present application from the perspective of interaction between various network elements. It can be understood that, in order to implement the above-mentioned functions, the terminal includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对终端进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the terminal into functional units according to the foregoing method examples. For example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software program modules. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
在采用集成的单元的情况下,图5示出了上述实施例中所涉及的消息端点发现装置的一种可能的功能单元组成框图。消息端点发现装置500应用于终端,具体包括:处理单元502和通信单元503。处理单元502用于对终端的动作进行控制管理,例如,处理单元502用于支持终端执行本文所描述的技术的过程。通信单元503用于支持终端与其他设备的通信。终端还可以包括存储单元501,用于存储终端的程序代码和数据。In the case of using an integrated unit, FIG. 5 shows a block diagram of a possible functional unit composition of the message endpoint discovery apparatus involved in the foregoing embodiment. The message endpoint discovery device 500 is applied to a terminal and specifically includes a processing unit 502 and a communication unit 503. The processing unit 502 is used to control and manage the actions of the terminal. For example, the processing unit 502 is used to support the terminal to perform the process of the technology described herein. The communication unit 503 is used to support communication between the terminal and other devices. The terminal may also include a storage unit 501 for storing program codes and data of the terminal.
其中,处理单元502可以是处理器或控制器,例如可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信单元503可以是通信接口、收发器、收发电路等,存储单元501可以是存储器。当处理单元502为处理器,通信单元503为通信接口,存储单元501为存储器时,本申请实施例所涉及的终端可以为图3所示的终端。The processing unit 502 may be a processor or a controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), and an application-specific integrated circuit (Application-Specific Integrated Circuit). Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination for realizing computing functions, for example, including a combination of one or more microprocessors, a combination of DSP and microprocessor, and so on. The communication unit 503 may be a communication interface, a transceiver, a transceiving circuit, etc., and the storage unit 501 may be a memory. When the processing unit 502 is a processor, the communication unit 503 is a communication interface, and the storage unit 501 is a memory, the terminal involved in the embodiment of the present application may be the terminal shown in FIG. 3.
具体实现时,所述处理单元502用于执行如上述方法实施例中由终端执行的任一步骤,且在执行诸如发送等数据传输时,可选择的调用所述通信单元503来完成相应操作。下面进行详细说明。In specific implementation, the processing unit 502 is configured to perform any step performed by the terminal in the foregoing method embodiment, and when performing data transmission such as sending, the communication unit 503 can be optionally invoked to complete the corresponding operation. The detailed description will be given below.
所述处理单元502,用于通过所述通信单元503发送多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及通过所述通信单元503 接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The processing unit 502 is configured to send a multicast request through the communication unit 503, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic /res resource; and receiving the first resource information from the first server through the communication unit 503, the OCF resource of the first resource information refers to the Link parameter and indicates the resource carried by the first server in the form of Links array, so Each Link parameter in the Links array corresponds to a resource;
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
在一个可能的示例中,所述端点信息资源的预定义的资源URI为/oic/eps;In a possible example, the predefined resource URI of the endpoint information resource is /oic/eps;
所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
在一个可能的示例中,所述端点信息资源的资源属性还包括以下至少一种:In a possible example, the resource attribute of the endpoint information resource further includes at least one of the following:
所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
在一个可能的示例中,所述每个Link参数仅包括除第二参数之外的OCF Link参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
在一个可能的示例中,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。In a possible example, the resource attribute of the first resource information further includes a second parameter, the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and the second parameter uses the Describe the endpoint information of the same port.
在一个可能的示例中,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。In a possible example, the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;In a possible example, the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
所述处理单元502通过所述通信单元503接收来自第一服务端的第一资源信息之后,还用于:通过所述通信单元503向所述第一服务端的第一端口发送单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;以及通过所述通信单元503接收来自所述第一服务端的第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。After the processing unit 502 receives the first resource information from the first server through the communication unit 503, it is further configured to: send a unicast request to the first port of the first server through the communication unit 503, The unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located And receiving second resource information from the first server through the communication unit 503, where the second resource information includes endpoint information of the resource carried by the first server.
在采用集成的单元的情况下,图6示出了上述实施例中所涉及的消息端点发现装置的一种可能的功能单元组成框图。消息端点发现装置600应用于网络设备,该网络设备包括:处理单元602和通信单元603。处理单元602用于对网络设备的动作进行控制管理,例如,处理单元502用于支持网络设备执行本文所描述的技术的过程。通信单元603用于支持网络设备与其他设备的通信。网络设备还可以包括存储单元601,用于存储终端的程序代码和数据。In the case of using an integrated unit, FIG. 6 shows a block diagram of a possible functional unit composition of the message endpoint discovery apparatus involved in the foregoing embodiment. The message endpoint discovery apparatus 600 is applied to a network device, and the network device includes a processing unit 602 and a communication unit 603. The processing unit 602 is used to control and manage the actions of the network device. For example, the processing unit 502 is used to support the process of the network device to perform the technology described herein. The communication unit 603 is used to support communication between the network device and other devices. The network device may also include a storage unit 601 for storing program codes and data of the terminal.
其中,处理单元602可以是处理器或控制器,例如可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC),现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描 述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信单元603可以是通信接口、收发器、收发电路等,存储单元601可以是存储器。当处理单元602为处理器,通信单元603为通信接口,存储单元601为存储器时,本申请实施例所涉及的终端可以为图4所示的网络设备。The processing unit 602 may be a processor or a controller, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), and an application-specific integrated circuit (Application-Specific Integrated Circuit). Integrated Circuit, ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination for realizing computing functions, for example, including a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on. The communication unit 603 may be a communication interface, a transceiver, a transceiver circuit, etc., and the storage unit 601 may be a memory. When the processing unit 602 is a processor, the communication unit 603 is a communication interface, and the storage unit 601 is a memory, the terminal involved in the embodiment of the present application may be the network device shown in FIG. 4.
所述处理单元602用于通过所述通信单元603接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及通过所述通信单元603向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The processing unit 602 is configured to receive a multicast request from a client through the communication unit 603, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic/res resources; and sending first resource information to the client through the communication unit 603, the OCF resource of the first resource information refers to the Link parameter and indicates the resources carried by the first server in the form of an array of Links , Each Link parameter in the Links array corresponds to a resource;
其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
在一个可能的示例中,所述端点信息资源的预定义的资源URI为/oic/eps;In a possible example, the predefined resource URI of the endpoint information resource is /oic/eps;
所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
在一个可能的示例中,所述端点信息资源的资源属性还包括以下至少一种:In a possible example, the resource attribute of the endpoint information resource further includes at least one of the following:
所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
在一个可能的示例中,所述每个Link参数仅包括除第二参数之外的OCF Link参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, each Link parameter includes only OCF Link parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located; or,
所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
在一个可能的示例中,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。In a possible example, the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。In a possible example, the resource attribute of the first resource information further includes a second parameter, the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and the second parameter uses the Describe the endpoint information of the same port.
在一个可能的示例中,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。In a possible example, the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
在一个可能的示例中,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。In a possible example, the resource attribute of the first resource information only includes parameters other than the second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located.
在一个可能的示例中,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;In a possible example, the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
所述处理单元602通过所述通信单元603向所述客户端发送第一资源信息之后,还用于:通过所述通信单元603由本端的第一端口接收来自所述客户端的单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;以及通过所述通信单元603向所述客户端发送第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。After the processing unit 602 sends the first resource information to the client through the communication unit 603, it is further configured to: receive a unicast request from the client through the first port of the local terminal through the communication unit 603, and The unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located And sending second resource information to the client through the communication unit 603, the second resource information including the endpoint information of the resource carried by the first server.
可以理解的是,由于方法实施例与装置实施例为相同技术构思的不同呈现形式,因此,本申请中方法实施例部分的内容应同步适配于装置实施例部分,此处不再赘述。It is understandable that since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the method embodiment part of this application should be synchronized to the device embodiment part, and will not be repeated here.
本申请实施例还提供了一种芯片,其中,该芯片包括处理器,用于从存储器中调用并运行计算机 程序,使得安装有所述芯片的设备执行如上述方法实施例中终端所描述的部分或全部步骤。The embodiment of the present application also provides a chip, wherein the chip includes a processor, which is used to call and run a computer program from the memory, so that the device installed with the chip executes the part described in the terminal in the above method embodiment Or all steps.
本申请实施例还提供了一种计算机可读存储介质,其中,所述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如上述方法实施例中终端所描述的部分或全部步骤。The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the terminal in the above method embodiment Some or all of the steps described.
本申请实施例还提供了一种计算机可读存储介质,其中,所述计算机可读存储介质存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如上述方法实施例中网络侧设备所描述的部分或全部步骤。The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program causes the computer to execute the network in the above-mentioned method embodiment. Part or all of the steps described by the side device.
本申请实施例还提供了一种计算机程序产品,其中,所述计算机程序产品包括计算机程序,所述计算机程序可操作来使计算机执行如上述方法实施例中终端所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。The embodiments of the present application also provide a computer program product, wherein the computer program product includes a computer program, and the computer program is operable to make a computer execute part or all of the steps described in the terminal in the above method embodiment. The computer program product may be a software installation package.
本申请实施例所描述的方法或者算法的步骤可以以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于接入网设备、目标网络设备或核心网设备中。当然,处理器和存储介质也可以作为分立组件存在于接入网设备、目标网络设备或核心网设备中。The steps of the method or algorithm described in the embodiments of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, which can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read Only Memory, ROM), and erasable programmable read-only memory ( Erasable Programmable ROM (EPROM), Electrically Erasable Programmable Read-Only Memory (Electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in the ASIC. In addition, the ASIC may be located in an access network device, a target network device, or a core network device. Of course, the processor and the storage medium may also exist as discrete components in the access network device, the target network device, or the core network device.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(Digital Video Disc,DVD))、或者半导体介质(例如,固态硬盘(Solid State Disk,SSD))等。Those skilled in the art should be aware that, in one or more of the foregoing examples, the functions described in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a Digital Video Disc (DVD)), or a semiconductor medium (for example, a Solid State Disk (SSD)) )Wait.
以上所述的具体实施方式,对本申请实施例的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请实施例的具体实施方式而已,并不用于限定本申请实施例的保护范围,凡在本申请实施例的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请实施例的保护范围之内。The specific implementations described above further describe the purpose, technical solutions, and beneficial effects of the embodiments of the present application in further detail. It should be understood that the foregoing descriptions are only specific implementations of the embodiments of the present application, and are not used for To limit the protection scope of the embodiments of the present application, any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.

Claims (49)

  1. 一种消息端点发现方法,其特征在于,包括:A method for discovering message endpoints, which is characterized in that it comprises:
    客户端发送多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;The client sends a multicast request, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource;
    所述客户端接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The client receives the first resource information from the first server, and the OCF resource of the first resource information refers to the Link parameter indicating the resource carried by the first server in the form of Links array. Each Link in the Links array The parameter corresponds to a resource;
    其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  2. 根据权利要求1所述的方法,其特征在于,所述端点信息资源的预定义的资源URI为/oic/eps;The method according to claim 1, wherein the predefined resource URI of the endpoint information resource is /oic/eps;
    所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
    所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
    所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
    所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
  3. 根据权利要求1所述的方法,其特征在于,所述端点信息资源的资源属性还包括以下至少一种:The method according to claim 1, wherein the resource attribute of the endpoint information resource further comprises at least one of the following:
    所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
  4. 根据权利要求1所述的方法,其特征在于,所述每个Link参数仅包括除第二参数之外的OCF Link参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The method according to claim 1, wherein each Link parameter only includes OCF Link parameters other than a second parameter, and the second parameter is used to indicate where the /oic/res resource itself is located. Endpoint.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The method according to any one of claims 1 to 4, wherein the resources carried by the first server all use default ports; the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  6. 根据权利要求5所述的方法,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,The method according to claim 5, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate the location of the /oic/res resource itself The endpoint; or,
    所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  7. 根据权利要求1-4任一项所述的方法,其特征在于,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The method according to any one of claims 1-4, wherein the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain all the resources. The endpoint information resource.
  8. 根据权利要求7所述的方法,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。The method according to claim 7, wherein the resource attribute of the first resource information further includes a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and The second parameter uses the endpoint information of the same port.
  9. 根据权利要求1-4任一项所述的方法,其特征在于,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。The method according to any one of claims 1 to 4, wherein the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  10. 根据权利要求9所述的方法,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The method according to claim 9, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate the location of the /oic/res resource itself Of the endpoint.
  11. 根据权利要求9所述的方法,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;The method according to claim 9, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
    所述客户端接收来自第一服务端的第一资源信息之后,所述方法还包括:After the client receives the first resource information from the first server, the method further includes:
    所述客户端向所述第一服务端的第一端口发送单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;The client sends a unicast request to the first port of the first server, the unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port Is the port indicated by the second parameter, that is, the port where the endpoint information resource is located;
    所述客户端接收来自所述第一服务端的第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。The client receives second resource information from the first server, where the second resource information includes endpoint information of the resource carried by the first server.
  12. 一种消息端点发现方法,其特征在于,包括:A method for discovering message endpoints, which is characterized in that it comprises:
    第一服务端接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;The first server receives a multicast request from the client, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is the /oic/res resource;
    所述第一服务端向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The first server sends first resource information to the client, and the OCF resource of the first resource information refers to the Link parameter to indicate the resource carried by the first server in the form of an array of Links, and each link in the array of Links Each Link parameter corresponds to one resource;
    其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  13. 根据权利要求12所述的方法,其特征在于,所述端点信息资源的预定义的资源URI为/oic/eps;The method according to claim 12, wherein the predefined resource URI of the endpoint information resource is /oic/eps;
    所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
    所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
    所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
    所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
  14. 根据权利要求12所述的方法,其特征在于,所述端点信息资源的资源属性还包括以下至少一种:The method according to claim 12, wherein the resource attribute of the endpoint information resource further comprises at least one of the following:
    所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
  15. 根据权利要求12所述的方法,其特征在于,所述每个Link参数仅包括除第二参数之外的OCFLink参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The method according to claim 12, wherein each Link parameter only includes OCFLink parameters other than a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located. .
  16. 根据权利要求12-15任一项所述的方法,其特征在于,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The method according to any one of claims 12-15, wherein the resources carried by the first server all use default ports; and the first parameter is used to indicate that there is no need to further obtain the endpoint information resource.
  17. 根据权利要求16所述的方法,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,The method according to claim 16, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate the location of the /oic/res resource itself. The endpoint; or,
    所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  18. 根据权利要求12-15任一项所述的方法,其特征在于,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The method according to any one of claims 12-15, wherein the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain all the resources. The endpoint information resource.
  19. 根据权利要求18所述的方法,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。The method according to claim 18, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and The second parameter uses the endpoint information of the same port.
  20. 根据权利要求12-15任一项所述的方法,其特征在于,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。The method according to any one of claims 12-15, wherein the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  21. 根据权利要求20所述的方法,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The method according to claim 20, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate the location of the /oic/res resource itself Of the endpoint.
  22. 根据权利要求20所述的方法,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;The method according to claim 20, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
    所述第一服务端向所述客户端发送第一资源信息之后,所述方法还包括:After the first server sends the first resource information to the client, the method further includes:
    所述第一服务端的第一端口接收来自所述客户端的单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;The first port of the first server receives a unicast request from the client, the unicast request includes a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port Is the port indicated by the second parameter, that is, the port where the endpoint information resource is located;
    所述第一服务端向所述客户端发送第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。The first server sends second resource information to the client, where the second resource information includes endpoint information of the resource carried by the first server.
  23. 一种消息端点发现装置,其特征在于,应用于客户端,所述装置包括处理单元和通信单元,其中,A message endpoint discovery device is characterized in that it is applied to a client, the device includes a processing unit and a communication unit, wherein:
    所述处理单元,用于通过所述通信单元发送多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及通过所述通信单元接收来自第一服务端的第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The processing unit is configured to send a multicast request through the communication unit, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is /oic/res Resources; and receiving first resource information from the first server through the communication unit, the OCF resource of the first resource information references the Link parameter to indicate the resources carried by the first server in the form of an array of Links, the array of Links Each Link parameter corresponds to a resource;
    其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  24. 根据权利要求23所述的装置,其特征在于,所述端点信息资源的预定义的资源URI为/oic/eps;The device according to claim 23, wherein the predefined resource URI of the endpoint information resource is /oic/eps;
    所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
    所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
    所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
    所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
  25. 根据权利要求23所述的装置,其特征在于,所述端点信息资源的资源属性还包括以下至少一种:The device according to claim 23, wherein the resource attribute of the endpoint information resource further comprises at least one of the following:
    所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
  26. 根据权利要求23所述的装置,其特征在于,所述每个Link参数仅包括除第二参数之外的OCFLink参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The apparatus according to claim 23, wherein each Link parameter includes only OCFLink parameters except for a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located. .
  27. 根据权利要求23-26任一项所述的装置,其特征在于,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The device according to any one of claims 23-26, wherein the resources carried by the first server all use default ports; and the first parameter is used to indicate that no further acquisition of the endpoint information resource is required.
  28. 根据权利要求27所述的装置,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,The device according to claim 27, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate where the /oic/res resource itself is located. The endpoint; or,
    所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  29. 根据权利要求23-26任一项所述的装置,其特征在于,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The device according to any one of claims 23-26, wherein the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain all the resources. The endpoint information resource.
  30. 根据权利要求29所述的装置,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。The device according to claim 29, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and The second parameter uses the endpoint information of the same port.
  31. 根据权利要求23-26任一项所述的装置,其特征在于,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。The device according to any one of claims 23-26, wherein the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  32. 根据权利要求31所述的装置,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The device according to claim 31, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate where the /oic/res resource itself is located. Of the endpoint.
  33. 根据权利要求31所述的装置,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;The device according to claim 31, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
    所述处理单元通过所述通信单元接收来自第一服务端的第一资源信息之后,还用于:通过所述通信单元向所述第一服务端的第一端口发送单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;以及通过所述通信单元接收来自所述第一服务端的第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。After the processing unit receives the first resource information from the first server through the communication unit, it is further configured to: send a unicast request to the first port of the first server through the communication unit, the unicast request Including a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; and The communication unit receives second resource information from the first server, where the second resource information includes endpoint information of the resource carried by the first server.
  34. 一种消息端点发现装置,其特征在于,应用于第一服务端,所述装置包括处理单元和通信单元,其中,A message endpoint discovery device, characterized in that it is applied to a first server, the device includes a processing unit and a communication unit, wherein:
    所述处理单元,用于通过所述通信单元接收来自客户端的多播请求,所述多播请求包括第一统一资源标识符URI,所述第一URI对应的资源受限应用协议CoAP资源为/oic/res资源;以及通过所述通信单元向所述客户端发送第一资源信息,所述第一资源信息的OCF资源引用Link参数以Links数组方式指示所述第一服务端承载的资源,所述Links数组中每个Link参数对应一个资源;The processing unit is configured to receive a multicast request from a client through the communication unit, the multicast request includes a first uniform resource identifier URI, and the resource-constrained application protocol CoAP resource corresponding to the first URI is/ oic/res resources; and sending first resource information to the client through the communication unit, the OCF resource of the first resource information references the Link parameter to indicate the resources carried by the first server in the form of an array of Links, so Each Link parameter in the Links array corresponds to a resource;
    其中,所述第一资源信息的资源属性包括第一参数,所述第一参数用于指示是否需要进一步获取端点信息资源,所述端点信息资源用于指示所述第一服务端承载的资源的端点信息,所述端点信息资源与所述/oic/res资源所在的端点相同。Wherein, the resource attribute of the first resource information includes a first parameter, and the first parameter is used to indicate whether it is necessary to further obtain an endpoint information resource, and the endpoint information resource is used to indicate the status of the resource carried by the first server. Endpoint information, the endpoint information resource is the same as the endpoint where the /oic/res resource is located.
  35. 根据权利要求34所述的装置,其特征在于,所述端点信息资源的预定义的资源URI为/oic/eps;The device according to claim 34, wherein the predefined resource URI of the endpoint information resource is /oic/eps;
    所述端点信息资源的资源类型显示名称为Endpoint Info;The resource type display name of the endpoint information resource is Endpoint Info;
    所述端点信息资源的资源类型为oic.wk.eps;The resource type of the endpoint information resource is oic.wk.eps;
    所述端点信息资源支持的接口列表为oic.if.baseline;The interface list supported by the endpoint information resource is oic.if.baseline;
    所述端点信息资源的必选性为必选CM。The mandatory selection of the endpoint information resource is mandatory CM.
  36. 根据权利要求34所述的装置,其特征在于,所述端点信息资源的资源属性还包括以下至少一种:The device according to claim 34, wherein the resource attribute of the endpoint information resource further comprises at least one of the following:
    所述端点信息资源的资源类型rt、所述端点信息资源的接口列表if、所有端点信息列表eps、一个端点信息ep、端点上的所有资源的URI列表hrefs。The resource type rt of the endpoint information resource, the interface list if of the endpoint information resource, all the endpoint information lists eps, one endpoint information ep, and the URI lists hrefs of all resources on the endpoint.
  37. 根据权利要求34所述的装置,其特征在于,所述每个Link参数仅包括除第二参数之外的OCFLink参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The device according to claim 34, wherein each Link parameter only includes OCFLink parameters except for a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located. .
  38. 根据权利要求34-37任一项所述的装置,其特征在于,所述第一服务端承载的资源均使用默认端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The apparatus according to any one of claims 34-37, wherein the resources carried by the first server all use default ports; the first parameter is used to indicate that no further acquisition of the endpoint information resource is required.
  39. 根据权利要求38所述的装置,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;或者,The device according to claim 38, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate where the /oic/res resource itself is located. The endpoint; or,
    所述第一资源信息的资源属性还包括所述第二参数,且所述第二参数使用所述默认端口的端点信息。The resource attribute of the first resource information further includes the second parameter, and the second parameter uses the endpoint information of the default port.
  40. 根据权利要求34-37任一项所述的装置,其特征在于,所述第一服务端承载的资源均使用除默认端口之外的相同端口;所述第一参数用于指示无需进一步获取所述端点信息资源。The device according to any one of claims 34-37, wherein the resources carried by the first server all use the same port except the default port; the first parameter is used to indicate that there is no need to further obtain all the resources. The endpoint information resource.
  41. 根据权利要求40所述的装置,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点,且所述第二参数使用所述相同端口的端点信息。The device according to claim 40, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located, and The second parameter uses the endpoint information of the same port.
  42. 根据权利要求34-37任一项所述的装置,其特征在于,所述第一服务端承载的资源未使用相同端口;所述第一参数用于指示需要进一步获取所述端点信息资源。The device according to any one of claims 34-37, wherein the resources carried by the first server do not use the same port; the first parameter is used to indicate that the endpoint information resource needs to be further obtained.
  43. 根据权利要求42所述的装置,其特征在于,所述第一资源信息的资源属性仅包括除第二参数之外的参数,所述第二参数用于指示所述/oic/res资源自身所在的端点。The device according to claim 42, wherein the resource attribute of the first resource information only includes parameters other than a second parameter, and the second parameter is used to indicate where the /oic/res resource itself is located. Of the endpoint.
  44. 根据权利要求42所述的装置,其特征在于,所述第一资源信息的资源属性还包括第二参数,所述第二参数用于指示所述/oic/res资源自身所在的端点;The device according to claim 42, wherein the resource attribute of the first resource information further comprises a second parameter, and the second parameter is used to indicate the endpoint where the /oic/res resource itself is located;
    所述处理单元通过所述通信单元向所述客户端发送第一资源信息之后,还用于:通过所述通信单元由本端的第一端口接收来自所述客户端的单播请求,所述单播请求包括第二URI,所述第二URI对应的CoAP资源为所述端点信息资源,所述第一端口为所述第二参数所指示的端口,也即所述端点信息资源所在的端口;以及通过所述通信单元向所述客户端发送第二资源信息,所述第二资源信息包含所述第一服务端承载的资源的端点信息。After the processing unit sends the first resource information to the client through the communication unit, it is further configured to: receive a unicast request from the client through the first port of the local end through the communication unit, the unicast request Including a second URI, the CoAP resource corresponding to the second URI is the endpoint information resource, and the first port is the port indicated by the second parameter, that is, the port where the endpoint information resource is located; and The communication unit sends second resource information to the client, where the second resource information includes endpoint information of the resource carried by the first server.
  45. 一种客户端,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-11任一项所述的方法中的步骤的指令。A client is characterized by comprising a processor, a memory, a communication interface, and one or more programs, the one or more programs are stored in the memory and configured to be executed by the processor, The program includes instructions for performing the steps in the method according to any one of claims 1-11.
  46. 一种第一服务端,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求12-22任一项所述的方法中的步骤的指令。A first server, which is characterized by comprising a processor, a memory, a communication interface, and one or more programs, and the one or more programs are stored in the memory and configured by the processor Execution, the program includes instructions for executing the steps in the method according to any one of claims 12-22.
  47. 一种芯片,其特征在于,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求1-11或12-22中任一项所述的方法。A chip, characterized by comprising: a processor, used to call and run a computer program from the memory, so that the device installed with the chip executes the method described in any one of claims 1-11 or 12-22 method.
  48. 一种计算机可读存储介质,其特征在于,其存储用于电子数据交换的计算机程序,其中,所述计算机程序使得计算机执行如权利要求1-11或12-22中任一项所述的方法。A computer-readable storage medium, characterized in that it stores a computer program for electronic data exchange, wherein the computer program causes a computer to execute the method according to any one of claims 1-11 or 12-22 .
  49. 一种计算机程序,所述计算机程序使得计算机执行如权利要求1-11或12-22中任一项所述的方法。A computer program that causes a computer to execute the method according to any one of claims 1-11 or 12-22.
PCT/CN2020/073636 2020-01-21 2020-01-21 Message endpoint discovery method and related apparatus WO2021146960A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/073636 WO2021146960A1 (en) 2020-01-21 2020-01-21 Message endpoint discovery method and related apparatus
CN202080077882.5A CN114651423B (en) 2020-01-21 2020-01-21 Message endpoint discovery method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/073636 WO2021146960A1 (en) 2020-01-21 2020-01-21 Message endpoint discovery method and related apparatus

Publications (1)

Publication Number Publication Date
WO2021146960A1 true WO2021146960A1 (en) 2021-07-29

Family

ID=76992740

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/073636 WO2021146960A1 (en) 2020-01-21 2020-01-21 Message endpoint discovery method and related apparatus

Country Status (2)

Country Link
CN (1) CN114651423B (en)
WO (1) WO2021146960A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016048208A1 (en) * 2014-09-25 2016-03-31 Telefonaktiebolaget L M Ericsson (Publ) Device mobility with coap
WO2017044772A1 (en) * 2015-09-09 2017-03-16 Convida Wireless, Llc Methods for enabling context-aware coap messaging
WO2019040609A1 (en) * 2017-08-22 2019-02-28 Convida Wireless, Llc Overlay resource trees in a communications network
WO2019192722A1 (en) * 2018-04-06 2019-10-10 Telefonaktiebolaget Lm Ericsson (Publ) Thing description to resource directory mapping

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI20116301A (en) * 2011-12-21 2013-06-22 Sensinode Oy Method, device, and system for allocating resources
GB2529838B (en) * 2014-09-03 2021-06-30 Advanced Risc Mach Ltd Bootstrap Mechanism For Endpoint Devices
WO2017106450A1 (en) * 2015-12-15 2017-06-22 Convida Wireless, Llc Methods and nodes for enabling context-awareness in coap
KR102224379B1 (en) * 2016-10-07 2021-03-08 콘비다 와이어리스, 엘엘씨 Service layer resource management for general interoperability and scalability
CN110035058B (en) * 2019-02-28 2021-07-06 Oppo广东移动通信有限公司 Resource request method, device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016048208A1 (en) * 2014-09-25 2016-03-31 Telefonaktiebolaget L M Ericsson (Publ) Device mobility with coap
WO2017044772A1 (en) * 2015-09-09 2017-03-16 Convida Wireless, Llc Methods for enabling context-aware coap messaging
WO2019040609A1 (en) * 2017-08-22 2019-02-28 Convida Wireless, Llc Overlay resource trees in a communications network
WO2019192722A1 (en) * 2018-04-06 2019-10-10 Telefonaktiebolaget Lm Ericsson (Publ) Thing description to resource directory mapping

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
27 June 2014 (2014-06-27), Z. SHELBY K. HARTKE C. BORMANN UNIVERSITAET BREMEN TZI: "The Constrained Application Protocol (CoAP); rfc7252.txt", XP015100722, Database accession no. 7252 *
Z. SHELBY ARM M. KOSTER SMARTTHINGS C. BORMANN UNIVERSITAET BREMEN TZI P. VAN DER STOK CONSULTANT C. AMSUESS, ED.: "CoRE Resource Directory; draft-ietf-core-resource-directory-23.txt", CORE RESOURCE DIRECTORY; DRAFT-IETF-CORE-RESOURCE-DIRECTORY-23.TXT; INTERNET-DRAFT: CORE, INTERNET ENGINEERING TASK FORCE, IETF; STANDARDWORKINGDRAFT, INTERNET SOCIETY (ISOC) 4, RUE DES FALAISES CH- 1205 GENEVA, SWITZERLAND, no. 23, 8 July 2019 (2019-07-08), Internet Society (ISOC) 4, rue des Falaises CH- 1205 Geneva, Switzerland, pages 1 - 76, XP015134060 *
Z. SHELBY SENSINODE: "Constrained RESTful Environments (CoRE) Link Format; rfc6690.txt", 6690, 7 August 2012 (2012-08-07), XP015084143 *

Also Published As

Publication number Publication date
CN114651423B (en) 2023-07-28
CN114651423A (en) 2022-06-21

Similar Documents

Publication Publication Date Title
CN111601353B (en) Routing method of application program and related device
US20230171618A1 (en) Communication method and apparatus
WO2023011210A1 (en) Method and apparatus for acquiring edge service
WO2021243837A1 (en) Application data routing method based on ursp rule, and user equipment
US11516310B2 (en) Method and apparatus for invoking application programming interface
WO2011137792A1 (en) Method and apparatus for cooperation between push devices
WO2022032865A1 (en) Traffic descriptor transmission method and related device
US11317450B2 (en) Wireless communication method and network device
WO2020248582A1 (en) Methods and apparatuses for logical tsn bridge
US11310658B2 (en) Method and apparatus for determining status of terminal device, and device
WO2023011217A1 (en) Communication method and apparatus
WO2021212939A1 (en) Communication method, apparatus and system
WO2023124457A1 (en) Method and apparatus for selecting network
US20220006816A1 (en) Terminal management and control method, apparatus, and system
WO2022022322A1 (en) Method and device for accessing local network
WO2018214762A1 (en) Method and apparatus for acquiring paging parameter
WO2022027345A1 (en) Wireless communication method and device
WO2021163901A1 (en) Session processing method and apparatus therefor
WO2021146960A1 (en) Message endpoint discovery method and related apparatus
WO2021088007A1 (en) Wireless communication method, terminal device, and network device
JP2023539805A (en) How to search and register devices, network side devices
WO2020224582A1 (en) Network slice update method and device
WO2021179169A1 (en) Resource management method and apparatus, and readable storage medium
CN115209522B (en) Network function registration method, discovery method, device, equipment and medium
WO2021244622A1 (en) Communication method and apparatus, and computer-readable storage medium

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: 20915609

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: 20915609

Country of ref document: EP

Kind code of ref document: A1