WO2021012234A1 - Method for generating shadow device, device, and storage medium - Google Patents

Method for generating shadow device, device, and storage medium Download PDF

Info

Publication number
WO2021012234A1
WO2021012234A1 PCT/CN2019/097579 CN2019097579W WO2021012234A1 WO 2021012234 A1 WO2021012234 A1 WO 2021012234A1 CN 2019097579 W CN2019097579 W CN 2019097579W WO 2021012234 A1 WO2021012234 A1 WO 2021012234A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
server
server device
shadow
cloud server
Prior art date
Application number
PCT/CN2019/097579
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 CN201980092716.XA priority Critical patent/CN113454586A/en
Priority to PCT/CN2019/097579 priority patent/WO2021012234A1/en
Publication of WO2021012234A1 publication Critical patent/WO2021012234A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines

Definitions

  • the present invention relates to the field of information processing technology, in particular to a method, device and storage medium for generating shadow devices.
  • a shadow device is generated for the Open Connectivity Foundation (OCF) server device, and the shadow device communicates with the OCF client device remotely to improve communication processing efficiency.
  • OCF Open Connectivity Foundation
  • the process of generating the shadow device in the related technology is complicated; and the user's participation is required to complete the generation of the shadow device, which affects the function of the shadow device.
  • embodiments of the present invention provide a shadow device generation method, device, and storage medium, which can simplify the process of generating shadow devices and improve the functions of shadow devices.
  • an embodiment of the present invention provides a method for generating a shadow device, which includes: a server device sends a shadow device creation request message to a cloud server, and the shadow device creation request message is used to request the cloud server to generate the service The shadow device of the end device; the server device receives a shadow device creation request response message.
  • an embodiment of the present invention provides a method for generating a shadow device, including: a cloud server receives a shadow device creation request message sent by a server device;
  • the cloud server generates the shadow device of the server device based on the shadow device creation request message.
  • an embodiment of the present invention provides a method for generating a shadow device, which includes: a server device sends a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
  • the resource expression is used by the cloud server to generate the shadow device of the server device.
  • an embodiment of the present invention provides a method for generating a shadow device, including: a cloud server obtains a resource expression corresponding to a resource link, and the resource link is published by the server device to the cloud server;
  • the cloud server generates the shadow device of the server device based on the resource expression.
  • an embodiment of the present invention provides a server device, the server device includes:
  • the first sending unit is configured to send a shadow device creation request message to a cloud server, where the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device;
  • the first receiving unit is configured to receive a shadow device creation request response message.
  • an embodiment of the present invention provides a cloud server, and the cloud server includes:
  • the second receiving unit is configured to receive a shadow device creation request message sent by the server device
  • the first processing unit is configured to generate a shadow device of the server device based on the shadow device creation request message.
  • an embodiment of the present invention provides a server device, and the server device includes:
  • a fifth sending unit configured to send a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
  • the resource expression is used by the cloud server to generate the shadow device of the server device.
  • an embodiment of the present invention provides a cloud server, and the cloud server includes:
  • the sixth receiving unit is configured to obtain the resource expression corresponding to the resource link, and the resource link is published by the server device to the cloud server;
  • the second processing unit is configured to generate a shadow device of the server device based on the resource expression.
  • an embodiment of the present invention provides a server device, including a processor and a memory configured to store a computer program that can run on the processor, where the processor is configured to execute the above-mentioned computer program when the computer program is running.
  • the steps of the shadow device generation method executed by the server device including a processor and a memory configured to store a computer program that can run on the processor, where the processor is configured to execute the above-mentioned computer program when the computer program is running.
  • an embodiment of the present invention provides a cloud server, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is configured to execute the cloud The steps of the shadow device generation method executed by the server.
  • an embodiment of the present invention provides a storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device executed by the server device is implemented.
  • an embodiment of the present invention provides a storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device executed by the cloud server is implemented.
  • the shadow device generation method provided by the embodiment of the present invention includes: a server device sends a shadow device creation request message to a cloud server; the cloud server receives a shadow device creation request message sent by the server device, and based on the shadow device creation request message, Generate the shadow device of the server device.
  • the server device can directly interact with the cloud server to create the shadow device of the server device; since there is no need for a configurator to participate in the shadow device generation process of the server device, the process of generating the shadow device is simplified.
  • the user is not required to participate in selecting the resources to be copied, which avoids the problem that the generated shadow device cannot accurately serve the function of the server device due to human factors, and improves the function of the shadow device.
  • Figure 1 is a schematic diagram of the communication process between a client device and a server device according to the present invention
  • FIG. 2 is a schematic diagram of the process of creating a shadow device for the server device and the synchronization between the server device and the shadow device according to the present invention
  • FIG. 3 is a schematic diagram of an optional processing flow of a method for generating a shadow device applied to a server device according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of an optional processing flow of a method for generating a shadow device applied to a cloud server according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a detailed processing flow of a method for generating a shadow device according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a detailed processing flow of another method for generating a shadow device according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of another optional processing flow of a method for generating a shadow device applied to a server device according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of another optional processing flow of a method for generating a shadow device applied to a cloud server according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a detailed processing flow of another method for generating a shadow device according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of the composition structure of a server device according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of the composition structure of a cloud server according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of the composition structure of another server device according to an embodiment of the present invention.
  • FIG. 13 is a schematic diagram of the composition structure of another cloud server according to an embodiment of the present invention.
  • FIG. 14 is a schematic diagram of the hardware composition structure of an electronic device according to an embodiment of the present invention.
  • the configurator provides a tool for the server equipment to access the configuration function of the cloud server.
  • the function of the configurator can be implemented by application software.
  • Endpoint which is the source or destination of the request message and the response message.
  • the server device is an OCF server.
  • the shadow device is a digital twin device generated by the server device. Other devices can directly communicate with the shadow device, thereby reducing the workload of message processing on the server device and improving the communication efficiency of the system.
  • Resource catalog supporting OCF equipment to publish resources and discover the logical functional entities of resources.
  • OCF is an emerging technology standards organization for the application layer of the Internet of Things.
  • OCF develops a Restful service framework for interconnection and intercommunication between Internet of Things devices; in the OCF Restful service framework, resources are used to express Internet of Things devices, functional services of OCF devices, and OCF devices The status and other information.
  • the entity that provides the resource is the OCF server device (hereinafter referred to as the server device), and the entity that accesses the resource is the OCF client (hereinafter referred to as the client device).
  • control terminal that obtains the indoor environment status data is the client device
  • the sensor device that monitors the indoor environment status data is the server device.
  • the business interaction between the client device and the server device is through the creation, reading, and updating of resources. It is realized by resource operation methods such as deletion or notification.
  • the communication process between the client device and the server device is shown in Figure 1:
  • the client device sends a resource update request for resources on the server device to the server device.
  • the server device performs a corresponding resource operation according to the update resource request, and sends an update resource response to the client device; wherein the update resource response carries a resource expression.
  • the form of the resource update request is:
  • the resource update request carries the Uniform Resource Identifier (URI) of the resource and the resource operation method; taking Figure 1 as an example, the server device has an environmental temperature resource, and the URI of the resource is "/environmentTemperature” ;
  • the resource operation method requested by the client device from the server device is the update method POST.
  • the description of the resource includes: the URI of the resource, the resource type, the resource interface, and the functional attributes of the resource, etc.
  • the information included in the description of the resource is described below:
  • the URI of the resource provides the address of the OCF server device resource.
  • the value of "href” is the URI of the specific resource.
  • the OCF client device accesses the OCF server device through the resource URI.
  • the resource; in Figure 1, the URI of the environmental temperature resource is "/environmentTemperature”.
  • the resource type represented by "rt” in the description of the resource, represents the type of resource.
  • the resource type “rt” is "oic.r.temperature”, which represents the temperature resource type.
  • the resource interface represented by "if” in the description of the resource, provides a response to the resource view and resource support.
  • the resource interface "if” is "oic.if.a”, which means the controller interface.
  • TargetTemperature represents the target temperature attribute of the temperature resource
  • currentTemperature represents the current temperature attribute of the temperature resource
  • temperatureRange represents the temperature range attribute of the temperature resource
  • OCF defines the resource discovery resource "/oic/res" that all OCF devices must support.
  • Resource discovery resources are used for OCF device and resource discovery; resource discovery resources provide device resource discovery functions, and the URI of resource discovery resources is fixed as " /oic/res”.
  • OCF defines resource links, namely resource Links;
  • OCF server devices can provide their own resources in the form of resource links, so that OCF client devices can discover the resources of OCF server devices.
  • the content of the resource link is as follows:
  • the content of the resource link includes:
  • Context URI which represents the URI of the owner resource that contains the resource link.
  • Target URI that is, the URI of the target resource referenced in the resource link.
  • eps The endpoint that can access the target resource.
  • each OCF server device needs to have an endpoint, and each OCF device must be associated with at least one endpoint for sending and receiving messages;
  • the client device can access the target resource of the server device through the endpoint.
  • the "eps" array is used in the resource link parameters to represent the endpoint of the target resource, and the specific endpoint is represented by "ep", that is, the target resource can be accessed through the address of the "ep" value in the "eps” parameter.
  • the client device can access the target resource "/myLightSwitch" through the message endpoint "coaps://[2001:db8:b::c2e5]:22222".
  • the client device communicates with the shadow device of the server device, which can improve the communication efficiency of the system.
  • OCF cloud server implements shadow service.
  • the shadow service of OCF cloud service creates a shadow device for each OCF server device.
  • the shadow device can directly respond to the request of the client device without obtaining the resource representation of the server device; in this way The client device does not need to communicate with the server device to obtain the resource representation of the server device, thereby reducing the workload of message processing on the server device and improving the communication efficiency of the system.
  • the configurator configures the server device: the configurator executes the shadow configuration process for the server device, sends a resource update request to the shadow configuration resource of the server device, and provides shadow service information for the server device to generate the shadow device; among them.
  • the shadow service information includes: the shadow service identifier, the URI of the shadow generation resource, and the instructions for generating the shadow device; among them, the shadow service identifier represents the identification information of the shadow service, and the URI of the shadow generation resource provides access to the shadow generation resource "oic.wk.shadow.
  • the URI of "gen” for example, the URI of the shadow generation resource is /oic/shadow/gen), and the instruction for generating a shadow device is used to indicate whether the original device generates a shadow device.
  • step 1 the server device obtains the shadow service information, which includes the URI of the shadow generation resource.
  • the server device sends a request for creating the shadow device to the cloud server for the URI of the shadow generation resource.
  • the request provides the original resource information that needs to be copied; after receiving the request from the server device, the cloud server generates a shadow device for the server device; where the shadow device includes the copied resource information corresponding to the original resource information.
  • the configurator configures the shadow device: the configurator executes the configuration process for the shadow device, and the shadow device obtains access control information.
  • the cloud server receives the resource update request: the cloud server receives the update request from the client device for the resources copied on the shadow device.
  • the shadow device and the server device synchronize resources: the server device and the shadow device establish a synchronization relationship through the shadow synchronization resource, and the server device and the shadow device synchronize information.
  • the shadow device sends synchronization information to the client device.
  • the configurator needs to interact with the server device and the cloud server multiple times, resulting in a complicated process of generating the shadow device.
  • the user needs to select the resources copied to the shadow device; if the resource selected by the user is inappropriate, for example, a secure resource is selected (secure resources refer to resources related to secure communication), or selected functions Resources (functional resources refer to resources related to device functions, such as air-conditioning temperature setting resources) are not comprehensive, selected functional resources will be synchronized through the shadow device, and unselected functional resources cannot be synchronized through the shadow device; this will cause generation
  • the shadow device cannot accurately replicate the function of the original device, which affects the function of the shadow device.
  • the present invention provides a method for generating shadow devices.
  • the method for generating shadow devices in the embodiments of this application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, code Code Division Multiple Access (CDMA) system, 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 Mobile Telecommunication System (UMTS), Worldwide Interoperability (Worldwide Interoperability) for Microwave Access, WiMAX) communication system or 5G system, etc.
  • GSM Global System of Mobile communication
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • GPRS General Packet Radio Service
  • LTE Long Term Evolution
  • TDD Time Division Duplex
  • UMTS Universal Mobile Telecommunication System
  • Worldwide Interoperability Worldwide Interoperability (Worldwide Interoperability
  • An optional processing flow of the method for generating a shadow device applied to a server device provided by the embodiment of the present invention, as shown in FIG. 3, includes the following steps:
  • Step S201 The server device sends a shadow device creation request message to the cloud server.
  • the shadow device creation request message is used to request the cloud server to generate the shadow device of the server device.
  • the shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
  • the shadow device creation request message includes the server device identifier, and/or the original resource expression of the server device.
  • the shadow device creation request message may include the server device identifier and/or the original resource expression of the server device, as well as the shadow synchronization resources of the server device.
  • step S202 the server device receives a shadow device creation request response message.
  • the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  • step S202 the method further includes:
  • Step S203 The server device sends a first resource synchronization request message to the cloud server.
  • the first resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device; wherein, the first resource synchronization request message includes the server device identifier.
  • the target URI of the first resource synchronization request message to request resource synchronization is the URI of the original resource whose resource expression has changed.
  • Step S204 The server device receives the first resource synchronization request response message sent by the cloud server.
  • the first resource synchronization request response message is used to indicate that the resource synchronization is successful.
  • Step S205 The server device receives the second resource synchronization request message sent by the cloud server.
  • the second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device; wherein, the second resource synchronization request message includes the server device identifier.
  • the URI of the target resource for which the second resource synchronization request message requests resource synchronization is the URI of the original resource whose resource expression needs to be updated, and the URI of the target resource in the second resource synchronization request message does not include the server device identifier .
  • Step S206 The server device sends a second resource synchronization request response message to the cloud server;
  • the second resource synchronization request response message is used to indicate that the resource synchronization is successful.
  • steps S203 to S204 and steps S205 to S206 may be executed, or only steps S203 to S204 may be executed, or only steps S205 to S206 may be executed.
  • step S203 to step S206 may occur before step S205 to step S206, and step S203 to step S204 may also occur after step S205 to step S206.
  • An optional processing flow of the method for generating a shadow device applied to a cloud server provided by the embodiment of the present invention, as shown in FIG. 4, includes:
  • Step S301 The cloud server receives a shadow device creation request message sent by the server device.
  • the shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
  • the shadow device creation request message includes the server device identifier, and/or the original resource expression of the server device.
  • the shadow device creation request message may include the server device identifier and/or the original resource expression of the server device, as well as the shadow synchronization resources of the server device.
  • the device identifier of the created shadow device is the same as the device identifier of the server device; and/or, the copy resource URI of the shadow device is the same as the original resource URI of the server device.
  • the resources of the shadow device include shadow synchronization resources.
  • Step S302 The cloud server generates the shadow device of the server device based on the shadow device creation request message.
  • step S302 the method further includes:
  • step S303 the cloud server sends a shadow device creation request response message to the server device.
  • the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  • Step S304 The cloud server publishes the copy resource link of the shadow device to the resource discovery directory of the cloud server.
  • the cloud server publishes the copy resource link of the shadow device to the resource discovery directory of the cloud server, that is, the cloud server adds the copy resource link of the shadow device to the resource link of /oic/res of the cloud server.
  • the URI of the copy resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
  • step S304 the method further includes:
  • Step S305 The cloud server receives the first synchronization resource request message sent by the server device;
  • the first resource synchronization request message is used to request the server device and the shadow device to perform resource synchronization.
  • the first resource synchronization request message includes the server device identifier.
  • the target URI of the first resource synchronization request message to request resource synchronization is the URI of the original resource whose resource expression has changed.
  • Step S306 The cloud server sends a first resource synchronization request response message to the server device.
  • the first resource synchronization request response message is used to indicate that the resource synchronization is successful.
  • Step S307 The cloud server sends a second resource synchronization request message to the server device.
  • the second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device; wherein, the second resource synchronization request message includes the server device identifier.
  • the URI of the target resource for which the second resource synchronization request message requests resource synchronization is the URI of the original resource whose resource expression needs to be updated, and the URI of the target resource in the second resource synchronization request message does not include the server device identifier .
  • Step S308 The cloud server receives the second resource synchronization request response message sent by the server device.
  • the second resource synchronization request response message is used to indicate that the resource synchronization is successful.
  • steps S305 to S306 and steps S307 to S308 may be executed, or only steps S305 to S306 may be executed, or only steps S307 to S308 may be executed.
  • step S305 to step S308 may occur before step S307 to step S308, and step S305 to step S306 may also occur after step S307 to step S308.
  • Step S309 the cloud server updates the resource expression of the shadow device on the cloud server.
  • the detailed processing flow of the shadow device generating method provided by the embodiment of the present invention, as shown in FIG. 5, includes the following steps:
  • Step S401 the OCF server device is connected to the OCF cloud server.
  • Step S402 The OCF server device sends a shadow device creation request to the OCF cloud server, requesting the OCF cloud server to generate a shadow device for the OCF server device.
  • the OCF server device sends a creation request to the shadow generation resource /oic/shadow/gen of the OCF cloud server, and the request message provides the OCF server device identification and the original resource expression of the OCF device.
  • the OCF server device is an air conditioner, and the device ID is dc70373c-1e8d-4fb3-962e-017eaa863989.
  • the air conditioner has the current temperature resource (the resource URI is /currentTemperature, the current temperature value is 25°C) and the target temperature resource ( The resource URI is /targetTemperature, and the target temperature value is 25°C) two functional resources.
  • the target resource URI of the request to generate a shadow device is /oic/shadow/gen, and the resource description provided in the request message is as follows:
  • “di” is the equipment identification of the air conditioner
  • “resources” is the resource expression of the current temperature resource and the target temperature resource of the air conditioner.
  • Step S403 The OCF cloud server generates a shadow device for the OCF server device.
  • the device identifier of the generated shadow device is the same as the device identifier of the original device, and the copy resource URI of the shadow device is the same as the shadow resource URI of the original device.
  • the original device is an air conditioner
  • the device identifier is dc70373c-1e8d-4fb3-962e-017eaa863989.
  • the air conditioner implements two functional resources: the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature)
  • the device identifier of the shadow device generated by the OCF cloud server is also dc70373c-1e8d-4fb3-962e-017eaa863989
  • the shadow device also has a current temperature resource (resource URI is /currentTemperature) and a target temperature resource (resource URI is /targetTemperature).
  • the resource description of the generated shadow device is as follows:
  • di is the device identifier of the shadow device of the air conditioner
  • resources is the resource expression of the current temperature resource and the target temperature resource of the shadow device of the air conditioner.
  • step S404 the OCF cloud server sends a response for creating a shadow device to the OCF server device, indicating that the shadow device is successfully created.
  • Step S405 The OCF cloud server publishes the resource link of the shadow device to the resource catalog of the OCF cloud server.
  • the URI of the shadow resource published in the resource catalog plus the device identifier of the OCF device is optionally included in the URI of the shadow resource published in the resource catalog plus the device identifier of the OCF device.
  • the device identifier of the OCF device is dc70373c-1e8d-4fb3-962e-017eaa863989
  • the resource URI of the current temperature resource of the shadow device published to the resource catalog is /currentTemperature
  • the resource URI of the target temperature resource is /targetTemperature
  • the resource The current temperature resource URI of the shadow device published in the catalog is dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature
  • the resource URI of the target temperature resource is dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature.
  • step S406 the resource expression on the OCF server device changes, and resource synchronization needs to be performed.
  • the OCF server equipment is an air conditioner, which has the function of monitoring the current temperature, and realizes the /currentTemperature resource.
  • the monitored current temperature changes, and the temperature value of the /currentTemperature resource changes, and the current temperature value becomes 28°C. , Need to be synchronized to the shadow device.
  • Step S407 The OCF server device requests resource synchronization to the shadow device on the OCF cloud server, the target URI of the requested resource synchronization is the original resource URI that has changed, and the device identifier is the original device identifier.
  • the target resource URI of the shadow device requesting synchronization is /currentTemperature.
  • “di” is the equipment identification of the air conditioner
  • “resources” is the resource expression of the current temperature resource of the changed air conditioner.
  • Step S408 According to the received resource expression of the original resource, the shadow device of the OCF cloud server updates the resource expression of the corresponding shadow resource.
  • the current temperature value of the current temperature resource/currentTemperature of the shadow device is updated to 28°C.
  • Step S409 The shadow device on the OCF cloud server sends a resource synchronization response to the OCF server device.
  • steps S406 to S409 are the uplink resource synchronization process, that is, the process of resource synchronization between the OCF server device and the shadow device on the OCF cloud server.
  • Step S410 the OCF client device discovers the resource of the shadow device through the OCF cloud server.
  • the OCF client device found a shadow device, with the current temperature resource URI being dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature, and the resource URI of the target temperature resource being dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature.
  • Step S411-Step S412 the OCF client device obtains the resource expression of the shadow device, and the OCF cloud server returns the resource expression of the shadow device to the OCF client device.
  • the OCF client device obtains the resource representation of the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature of the shadow device, and obtains the target temperature as 25°C.
  • Step S413 the OCF client device requests to update the resource representation of the shadow device.
  • the OCF client device requests to update the resource representation of the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature of the shadow device, and the target temperature requested to update is 20°C.
  • Step S414 The shadow device of the OCF cloud server requests resource synchronization to the OCF server device, and the target resource URI of the requested resource synchronization is the original resource URI whose resource expression needs to be updated.
  • the shadow device of the OCF cloud server removes the device identifier in the target resource URI, and then sends a resource synchronization request to the OCF server device.
  • the shadow device of the OCF cloud server receives the OCF client request to update the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature, and the requested update target temperature value is 20°C, the shadow device will target The device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 in the resource URI is removed, and the target resource URI to request synchronization from the original device is the target temperature resource/targetTemperature.
  • the resource description provided in the request message is as follows:
  • “di” is the equipment identification of the air conditioner
  • “resources” is the resource expression of the target temperature resource of the air conditioner that is requested to be updated.
  • Step S415 The OCF server device sends a resource synchronization response to the cloud server, indicating that the resource synchronization is successful.
  • Step S416 The shadow device of the OCF cloud server updates its own resource expression.
  • Step S417 The shadow device of the OCF cloud server sends the update result of the device resource expression to the OCF client device.
  • steps S410 to S417 are the downlink resource synchronization process, that is, the process of resource synchronization between the shadow device on the OCF cloud server and the OCF server device.
  • the detailed processing flow of another shadow device generating method provided by the embodiment of the present invention, as shown in FIG. 6, includes the following steps:
  • step S501 the OCF server device is connected to the OCF cloud server.
  • step S502 the OCF server device sends a shadow device creation request to the OCF cloud server, requesting the OCF cloud server to generate a shadow device for the OCF server device.
  • the OCF server device sends a creation request to the shadow generation resource /oic/shadow/gen of the OCF cloud server, and the request message provides the OCF device identifier and the original resource expression of the OCF device.
  • the shadow device creation request also provides the shadow synchronization resource of the original device.
  • the shadow synchronization resource is used to receive the shadow device to the original device.
  • the original equipment is an air conditioner
  • the equipment identifier is dc70373c-1e8d-4fb3-962e-017eaa863989.
  • the air conditioner has a current temperature resource (resource URI is /currentTemperature, current temperature value is 25°C) and a target temperature resource (resource URI is /targetTemperature, the target temperature value is 25°C) two functional resources.
  • the target resource URI of the request to generate a shadow device is /oic/shadow/gen, and the resource description provided in the request message is as follows:
  • “di” is the device identifier of the air conditioner
  • “ssr” is the shadow synchronization resource of the air conditioner, which is used to receive downlink resource synchronization messages (that is, the target resource URI for the shadow device of the air conditioner to send resource synchronization messages to the air conditioner)
  • “resources” is the air conditioner The resource representation of the current temperature resource and the target temperature resource.
  • the OCF cloud server generates a shadow device for the OCF server device.
  • the device identifier of the generated shadow device is the same as that of the original device, and the copy resource URI of the shadow device is the same as the shadow resource URI of the OCF server device.
  • the created shadow device also includes shadow synchronization resources.
  • the shadow synchronization resource of the shadow device is a target resource used to receive the resource synchronization message sent by the OCF server device to the shadow device.
  • the original device is an air conditioner
  • the device identifier is dc70373c-1e8d-4fb3-962e-017eaa863989.
  • the air conditioner implements two functional resources: the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature)
  • the device identifier of the shadow device generated by the OCF cloud server is also dc70373c-1e8d-4fb3-962e-017eaa863989
  • the shadow device also has a current temperature resource (resource URI is /currentTemperature) and a target temperature resource (resource URI is /targetTemperature).
  • the resource description of the generated shadow device is as follows:
  • “di” is the device identifier of the shadow device of the air conditioner
  • “ssr” is the shadow synchronization resource of the shadow device of the air conditioner, used to receive uplink resource synchronization messages (that is, the target resource URI of the air conditioner sending resource synchronization messages to the shadow device of the air conditioner )
  • “resources” is the resource representation of the current temperature resource and target temperature resource of the shadow device of the air conditioner.
  • step S504 the OCF cloud server sends a response for creating a shadow device to the OCF server device, indicating that the shadow device is successfully created.
  • step S505 the OCF cloud server publishes the resource link of the shadow device to the resource catalog of the OCF cloud server.
  • the URI of the shadow resource published in the resource catalog plus the device identifier of the OCF server device is optionally, the URI of the shadow resource published in the resource catalog plus the device identifier of the OCF server device.
  • the device identifier of the OCF device is dc70373c-1e8d-4fb3-962e-017eaa863989
  • the resource URI of the current temperature resource of the shadow device published to the resource catalog is /currentTemperature
  • the resource URI of the target temperature resource is /targetTemperature
  • the resource The current temperature resource URI of the shadow device published in the catalog is dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature
  • the resource URI of the target temperature resource is dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature.
  • step S506 the resource expression on the OCF server device changes, and resource synchronization needs to be performed.
  • the OCF server equipment is an air conditioner, which has the function of monitoring the current temperature, and realizes the /currentTemperature resource.
  • the monitored current temperature changes, and the temperature value of the /currentTemperature resource changes, and the current temperature value becomes 28°C. , Need to be synchronized to the shadow device.
  • Step S507 The OCF server device requests resource synchronization with the shadow device on the OCF cloud server, the target URI of the requested resource synchronization is the shadow synchronization resource URI, and the device identifier is the original device identifier.
  • the target resource URI of the shadow device requesting synchronization is the shadow synchronization resource /oic/shadow/sync, which is provided in the request message See the resource description below:
  • “di” is the equipment identification of the air conditioner
  • “resources” is the resource expression of the current temperature resource of the changed air conditioner.
  • Step S508 According to the received resource expression of the original resource, the shadow device on the OCF cloud server updates the resource expression of the corresponding shadow resource.
  • the current temperature value of the current temperature resource/currentTemperature of the shadow device is updated to 28°C.
  • Step S509 The shadow device on the OCF cloud server sends a resource synchronization response to the OCF server device.
  • steps S506 to S509 are an uplink resource synchronization process, that is, a process in which the OCF server device performs resource synchronization with the shadow device on the OCF cloud server.
  • Step S510-Step S513 the OCF client device discovers and obtains the resource representation of the shadow device.
  • step S510 to step S513 in the embodiment of the present invention are the same as the foregoing step S410 to step S413, and will not be repeated here.
  • step S514 the shadow device on the OCF cloud server requests resource synchronization to the OCF server device, and the target resource URI of the requested resource synchronization is the shadow synchronization resource URI.
  • the shadow device on the OCF cloud server removes the device identifier in the target resource URI, and then sends a resource synchronization request to the OCF server device.
  • the shadow device on the OCF cloud server receives the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature that the OCF client device requests to update, and the target temperature value requested to update is 20°C, then the shadow device Remove the device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 from the target resource URI.
  • the target resource URI for requesting synchronization from the original device is the shadow synchronization resource /oic/shadow/sync.
  • the resource expression provided in the request message is as follows:
  • “di” is the equipment identification of the air conditioner
  • “resources” is the resource expression of the target temperature resource of the air conditioner that is requested to be updated.
  • Step S515 The OCF server device sends a resource synchronization response to the OCF cloud server, indicating that the resource synchronization is successful.
  • step S5166 the shadow device on the OCF cloud server updates its own resource expression.
  • Step S517 The shadow device on the OCF cloud server sends the update result of the device resource expression to the OCF client device.
  • steps S510 to S517 are the downlink resource synchronization process, that is, the process of resource synchronization between the shadow device on the OCF cloud server and the OCF server device.
  • Another optional processing procedure of the method for generating a shadow device applied to a server device provided by the embodiment of the present invention, as shown in FIG. 7, includes the following steps:
  • Step S601 The server device sends a resource expression corresponding to the resource link to the cloud server.
  • the resource link is published by the server device to the cloud server, and the resource expression is used by the cloud server to generate a shadow device of the server device.
  • step S601 the method further includes:
  • Step S602 The server device receives the request message for obtaining the resource expression sent by the cloud server.
  • the request message for obtaining a resource expression includes: obtaining a resource expression corresponding to a resource link published by the server device to the cloud server; correspondingly, the server device sends a resource expression to the cloud server.
  • the resource representation corresponding to the resource link if the cloud server requests to obtain resource expressions corresponding to N resource links, it needs to send N request messages for obtaining resource expressions to the server device; the server device sends a request message to the cloud for each resource expression request message.
  • the server sends resource expressions corresponding to N times different resource links.
  • the request message for obtaining resource expressions includes: obtaining resource expressions corresponding to all resource links published by the server device to the cloud server.
  • the server device sends the resource expressions corresponding to all resource links of the cloud server to the cloud server.
  • the all resource links are published by the server device to the cloud server.
  • All resource links published by the server device to the cloud server may be all resources corresponding to the server device (such as functional resources of the server device and non-functional resources of the server device);
  • the resources related to the server device function such as the current temperature resource and the target temperature resource); it can also be the resource related to the server device function and the configuration resource of the server device (such as /oic/d resource) .
  • resources corresponding to all resource links published by the server device to the cloud server are subscribeable resources.
  • step S602 the method further includes:
  • Step S603 The server device receives the request message for subscribing to the original resource of the server device sent by the cloud server.
  • the request message for subscribing to the original resource of the server device is used to send the changed original resource expression to the cloud server when the original resource expression on the server device changes.
  • Step S604 The server device sends the changed original resource expression to the cloud server.
  • the resource expression on the server device changes. Because the cloud server subscribes to the resource of the server device, the server device needs to send the changed resource expression to the cloud server; the cloud server then updates the changed resource expression The status of the shadow device on the cloud server.
  • step S602 the method further includes:
  • Step S605 The server device receives a request message for updating the resource expression of the server device sent by the cloud server.
  • the URI of the target resource requested to be updated is the URI of the original resource that needs to update the resource expression.
  • the URI of the target resource does not include the server device identifier.
  • Step S606 The server device sends a request response message for updating the resource expression of the server device to the cloud server.
  • the request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  • step S603-step S604, and step S605-step S606 may be executed, or only step S603-step S604 may be executed, or only step S605-step S606 may be executed.
  • step S603 to step S606 may occur before step S605 to step S606, and step S603 to step S604 may also occur after step S605 to step S606.
  • Another optional processing flow of the method for generating a shadow device applied to a cloud server provided by the embodiment of the present invention, as shown in FIG. 8, includes the following steps:
  • Step S701 The cloud server obtains the resource expression corresponding to the resource link.
  • the resource link is published by the server device to the cloud server;
  • Step S702 the cloud server generates a shadow device of the server device based on the resource expression.
  • the device identifier of the shadow device is the same as the device identifier of the server device.
  • step S702 the method further includes:
  • Step S703 The cloud server sends a resource expression request message to the server device.
  • the request message for obtaining a resource expression includes: obtaining a resource expression corresponding to a resource link published by the server device to the cloud server; correspondingly, the server device sends a resource expression to the cloud server.
  • the resource representation corresponding to the resource link if the cloud server requests to obtain resource expressions corresponding to N resource links, it needs to send N request messages for obtaining resource expressions to the server device; the server device sends a request message to the cloud for each resource expression request message.
  • the server sends resource expressions corresponding to N times different resource links.
  • the request message for obtaining a resource expression includes: obtaining resource expressions corresponding to all resource links published by the server device to the cloud server.
  • the server device sends the resource expressions corresponding to all resource links of the cloud server to the cloud server.
  • the all resource links are published by the server device to the cloud server.
  • step S704 the cloud server sends a request message for subscribing to the original resource of the server device to the server device.
  • the request message for subscribing to the original resource of the server device is used to request the server device to send to the cloud server when the original resource expression on the server device changes The original resource representation that has changed.
  • step S705 when the cloud server receives the resource expression of the changed resource, the server updates the resource of the shadow device based on the resource expression of the changed resource.
  • Step S706 The cloud server sends a request message for updating the resource expression of the server device to the server device.
  • the URI of the target resource requested to be updated is the URI of the original resource that needs to update the resource expression.
  • the URI of the target resource does not include the server device identifier.
  • step S707 the cloud server receives a request response message for updating the resource expression of the server device.
  • the request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  • Step S708 the cloud server updates the resource of the shadow device based on the request response message for updating the resource expression of the server device.
  • steps S704 to S705, and steps S706 to S708 may be executed, or only steps S704 to S705 may be executed, or only steps S706 to S708 may be executed.
  • step S704 to step S705 may occur before step S706 to step S708, and step S704 to step S705 may also occur after step S706 to step S708.
  • the detailed processing flow of another shadow device generation method provided by the embodiment of the present invention includes the following steps:
  • step S801 the OCF server device is connected to the OCF cloud server.
  • Step S802-Step S804 the OCF server device publishes its own resource link to the OCF cloud server, and the OCF cloud server publishes the resource link of the shadow device to the resource catalog of the OCF cloud server.
  • the OCF server device is an air conditioner, and the device ID is dc70373c-1e8d-4fb3-962e-017eaa863989.
  • the air conditioner has a current temperature resource (the resource URI is /currentTemperature, and the current temperature value is 25°C) and a target temperature resource (resource The URI is /targetTemperature, and the target temperature value is 25°C) two functional resources.
  • the target resource URI of the requested publishing resource is /oic/rd, and the resource link provided in the request message is as follows:
  • “di” is the equipment identification of the air conditioner
  • “resources” is the resource link of the air conditioner, including the resource link of the current temperature resource and the target temperature resource.
  • the OCF cloud server can obtain the resource representation of the OCF server device in at least the following two ways:
  • Method a The OCF server device separately obtains resource expressions for each published resource; if the OCF server device publishes N resource links, the OCF cloud server needs to send N requests for obtaining resource expressions to the OCF server device.
  • the resource representation used to obtain each resource is not limited to:
  • step S805a-step S806a according to the resource link published by the OCF server device, the OCF cloud server sends a request for obtaining a resource expression to each published resource.
  • the OCF cloud server sends requests to obtain resource expressions for these two resources, thereby obtaining all the resources that have been published to OCF.
  • the resource representation of the resource of the cloud server is not limited to, current temperature resource/currentTemperature and target temperature resource/currentTemperature.
  • Method b Obtain the resource expressions of all the resources published by the OCF server device to the OCF cloud server by obtaining resource expressions in batches; in this case, the OCF cloud server only needs to send one resource expression acquisition to the OCF server device Upon request, it is possible to obtain the resource expressions of all resources published by the OCF server device to the OCF cloud server.
  • step S805b-step S806b the OCF cloud server sends a batch request for obtaining resource expressions to the OCF server device, and obtains the resource expressions of all resources published by the OCF server device to the OCF cloud server.
  • the OCF cloud server sends a request for obtaining resource expressions for the resource URI, thereby obtaining the resource expressions of all resources that have been published to the OCF cloud server.
  • Step S807 The OCF cloud server generates a shadow device for the OCF server device, and the generated copy resource URI of the shadow device is the same as the shadow resource URI of the original device of the OCF server device.
  • the device ID of the shadow device can be the same as or different from the device ID of the OCF server device (ie, the original device).
  • the original equipment is an air conditioner.
  • the air conditioner has two functional resources: the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature).
  • the current temperature value is 25°C
  • the target temperature value is 25°C
  • the shadow device generated by the OCF cloud server also has current temperature resources (resource URI is /currentTemperature, current temperature value is 25°C) and target temperature resources (resource URI is /targetTemperature, target temperature value is 25°C)
  • the resource description of the generated shadow device is as follows:
  • “di” is the device ID of the shadow device of the air conditioner, which can be the same as or different from the device ID of the air conditioner itself
  • “resources” is the resource expression of the shadow device of the air conditioner, including the current temperature resource and target temperature of the shadow device Resource representation of resources.
  • Step S808 After the shadow device is generated, the OCF cloud server subscribes the resources of the corresponding original device to the OCF server device for the generated shadow device.
  • the OCF cloud server serves the OCF
  • the current temperature resource (resource URI: /currentTemperature) and the target temperature resource (resource URI: /targetTemperature) of the end device perform resource subscription to obtain resource change notifications of these two original resources.
  • step S809 the resource expression on the OCF server device changes. Since the OCF cloud server subscribes to the resource of the OCF server device, the OCF server device needs to send the changed resource expression to the OCF cloud server.
  • the OCF device is an air conditioner, which has the function of monitoring the current temperature. It realizes the /currentTemperature resource. The monitored current temperature changes, and the temperature value of the /currentTemperature resource changes, and the current temperature value becomes 28°C. Send the latest temperature value to the OCF cloud server.
  • step S810 the OCF server device sends a resource update notification synchronization to the OCF cloud server, and provides a resource expression of the changed resource.
  • the OCF device sends the latest resource expression of the current temperature resource to the OCF cloud server, requesting the resource expression provided in the message See below:
  • Step S811 The OCF cloud server copies the updated resource expression to the shadow device.
  • the current temperature resource of the shadow device on the OCF cloud server/current temperature value value of currentTemperature is updated to 28°C.
  • steps S809 to S811 are the uplink resource synchronization process, that is, the process of resource synchronization between the OCF server device and the shadow device on the OCF cloud server.
  • Step S812-Step S815 the OCF client device discovers and obtains the resource representation of the shadow device.
  • step S816 the OCF cloud server requests to update the resource expression of the OCF server device, and the target resource URI requested to update is the resource URI of the OCF server device that needs to update the resource expression.
  • the OCF cloud server removes the device identifier in the target resource URI, and then sends a resource update request to the OCF device.
  • the OCF cloud server sets the target resource The device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 in the URI is removed, and the target resource URI of the original device requesting the update is the target temperature resource/targetTemperature.
  • the resource description provided in the request message is as follows:
  • Step S817 The OCF server device sends a resource update response to the OCF cloud server, indicating that the resource update is successful.
  • step S818 the OCF cloud server copies the updated resource expression to the shadow device.
  • the OCF cloud server updates the resource expression of the target temperature resource provided by the OCF server device in step S817, and the current temperature value of the target temperature resource/targetTemperature of the shadow device on the OCF cloud server is updated to 20°C.
  • the OCF cloud server since the OCF cloud server has subscribed to the resources of the OCF server device in step S808, the OCF cloud server can also wait for the resource change notification sent by the OCF server device to copy the updated resource expression To the shadow device.
  • steps S812 to S818 are the downlink resource synchronization process, that is, the process of resource synchronization between the shadow device of the OCF cloud server and the OCF server device.
  • Step S819 The shadow device of the OCF cloud server sends the update result of the device resource expression to the OCF client device.
  • step S820 the OCF server device sends a resource update notification to the OCF cloud server according to the resource subscription information, and provides an updated resource expression.
  • step S809-step S811, and step S812-step S818 may be executed, or only step S809-step S811 may be executed, or only step S812-step S818 may be executed.
  • step S809-step S811 may occur before step S812-step S818, and step S809-step S811 may also occur after step S812-step S818.
  • an embodiment of the present invention provides a server device.
  • the structure of the server device 900, as shown in FIG. 10, includes:
  • the first sending unit 901 is configured to send a shadow device creation request message to a cloud server, where the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device;
  • the first receiving unit 902 is configured to receive a shadow device creation request response message.
  • the shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
  • the shadow device creation request message includes at least one of the following: a server device identifier and an original resource expression of the server device.
  • the shadow device creation request message further includes: shadow synchronization resources of the server device.
  • the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  • the first sending unit 901 is further configured to send a first resource synchronization request message to the cloud server;
  • the first resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the first resource synchronization request message includes the server device identifier.
  • the first receiving unit 902 is further configured to receive a first resource synchronization request response message sent by the cloud server, where the first resource synchronization request response message is used to indicate successful resource synchronization.
  • the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression has changed.
  • the first receiving unit 902 is further configured to receive a second resource synchronization request message sent by the cloud server;
  • the second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
  • the first sending unit 901 is further configured to send a second resource synchronization request response message to the cloud server, where the second resource synchronization request response message is used to indicate successful resource synchronization.
  • the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression needs to be updated.
  • the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
  • the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
  • an embodiment of the present invention provides a cloud server.
  • the composition structure of the cloud server 1000 includes:
  • the second receiving unit 1001 is configured to receive a shadow device creation request message sent by the server device;
  • the first processing unit 1002 is configured to generate the shadow device of the server device based on the shadow device creation request message.
  • the shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
  • the shadow device creation request message includes at least one of the following: a server device identifier and an original resource expression of the server device.
  • the shadow device creation request message further includes: shadow synchronization resources of the server device.
  • the device identifier of the shadow device is the same as the device identifier of the server device; and/or, the copy resource URI of the shadow device is the same as the original resource URI of the server device.
  • the resources of the shadow device include shadow synchronization resources.
  • the cloud server further includes:
  • the second sending unit 1003 is configured to send a shadow device creation request response message to the server device, where the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  • the first processing unit 1002 is further configured to publish the copy resource link of the shadow device to the resource discovery directory of the cloud server.
  • the URI of the copy resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
  • the second receiving unit 1001 is further configured to receive a first synchronization resource request message sent by the server device; the first resource synchronization request message is used to request the server device to communicate with each other The shadow device performs resource synchronization, and the first resource synchronization request message includes the server device identifier.
  • the cloud server further includes:
  • the third sending unit 1004 is configured to send a first resource synchronization request response message to the server device, where the first resource synchronization request response message is used to indicate successful resource synchronization.
  • the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression has changed.
  • the cloud server further includes:
  • the fourth sending unit 1005 is configured to send a second resource synchronization request message to the server device;
  • the second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
  • the second receiving unit 1001 is further configured to receive a second resource synchronization request response message sent by the server device, where the second resource synchronization request response message is used to indicate successful resource synchronization.
  • the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression needs to be updated.
  • the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
  • the first processing unit 1002 is further configured to update the resource expression of the shadow device on the cloud server.
  • the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
  • an embodiment of the present invention provides another server device.
  • the structure of the server device 2000 as shown in FIG. 12, includes:
  • a fifth sending unit 2001 configured to send a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
  • the resource expression is used by the cloud server to generate the shadow device of the server device.
  • the server device further includes:
  • the third receiving unit 2002 receives the request message for obtaining the resource expression sent by the cloud server.
  • the request message for obtaining a resource expression includes: obtaining a resource expression corresponding to a resource link published by the server device to the cloud server.
  • the fifth sending unit 2001 is configured to send a resource expression corresponding to a resource link to the cloud server.
  • the request message for obtaining resource expressions includes: obtaining resource expressions corresponding to all resource links published by the server device to the cloud server.
  • the fifth sending unit 2001 is configured to send resource expressions corresponding to all resource links to the cloud server, and the all resource links are published by the server device to the cloud server.
  • the server device further includes:
  • the fourth receiving unit 2003 is configured to receive a request message for subscribing to the original resource of the server device sent by the cloud server;
  • the request message for subscribing to the original resource of the server device is used to send the changed original resource expression to the cloud server when the original resource expression on the server device changes.
  • the server device further includes:
  • the fifth receiving unit 2004 is configured to receive a request message for updating the resource expression of the server device sent by the cloud server; in the request message for updating the resource expression of the server device, the URI of the target resource requested to be updated is that it needs to be updated The URI of the original resource represented by the resource.
  • the URI of the target resource does not include the server device identifier.
  • the fifth sending unit 2001 is further configured to send a request response message for updating the resource expression of the server device to the cloud server;
  • the request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  • an embodiment of the present invention provides another cloud server.
  • the composition structure of the cloud server 3000 as shown in FIG. 13, includes:
  • the sixth receiving unit 3001 is configured to obtain a resource expression corresponding to a resource link, and the resource link is published by the server device to the cloud server;
  • the second processing unit 3002 is configured to generate a shadow device of the server device based on the resource expression.
  • the cloud server further includes:
  • the sixth sending unit 3003 is configured to send a resource representation request message to the server device.
  • the sixth receiving unit 3001 is configured to obtain a resource expression corresponding to a resource link published by the server to the cloud server.
  • the sixth receiving unit 3001 is configured to receive a resource expression corresponding to a resource link sent by the server device.
  • the sixth receiving unit 3001 is configured to obtain resource expressions corresponding to all resource links published by the server device to the cloud server.
  • the sixth receiving unit 3001 is configured to receive resource expressions corresponding to all resource links sent by the server device, and the all resource links are published by the server device to the cloud server.
  • the method further includes:
  • the seventh sending unit 3004 is configured to send a request message for subscribing to the original resource of the server device to the server device;
  • the request message for subscribing to the original resource of the server device is used to request the server device to send the changed original resource expression to the cloud server when the original resource expression on the server device changes .
  • the second processing unit 3002 when the sixth receiving unit 3001 receives the resource expression of the resource that has changed, the second processing unit 3002 is configured to update the resource expression of the resource that has changed. Resources of the shadow device.
  • the cloud server further includes:
  • the eighth sending unit 3005 is configured to send a request message for updating the resource expression of the server device to the server device; in the request message for updating the resource expression of the server device, the uniform resource identifier of the target resource requested to be updated
  • the URI is the URI of the original resource that needs to update the resource expression.
  • the URI of the target resource does not include the server device identifier.
  • the sixth receiving unit 3001 is further configured to receive a request response message for updating the resource expression of the server device;
  • the request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  • the second processing unit 3002 is configured to update the resource of the shadow device based on the request response message for updating the resource expression of the server device.
  • the device identifier of the shadow device is the same as the device identifier of the server device.
  • the original device refers to the server device; in the embodiment of the present invention, the server device may be an OCF server device, the cloud server may be an OCF cloud server, and the client device may be OCF Client device.
  • the embodiment of the present invention also provides a server device, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is used to execute the server device when the computer program is running Perform the steps of the shadow device generation method.
  • the embodiment of the present invention also provides a cloud server, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is used to execute the above-mentioned cloud server when the computer program is running.
  • the steps of the shadow device generation method are described in detail below.
  • the electronic device 700 includes: at least one processor 701, a memory 702, and at least one network interface 704.
  • the various components in the electronic device 700 are coupled together through the bus system 705. It can be understood that the bus system 705 is used to implement connection and communication between these components.
  • the bus system 705 also includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus system 705 in FIG. 14.
  • the memory 702 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory.
  • the non-volatile memory may be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and electrically erasable Programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), magnetic random access memory (FRAM, ferromagnetic random access memory), flash memory (Flash Memory), magnetic surface memory, optical disk, or CD-ROM -ROM, Compact Disc Read-Only Memory); Magnetic surface memory can be disk storage or tape storage.
  • the volatile memory may be random access memory (RAM, Random Access Memory), which is used as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • SSRAM synchronous static random access memory
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • ESDRAM enhanced -Type synchronous dynamic random access memory
  • SLDRAM SyncLink Dynamic Random Access Memory
  • direct memory bus random access memory DRRAM, Direct Rambus Random Access Memory
  • DRRAM Direct Rambus Random Access Memory
  • the memory 702 described in the embodiment of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
  • the memory 702 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 700. Examples of these data include: any computer program used to operate on the electronic device 700, such as the application program 7022.
  • the program for implementing the method of the embodiment of the present invention may be included in the application program 7022.
  • the method disclosed in the foregoing embodiment of the present invention may be applied to the processor 701 or implemented by the processor 701.
  • the processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or instructions in the form of software.
  • the aforementioned processor 701 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the processor 701 may implement or execute various methods, steps, and logical block diagrams disclosed in the embodiments of the present invention.
  • the general-purpose processor may be a microprocessor or any conventional processor.
  • the steps of the method disclosed in the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a storage medium, and the storage medium is located in the memory 702.
  • the processor 701 reads the information in the memory 702 and completes the steps of the foregoing method in combination with its hardware.
  • the electronic device 700 may be used by one or more application specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), and complex programmable logic device (CPLD). , Complex Programmable Logic Device), FPGA, general-purpose processor, controller, MCU, MPU, or other electronic components to implement the foregoing method.
  • ASIC Application Specific Integrated Circuit
  • DSP digital signal processor
  • PLD programmable logic device
  • CPLD complex programmable logic device
  • FPGA field-programmable Logic Device
  • controller MCU
  • MPU or other electronic components to implement the foregoing method.
  • the embodiment of the present application also provides a storage medium for storing computer programs.
  • the storage medium can be applied to the terminal device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process in each method of the embodiment of the present application.
  • the computer program causes the computer to execute the corresponding process in each method of the embodiment of the present application.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

A method for generating a shadow device, comprising: a server device sends a shadow device creation request message to a cloud server, the shadow device creation request message being used for requesting the cloud server to generate a shadow device of the server device (S201); the server device receives a shadow device creation request response message (S202). Also provided is another method for generating a shadow device, a device, and a storage medium.

Description

一种影子设备的生成方法、设备及存储介质Method, device and storage medium for generating shadow device 技术领域Technical field
本发明涉及信息处理技术领域,尤其涉及一种影子设备的生成方法、设备及存储介质。The present invention relates to the field of information processing technology, in particular to a method, device and storage medium for generating shadow devices.
背景技术Background technique
相关技术中,为开放连接基金会(Open Connectivity Foundation,OCF)服务端设备生成影子设备,通过影子设备与OCF客户端设备进行远程通信,来提高通信处理效率。然而,相关技术中生成影子设备的流程复杂;并且生成影子设备时需要用户的参与才能完成,影响影子设备的功能。In related technologies, a shadow device is generated for the Open Connectivity Foundation (OCF) server device, and the shadow device communicates with the OCF client device remotely to improve communication processing efficiency. However, the process of generating the shadow device in the related technology is complicated; and the user's participation is required to complete the generation of the shadow device, which affects the function of the shadow device.
发明内容Summary of the invention
为解决上述技术问题,本发明实施例提供一种影子设备的生成方法、设备及存储介质,能够简化生成影子设备的流程,提高影子设备的功能。To solve the foregoing technical problems, embodiments of the present invention provide a shadow device generation method, device, and storage medium, which can simplify the process of generating shadow devices and improve the functions of shadow devices.
第一方面,本发明实施例提供一种影子设备的生成方法,包括:服务端设备向云服务器发送创建影子设备请求消息,所述创建影子设备请求消息用于请求所述云服务器生成所述服务端设备的影子设备;所述服务端设备接收创建影子设备请求响应消息。In a first aspect, an embodiment of the present invention provides a method for generating a shadow device, which includes: a server device sends a shadow device creation request message to a cloud server, and the shadow device creation request message is used to request the cloud server to generate the service The shadow device of the end device; the server device receives a shadow device creation request response message.
第二方面,本发明实施例提供一种影子设备的生成方法,包括:云服务器接收服务端设备发送的创建影子设备请求消息;In a second aspect, an embodiment of the present invention provides a method for generating a shadow device, including: a cloud server receives a shadow device creation request message sent by a server device;
所述云服务器基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。The cloud server generates the shadow device of the server device based on the shadow device creation request message.
第三方面,本发明实施例提供一种影子设备的生成方法,包括:服务端设备向云服务器发送资源链接对应的资源表述,所述资源链接由所述服务端设备发布到所述云服务器;In a third aspect, an embodiment of the present invention provides a method for generating a shadow device, which includes: a server device sends a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
所述资源表述用于所述云服务器生成所述服务端设备的影子设备。The resource expression is used by the cloud server to generate the shadow device of the server device.
第四方面,本发明实施例提供一种影子设备的生成方法,包括:云服务器获取资源链接对应的资源表述,所述资源链接由服务端设备发布到所述云服务器;In a fourth aspect, an embodiment of the present invention provides a method for generating a shadow device, including: a cloud server obtains a resource expression corresponding to a resource link, and the resource link is published by the server device to the cloud server;
所述云服务器基于所述资源表述,生成所述服务端设备的影子设备。The cloud server generates the shadow device of the server device based on the resource expression.
第五方面,本发明实施例提供一种服务端设备,所述服务端设备包括:In a fifth aspect, an embodiment of the present invention provides a server device, the server device includes:
第一发送单元,配置为向云服务器发送创建影子设备请求消息,所述创建影子设备请求消息用于请求所述云服务器生成所述服务端设备的影子设备;The first sending unit is configured to send a shadow device creation request message to a cloud server, where the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device;
第一接收单元,配置为接收创建影子设备请求响应消息。The first receiving unit is configured to receive a shadow device creation request response message.
第六方面,本发明实施例提供一种云服务器,所述云服务器包括:In a sixth aspect, an embodiment of the present invention provides a cloud server, and the cloud server includes:
第二接收单元,配置为接收服务端设备发送的创建影子设备请求消息;The second receiving unit is configured to receive a shadow device creation request message sent by the server device;
第一处理单元,配置为基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。The first processing unit is configured to generate a shadow device of the server device based on the shadow device creation request message.
第七方面,本发明实施例提供一种服务端设备,所述服务端设备包括:In a seventh aspect, an embodiment of the present invention provides a server device, and the server device includes:
第五发送单元,配置为向云服务器发送资源链接对应的资源表述,所述资源链接由所述服务端设备发布到所述云服务器;A fifth sending unit, configured to send a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
所述资源表述用于所述云服务器生成所述服务端设备的影子设备。The resource expression is used by the cloud server to generate the shadow device of the server device.
第八方面,本发明实施例提供一种云服务器,所述云服务器包括:In an eighth aspect, an embodiment of the present invention provides a cloud server, and the cloud server includes:
第六接收单元,配置为获取资源链接对应的资源表述,所述资源链接由服务端设备发布到所述云服务器;The sixth receiving unit is configured to obtain the resource expression corresponding to the resource link, and the resource link is published by the server device to the cloud server;
第二处理单元,配置为基于所述资源表述,生成所述服务端设备的影子设备。The second processing unit is configured to generate a shadow device of the server device based on the resource expression.
第九方面,本发明实施例提供一种服务端设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述服务端设备执行的影子设备的生成方法的步骤。In a ninth aspect, an embodiment of the present invention provides a server device, including a processor and a memory configured to store a computer program that can run on the processor, where the processor is configured to execute the above-mentioned computer program when the computer program is running. The steps of the shadow device generation method executed by the server device.
第十方面,本发明实施例提供一种云服务器,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述云服务器执行的影子 设备的生成方法的步骤。In a tenth aspect, an embodiment of the present invention provides a cloud server, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is configured to execute the cloud The steps of the shadow device generation method executed by the server.
第十一方面,本发明实施例提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现上述服务端设备执行的影子设备的生成方法。In an eleventh aspect, an embodiment of the present invention provides a storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device executed by the server device is implemented.
第十二方面,本发明实施例提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现上述云服务器执行的影子设备的生成方法。In a twelfth aspect, an embodiment of the present invention provides a storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device executed by the cloud server is implemented.
本发明实施例提供的影子设备的生成方法,包括:服务端设备向云服务器发送创建影子设备请求消息;云服务器接收服务端设备发送的创建影子设备请求消息,基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。如此,可通过服务端设备与云服务器直接交互来创建服务端设备的影子设备;由于无需配置器参与服务端设备的影子设备的生成过程,简化了生成影子设备的流程。并且,在生成影子设备的过程中,不需要用户参与选择复制的资源,避免由于人为因素导致的生成的影子设备不能准确服务服务端设备的功能的问题,提高了影子设备的功能。The shadow device generation method provided by the embodiment of the present invention includes: a server device sends a shadow device creation request message to a cloud server; the cloud server receives a shadow device creation request message sent by the server device, and based on the shadow device creation request message, Generate the shadow device of the server device. In this way, the server device can directly interact with the cloud server to create the shadow device of the server device; since there is no need for a configurator to participate in the shadow device generation process of the server device, the process of generating the shadow device is simplified. In addition, in the process of generating the shadow device, the user is not required to participate in selecting the resources to be copied, which avoids the problem that the generated shadow device cannot accurately serve the function of the server device due to human factors, and improves the function of the shadow device.
附图说明Description of the drawings
图1为本发明客户端设备和服务端设备通信的流程示意图;Figure 1 is a schematic diagram of the communication process between a client device and a server device according to the present invention;
图2为本发明为服务端设备创建影子设备,以及服务端设备与影子设备的同步的流程示意图;2 is a schematic diagram of the process of creating a shadow device for the server device and the synchronization between the server device and the shadow device according to the present invention;
图3为本发明实施例提供的应用于服务端设备的影子设备的生成方法的一种可选处理流程示意图;3 is a schematic diagram of an optional processing flow of a method for generating a shadow device applied to a server device according to an embodiment of the present invention;
图4为本发明实施例提供的应用于云服务器的影子设备的生成方法一种可选处理流程示意图;4 is a schematic diagram of an optional processing flow of a method for generating a shadow device applied to a cloud server according to an embodiment of the present invention;
图5为本发明实施例提供的一种影子设备的生成方法的详细处理流程示意图;FIG. 5 is a schematic diagram of a detailed processing flow of a method for generating a shadow device according to an embodiment of the present invention;
图6为本发明实施例提供的另一种影子设备的生成方法的详细处理流程示意图;6 is a schematic diagram of a detailed processing flow of another method for generating a shadow device according to an embodiment of the present invention;
图7为本发明实施例提供的应用于服务端设备的影子设备的生成方法的另一种可选处理流程示意图;FIG. 7 is a schematic diagram of another optional processing flow of a method for generating a shadow device applied to a server device according to an embodiment of the present invention;
图8为本发明实施例提供的应用于云服务器的影子设备的生成方法的另一种可选处理流程示意图;FIG. 8 is a schematic diagram of another optional processing flow of a method for generating a shadow device applied to a cloud server according to an embodiment of the present invention;
图9为本发明实施例提供的又一种影子设备的生成方法的详细处理流程示意图;9 is a schematic diagram of a detailed processing flow of another method for generating a shadow device according to an embodiment of the present invention;
图10为本发明实施例一种服务端设备的组成结构示意图;10 is a schematic diagram of the composition structure of a server device according to an embodiment of the present invention;
图11为本发明实施例一种云服务器的组成结构示意图;11 is a schematic diagram of the composition structure of a cloud server according to an embodiment of the present invention;
图12为本发明实施例另一种服务端设备的组成结构示意图;12 is a schematic diagram of the composition structure of another server device according to an embodiment of the present invention;
图13为本发明实施例另一种云服务器的组成结构示意图;13 is a schematic diagram of the composition structure of another cloud server according to an embodiment of the present invention;
图14为本发明实施例电子设备的硬件组成结构示意图。FIG. 14 is a schematic diagram of the hardware composition structure of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
为了能够更加详尽地了解本发明实施例的特点和技术内容,下面结合附图对本发明实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明实施例。In order to understand the features and technical content of the embodiments of the present invention in more detail, the implementation of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The attached drawings are for reference and explanation purposes only, and are not used to limit the embodiments of the present invention.
在对本发明实施例提供的影子设备的生成方法进行详细说明之前,先对相关技术中终端设备向网络设备上报信息进行简要说明。Before describing in detail the method for generating the shadow device provided by the embodiment of the present invention, a brief description of the information reported by the terminal device to the network device in the related technology is firstly described.
在对本发明实施例提供的影子设备的生成方法进行详细说明之前,先对本发明实施例涉及的名词进行简要说明。Before describing in detail the method for generating a shadow device provided by the embodiment of the present invention, a brief description of the terms involved in the embodiment of the present invention will be given.
1)配置器,为服务端设备提供云服务器接入配置功能的工具,配置器的功能可以由应用软件实现。1) The configurator provides a tool for the server equipment to access the configuration function of the cloud server. The function of the configurator can be implemented by application software.
2)资源链接,表示OCF资源之间的引用关系。2) Resource link, indicating the reference relationship between OCF resources.
3)端点,为请求消息和响应消息的源端或者目的端。3) Endpoint, which is the source or destination of the request message and the response message.
4)服务端设备,为OCF服务器。4) The server device is an OCF server.
5)影子设备,为服务端设备生成的数字孪生设备,其他设备可以与影子设备直接通信,从而减轻服务端设备上消息处理的工作量,提高***的通信效率。5) The shadow device is a digital twin device generated by the server device. Other devices can directly communicate with the shadow device, thereby reducing the workload of message processing on the server device and improving the communication efficiency of the system.
6)资源目录,支持OCF设备发布资源和发现资源的逻辑功能实体。6) Resource catalog, supporting OCF equipment to publish resources and discover the logical functional entities of resources.
再对OCF设备以及OCF设备之间的通信进行简要说明。Then briefly explain the OCF equipment and the communication between OCF equipment.
OCF是新兴的物联网应用层技术标准组织,OCF为物联网设备之间实现互联互通制定Restful服务框架;在OCF Restful服务框架中,通过资源来表述物联网设备、OCF设备的功能服务和OCF 设备的状态等信息。其中,提供资源的实体是OCF服务端设备(以下简称服务端设备),访问资源的实体是OCF客户端(以下简称客户端设备)。OCF is an emerging technology standards organization for the application layer of the Internet of Things. OCF develops a Restful service framework for interconnection and intercommunication between Internet of Things devices; in the OCF Restful service framework, resources are used to express Internet of Things devices, functional services of OCF devices, and OCF devices The status and other information. Among them, the entity that provides the resource is the OCF server device (hereinafter referred to as the server device), and the entity that accesses the resource is the OCF client (hereinafter referred to as the client device).
例如,获取室内环境状态数据的控制终端是客户端设备,监测室内环境状态数据的传感器设备是服务端设备,客户端设备和服务端设备的业务交互是通过对资源的创建、读取、更新、删除或者通知等资源操作方法而实现。For example, the control terminal that obtains the indoor environment status data is the client device, and the sensor device that monitors the indoor environment status data is the server device. The business interaction between the client device and the server device is through the creation, reading, and updating of resources. It is realized by resource operation methods such as deletion or notification.
客户端设备和服务端设备通信的流程,如图1所示:客户端设备向服务端设备发送针对服务端设备上的资源的更新资源请求。服务端设备根据所述更新资源请求,执行相应的资源操作,并向客户端设备发送更新资源响应;其中,所述更新资源响应中携带资源的表述。The communication process between the client device and the server device is shown in Figure 1: The client device sends a resource update request for resources on the server device to the server device. The server device performs a corresponding resource operation according to the update resource request, and sends an update resource response to the client device; wherein the update resource response carries a resource expression.
可选实施例中,资源更新请求的形式为:In an optional embodiment, the form of the resource update request is:
Figure PCTCN2019097579-appb-000001
Figure PCTCN2019097579-appb-000001
相应的,更新资源响应的形式为:Correspondingly, the form of the update resource response is:
Figure PCTCN2019097579-appb-000002
Figure PCTCN2019097579-appb-000002
这里,所述更新资源请求中携带资源的统一资源标识符(Uniform Resource Identifier,URI)以及资源操作方法;以图1为例,服务端设备上具有环境温度资源,资源的URI为“/environmentTemperature”;客户端设备向服务端设备请求的资源操作方法是更新方法POST。Here, the resource update request carries the Uniform Resource Identifier (URI) of the resource and the resource operation method; taking Figure 1 as an example, the server device has an environmental temperature resource, and the URI of the resource is "/environmentTemperature" ; The resource operation method requested by the client device from the server device is the update method POST.
资源的表述包括:资源的URI、资源类型、资源接口和资源的功能属性等,下面对资源的表述所包括的信息分别进行说明:The description of the resource includes: the URI of the resource, the resource type, the resource interface, and the functional attributes of the resource, etc. The information included in the description of the resource is described below:
资源的URI,在资源的表述中用“href”表示,提供OCF服务端设备资源的地址,“href”的值是具体的资源的URI,OCF客户端设备通过资源的URI来访问OCF服务端设备的资源;在图1中环境温度资源的URI是“/environmentTemperature”。The URI of the resource, represented by "href" in the description of the resource, provides the address of the OCF server device resource. The value of "href" is the URI of the specific resource. The OCF client device accesses the OCF server device through the resource URI. The resource; in Figure 1, the URI of the environmental temperature resource is "/environmentTemperature".
资源类型,在资源的表述中用“rt”表示,表示资源的类型,在图1中资源类型“rt”是“oic.r.temperature”,表示温度资源类型。The resource type, represented by "rt" in the description of the resource, represents the type of resource. In Figure 1, the resource type "rt" is "oic.r.temperature", which represents the temperature resource type.
资源接口,在资源的表述中用“if”表示,提供对资源的查看以及资源支持的响应,在图1中资源接口“if”是“oic.if.a”,表示控制器接口。The resource interface, represented by "if" in the description of the resource, provides a response to the resource view and resource support. In Figure 1, the resource interface "if" is "oic.if.a", which means the controller interface.
资源属性,在资源的表述中描述资源的属性信息,在图1中“targetTemperature”表示温度资源的目标温度属性,“currentTemperature”表示温度资源的当前温度属性,“temperatureRange”表示温度资源的温度范围属性。Resource attribute, describe the attribute information of the resource in the description of the resource. In Figure 1, "targetTemperature" represents the target temperature attribute of the temperature resource, "currentTemperature" represents the current temperature attribute of the temperature resource, and "temperatureRange" represents the temperature range attribute of the temperature resource .
OCF定义了所有OCF设备都必须支持的资源发现资源“/oic/res”,资源发现资源用于OCF设备以及资源的发现;资源发现资源提供设备资源发现的功能,资源发现资源的URI固定为“/oic/res”。OCF defines the resource discovery resource "/oic/res" that all OCF devices must support. Resource discovery resources are used for OCF device and resource discovery; resource discovery resources provide device resource discovery functions, and the URI of resource discovery resources is fixed as " /oic/res".
为表示资源之间的关联关系,OCF定义了资源链接,即资源Links;OCF服务端设备可以以资源链接的形式提供自己所拥有的资源,便于OCF客户端设备发现OCF服务端设备的资源。其中,资源链接的内容如下所示:In order to express the association relationship between resources, OCF defines resource links, namely resource Links; OCF server devices can provide their own resources in the form of resource links, so that OCF client devices can discover the resources of OCF server devices. Among them, the content of the resource link is as follows:
Figure PCTCN2019097579-appb-000003
Figure PCTCN2019097579-appb-000003
资源链接的内容包括:The content of the resource link includes:
anchor:上下文URI,表示包含资源链接的属主资源的URI。anchor: Context URI, which represents the URI of the owner resource that contains the resource link.
href:目标URI,即资源链接中引用的目标资源的URI。href: Target URI, that is, the URI of the target resource referenced in the resource link.
rt:目标资源的资源类型标识。rt: The resource type identifier of the target resource.
if:目标资源支持的接口。if: The interface supported by the target resource.
eps:可以访问目标资源的端点。eps: The endpoint that can access the target resource.
由于OCF标准协议在传输层采用受限制的应用协议(Constrained Application Protocol,CoAP)承载OCF消息,每个OCF服务端设备需要具有端点,每一个OCF设备必须关联至少一个端点用于发送和接收消息;客户端设备通过端点可以访问服务端设备的目标资源。在资源链接的参数中用“eps”数组表示目标资源的端点,具体端点用“ep”表示,即可以通过"eps"参数中"ep"值的地址访问目标资源。例如上面资源链接的例子中,客户端设备可以通过消息端点"coaps://[2001:db8:b::c2e5]:22222"访问目标资源"/myLightSwitch"。Since the OCF standard protocol adopts a restricted application protocol (CoAP) at the transport layer to carry OCF messages, each OCF server device needs to have an endpoint, and each OCF device must be associated with at least one endpoint for sending and receiving messages; The client device can access the target resource of the server device through the endpoint. The "eps" array is used in the resource link parameters to represent the endpoint of the target resource, and the specific endpoint is represented by "ep", that is, the target resource can be accessed through the address of the "ep" value in the "eps" parameter. For example, in the above resource link example, the client device can access the target resource "/myLightSwitch" through the message endpoint "coaps://[2001:db8:b::c2e5]:22222".
对于一些特定的场景,例如不需要频繁更新状态的IoT设备,客户端设备通过和服务端设备的影子设备通信,可以提高***通信效率。OCF云服务器实现影子服务,OCF云服务的影子服务为每个OCF服务端设备创建一个影子设备,影子设备可以直接响应客户端设备的请求,而无需获取服务端设备的资源表述;通过这种方式客户端设备不需要和服务端设备通信就可以获取服务端设备的资源表述,从而减轻服务端设备上的消息处理工作量,提高***的通信效率。For some specific scenarios, such as IoT devices that do not need to update their status frequently, the client device communicates with the shadow device of the server device, which can improve the communication efficiency of the system. OCF cloud server implements shadow service. The shadow service of OCF cloud service creates a shadow device for each OCF server device. The shadow device can directly respond to the request of the client device without obtaining the resource representation of the server device; in this way The client device does not need to communicate with the server device to obtain the resource representation of the server device, thereby reducing the workload of message processing on the server device and improving the communication efficiency of the system.
相关技术中,为服务端设备创建影子设备,以及服务端设备与影子设备的同步过程如图2所示,包括以下步骤:In the related technology, the creation of a shadow device for the server device and the synchronization process between the server device and the shadow device are shown in Figure 2, including the following steps:
1、配置器配置服务端设备:配置器为服务端设备执行影子配置过程,向服务端设备的影子配置资源发送资源更新请求,为服务端设备生成影子设备提供影子服务信息;其中。影子服务信息包括:影子服务标识、影子生成资源的URI、生成影子设备的指示;其中,影子服务标识表示影子服务的标识信息,影子生成资源的URI提供访问影子生成资源“oic.wk.shadow.gen”的URI(例如影子生成资源的URI是/oic/shadow/gen),生成影子设备的指示用于指示原始设备是否生成影子设备。1. The configurator configures the server device: the configurator executes the shadow configuration process for the server device, sends a resource update request to the shadow configuration resource of the server device, and provides shadow service information for the server device to generate the shadow device; among them. The shadow service information includes: the shadow service identifier, the URI of the shadow generation resource, and the instructions for generating the shadow device; among them, the shadow service identifier represents the identification information of the shadow service, and the URI of the shadow generation resource provides access to the shadow generation resource "oic.wk.shadow. The URI of "gen" (for example, the URI of the shadow generation resource is /oic/shadow/gen), and the instruction for generating a shadow device is used to indicate whether the original device generates a shadow device.
2、为服务端设备生成影子设备:通过第1步服务端设备获得了影子服务信息,其中包括影子生成资源的URI,服务端设备针对影子生成资源的URI向云服务器发送创建影子设备的请求,请求中提供需要复制的原始资源信息;云服务器接收服务端设备的请求后,为服务端设备生成影子设备;其中,影子设备包括与原始资源信息对应的复制资源信息。2. Generate a shadow device for the server device: Through step 1, the server device obtains the shadow service information, which includes the URI of the shadow generation resource. The server device sends a request for creating the shadow device to the cloud server for the URI of the shadow generation resource. The request provides the original resource information that needs to be copied; after receiving the request from the server device, the cloud server generates a shadow device for the server device; where the shadow device includes the copied resource information corresponding to the original resource information.
3、配置器配置影子设备:配置器为影子设备执行配置过程,影子设备获取访问控制信息。3. The configurator configures the shadow device: the configurator executes the configuration process for the shadow device, and the shadow device obtains access control information.
4、云服务器收到资源更新请求:云服务器接收到客户端设备针对影子设备上复制资源的更新请求。4. The cloud server receives the resource update request: the cloud server receives the update request from the client device for the resources copied on the shadow device.
5、影子设备和服务端设备同步资源:服务端设备和影子设备通过影子同步资源建立同步关系,服务端设备和影子设备进行信息同步。5. The shadow device and the server device synchronize resources: the server device and the shadow device establish a synchronization relationship through the shadow synchronization resource, and the server device and the shadow device synchronize information.
6、影子设备向客户端设备发送同步信息。6. The shadow device sends synchronization information to the client device.
可以看出,图2所示的影子设备生成过程中,需要配置器多次与服务端设备、云服务器交互,导致生成影子设备的流程复杂。并且,在影子设备生成的过程中,需要用户选择复制到影子设备上的资源;如果用户选择的资源不合适,例如选了安全资源(安全资源是指安全通信相关的资源),或者选择的功能资源(功能资源是指设备功能相关的资源,例如空调的温度设置资源)不全面,选中的功能资源会通过影子设备同步,未被选中的功能资源则不能通过影子设备同步;如此,会造成生成的影子设备不能准确的复制原始设备的功能,进而影响影子设备的功能。It can be seen that in the shadow device generation process shown in FIG. 2, the configurator needs to interact with the server device and the cloud server multiple times, resulting in a complicated process of generating the shadow device. In addition, in the process of shadow device generation, the user needs to select the resources copied to the shadow device; if the resource selected by the user is inappropriate, for example, a secure resource is selected (secure resources refer to resources related to secure communication), or selected functions Resources (functional resources refer to resources related to device functions, such as air-conditioning temperature setting resources) are not comprehensive, selected functional resources will be synchronized through the shadow device, and unselected functional resources cannot be synchronized through the shadow device; this will cause generation The shadow device cannot accurately replicate the function of the original device, which affects the function of the shadow device.
基于上述问题,本发明提供一种影子设备的生成方法,本申请实施例的影子设备的生成方法可以应用于各种通信***,例如:全球移动通讯(Global System of Mobile communication,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 Mobile Telecommunication System,UMTS)、全球互联微波接入(Worldwide Interoperability for Microwave Access,WiMAX)通信***或5G***等。Based on the above problems, the present invention provides a method for generating shadow devices. The method for generating shadow devices in the embodiments of this application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, code Code Division Multiple Access (CDMA) system, 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 Mobile Telecommunication System (UMTS), Worldwide Interoperability (Worldwide Interoperability) for Microwave Access, WiMAX) communication system or 5G system, etc.
本发明实施例提供的应用于服务端设备的影子设备的生成方法的一种可选处理流程,如图3所示,包括以下步骤:An optional processing flow of the method for generating a shadow device applied to a server device provided by the embodiment of the present invention, as shown in FIG. 3, includes the following steps:
步骤S201,服务端设备向云服务器发送创建影子设备请求消息。Step S201: The server device sends a shadow device creation request message to the cloud server.
本发明实施例中,所述创建影子设备请求消息用于请求所述云服务器生成所述服务端设备的影子设备。其中,创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。In the embodiment of the present invention, the shadow device creation request message is used to request the cloud server to generate the shadow device of the server device. The shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
在一些实施例中,创建影子设备请求消息包括服务端设备标识,和/或所述服务端设备的原始资源表述。In some embodiments, the shadow device creation request message includes the server device identifier, and/or the original resource expression of the server device.
在另一些实施例中,创建影子设备请求消息除了包括服务端设备标识,和/或所述服务端设备的原始资源表述以外,还可以包括服务端设备的影子同步资源。In other embodiments, the shadow device creation request message may include the server device identifier and/or the original resource expression of the server device, as well as the shadow synchronization resources of the server device.
步骤S202,服务端设备接收创建影子设备请求响应消息。In step S202, the server device receives a shadow device creation request response message.
本发明实施例中,所述创建影子设备请求响应消息,用于指示所述影子设备创建成功。In the embodiment of the present invention, the shadow device creation request response message is used to indicate that the shadow device is successfully created.
在执行步骤S202之后,所述方法还包括:After step S202 is performed, the method further includes:
步骤S203,服务端设备向云服务器发送第一资源同步请求消息。Step S203: The server device sends a first resource synchronization request message to the cloud server.
本发明实施例中,所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步;其中,所述第一资源同步请求消息包括服务端设备标识。In the embodiment of the present invention, the first resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device; wherein, the first resource synchronization request message includes the server device identifier.
在一些实施例中,第一资源同步请求消息请求资源同步的目标URI为资源表述发生变化的原始资源的URI。In some embodiments, the target URI of the first resource synchronization request message to request resource synchronization is the URI of the original resource whose resource expression has changed.
步骤S204,服务端设备接收云服务器发送的第一资源同步请求响应消息。Step S204: The server device receives the first resource synchronization request response message sent by the cloud server.
本发明实施例中,所述第一资源同步请求响应消息用于指示资源同步成功。In the embodiment of the present invention, the first resource synchronization request response message is used to indicate that the resource synchronization is successful.
步骤S205,服务端设备接收云服务器发送的第二资源同步请求消息。Step S205: The server device receives the second resource synchronization request message sent by the cloud server.
本发明实施例中,所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步;其中,所述第二资源同步请求消息包括服务端设备标识。In the embodiment of the present invention, the second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device; wherein, the second resource synchronization request message includes the server device identifier.
在一些实施例中,第二资源同步请求消息请求资源同步的目标资源的URI为需要更新资源表述的原始资源的URI,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。In some embodiments, the URI of the target resource for which the second resource synchronization request message requests resource synchronization is the URI of the original resource whose resource expression needs to be updated, and the URI of the target resource in the second resource synchronization request message does not include the server device identifier .
步骤S206,服务端设备向云服务器发送第二资源同步请求响应消息;Step S206: The server device sends a second resource synchronization request response message to the cloud server;
本发明实施例中,所述第二资源同步请求响应消息用于指示资源同步成功。In the embodiment of the present invention, the second resource synchronization request response message is used to indicate that the resource synchronization is successful.
需要说明的是,在具体实施时,步骤S203至步骤S204与步骤S205至步骤S206可以均执行,也可以只执行步骤S203至步骤S204,还可以只执行步骤S205至步骤S206。在步骤S203至步骤S206均执行的情况下,步骤S203至步骤S204可以发生在步骤S205至步骤S206之前,步骤S203至步骤S204也可以发生在步骤S205至步骤S206之后。It should be noted that in specific implementation, steps S203 to S204 and steps S205 to S206 may be executed, or only steps S203 to S204 may be executed, or only steps S205 to S206 may be executed. In the case where step S203 to step S206 are all performed, step S203 to step S204 may occur before step S205 to step S206, and step S203 to step S204 may also occur after step S205 to step S206.
本发明实施例提供的应用于云服务器的影子设备的生成方法一种可选处理流程,如图4所示,包括:An optional processing flow of the method for generating a shadow device applied to a cloud server provided by the embodiment of the present invention, as shown in FIG. 4, includes:
步骤S301,云服务器接收服务端设备发送的创建影子设备请求消息。Step S301: The cloud server receives a shadow device creation request message sent by the server device.
本发明实施例中,创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。In the embodiment of the present invention, the shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
在一些实施例中,创建影子设备请求消息包括服务端设备标识,和/或所述服务端设备的原始资源表述。In some embodiments, the shadow device creation request message includes the server device identifier, and/or the original resource expression of the server device.
在另一些实施例中,创建影子设备请求消息除了包括服务端设备标识,和/或所述服务端设备的原始资源表述以外,还可以包括服务端设备的影子同步资源。In other embodiments, the shadow device creation request message may include the server device identifier and/or the original resource expression of the server device, as well as the shadow synchronization resources of the server device.
本发明实施例中,所创建的影子设备的设备标识与服务端设备的设备标识相同;和/或,所述影子设备的复制资源URI与所述服务端设备的原始资源URI相同。In the embodiment of the present invention, the device identifier of the created shadow device is the same as the device identifier of the server device; and/or, the copy resource URI of the shadow device is the same as the original resource URI of the server device.
进一步的,所述影子设备的资源包括影子同步资源。Further, the resources of the shadow device include shadow synchronization resources.
步骤S302,云服务器基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。Step S302: The cloud server generates the shadow device of the server device based on the shadow device creation request message.
在执行步骤S302之后,所述方法还包括:After step S302 is performed, the method further includes:
步骤S303,云服务器向服务端设备发送创建影子设备请求响应消息。In step S303, the cloud server sends a shadow device creation request response message to the server device.
本发明实施例中,所述创建影子设备请求响应消息用于指示所述影子设备创建成功。In the embodiment of the present invention, the shadow device creation request response message is used to indicate that the shadow device is successfully created.
步骤S304,云服务器将影子设备的复制资源链接发布至云服务器的资源发现目录。Step S304: The cloud server publishes the copy resource link of the shadow device to the resource discovery directory of the cloud server.
本发明实施例中,云服务器将影子设备的复制资源链接发布至云服务器的资源发现目录,也就是云服务器把影子设备的复制资源链接添加到云服务器的/oic/res的资源链接中。In the embodiment of the present invention, the cloud server publishes the copy resource link of the shadow device to the resource discovery directory of the cloud server, that is, the cloud server adds the copy resource link of the shadow device to the resource link of /oic/res of the cloud server.
其中,云服务器的资源发现目录中公布的影子设备的复制资源的URI包括服务端设备标识。Wherein, the URI of the copy resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
在执行步骤S304之后,所述方法还包括:After step S304 is performed, the method further includes:
步骤S305,云服务器接收服务端设备发送的第一同步资源请求消息;Step S305: The cloud server receives the first synchronization resource request message sent by the server device;
本发明实施例中,所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步。其中,所述第一资源同步请求消息包括服务端设备标识。In the embodiment of the present invention, the first resource synchronization request message is used to request the server device and the shadow device to perform resource synchronization. Wherein, the first resource synchronization request message includes the server device identifier.
在一些实施例中,第一资源同步请求消息请求资源同步的目标URI为资源表述发生变化的原始资源的URI。In some embodiments, the target URI of the first resource synchronization request message to request resource synchronization is the URI of the original resource whose resource expression has changed.
步骤S306,云服务器向服务端设备发送第一资源同步请求响应消息。Step S306: The cloud server sends a first resource synchronization request response message to the server device.
本发明实施例中,所述第一资源同步请求响应消息用于指示资源同步成功。In the embodiment of the present invention, the first resource synchronization request response message is used to indicate that the resource synchronization is successful.
步骤S307,云服务器向服务端设备发送第二资源同步请求消息。Step S307: The cloud server sends a second resource synchronization request message to the server device.
本发明实施例中,所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步;其中,所述第二资源同步请求消息包括服务端设备标识。In the embodiment of the present invention, the second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device; wherein, the second resource synchronization request message includes the server device identifier.
在一些实施例中,第二资源同步请求消息请求资源同步的目标资源的URI为需要更新资源表述的原始资源的URI,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。In some embodiments, the URI of the target resource for which the second resource synchronization request message requests resource synchronization is the URI of the original resource whose resource expression needs to be updated, and the URI of the target resource in the second resource synchronization request message does not include the server device identifier .
步骤S308,云服务器接收服务端设备发送的第二资源同步请求响应消息。Step S308: The cloud server receives the second resource synchronization request response message sent by the server device.
所述第二资源同步请求响应消息用于指示资源同步成功。The second resource synchronization request response message is used to indicate that the resource synchronization is successful.
需要说明的是,在具体实施时,步骤S305至步骤S306与步骤S307至步骤S308可以均执行,也可以只执行步骤S305至步骤S306,还可以只执行步骤S307至步骤S308。在步骤S305至步骤S308均执行的情况下,步骤S305至步骤S306可以发生在步骤S307至步骤S308之前,步骤S305至步骤S306也可以发生在步骤S307至步骤S308之后。It should be noted that in specific implementation, steps S305 to S306 and steps S307 to S308 may be executed, or only steps S305 to S306 may be executed, or only steps S307 to S308 may be executed. In the case where step S305 to step S308 are all performed, step S305 to step S306 may occur before step S307 to step S308, and step S305 to step S306 may also occur after step S307 to step S308.
步骤S309,云服务器更新所述云服务器上的影子设备的资源表述。Step S309, the cloud server updates the resource expression of the shadow device on the cloud server.
针对图3和图4所示的影子设备的生成方法,本发明实施例提供的一种影子设备的生成方法的详细处理流程,如图5所示,包括以下步骤:Regarding the shadow device generating method shown in FIGS. 3 and 4, the detailed processing flow of the shadow device generating method provided by the embodiment of the present invention, as shown in FIG. 5, includes the following steps:
步骤S401,OCF服务端设备连接到OCF云服务器。Step S401, the OCF server device is connected to the OCF cloud server.
步骤S402、OCF服务端设备向OCF云服务器发送创建影子设备请求,请求OCF云服务器为OCF服务端设备生成影子设备。Step S402: The OCF server device sends a shadow device creation request to the OCF cloud server, requesting the OCF cloud server to generate a shadow device for the OCF server device.
在具体实施时,OCF服务端设备向OCF云服务器的影子生成资源/oic/shadow/gen发送创建请求,请求消息中提供OCF服务端设备标识和OCF设备的原始资源表述。In specific implementation, the OCF server device sends a creation request to the shadow generation resource /oic/shadow/gen of the OCF cloud server, and the request message provides the OCF server device identification and the original resource expression of the OCF device.
举例来说,OCF服务端设备是空调,设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,空调具备了当前温度资源(资源URI为/currentTemperature,当前温度值value为25℃)和目标温度资源(资源URI为/targetTemperature,目标温度值value为25℃)两个功能资源。For example, the OCF server device is an air conditioner, and the device ID is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner has the current temperature resource (the resource URI is /currentTemperature, the current temperature value is 25°C) and the target temperature resource ( The resource URI is /targetTemperature, and the target temperature value is 25°C) two functional resources.
请求生成影子设备的目标资源URI为/oic/shadow/gen,请求消息中提供的资源表述如下:The target resource URI of the request to generate a shadow device is /oic/shadow/gen, and the resource description provided in the request message is as follows:
Figure PCTCN2019097579-appb-000004
Figure PCTCN2019097579-appb-000004
其中,"di"是空调的设备标识,"resources"是空调的当前温度资源和目标温度资源的资源表述。Among them, "di" is the equipment identification of the air conditioner, and "resources" is the resource expression of the current temperature resource and the target temperature resource of the air conditioner.
步骤S403,OCF云服务器为OCF服务端设备生成影子设备,生成的影子设备的设备标识和原始设备的设备标识相同,影子设备的复制资源URI和原始设备的影子资源URI相同。Step S403: The OCF cloud server generates a shadow device for the OCF server device. The device identifier of the generated shadow device is the same as the device identifier of the original device, and the copy resource URI of the shadow device is the same as the shadow resource URI of the original device.
举例来说,原始设备是空调,设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,空调实现了当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)两个功能资源,那么OCF云服务器生成的影子设备的设备标识也为 dc70373c-1e8d-4fb3-962e-017eaa863989,影子设备也具有当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)两个功能资源。生成的影子设备的资源表述见下:For example, the original device is an air conditioner, and the device identifier is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner implements two functional resources: the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature) , Then the device identifier of the shadow device generated by the OCF cloud server is also dc70373c-1e8d-4fb3-962e-017eaa863989, and the shadow device also has a current temperature resource (resource URI is /currentTemperature) and a target temperature resource (resource URI is /targetTemperature). Functional resources. The resource description of the generated shadow device is as follows:
Figure PCTCN2019097579-appb-000005
Figure PCTCN2019097579-appb-000005
其中,"di"是空调的影子设备的设备标识,"resources"是空调的影子设备的当前温度资源和目标温度资源的资源表述。Among them, "di" is the device identifier of the shadow device of the air conditioner, and "resources" is the resource expression of the current temperature resource and the target temperature resource of the shadow device of the air conditioner.
步骤S404,OCF云服务器向OCF服务端设备发送创建影子设备的响应,指示影子设备创建成功。In step S404, the OCF cloud server sends a response for creating a shadow device to the OCF server device, indicating that the shadow device is successfully created.
步骤S405,OCF云服务器将影子设备的资源链接发布到OCF云服务器的资源目录。Step S405: The OCF cloud server publishes the resource link of the shadow device to the resource catalog of the OCF cloud server.
可选的,资源目录公布的影子资源的URI加上OCF设备的设备标识。Optionally, the URI of the shadow resource published in the resource catalog plus the device identifier of the OCF device.
举例来说,OCF设备的设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,发布到资源目录的影子设备的当前温度资源的资源URI为/currentTemperature,目标温度资源的资源URI为/targetTemperature,则资源目录公布的影子设备的当前温度资源URI为dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature,目标温度资源的资源URI为dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature。For example, the device identifier of the OCF device is dc70373c-1e8d-4fb3-962e-017eaa863989, the resource URI of the current temperature resource of the shadow device published to the resource catalog is /currentTemperature, and the resource URI of the target temperature resource is /targetTemperature, then the resource The current temperature resource URI of the shadow device published in the catalog is dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature, and the resource URI of the target temperature resource is dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature.
步骤S406,OCF服务端设备上的资源表述发生变化,需要进行资源同步。In step S406, the resource expression on the OCF server device changes, and resource synchronization needs to be performed.
举例来说,OCF服务端设备是空调,具有监测当前温度的功能,实现了/currentTemperature资源,监测到的当前温度发生变化,/currentTemperature资源的温度值发生了变化,当前温度值value变为28℃,需要同步给影子设备。For example, the OCF server equipment is an air conditioner, which has the function of monitoring the current temperature, and realizes the /currentTemperature resource. The monitored current temperature changes, and the temperature value of the /currentTemperature resource changes, and the current temperature value becomes 28℃. , Need to be synchronized to the shadow device.
步骤S407、OCF服务端设备请求向OCF云服务器上的影子设备进行资源同步,请求资源同步的目标URI是发生变化的原始资源URI,设备标识为原始设备标识。Step S407: The OCF server device requests resource synchronization to the shadow device on the OCF cloud server, the target URI of the requested resource synchronization is the original resource URI that has changed, and the device identifier is the original device identifier.
举例来说,OCF设备的当前温度资源/currentTemperature发生变化,当前温度值value变为28℃,则请求同步的影子设备的目标资源URI为/currentTemperature,请求消息中提供的资源表述见下:For example, if the current temperature resource /currentTemperature of the OCF device changes, and the current temperature value becomes 28°C, the target resource URI of the shadow device requesting synchronization is /currentTemperature. The resource expression provided in the request message is as follows:
Figure PCTCN2019097579-appb-000006
Figure PCTCN2019097579-appb-000006
Figure PCTCN2019097579-appb-000007
Figure PCTCN2019097579-appb-000007
其中,"di"是空调的设备标识,"resources"是发生变化的空调的当前温度资源的资源表述。Among them, "di" is the equipment identification of the air conditioner, and "resources" is the resource expression of the current temperature resource of the changed air conditioner.
步骤S408、根据收到的原始资源的资源表述,OCF云服务器的影子设备更新对应的影子资源的资源表述。Step S408: According to the received resource expression of the original resource, the shadow device of the OCF cloud server updates the resource expression of the corresponding shadow resource.
例如,根据步骤S407的原始资源的资源表述,影子设备的当前温度资源/currentTemperature的当前温度值value更新为28℃。For example, according to the resource expression of the original resource in step S407, the current temperature value of the current temperature resource/currentTemperature of the shadow device is updated to 28°C.
步骤S409、OCF云服务器上的影子设备向OCF服务端设备发送资源同步响应。Step S409: The shadow device on the OCF cloud server sends a resource synchronization response to the OCF server device.
需要说明的是,步骤S406至步骤S409为上行资源同步过程,即OCF服务端设备向OCF云服务器上的影子设备进行资源同步的过程。It should be noted that steps S406 to S409 are the uplink resource synchronization process, that is, the process of resource synchronization between the OCF server device and the shadow device on the OCF cloud server.
步骤S410,OCF客户端设备通过OCF云服务器发现影子设备的资源。Step S410, the OCF client device discovers the resource of the shadow device through the OCF cloud server.
举例来说,OCF客户端设备发现了影子设备,具有当前温度资源URI为dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature,目标温度资源的资源URI为dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature。For example, the OCF client device found a shadow device, with the current temperature resource URI being dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature, and the resource URI of the target temperature resource being dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature.
步骤S411-步骤S412,OCF客户端设备获取影子设备的资源表述,OCF云服务器向OCF客户端设备返回影子设备的资源表述。Step S411-Step S412, the OCF client device obtains the resource expression of the shadow device, and the OCF cloud server returns the resource expression of the shadow device to the OCF client device.
举例来说,OCF客户端设备获取影子设备的目标温度资源dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature的资源表述,得到目标温度为25℃。For example, the OCF client device obtains the resource representation of the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature of the shadow device, and obtains the target temperature as 25°C.
步骤S413,OCF客户端设备请求更新影子设备的资源表述。Step S413, the OCF client device requests to update the resource representation of the shadow device.
举例来说,OCF客户端设备请求更新影子设备的目标温度资源dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature的资源表述,请求更新的目标温度为20℃。For example, the OCF client device requests to update the resource representation of the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature of the shadow device, and the target temperature requested to update is 20°C.
步骤S414、OCF云服务器的影子设备请求向OCF服务端设备进行资源同步,请求资源同步的目标资源URI是需要更新资源表述的原始资源URI。Step S414: The shadow device of the OCF cloud server requests resource synchronization to the OCF server device, and the target resource URI of the requested resource synchronization is the original resource URI whose resource expression needs to be updated.
可选的,OCF云服务器的影子设备将目标资源URI中的设备标识去掉,再向OCF服务端设备发送资源同步请求。Optionally, the shadow device of the OCF cloud server removes the device identifier in the target resource URI, and then sends a resource synchronization request to the OCF server device.
举例来说,OCF云服务器的影子设备收到的OCF客户端请求更新的目标温度资源dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature,请求更新的目标温度值value为20℃,则影子设备将目标资源URI中的设备标识dc70373c-1e8d-4fb3-962e-017eaa863989去掉,向原始设备请求同步的目标资源URI为目标温度资源/targetTemperature,请求消息中提供的资源表述见下:For example, the shadow device of the OCF cloud server receives the OCF client request to update the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature, and the requested update target temperature value is 20°C, the shadow device will target The device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 in the resource URI is removed, and the target resource URI to request synchronization from the original device is the target temperature resource/targetTemperature. The resource description provided in the request message is as follows:
Figure PCTCN2019097579-appb-000008
Figure PCTCN2019097579-appb-000008
其中,"di"是空调的设备标识,"resources"是请求更新的空调的目标温度资源的资源表述。Among them, "di" is the equipment identification of the air conditioner, and "resources" is the resource expression of the target temperature resource of the air conditioner that is requested to be updated.
步骤S415、OCF服务端设备向云服务器发送资源同步响应,指示资源同步成功。Step S415: The OCF server device sends a resource synchronization response to the cloud server, indicating that the resource synchronization is successful.
步骤S416、OCF云服务器的影子设备更新自己的资源表述。Step S416: The shadow device of the OCF cloud server updates its own resource expression.
步骤S417、OCF云服务器的影子设备向OCF客户端设备发送设备资源表述的更新结果。Step S417: The shadow device of the OCF cloud server sends the update result of the device resource expression to the OCF client device.
需要说明的是,步骤S410至步骤S417为下行资源同步过程,即OCF云服务器上的影子设备向OCF服务端设备进行资源同步的过程。It should be noted that steps S410 to S417 are the downlink resource synchronization process, that is, the process of resource synchronization between the shadow device on the OCF cloud server and the OCF server device.
针对图3和图4所示的影子设备的生成方法,本发明实施例提供的另一种影子设备的生成方法的详细处理流程,如图6所示,包括以下步骤:Regarding the shadow device generating method shown in FIGS. 3 and 4, the detailed processing flow of another shadow device generating method provided by the embodiment of the present invention, as shown in FIG. 6, includes the following steps:
步骤S501,OCF服务端设备连接到OCF云服务器。In step S501, the OCF server device is connected to the OCF cloud server.
步骤S502,OCF服务端设备向OCF云服务器发送创建影子设备请求,请求OCF云服务器为 OCF服务端设备生成影子设备。In step S502, the OCF server device sends a shadow device creation request to the OCF cloud server, requesting the OCF cloud server to generate a shadow device for the OCF server device.
在一些实施例中,OCF服务端设备向OCF云服务器的影子生成资源/oic/shadow/gen发送创建请求,请求消息中提供OCF设备标识和OCF设备的原始资源表述。In some embodiments, the OCF server device sends a creation request to the shadow generation resource /oic/shadow/gen of the OCF cloud server, and the request message provides the OCF device identifier and the original resource expression of the OCF device.
在另一些实施例中,如果OCF服务端设备需要接收影子设备发送的下行资源同步消息,则创建影子设备的请求中还提供原始设备的影子同步资源,影子同步资源是用于接收影子设备向原始设备发送资源同步消息的目标资源。(如果原始设备不需要接收下行资源同步消息,则不用提供影子同步资源,例如只具有温度上报功能的传感器,不具备温度调节的功能,不需要接收下行的温度控制指令)In other embodiments, if the OCF server device needs to receive the downlink resource synchronization message sent by the shadow device, the shadow device creation request also provides the shadow synchronization resource of the original device. The shadow synchronization resource is used to receive the shadow device to the original device. The target resource for the device to send resource synchronization messages. (If the original device does not need to receive downlink resource synchronization messages, it does not need to provide shadow synchronization resources, such as a sensor that only has a temperature reporting function, does not have a temperature adjustment function, and does not need to receive a downlink temperature control command)
举例来说,原始设备是空调,设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,空调具有当前温度资源(资源URI为/currentTemperature,当前温度值value为25℃)和目标温度资源(资源URI为/targetTemperature,目标温度值value为25℃)两个功能资源。For example, the original equipment is an air conditioner, and the equipment identifier is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner has a current temperature resource (resource URI is /currentTemperature, current temperature value is 25°C) and a target temperature resource (resource URI is /targetTemperature, the target temperature value is 25℃) two functional resources.
请求生成影子设备的目标资源URI为/oic/shadow/gen,请求消息中提供的资源表述见下:The target resource URI of the request to generate a shadow device is /oic/shadow/gen, and the resource description provided in the request message is as follows:
Figure PCTCN2019097579-appb-000009
Figure PCTCN2019097579-appb-000009
其中,"di"是空调的设备标识,"ssr"是空调的影子同步资源,用于接收下行资源同步消息(即空调的影子设备向空调发送资源同步消息的目标资源URI)"resources"是空调的当前温度资源和目标温度资源的资源表述。Among them, "di" is the device identifier of the air conditioner, and "ssr" is the shadow synchronization resource of the air conditioner, which is used to receive downlink resource synchronization messages (that is, the target resource URI for the shadow device of the air conditioner to send resource synchronization messages to the air conditioner) "resources" is the air conditioner The resource representation of the current temperature resource and the target temperature resource.
步骤S503,OCF云服务器为OCF服务端设备生成影子设备,生成的影子设备的设备标识和原始设备的设备标识相同,影子设备的复制资源URI和OCF服务端设备的影子资源URI相同。为了接收原始设备发送的上行资源同步消息,创建的影子设备还包括影子同步资源,影子设备的影子同步资源是用于接收OCF服务端设备向影子设备发送资源同步消息的目标资源。In step S503, the OCF cloud server generates a shadow device for the OCF server device. The device identifier of the generated shadow device is the same as that of the original device, and the copy resource URI of the shadow device is the same as the shadow resource URI of the OCF server device. In order to receive the uplink resource synchronization message sent by the original device, the created shadow device also includes shadow synchronization resources. The shadow synchronization resource of the shadow device is a target resource used to receive the resource synchronization message sent by the OCF server device to the shadow device.
举例来说,原始设备是空调,设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,空调实现了当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)两个功能资源,那么OCF云服务器生成的影子设备的设备标识也为dc70373c-1e8d-4fb3-962e-017eaa863989,影子设备也具有当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)两个功能资源。生成的影子设备的资源表述见下:For example, the original device is an air conditioner, and the device identifier is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner implements two functional resources: the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature) , Then the device identifier of the shadow device generated by the OCF cloud server is also dc70373c-1e8d-4fb3-962e-017eaa863989, and the shadow device also has a current temperature resource (resource URI is /currentTemperature) and a target temperature resource (resource URI is /targetTemperature). Functional resources. The resource description of the generated shadow device is as follows:
Figure PCTCN2019097579-appb-000010
Figure PCTCN2019097579-appb-000010
Figure PCTCN2019097579-appb-000011
Figure PCTCN2019097579-appb-000011
其中,"di"是空调的影子设备的设备标识,"ssr"是空调的影子设备的影子同步资源,用于接收上行资源同步消息(即空调向空调的影子设备发送资源同步消息的目标资源URI),"resources"是空调的影子设备的当前温度资源和目标温度资源的资源表述。Among them, "di" is the device identifier of the shadow device of the air conditioner, and "ssr" is the shadow synchronization resource of the shadow device of the air conditioner, used to receive uplink resource synchronization messages (that is, the target resource URI of the air conditioner sending resource synchronization messages to the shadow device of the air conditioner ), "resources" is the resource representation of the current temperature resource and target temperature resource of the shadow device of the air conditioner.
步骤S504,OCF云服务器向OCF服务端设备发送创建影子设备的响应,指示影子设备创建成功。In step S504, the OCF cloud server sends a response for creating a shadow device to the OCF server device, indicating that the shadow device is successfully created.
步骤S505,OCF云服务器将影子设备的资源链接发布到OCF云服务器的资源目录。In step S505, the OCF cloud server publishes the resource link of the shadow device to the resource catalog of the OCF cloud server.
可选的,资源目录公布的影子资源的URI加上OCF服务端设备的设备标识。Optionally, the URI of the shadow resource published in the resource catalog plus the device identifier of the OCF server device.
举例来说,OCF设备的设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,发布到资源目录的影子设备的当前温度资源的资源URI为/currentTemperature,目标温度资源的资源URI为/targetTemperature,则资源目录公布的影子设备的当前温度资源URI为dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature,目标温度资源的资源URI为dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature。For example, the device identifier of the OCF device is dc70373c-1e8d-4fb3-962e-017eaa863989, the resource URI of the current temperature resource of the shadow device published to the resource catalog is /currentTemperature, and the resource URI of the target temperature resource is /targetTemperature, then the resource The current temperature resource URI of the shadow device published in the catalog is dc70373c-1e8d-4fb3-962e-017eaa863989/currentTemperature, and the resource URI of the target temperature resource is dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature.
步骤S506,OCF服务端设备上的资源表述发生变化,需要进行资源同步。In step S506, the resource expression on the OCF server device changes, and resource synchronization needs to be performed.
举例来说,OCF服务端设备是空调,具有监测当前温度的功能,实现了/currentTemperature资源,监测到的当前温度发生变化,/currentTemperature资源的温度值发生了变化,当前温度值value变为28℃,需要同步给影子设备。For example, the OCF server equipment is an air conditioner, which has the function of monitoring the current temperature, and realizes the /currentTemperature resource. The monitored current temperature changes, and the temperature value of the /currentTemperature resource changes, and the current temperature value becomes 28℃. , Need to be synchronized to the shadow device.
步骤S507,OCF服务端设备请求向OCF云服务器上的影子设备进行资源同步,请求资源同步的目标URI是影子同步资源URI,设备标识为原始设备标识。Step S507: The OCF server device requests resource synchronization with the shadow device on the OCF cloud server, the target URI of the requested resource synchronization is the shadow synchronization resource URI, and the device identifier is the original device identifier.
举例来说,OCF设备的当前温度资源/currentTemperature发生变化,当前温度值value变为28℃,则请求同步的影子设备的目标资源URI为影子同步资源/oic/shadow/sync,请求消息中提供的资源表述见下:For example, if the current temperature resource /currentTemperature of the OCF device changes, and the current temperature value becomes 28°C, the target resource URI of the shadow device requesting synchronization is the shadow synchronization resource /oic/shadow/sync, which is provided in the request message See the resource description below:
Figure PCTCN2019097579-appb-000012
Figure PCTCN2019097579-appb-000012
Figure PCTCN2019097579-appb-000013
Figure PCTCN2019097579-appb-000013
其中,"di"是空调的设备标识,"resources"是发生变化的空调的当前温度资源的资源表述。Among them, "di" is the equipment identification of the air conditioner, and "resources" is the resource expression of the current temperature resource of the changed air conditioner.
步骤S508,根据收到的原始资源的资源表述,OCF云服务器上的影子设备更新对应的影子资源的资源表述。Step S508: According to the received resource expression of the original resource, the shadow device on the OCF cloud server updates the resource expression of the corresponding shadow resource.
举例来说,根据步骤S507步的原始资源的资源表述,影子设备的当前温度资源/currentTemperature的当前温度值value更新为28℃。For example, according to the resource expression of the original resource in step S507, the current temperature value of the current temperature resource/currentTemperature of the shadow device is updated to 28°C.
步骤S509,OCF云服务器上的影子设备向OCF服务端设备发送资源同步响应。Step S509: The shadow device on the OCF cloud server sends a resource synchronization response to the OCF server device.
需要说明的是,步骤S506至步骤S509为上行资源同步过程,即OCF服务端设备向OCF云服务器上的影子设备进行资源同步的过程。It should be noted that steps S506 to S509 are an uplink resource synchronization process, that is, a process in which the OCF server device performs resource synchronization with the shadow device on the OCF cloud server.
步骤S510-步骤S513,OCF客户端设备发现并获取影子设备的资源表述。Step S510-Step S513, the OCF client device discovers and obtains the resource representation of the shadow device.
需要说明的是,本发明实施例中步骤S510-步骤S513的处理过程与上述步骤S410-步骤S413相同,这里不再赘述。It should be noted that the processing procedures of step S510 to step S513 in the embodiment of the present invention are the same as the foregoing step S410 to step S413, and will not be repeated here.
步骤S514,OCF云服务器上的影子设备请求向OCF服务端设备进行资源同步,请求资源同步的目标资源URI是影子同步资源URI。In step S514, the shadow device on the OCF cloud server requests resource synchronization to the OCF server device, and the target resource URI of the requested resource synchronization is the shadow synchronization resource URI.
可选的,OCF云服务器上的影子设备将目标资源URI中的设备标识去掉,再向OCF服务端设备发送资源同步请求。Optionally, the shadow device on the OCF cloud server removes the device identifier in the target resource URI, and then sends a resource synchronization request to the OCF server device.
举例来说,OCF云服务器上的影子设备收到的OCF客户端设备请求更新的目标温度资源dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature,请求更新的目标温度值value为20℃,则影子设备将目标资源URI中的设备标识dc70373c-1e8d-4fb3-962e-017eaa863989去掉,向原始设备请求同步的目标资源URI为影子同步资源/oic/shadow/sync,请求消息中提供的资源表述见下:For example, the shadow device on the OCF cloud server receives the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature that the OCF client device requests to update, and the target temperature value requested to update is 20°C, then the shadow device Remove the device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 from the target resource URI. The target resource URI for requesting synchronization from the original device is the shadow synchronization resource /oic/shadow/sync. The resource expression provided in the request message is as follows:
Figure PCTCN2019097579-appb-000014
Figure PCTCN2019097579-appb-000014
其中,"di"是空调的设备标识,"resources"是请求更新的空调的目标温度资源的资源表述。Among them, "di" is the equipment identification of the air conditioner, and "resources" is the resource expression of the target temperature resource of the air conditioner that is requested to be updated.
步骤S515,OCF服务端设备向OCF云服务器发送资源同步响应,指示资源同步成功。Step S515: The OCF server device sends a resource synchronization response to the OCF cloud server, indicating that the resource synchronization is successful.
步骤S516,OCF云服务器上的影子设备更新自己的资源表述。In step S516, the shadow device on the OCF cloud server updates its own resource expression.
步骤S517,OCF云服务器上的影子设备向OCF客户端设备发送设备资源表述的更新结果。Step S517: The shadow device on the OCF cloud server sends the update result of the device resource expression to the OCF client device.
需要说明的是,步骤S510至步骤S517为下行资源同步过程,即OCF云服务器上的影子设备向OCF服务端设备进行资源同步的过程。It should be noted that steps S510 to S517 are the downlink resource synchronization process, that is, the process of resource synchronization between the shadow device on the OCF cloud server and the OCF server device.
本发明实施例提供的应用于服务端设备的影子设备的生成方法的另一种可选处理流程,如图7所示,包括以下步骤:Another optional processing procedure of the method for generating a shadow device applied to a server device provided by the embodiment of the present invention, as shown in FIG. 7, includes the following steps:
步骤S601,服务端设备向云服务器发送资源链接对应的资源表述。Step S601: The server device sends a resource expression corresponding to the resource link to the cloud server.
本发明实施例中,所述资源链接由所述服务端设备发布到所述云服务器,所述资源表述用于所述云服务器生成所述服务端设备的影子设备。In the embodiment of the present invention, the resource link is published by the server device to the cloud server, and the resource expression is used by the cloud server to generate a shadow device of the server device.
在执行步骤S601之后,所述方法还包括:After step S601 is performed, the method further includes:
步骤S602,服务端设备接收云服务器发送的获取资源表述的请求消息。Step S602: The server device receives the request message for obtaining the resource expression sent by the cloud server.
在一些实施例中,所述获取资源表述的请求消息包括:获取所述服务端设备发布到所述云服务器的一个资源链接对应的资源表述;相应的,服务端设备向所述云服务器发送一个资源链接对应的资源表述。在这种情况下,若云服务器请求获取N个资源链接对应的资源表述,需要向服务端设备发送N个获取资源表述的请求消息;服务端设备针对每个获取资源表述的请求消息,向云服务器发送N个次不同的资源链接对应的资源表述。In some embodiments, the request message for obtaining a resource expression includes: obtaining a resource expression corresponding to a resource link published by the server device to the cloud server; correspondingly, the server device sends a resource expression to the cloud server. The resource representation corresponding to the resource link. In this case, if the cloud server requests to obtain resource expressions corresponding to N resource links, it needs to send N request messages for obtaining resource expressions to the server device; the server device sends a request message to the cloud for each resource expression request message. The server sends resource expressions corresponding to N times different resource links.
在另一些实施例中,所述获取资源表述的请求消息包括:获取所述服务端设备发布到所述云服 务器的全部资源链接对应的资源表述。相应的,服务端设备向所述云服务器发送云服务器的全部资源链接对应的资源表述。其中,所述全部资源链接由所述服务端设备发布到所述云服务器。所述服务端设备发布到所述云服务器的全部资源链接,可以是对应所述服务端设备的所有资源(如服务端设备的功能资源和服务端设备的非功能资源);也可以是对应所述服务端设备功能相关的资源(如当前的温度资源和目标温度资源);还可以是对应所述服务端设备功能相关的资源以及所述服务端设备的配置资源(如/oic/d资源)。在一些可选实施例中,服务端设备发布到所述云服务器的全部资源链接对应的资源为可订阅的资源。In some other embodiments, the request message for obtaining resource expressions includes: obtaining resource expressions corresponding to all resource links published by the server device to the cloud server. Correspondingly, the server device sends the resource expressions corresponding to all resource links of the cloud server to the cloud server. Wherein, the all resource links are published by the server device to the cloud server. All resource links published by the server device to the cloud server may be all resources corresponding to the server device (such as functional resources of the server device and non-functional resources of the server device); The resources related to the server device function (such as the current temperature resource and the target temperature resource); it can also be the resource related to the server device function and the configuration resource of the server device (such as /oic/d resource) . In some optional embodiments, resources corresponding to all resource links published by the server device to the cloud server are subscribeable resources.
在执行步骤S602之后,所述方法还包括:After step S602 is performed, the method further includes:
步骤S603,服务端设备接收云服务器发送的订阅服务端设备的原始资源的请求消息。Step S603: The server device receives the request message for subscribing to the original resource of the server device sent by the cloud server.
本发明实施例中,所述订阅服务端设备的原始资源的请求消息,用于所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。In the embodiment of the present invention, the request message for subscribing to the original resource of the server device is used to send the changed original resource expression to the cloud server when the original resource expression on the server device changes.
步骤S604,服务端设备向云服务器发送发生变化的原始资源表述。Step S604: The server device sends the changed original resource expression to the cloud server.
在一些实施例中,服务端设备上的资源表述发生变化,由于云服务器订阅了服务端设备的资源,因此服务端设备需要向云服务器发送变化的资源表述;云服务器再将变化的资源表述更新云服务器上影子设备的状态。In some embodiments, the resource expression on the server device changes. Because the cloud server subscribes to the resource of the server device, the server device needs to send the changed resource expression to the cloud server; the cloud server then updates the changed resource expression The status of the shadow device on the cloud server.
在执行步骤S602之后,所述方法还包括:After step S602 is performed, the method further includes:
步骤S605,服务端设备接收云服务器发送的更新服务端设备的资源表述的请求消息。Step S605: The server device receives a request message for updating the resource expression of the server device sent by the cloud server.
本发明实施例中,所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的URI为需要更新资源表述的原始资源的URI。In the embodiment of the present invention, in the request message for updating the resource expression of the server device, the URI of the target resource requested to be updated is the URI of the original resource that needs to update the resource expression.
其中,所述目标资源的URI不包括服务端设备标识。Wherein, the URI of the target resource does not include the server device identifier.
步骤S606,服务端设备向云服务器发送更新服务端设备的资源表述的请求响应消息。Step S606: The server device sends a request response message for updating the resource expression of the server device to the cloud server.
本发明实施例中,所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。In the embodiment of the present invention, the request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
需要说明的是,本发明实施例中,步骤S603-步骤S604,与步骤S605-步骤S606可以均执行,也可以只执行步骤S603-步骤S604,还可以只执行步骤S605-步骤S606。在步骤S603至步骤S606均执行的情况下,步骤S603-步骤S604可以发生在步骤S605-步骤S606之前,步骤S603-步骤S604也可以发生在步骤S605-步骤S606之后。It should be noted that, in the embodiment of the present invention, step S603-step S604, and step S605-step S606 may be executed, or only step S603-step S604 may be executed, or only step S605-step S606 may be executed. In the case where step S603 to step S606 are all performed, step S603 to step S604 may occur before step S605 to step S606, and step S603 to step S604 may also occur after step S605 to step S606.
本发明实施例提供的应用于云服务器的影子设备的生成方法的另一种可选处理流程,如图8所示,包括以下步骤:Another optional processing flow of the method for generating a shadow device applied to a cloud server provided by the embodiment of the present invention, as shown in FIG. 8, includes the following steps:
步骤S701,云服务器获取资源链接对应的资源表述。Step S701: The cloud server obtains the resource expression corresponding to the resource link.
本发明实施例中,所述资源链接由服务端设备发布到所述云服务器;In the embodiment of the present invention, the resource link is published by the server device to the cloud server;
步骤S702,云服务器基于所述资源表述,生成服务端设备的影子设备。Step S702, the cloud server generates a shadow device of the server device based on the resource expression.
本发明实施例中,影子设备的设备标识与所述服务端设备的设备标识相同。In the embodiment of the present invention, the device identifier of the shadow device is the same as the device identifier of the server device.
在执行步骤S702之后,所述方法还包括:After step S702 is performed, the method further includes:
步骤S703,云服务器向服务端设备发送获取资源表述请求消息。Step S703: The cloud server sends a resource expression request message to the server device.
在一些实施例中,所述获取资源表述的请求消息包括:获取所述服务端设备发布到所述云服务器的一个资源链接对应的资源表述;相应的,服务端设备向所述云服务器发送一个资源链接对应的资源表述。在这种情况下,若云服务器请求获取N个资源链接对应的资源表述,需要向服务端设备发送N个获取资源表述的请求消息;服务端设备针对每个获取资源表述的请求消息,向云服务器发送N个次不同的资源链接对应的资源表述。In some embodiments, the request message for obtaining a resource expression includes: obtaining a resource expression corresponding to a resource link published by the server device to the cloud server; correspondingly, the server device sends a resource expression to the cloud server. The resource representation corresponding to the resource link. In this case, if the cloud server requests to obtain resource expressions corresponding to N resource links, it needs to send N request messages for obtaining resource expressions to the server device; the server device sends a request message to the cloud for each resource expression request message. The server sends resource expressions corresponding to N times different resource links.
在另一些实施例中,所述获取资源表述的请求消息包括:获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。相应的,服务端设备向所述云服务器发送云服务器的全部资源链接对应的资源表述。其中,所述全部资源链接由所述服务端设备发布到所述云服务器。In other embodiments, the request message for obtaining a resource expression includes: obtaining resource expressions corresponding to all resource links published by the server device to the cloud server. Correspondingly, the server device sends the resource expressions corresponding to all resource links of the cloud server to the cloud server. Wherein, the all resource links are published by the server device to the cloud server.
步骤S704,云服务器向服务端设备发送订阅服务端设备的原始资源的请求消息。In step S704, the cloud server sends a request message for subscribing to the original resource of the server device to the server device.
本发明实施例中,所述订阅服务端设备的原始资源的请求消息,用于请求所述服务端设备在所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。In the embodiment of the present invention, the request message for subscribing to the original resource of the server device is used to request the server device to send to the cloud server when the original resource expression on the server device changes The original resource representation that has changed.
步骤S705,云服务器接收到发生变化的资源的资源表述的情况下,服务器基于所述发生变化的资源的资源表述,更新所述影子设备的资源。In step S705, when the cloud server receives the resource expression of the changed resource, the server updates the resource of the shadow device based on the resource expression of the changed resource.
步骤S706,云服务器向服务端设备发送更新服务端设备的资源表述的请求消息。Step S706: The cloud server sends a request message for updating the resource expression of the server device to the server device.
本发明实施例中,所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的URI为需要更新资源表述的原始资源的URI。In the embodiment of the present invention, in the request message for updating the resource expression of the server device, the URI of the target resource requested to be updated is the URI of the original resource that needs to update the resource expression.
可选地,目标资源的URI不包括服务端设备标识。Optionally, the URI of the target resource does not include the server device identifier.
步骤S707,云服务器接收更新服务端设备的资源表述的请求响应消息。In step S707, the cloud server receives a request response message for updating the resource expression of the server device.
本发明实施例中,更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。In the embodiment of the present invention, the request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
步骤S708,云服务器基于更新服务端设备的资源表述的请求响应消息,更新所述影子设备的资源。Step S708, the cloud server updates the resource of the shadow device based on the request response message for updating the resource expression of the server device.
需要说明的是,本发明实施例中,步骤S704-步骤S705,与步骤S706-步骤S708可以均执行,也可以只执行步骤S704-步骤S705,还可以只执行步骤S706-步骤S708。在步骤S704至步骤S708均执行的情况下,步骤S704-步骤S705可以发生在步骤S706-步骤S708之前,步骤S704-步骤S705也可以发生在步骤S706-步骤S708之后。It should be noted that, in the embodiment of the present invention, steps S704 to S705, and steps S706 to S708 may be executed, or only steps S704 to S705 may be executed, or only steps S706 to S708 may be executed. In the case where step S704 to step S708 are all performed, step S704 to step S705 may occur before step S706 to step S708, and step S704 to step S705 may also occur after step S706 to step S708.
针对图7和图8所示的影子设备的生成方法,本发明实施例提供的又一种影子设备的生成方法的详细处理流程,如图9所示,包括以下步骤:With regard to the shadow device generation methods shown in FIGS. 7 and 8, the detailed processing flow of another shadow device generation method provided by the embodiment of the present invention, as shown in FIG. 9, includes the following steps:
步骤S801,OCF服务端设备连接到OCF云服务器。In step S801, the OCF server device is connected to the OCF cloud server.
步骤S802-步骤S804,OCF服务端设备向OCF云服务器发布自己的资源链接,OCF云服务器将影子设备的资源链接发布到OCF云服务器的资源目录。Step S802-Step S804, the OCF server device publishes its own resource link to the OCF cloud server, and the OCF cloud server publishes the resource link of the shadow device to the resource catalog of the OCF cloud server.
举例来说,OCF服务端设备是空调,设备标识为dc70373c-1e8d-4fb3-962e-017eaa863989,空调具有当前温度资源(资源URI为/currentTemperature,当前温度值value为25℃)和目标温度资源(资源URI为/targetTemperature,目标温度值value为25℃)两个功能资源。For example, the OCF server device is an air conditioner, and the device ID is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner has a current temperature resource (the resource URI is /currentTemperature, and the current temperature value is 25°C) and a target temperature resource (resource The URI is /targetTemperature, and the target temperature value is 25°C) two functional resources.
请求发布资源的目标资源URI为/oic/rd,请求消息中提供的资源链接见下:The target resource URI of the requested publishing resource is /oic/rd, and the resource link provided in the request message is as follows:
Figure PCTCN2019097579-appb-000015
Figure PCTCN2019097579-appb-000015
其中,"di"是空调的设备标识,"resources"是空调的资源链接,包括当前温度资源和目标温度资源的资源链接。Among them, "di" is the equipment identification of the air conditioner, and "resources" is the resource link of the air conditioner, including the resource link of the current temperature resource and the target temperature resource.
OCF服务端设备将资源链接发布到OCF云服务器后,OCF云服务器需要获取OCF服务端设备的资源表述,用于生成对应的影子设备。OCF云服务器至少可通过下述两种方式获取OCF服务端设备的资源表述:After the OCF server device publishes the resource link to the OCF cloud server, the OCF cloud server needs to obtain the resource representation of the OCF server device to generate the corresponding shadow device. The OCF cloud server can obtain the resource representation of the OCF server device in at least the following two ways:
方式a:OCF服务端设备分别针对每个发布的资源单独获取资源表述;如果OCF服务端设备发布了N个资源链接,则OCF云服务器需要向OCF服务端设备发送N次获取资源表述的请求,用于获取每个资源的资源表述。Method a: The OCF server device separately obtains resource expressions for each published resource; if the OCF server device publishes N resource links, the OCF cloud server needs to send N requests for obtaining resource expressions to the OCF server device. The resource representation used to obtain each resource.
步骤S805a-步骤S806a,根据OCF服务端设备发布的资源链接,OCF云服务器分别向每个发布的资源发送获取资源表述的请求。In step S805a-step S806a, according to the resource link published by the OCF server device, the OCF cloud server sends a request for obtaining a resource expression to each published resource.
举例来说,OCF服务端设备发布的资源链接包括当前温度资源/currentTemperature和目标温度 资源/currentTemperature,则OCF云服务器分别针对这两个资源发送获取资源表述的请求,从而获取到所有已发布到OCF云服务器的资源的资源表述。For example, if the resource links published by the OCF server device include current temperature resource/currentTemperature and target temperature resource/currentTemperature, the OCF cloud server sends requests to obtain resource expressions for these two resources, thereby obtaining all the resources that have been published to OCF. The resource representation of the resource of the cloud server.
方式b:通过批量获取资源表述的方式来获取OCF服务端设备发布到OCF云服务器的所有资源的资源表述;这种情况下,OCF云服务器只需要向OCF服务端设备发送1个获取资源表述的请求,就可以获取该OCF服务端设备发布到OCF云服务器的所有资源的资源表述。Method b: Obtain the resource expressions of all the resources published by the OCF server device to the OCF cloud server by obtaining resource expressions in batches; in this case, the OCF cloud server only needs to send one resource expression acquisition to the OCF server device Upon request, it is possible to obtain the resource expressions of all resources published by the OCF server device to the OCF cloud server.
步骤S805b-步骤S806b,OCF云服务器向OCF服务端设备发送批量获取资源表述的请求,获取该OCF服务端设备发布到OCF云服务器的所有资源的资源表述。In step S805b-step S806b, the OCF cloud server sends a batch request for obtaining resource expressions to the OCF server device, and obtains the resource expressions of all resources published by the OCF server device to the OCF cloud server.
举例来说,批量获取OCF设备资源表述的资源URI为/fullStatusQuery,则OCF云服务器针对该资源URI发送获取资源表述的请求,从而获取到所有已发布到OCF云服务器的资源的资源表述。For example, if the resource URI for obtaining OCF device resource expressions in batches is /fullStatusQuery, the OCF cloud server sends a request for obtaining resource expressions for the resource URI, thereby obtaining the resource expressions of all resources that have been published to the OCF cloud server.
步骤S807、OCF云服务器为OCF服务端设备生成影子设备,生成的影子设备的复制资源URI和OCF服务端设备的原始设备的影子资源URI相同。Step S807: The OCF cloud server generates a shadow device for the OCF server device, and the generated copy resource URI of the shadow device is the same as the shadow resource URI of the original device of the OCF server device.
这里,影子设备的设备标识可以和OCF服务端设备(即原始设备)的设备标识相同,也可以不同。Here, the device ID of the shadow device can be the same as or different from the device ID of the OCF server device (ie, the original device).
举例来说,原始设备是空调,空调具有当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)两个功能资源,当前温度值value为25℃,目标温度值value为25℃,那么OCF云服务器生成的影子设备也具有当前温度资源(资源URI为/currentTemperature,当前温度值value为25℃)和目标温度资源(资源URI为/targetTemperature,目标温度值value为25℃)两个功能资源。生成的影子设备的资源表述见下:For example, the original equipment is an air conditioner. The air conditioner has two functional resources: the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature). The current temperature value is 25°C, and the target temperature value is 25°C, the shadow device generated by the OCF cloud server also has current temperature resources (resource URI is /currentTemperature, current temperature value is 25°C) and target temperature resources (resource URI is /targetTemperature, target temperature value is 25°C) Two functional resources. The resource description of the generated shadow device is as follows:
Figure PCTCN2019097579-appb-000016
Figure PCTCN2019097579-appb-000016
其中,"di"是空调的影子设备的设备标识,该设备标识可以和空调自身的设备标识相同或不同,"resources"是空调的影子设备的资源表述,包括该影子设备当前温度资源和目标温度资源的资源表述。Among them, "di" is the device ID of the shadow device of the air conditioner, which can be the same as or different from the device ID of the air conditioner itself, and "resources" is the resource expression of the shadow device of the air conditioner, including the current temperature resource and target temperature of the shadow device Resource representation of resources.
步骤S808,生成影子设备后,OCF云服务器为生成的影子设备向OCF服务端设备订阅对应的原始设备的资源。Step S808: After the shadow device is generated, the OCF cloud server subscribes the resources of the corresponding original device to the OCF server device for the generated shadow device.
举例来说,OCF云服务器为OCF服务端设备生成的影子设备具有当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)两个功能资源,则OCF云服务器向OCF服务端设备的当前温度资源(资源URI为/currentTemperature)和目标温度资源(资源URI为/targetTemperature)进行资源订阅,用于获取这两个原始资源的资源变化通知。For example, if the shadow device generated by the OCF cloud server for the OCF server device has two functional resources, the current temperature resource (resource URI is /currentTemperature) and the target temperature resource (resource URI is /targetTemperature), then the OCF cloud server serves the OCF The current temperature resource (resource URI: /currentTemperature) and the target temperature resource (resource URI: /targetTemperature) of the end device perform resource subscription to obtain resource change notifications of these two original resources.
步骤S809,OCF服务端设备上的资源表述发生变化,由于OCF云服务器订阅了该OCF服务 端设备的资源,因此OCF服务端设备需要向OCF云服务器发送变化的资源表述。In step S809, the resource expression on the OCF server device changes. Since the OCF cloud server subscribes to the resource of the OCF server device, the OCF server device needs to send the changed resource expression to the OCF cloud server.
举例来说,OCF设备是空调,具有监测当前温度的功能,实现了/currentTemperature资源,监测到的当前温度发生变化,/currentTemperature资源的温度值发生了变化,当前温度值value变为28℃,需要将最新的温度值发送给OCF云服务器。For example, the OCF device is an air conditioner, which has the function of monitoring the current temperature. It realizes the /currentTemperature resource. The monitored current temperature changes, and the temperature value of the /currentTemperature resource changes, and the current temperature value becomes 28°C. Send the latest temperature value to the OCF cloud server.
步骤S810,OCF服务端设备向OCF云服务器发送资源更新通知同步,提供发生变化的资源的资源表述。In step S810, the OCF server device sends a resource update notification synchronization to the OCF cloud server, and provides a resource expression of the changed resource.
举例来说,OCF服务端设备的当前温度资源/currentTemperature发生变化,当前温度值value变为28℃,则OCF设备将当前温度资源的最新资源表述发送给OCF云服务器,请求消息中提供的资源表述见下:For example, if the current temperature resource/currentTemperature of the OCF server device changes, and the current temperature value becomes 28°C, the OCF device sends the latest resource expression of the current temperature resource to the OCF cloud server, requesting the resource expression provided in the message See below:
{{
"value":28,"value":28,
"unit":"℃""unit":"℃"
}}
步骤S811、OCF云服务器将更新的资源表述复制到影子设备上。Step S811: The OCF cloud server copies the updated resource expression to the shadow device.
举例来说,根据步骤S810中的OCF服务端设备提供的当前温度资源更新的资源表述,OCF云服务器上的影子设备的当前温度资源/currentTemperature的当前温度值value更新为28℃。For example, according to the resource expression of the current temperature resource update provided by the OCF server device in step S810, the current temperature resource of the shadow device on the OCF cloud server/current temperature value value of currentTemperature is updated to 28°C.
需要说明的是,步骤S809至步骤S811为上行资源同步过程,即OCF服务端设备向OCF云服务器上的影子设备进行资源同步的过程。It should be noted that steps S809 to S811 are the uplink resource synchronization process, that is, the process of resource synchronization between the OCF server device and the shadow device on the OCF cloud server.
步骤S812-步骤S815,OCF客户端设备发现并获取影子设备的资源表述。Step S812-Step S815, the OCF client device discovers and obtains the resource representation of the shadow device.
步骤S816,OCF云服务器请求更新OCF服务端设备的资源表述,请求更新的目标资源URI是需要更新资源表述的OCF服务端设备的资源URI。In step S816, the OCF cloud server requests to update the resource expression of the OCF server device, and the target resource URI requested to update is the resource URI of the OCF server device that needs to update the resource expression.
可选的,OCF云服务器将目标资源URI中的设备标识去掉,再向OCF设备发送资源更新请求。Optionally, the OCF cloud server removes the device identifier in the target resource URI, and then sends a resource update request to the OCF device.
举例来说,OCF云服务器收到的OCF客户端设备请求更新的目标温度资源dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature,请求更新的目标温度值value为20℃,则OCF云服务器将目标资源URI中的设备标识dc70373c-1e8d-4fb3-962e-017eaa863989去掉,请求更新的原始设备的目标资源URI为目标温度资源/targetTemperature,请求消息中提供的资源表述见下:For example, if the OCF client device receives the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989/targetTemperature received by the OCF cloud server, and the target temperature value requested to be updated is 20°C, the OCF cloud server sets the target resource The device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 in the URI is removed, and the target resource URI of the original device requesting the update is the target temperature resource/targetTemperature. The resource description provided in the request message is as follows:
{{
"value":20,"value":20,
"unit":"℃""unit":"℃"
}}
步骤S817、OCF服务端设备向OCF云服务器发送资源更新响应,指示资源更新成功。Step S817: The OCF server device sends a resource update response to the OCF cloud server, indicating that the resource update is successful.
步骤S818,OCF云服务器将更新的资源表述复制到影子设备上。In step S818, the OCF cloud server copies the updated resource expression to the shadow device.
举例来说,OCF云服务器根据步骤S817中OCF服务端设备提供的目标温度资源更新的资源表述,OCF云服务器上的影子设备的目标温度资源/targetTemperature的目前温度值value更新为20℃。For example, the OCF cloud server updates the resource expression of the target temperature resource provided by the OCF server device in step S817, and the current temperature value of the target temperature resource/targetTemperature of the shadow device on the OCF cloud server is updated to 20°C.
在具体实施时,由于在步骤S808中OCF云服务器已经订阅了OCF服务端设备的资源,因此OCF云服务器也可以等收到OCF服务端设备发送的资源变化通知后,再将更新的资源表述复制到影子设备上。In specific implementation, since the OCF cloud server has subscribed to the resources of the OCF server device in step S808, the OCF cloud server can also wait for the resource change notification sent by the OCF server device to copy the updated resource expression To the shadow device.
需要说明的是,步骤S812-步骤S818为下行资源同步过程,即OCF云服务器的影子设备向OCF服务端设备进行资源同步的过程。It should be noted that steps S812 to S818 are the downlink resource synchronization process, that is, the process of resource synchronization between the shadow device of the OCF cloud server and the OCF server device.
步骤S819,OCF云服务器的影子设备向OCF客户端设备发送设备资源表述的更新结果。Step S819: The shadow device of the OCF cloud server sends the update result of the device resource expression to the OCF client device.
步骤S820,OCF服务端设备根据资源订阅信息,向OCF云服务器发送资源更新通知,提供更新的资源表述。In step S820, the OCF server device sends a resource update notification to the OCF cloud server according to the resource subscription information, and provides an updated resource expression.
需要说明的是,本发明实施例中,步骤S809-步骤S811,与步骤S812-步骤S818可以均执行,也可以只执行步骤S809-步骤S811,还可以只执行步骤S812-步骤S818。在步骤S809至步骤S818均执行的情况下,步骤S809-步骤S811可以发生在步骤S812-步骤S818之前,步骤S809-步骤S811也可以发生在步骤S812-步骤S818之后。It should be noted that, in the embodiment of the present invention, step S809-step S811, and step S812-step S818 may be executed, or only step S809-step S811 may be executed, or only step S812-step S818 may be executed. In the case where all steps S809 to S818 are executed, step S809-step S811 may occur before step S812-step S818, and step S809-step S811 may also occur after step S812-step S818.
为实现上述影子设备的生成方法,本发明实施例提供一种服务端设备,所述服务端设备900的组成结构,如图10所示,包括:To implement the foregoing shadow device generation method, an embodiment of the present invention provides a server device. The structure of the server device 900, as shown in FIG. 10, includes:
第一发送单元901,配置为向云服务器发送创建影子设备请求消息,所述创建影子设备请求消息用于请求所述云服务器生成所述服务端设备的影子设备;The first sending unit 901 is configured to send a shadow device creation request message to a cloud server, where the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device;
第一接收单元902,配置为接收创建影子设备请求响应消息。The first receiving unit 902 is configured to receive a shadow device creation request response message.
在一些实施例中,所述创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。所述创建影子设备请求消息包括下述中的至少一项:服务端设备标识和所述服务端设备的原始资源表述。In some embodiments, the shadow device creation request message includes: a shadow device creation request message for shadow generation resources. The shadow device creation request message includes at least one of the following: a server device identifier and an original resource expression of the server device.
在一些实施例中,所述创建影子设备请求消息还包括:所述服务端设备的影子同步资源。In some embodiments, the shadow device creation request message further includes: shadow synchronization resources of the server device.
在一些实施例中,所述创建影子设备请求响应消息,用于指示所述影子设备创建成功。In some embodiments, the shadow device creation request response message is used to indicate that the shadow device is successfully created.
在一些实施例中,所述第一发送单元901,还配置为向所述云服务器发送第一资源同步请求消息;In some embodiments, the first sending unit 901 is further configured to send a first resource synchronization request message to the cloud server;
所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第一资源同步请求消息包括服务端设备标识。The first resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the first resource synchronization request message includes the server device identifier.
在一些实施例中,所述第一接收单元902,还配置为接收所述云服务器发送的第一资源同步请求响应消息,所述第一资源同步请求响应消息用于指示资源同步成功。In some embodiments, the first receiving unit 902 is further configured to receive a first resource synchronization request response message sent by the cloud server, where the first resource synchronization request response message is used to indicate successful resource synchronization.
在一些实施例中,所述资源同步的目标资源的URI为资源表述发生变化的原始资源的URI。In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression has changed.
在一些实施例中,所述第一接收单元902,还配置为接收所述云服务器发送的第二资源同步请求消息;In some embodiments, the first receiving unit 902 is further configured to receive a second resource synchronization request message sent by the cloud server;
所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第二资源同步请求消息包括服务端设备标识。The second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
在一些实施例中,所述第一发送单元901,还配置为向所述云服务器发送第二资源同步请求响应消息,所述第二资源同步请求响应消息用于指示资源同步成功。In some embodiments, the first sending unit 901 is further configured to send a second resource synchronization request response message to the cloud server, where the second resource synchronization request response message is used to indicate successful resource synchronization.
在一些实施例中,所述资源同步的目标资源的URI为需要更新资源表述的原始资源的URI。In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression needs to be updated.
在一些实施例中,所述资源同步的目标资源的URI为影子同步资源的URI。In some embodiments, the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
在一些实施例中,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。In some embodiments, the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
为实现上述影子设备的生成方法,本发明实施例提供一种云服务器,所述云服务器1000的组成结构,如图11所示,包括:To implement the foregoing shadow device generation method, an embodiment of the present invention provides a cloud server. The composition structure of the cloud server 1000, as shown in FIG. 11, includes:
第二接收单元1001,配置为接收服务端设备发送的创建影子设备请求消息;The second receiving unit 1001 is configured to receive a shadow device creation request message sent by the server device;
第一处理单元1002,配置为基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。The first processing unit 1002 is configured to generate the shadow device of the server device based on the shadow device creation request message.
在一些实施例中,所述创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。In some embodiments, the shadow device creation request message includes: a shadow device creation request message for shadow generation resources.
在一些实施例中,所述创建影子设备请求消息包括下述中的至少一项:服务端设备标识和所述服务端设备的原始资源表述。In some embodiments, the shadow device creation request message includes at least one of the following: a server device identifier and an original resource expression of the server device.
在一些实施例中,所述创建影子设备请求消息还包括:所述服务端设备的影子同步资源。In some embodiments, the shadow device creation request message further includes: shadow synchronization resources of the server device.
在一些实施例中,所述影子设备的设备标识与所述服务端设备的设备标识相同;和/或,所述影子设备的复制资源URI与所述服务端设备的原始资源URI相同。In some embodiments, the device identifier of the shadow device is the same as the device identifier of the server device; and/or, the copy resource URI of the shadow device is the same as the original resource URI of the server device.
在一些实施例中,所述影子设备的资源包括影子同步资源。In some embodiments, the resources of the shadow device include shadow synchronization resources.
在一些实施例中,所述云服务器还包括:In some embodiments, the cloud server further includes:
第二发送单元1003,配置为向所述服务端设备发送创建影子设备请求响应消息,所述创建影子设备请求响应消息用于指示所述影子设备创建成功。The second sending unit 1003 is configured to send a shadow device creation request response message to the server device, where the shadow device creation request response message is used to indicate that the shadow device is successfully created.
在一些实施例中,所述第一处理单元1002,还配置为将所述影子设备的复制资源链接发布至所述云服务器的资源发现目录。In some embodiments, the first processing unit 1002 is further configured to publish the copy resource link of the shadow device to the resource discovery directory of the cloud server.
在一些实施例中,所述云服务器的资源发现目录中公布的影子设备的复制资源的URI包括服务端设备标识。In some embodiments, the URI of the copy resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
在一些实施例中,所述第二接收单元1001,还配置为接收所述服务端设备发送的第一同步资源请求消息;所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第一资源同步请求消息包括服务端设备标识。In some embodiments, the second receiving unit 1001 is further configured to receive a first synchronization resource request message sent by the server device; the first resource synchronization request message is used to request the server device to communicate with each other The shadow device performs resource synchronization, and the first resource synchronization request message includes the server device identifier.
在一些实施例中,所述云服务器还包括:In some embodiments, the cloud server further includes:
第三发送单元1004,配置为向所述服务端设备发送第一资源同步请求响应消息,所述第一资源同步请求响应消息用于指示资源同步成功。The third sending unit 1004 is configured to send a first resource synchronization request response message to the server device, where the first resource synchronization request response message is used to indicate successful resource synchronization.
在一些实施例中,所述资源同步的目标资源的URI为资源表述发生变化的原始资源的URI。In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression has changed.
在一些实施例中,所述云服务器还包括:In some embodiments, the cloud server further includes:
第四发送单元1005,配置为向所述服务端设备发送第二资源同步请求消息;The fourth sending unit 1005 is configured to send a second resource synchronization request message to the server device;
所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第二资源同步请求消息包括服务端设备标识。The second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
在一些实施例中,所述第二接收单元1001,还配置为接收所述服务端设备发送的第二资源同步请求响应消息,所述第二资源同步请求响应消息用于指示资源同步成功。In some embodiments, the second receiving unit 1001 is further configured to receive a second resource synchronization request response message sent by the server device, where the second resource synchronization request response message is used to indicate successful resource synchronization.
在一些实施例中,所述资源同步的目标资源的URI为需要更新资源表述的原始资源的URI。In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression needs to be updated.
在一些实施例中,所述资源同步的目标资源的URI为影子同步资源的URI。In some embodiments, the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
在一些实施例中,所述第一处理单元1002,还配置为更新所述云服务器上的影子设备的资源表述。In some embodiments, the first processing unit 1002 is further configured to update the resource expression of the shadow device on the cloud server.
在一些实施例中,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。In some embodiments, the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
为实现上述影子设备的生成方法,本发明实施例提供另一种服务端设备,所述服务端设备2000的组成结构,如图12所示,包括:In order to implement the foregoing shadow device generation method, an embodiment of the present invention provides another server device. The structure of the server device 2000, as shown in FIG. 12, includes:
第五发送单元2001,配置为向云服务器发送资源链接对应的资源表述,所述资源链接由所述服务端设备发布到所述云服务器;A fifth sending unit 2001, configured to send a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
所述资源表述用于所述云服务器生成所述服务端设备的影子设备。The resource expression is used by the cloud server to generate the shadow device of the server device.
在一些实施例中,所述服务端设备还包括:In some embodiments, the server device further includes:
第三接收单元2002,接收所述云服务器发送的获取资源表述的请求消息。The third receiving unit 2002 receives the request message for obtaining the resource expression sent by the cloud server.
在一些实施例中,所述获取资源表述的请求消息包括:获取所述服务端设备发布到所述云服务器的一个资源链接对应的资源表述。In some embodiments, the request message for obtaining a resource expression includes: obtaining a resource expression corresponding to a resource link published by the server device to the cloud server.
在一些实施例中,所述第五发送单元2001,配置为向所述云服务器发送一个资源链接对应的资源表述。In some embodiments, the fifth sending unit 2001 is configured to send a resource expression corresponding to a resource link to the cloud server.
在一些实施例中,所述获取资源表述的请求消息包括:获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。In some embodiments, the request message for obtaining resource expressions includes: obtaining resource expressions corresponding to all resource links published by the server device to the cloud server.
在一些实施例中,所述第五发送单元2001,配置为向所述云服务器发送全部资源链接对应的资源表述,所述全部资源链接由所述服务端设备发布到所述云服务器。In some embodiments, the fifth sending unit 2001 is configured to send resource expressions corresponding to all resource links to the cloud server, and the all resource links are published by the server device to the cloud server.
在一些实施例中,所述服务端设备还包括:In some embodiments, the server device further includes:
第四接收单元2003,配置为接收所述云服务器发送的订阅服务端设备的原始资源的请求消息;The fourth receiving unit 2003 is configured to receive a request message for subscribing to the original resource of the server device sent by the cloud server;
所述订阅服务端设备的原始资源的请求消息,用于所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。The request message for subscribing to the original resource of the server device is used to send the changed original resource expression to the cloud server when the original resource expression on the server device changes.
在一些实施例中,所述服务端设备还包括:In some embodiments, the server device further includes:
第五接收单元2004,配置为接收所述云服务器发送的更新服务端设备的资源表述的请求消息;所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的URI为需要更新资源表述的原始资源的URI。The fifth receiving unit 2004 is configured to receive a request message for updating the resource expression of the server device sent by the cloud server; in the request message for updating the resource expression of the server device, the URI of the target resource requested to be updated is that it needs to be updated The URI of the original resource represented by the resource.
在一些实施例中,所述目标资源的URI不包括服务端设备标识。In some embodiments, the URI of the target resource does not include the server device identifier.
在一些实施例中,所述第五发送单元2001,还配置为向所述云服务器发送更新服务端设备的资源表述的请求响应消息;In some embodiments, the fifth sending unit 2001 is further configured to send a request response message for updating the resource expression of the server device to the cloud server;
所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。The request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
为实现上述影子设备的生成方法,本发明实施例提供另一种云服务器,所述云服务器3000的组成结构,如图13所示,包括:In order to implement the foregoing shadow device generation method, an embodiment of the present invention provides another cloud server. The composition structure of the cloud server 3000, as shown in FIG. 13, includes:
第六接收单元3001,配置为获取资源链接对应的资源表述,所述资源链接由服务端设备发布到所述云服务器;The sixth receiving unit 3001 is configured to obtain a resource expression corresponding to a resource link, and the resource link is published by the server device to the cloud server;
第二处理单元3002,配置为基于所述资源表述,生成所述服务端设备的影子设备。The second processing unit 3002 is configured to generate a shadow device of the server device based on the resource expression.
在一些实施例中,所述云服务器还包括:In some embodiments, the cloud server further includes:
第六发送单元3003,配置为向所述服务端设备发送获取资源表述请求消息。The sixth sending unit 3003 is configured to send a resource representation request message to the server device.
在一些实施例中,所述第六接收单元3001,配置为获取所述服务端发布到所述云服务器的一个资源链接对应的资源表述。In some embodiments, the sixth receiving unit 3001 is configured to obtain a resource expression corresponding to a resource link published by the server to the cloud server.
在一些实施例中,所述第六接收单元3001,配置为接收所述服务端设备发送的一个资源链接对应的资源表述。In some embodiments, the sixth receiving unit 3001 is configured to receive a resource expression corresponding to a resource link sent by the server device.
在一些实施例中,所述第六接收单元3001,配置为获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。In some embodiments, the sixth receiving unit 3001 is configured to obtain resource expressions corresponding to all resource links published by the server device to the cloud server.
在一些实施例中,所述第六接收单元3001,配置为接收所述服务端设备发送的全部资源链接对应的资源表述,所述全部资源链接由所述服务端设备发布到所述云服务器。In some embodiments, the sixth receiving unit 3001 is configured to receive resource expressions corresponding to all resource links sent by the server device, and the all resource links are published by the server device to the cloud server.
在一些实施例中,所述方法还包括:In some embodiments, the method further includes:
第七发送单元3004,配置为向所述服务端设备发送订阅服务端设备的原始资源的请求消息;The seventh sending unit 3004 is configured to send a request message for subscribing to the original resource of the server device to the server device;
所述订阅服务端设备的原始资源的请求消息,用于请求所述服务端设备在所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。The request message for subscribing to the original resource of the server device is used to request the server device to send the changed original resource expression to the cloud server when the original resource expression on the server device changes .
在一些实施例中,所述第六接收单元3001接收到发生变化的资源的资源表述的情况下,所述第二处理单元3002,配置为基于所述发生变化的资源的资源表述,更新所述影子设备的资源。In some embodiments, when the sixth receiving unit 3001 receives the resource expression of the resource that has changed, the second processing unit 3002 is configured to update the resource expression of the resource that has changed. Resources of the shadow device.
在一些实施例中,所述云服务器还包括:In some embodiments, the cloud server further includes:
第八发送单元3005,配置为向所述服务端设备发送更新服务端设备的资源表述的请求消息;所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的统一资源标识符URI为需要更新资源表述的原始资源的URI。The eighth sending unit 3005 is configured to send a request message for updating the resource expression of the server device to the server device; in the request message for updating the resource expression of the server device, the uniform resource identifier of the target resource requested to be updated The URI is the URI of the original resource that needs to update the resource expression.
在一些实施例中,所述目标资源的URI不包括服务端设备标识。In some embodiments, the URI of the target resource does not include the server device identifier.
在一些实施例中,所述第六接收单元3001,还配置为接收更新服务端设备的资源表述的请求响应消息;In some embodiments, the sixth receiving unit 3001 is further configured to receive a request response message for updating the resource expression of the server device;
所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。The request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
在一些实施例中,所述第二处理单元3002,配置为基于所述更新服务端设备的资源表述的请求响应消息,更新所述影子设备的资源。In some embodiments, the second processing unit 3002 is configured to update the resource of the shadow device based on the request response message for updating the resource expression of the server device.
在一些实施例中,所述影子设备的设备标识与所述服务端设备的设备标识相同。In some embodiments, the device identifier of the shadow device is the same as the device identifier of the server device.
需要说明的是,本发明实施例中,所述原始设备是指服务端设备;本发明实施例中服务端设备可以为OCF服务端设备,云服务器可以为OCF云服务器,客户端设备可以为OCF客户端设备。It should be noted that in the embodiment of the present invention, the original device refers to the server device; in the embodiment of the present invention, the server device may be an OCF server device, the cloud server may be an OCF cloud server, and the client device may be OCF Client device.
本发明实施例还提供一种服务端设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述服务端设备执行的影子设备的生成方法的步骤。The embodiment of the present invention also provides a server device, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is used to execute the server device when the computer program is running Perform the steps of the shadow device generation method.
本发明实施例还提供一种云服务器,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行上述云服务器执行的影子设备的生成方法的步骤。The embodiment of the present invention also provides a cloud server, including a processor and a memory for storing a computer program that can run on the processor, wherein the processor is used to execute the above-mentioned cloud server when the computer program is running. The steps of the shadow device generation method.
图14是本发明实施例的电子设备(服务端设备和云服务器)的硬件组成结构示意图,电子设备700包括:至少一个处理器701、存储器702和至少一个网络接口704。电子设备700中的各个组件通过总线***705耦合在一起。可理解,总线***705用于实现这些组件之间的连接通信。总线***705除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图14中将各种总线都标为总线***705。14 is a schematic diagram of the hardware composition structure of an electronic device (a server device and a cloud server) according to an embodiment of the present invention. The electronic device 700 includes: at least one processor 701, a memory 702, and at least one network interface 704. The various components in the electronic device 700 are coupled together through the bus system 705. It can be understood that the bus system 705 is used to implement connection and communication between these components. In addition to the data bus, the bus system 705 also includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus system 705 in FIG. 14.
可以理解,存储器702可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是ROM、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器702旨在包括但不限于这些和任意其它适合类型的存储器。It is understood that the memory 702 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. Among them, the non-volatile memory may be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and electrically erasable Programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), magnetic random access memory (FRAM, ferromagnetic random access memory), flash memory (Flash Memory), magnetic surface memory, optical disk, or CD-ROM -ROM, Compact Disc Read-Only Memory); Magnetic surface memory can be disk storage or tape storage. The volatile memory may be random access memory (RAM, Random Access Memory), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (SRAM, Static Random Access Memory), synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), and dynamic random access Memory (DRAM, Dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), enhanced -Type synchronous dynamic random access memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), synchronous connection dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, Direct Rambus Random Access Memory) ). The memory 702 described in the embodiment of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
本发明实施例中的存储器702用于存储各种类型的数据以支持电子设备700的操作。这些数据的示例包括:用于在电子设备700上操作的任何计算机程序,如应用程序7022。实现本发明实施例方法的程序可以包含在应用程序7022中。The memory 702 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 700. Examples of these data include: any computer program used to operate on the electronic device 700, such as the application program 7022. The program for implementing the method of the embodiment of the present invention may be included in the application program 7022.
上述本发明实施例揭示的方法可以应用于处理器701中,或者由处理器701实现。处理器701可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理 器701中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器701可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器701可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器702,处理器701读取存储器702中的信息,结合其硬件完成前述方法的步骤。The method disclosed in the foregoing embodiment of the present invention may be applied to the processor 701 or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or instructions in the form of software. The aforementioned processor 701 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 701 may implement or execute various methods, steps, and logical block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, and the storage medium is located in the memory 702. The processor 701 reads the information in the memory 702 and completes the steps of the foregoing method in combination with its hardware.
在示例性实施例中,电子设备700可以被一个或多个应用专用集成电路(ASIC,Application Specific Integrated Circuit)、DSP、可编程逻辑器件(PLD,Programmable Logic Device)、复杂可编程逻辑器件(CPLD,Complex Programmable Logic Device)、FPGA、通用处理器、控制器、MCU、MPU、或其他电子元件实现,用于执行前述方法。In an exemplary embodiment, the electronic device 700 may be used by one or more application specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), and complex programmable logic device (CPLD). , Complex Programmable Logic Device), FPGA, general-purpose processor, controller, MCU, MPU, or other electronic components to implement the foregoing method.
本申请实施例还提供了一种存储介质,用于存储计算机程序。The embodiment of the present application also provides a storage medium for storing computer programs.
可选的,该存储介质可应用于本申请实施例中的终端设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。Optionally, the storage medium can be applied to the terminal device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process in each method of the embodiment of the present application. For brevity, details are not repeated here.
本发明是参照根据本发明实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above are only the preferred embodiments of the present invention and are not used to limit the scope of protection of the present invention. Any modification, equivalent replacement and improvement made within the spirit and principle of the present invention shall be included in Within the protection scope of the present invention.

Claims (116)

  1. 一种影子设备的生成方法,所述方法包括:A method for generating a shadow device, the method comprising:
    服务端设备向云服务器发送创建影子设备请求消息,所述创建影子设备请求消息用于请求所述云服务器生成所述服务端设备的影子设备;The server device sends a shadow device creation request message to the cloud server, where the shadow device creation request message is used to request the cloud server to generate the shadow device of the server device;
    所述服务端设备接收创建影子设备请求响应消息。The server device receives a shadow device creation request response message.
  2. 根据权利要求1所述的方法,其中,所述创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。The method according to claim 1, wherein the shadow device creation request message comprises: a shadow device creation request message for shadow generation resources.
  3. 根据权利要求1或2所述的方法,其中,所述创建影子设备请求消息包括下述中的至少一项:The method according to claim 1 or 2, wherein the shadow device creation request message includes at least one of the following:
    服务端设备标识和所述服务端设备的原始资源表述。The server device identifier and the original resource expression of the server device.
  4. 根据权利要求3所述的方法,其中,所述创建影子设备请求消息还包括:The method according to claim 3, wherein said creating shadow device request message further comprises:
    所述服务端设备的影子同步资源。The shadow synchronization resource of the server device.
  5. 根据权利要求1至4任一项所述的方法,其中,所述创建影子设备请求响应消息,用于指示所述影子设备创建成功。The method according to any one of claims 1 to 4, wherein the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  6. 根据权利要求1至5任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    所述服务端设备向所述云服务器发送第一资源同步请求消息;Sending, by the server device, a first resource synchronization request message to the cloud server;
    所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第一资源同步请求消息包括服务端设备标识。The first resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the first resource synchronization request message includes the server device identifier.
  7. 根据权利要求6所述的方法,其中,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    所述服务端设备接收所述云服务器发送的第一资源同步请求响应消息,所述第一资源同步请求响应消息用于指示资源同步成功。The server device receives a first resource synchronization request response message sent by the cloud server, where the first resource synchronization request response message is used to indicate that the resource synchronization is successful.
  8. 根据权利要求6或7所述的方法,其中,所述资源同步的目标资源的统一资源标识符URI为资源表述发生变化的原始资源的URI。The method according to claim 6 or 7, wherein the uniform resource identifier URI of the target resource of the resource synchronization is the URI of the original resource whose resource expression has changed.
  9. 根据权利要求1至8任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:
    所述服务端设备接收所述云服务器发送的第二资源同步请求消息;Receiving, by the server device, a second resource synchronization request message sent by the cloud server;
    所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第二资源同步请求消息包括服务端设备标识。The second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
  10. 根据权利要求9所述的方法,其中,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    所述服务端设备向所述云服务器发送第二资源同步请求响应消息,所述第二资源同步请求响应消息用于指示资源同步成功。The server device sends a second resource synchronization request response message to the cloud server, where the second resource synchronization request response message is used to indicate that the resource synchronization is successful.
  11. 根据权利要求9或10所述的方法,其中,所述资源同步的目标资源的URI为需要更新资源表述的原始资源的URI。The method according to claim 9 or 10, wherein the URI of the target resource of the resource synchronization is the URI of the original resource whose resource expression needs to be updated.
  12. 根据权利要求6或9所述的方法,其中,所述资源同步的目标资源的URI为影子同步资源的URI。The method according to claim 6 or 9, wherein the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
  13. 根据权利要求9或10所述的方法,其中,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。The method according to claim 9 or 10, wherein the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
  14. 一种影子设备的生成方法,所述方法包括:A method for generating a shadow device, the method comprising:
    云服务器接收服务端设备发送的创建影子设备请求消息;The cloud server receives the shadow device creation request message sent by the server device;
    所述云服务器基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。The cloud server generates the shadow device of the server device based on the shadow device creation request message.
  15. 根据权利要求14所述的方法,其中,所述创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。The method according to claim 14, wherein the shadow device creation request message comprises: a shadow device creation request message for shadow generation resources.
  16. 根据权利要求14或15所述的方法,其中,所述创建影子设备请求消息包括下述中的至少一项:The method according to claim 14 or 15, wherein the shadow device creation request message includes at least one of the following:
    服务端设备标识和所述服务端设备的原始资源表述。The server device identifier and the original resource expression of the server device.
  17. 根据权利要求16所述的方法,其中,所述创建影子设备请求消息还包括:The method according to claim 16, wherein the request message for creating a shadow device further comprises:
    所述服务端设备的影子同步资源。The shadow synchronization resource of the server device.
  18. 根据权利要求14至17任一项所述的方法,其中,所述影子设备的设备标识与所述服务端设备的设备标识相同;The method according to any one of claims 14 to 17, wherein the device ID of the shadow device is the same as the device ID of the server device;
    和/或,所述影子设备的复制资源统一资源标识符URI与所述服务端设备的原始资源URI相同。And/or, the uniform resource identifier URI of the duplicate resource of the shadow device is the same as the original resource URI of the server device.
  19. 根据权利要求18所述的方法,其中,所述影子设备的资源包括影子同步资源。The method of claim 18, wherein the resources of the shadow device include shadow synchronization resources.
  20. 根据权利要求14至19任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 14 to 19, wherein the method further comprises:
    所述云服务器向所述服务端设备发送创建影子设备请求响应消息,所述创建影子设备请求响应消息用于指示所述影子设备创建成功。The cloud server sends a shadow device creation request response message to the server device, and the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  21. 根据权利要求14至20任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 14 to 20, wherein the method further comprises:
    所述云服务器将所述影子设备的复制资源链接发布至所述云服务器的资源发现目录。The cloud server publishes the copy resource link of the shadow device to the resource discovery directory of the cloud server.
  22. 根据权利要求21所述的方法,其中,所述云服务器的资源发现目录中公布的影子设备的复制资源的URI包括服务端设备标识。The method according to claim 21, wherein the URI of the copy resource of the shadow device published in the resource discovery directory of the cloud server includes a server device identifier.
  23. 根据权利要求14至22任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 14 to 22, wherein the method further comprises:
    所述云服务器接收所述服务端设备发送的第一同步资源请求消息;所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第一资源同步请求消息包括服务端设备标识。The cloud server receives a first synchronization resource request message sent by the server device; the first resource synchronization request message is used to request the server device to synchronize resources with the shadow device, and the first resource synchronization The request message includes the server device identification.
  24. 根据权利要求23所述的方法,其中,所述方法还包括:The method of claim 23, wherein the method further comprises:
    所述云服务器向所述服务端设备发送第一资源同步请求响应消息,所述第一资源同步请求响应消息用于指示资源同步成功。The cloud server sends a first resource synchronization request response message to the server device, where the first resource synchronization request response message is used to indicate that the resource synchronization is successful.
  25. 根据权利要求23或24所述的方法,其中,所述资源同步的目标资源的URI为资源表述发生变化的原始资源的URI。The method according to claim 23 or 24, wherein the URI of the target resource of the resource synchronization is the URI of the original resource whose resource expression has changed.
  26. 根据权利要求14至25任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 14 to 25, wherein the method further comprises:
    所述云服务器向所述服务端设备发送第二资源同步请求消息;Sending, by the cloud server, a second resource synchronization request message to the server device;
    所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第二资源同步请求消息包括服务端设备标识。The second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
  27. 根据权利要求26所述的方法,其中,所述方法还包括:The method of claim 26, wherein the method further comprises:
    所述云服务器接收所述服务端设备发送的第二资源同步请求响应消息,所述第二资源同步请求响应消息用于指示资源同步成功。The cloud server receives a second resource synchronization request response message sent by the server device, where the second resource synchronization request response message is used to indicate that the resource synchronization is successful.
  28. 根据权利要求26或27所述的方法,其中,所述资源同步的目标资源的URI为需要更新资源表述的原始资源的URI。The method according to claim 26 or 27, wherein the URI of the target resource of the resource synchronization is the URI of the original resource whose resource expression needs to be updated.
  29. 根据权利要求23或26所述的方法,其中,所述资源同步的目标资源的URI为影子同步资源的URI。The method according to claim 23 or 26, wherein the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
  30. 根据权利要求14至29任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 14 to 29, wherein the method further comprises:
    所述云服务器更新所述云服务器上的影子设备的资源表述。The cloud server updates the resource expression of the shadow device on the cloud server.
  31. 根据权利要求26或27所述的方法,其中,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。The method according to claim 26 or 27, wherein the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
  32. 一种影子设备生成方法,所述方法还包括:A shadow device generation method, the method further includes:
    服务端设备向云服务器发送资源链接对应的资源表述,所述资源链接由所述服务端设备发布到所述云服务器;The server device sends a resource expression corresponding to the resource link to the cloud server, and the resource link is published by the server device to the cloud server;
    所述资源表述用于所述云服务器生成所述服务端设备的影子设备。The resource expression is used by the cloud server to generate the shadow device of the server device.
  33. 根据权利要求32所述的方法,其中,所述方法还包括:The method of claim 32, wherein the method further comprises:
    所述服务端设备接收所述云服务器发送的获取资源表述的请求消息。The server device receives a request message for obtaining a resource expression sent by the cloud server.
  34. 根据权利要求33所述的方法,其中,所述获取资源表述的请求消息包括:The method according to claim 33, wherein the request message for obtaining the resource expression comprises:
    获取所述服务端设备发布到所述云服务器的一个资源链接对应的资源表述。Acquire a resource expression corresponding to a resource link published by the server device to the cloud server.
  35. 根据权利要求34所述的方法,其中,所述服务端设备向云服务器发送资源链接对应的资源表述,包括:The method according to claim 34, wherein the server device sending the resource expression corresponding to the resource link to the cloud server comprises:
    所述服务端设备向所述云服务器发送一个资源链接对应的资源表述。The server device sends a resource expression corresponding to a resource link to the cloud server.
  36. 根据权利要求33所述的方法,其中,所述获取资源表述的请求消息包括:The method according to claim 33, wherein the request message for obtaining the resource expression comprises:
    获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。Obtain resource expressions corresponding to all resource links published by the server device to the cloud server.
  37. 根据权利要求36所述的方法,其中,所述服务端设备向云服务器发送资源链接对应的资源表述,包括:The method according to claim 36, wherein the server device sending the resource expression corresponding to the resource link to the cloud server comprises:
    所述服务端设备向所述云服务器发送全部资源链接对应的资源表述,所述全部资源链接由所述服务端设备发布到所述云服务器。The server device sends the resource expressions corresponding to all resource links to the cloud server, and the all resource links are published by the server device to the cloud server.
  38. 根据权利要求32至37任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 32 to 37, wherein the method further comprises:
    所述服务端设备接收所述云服务器发送的订阅服务端设备的原始资源的请求消息;Receiving, by the server device, a request message for subscribing to the original resource of the server device sent by the cloud server;
    所述订阅服务端设备的原始资源的请求消息,用于所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。The request message for subscribing to the original resource of the server device is used to send the changed original resource expression to the cloud server when the original resource expression on the server device changes.
  39. 根据权利要求32至38任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 32 to 38, wherein the method further comprises:
    所述服务端设备接收所述云服务器发送的更新服务端设备的资源表述的请求消息;所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的统一资源标识符URI为需要更新资源表述的原始资源的URI。The server device receives a request message for updating the resource expression of the server device sent by the cloud server; in the request message for updating the resource expression of the server device, the uniform resource identifier URI of the target resource requested to be updated is required Update the URI of the original resource represented by the resource.
  40. 根据权利要求39所述的方法,其中,所述目标资源的URI不包括服务端设备标识。The method of claim 39, wherein the URI of the target resource does not include a server device identifier.
  41. 根据权利要求38至40任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 38 to 40, wherein the method further comprises:
    所述服务端设备向所述云服务器发送更新服务端设备的资源表述的请求响应消息;Sending, by the server device, a request response message for updating the resource expression of the server device to the cloud server;
    所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。The request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  42. 一种影子设备的生成方法,所述方法包括:A method for generating a shadow device, the method comprising:
    云服务器获取资源链接对应的资源表述,所述资源链接由服务端设备发布到所述云服务器;The cloud server obtains the resource expression corresponding to the resource link, and the resource link is published to the cloud server by the server device;
    所述云服务器基于所述资源表述,生成所述服务端设备的影子设备。The cloud server generates the shadow device of the server device based on the resource expression.
  43. 根据权利要求42所述的方法,其中,所述方法还包括:The method of claim 42, wherein the method further comprises:
    所述云服务器向所述服务端设备发送获取资源表述请求消息。The cloud server sends a resource expression request message to the server device.
  44. 根据权利要求43所述的方法,其中,所述获取资源表述请求消息包括:The method according to claim 43, wherein the obtaining resource expression request message comprises:
    获取所述服务端发布到所述云服务器的一个资源链接对应的资源表述。Obtain a resource expression corresponding to a resource link published by the server to the cloud server.
  45. 根据权利要求44所述的方法,其中,所述云服务器获取资源链接对应的资源表述,包括:The method according to claim 44, wherein said cloud server obtaining the resource expression corresponding to the resource link comprises:
    所述云服务器接收所述服务端设备发送的一个资源链接对应的资源表述。The cloud server receives a resource expression corresponding to a resource link sent by the server device.
  46. 根据权利要求43所述的方法,其中,所述获取资源表述请求消息包括:The method according to claim 43, wherein the obtaining resource expression request message comprises:
    获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。Obtain resource expressions corresponding to all resource links published by the server device to the cloud server.
  47. 根据权利要求46所述的方法,其中,所述云服务器获取资源链接对应的资源表述,包括:The method according to claim 46, wherein said cloud server obtaining a resource expression corresponding to a resource link comprises:
    所述云服务器接收所述服务端设备发送的全部资源链接对应的资源表述,所述全部资源链接由所述服务端设备发布到所述云服务器。The cloud server receives resource expressions corresponding to all resource links sent by the server device, and the all resource links are published by the server device to the cloud server.
  48. 根据权利要求42至47任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 42 to 47, wherein the method further comprises:
    所述云服务器向所述服务端设备发送订阅服务端设备的原始资源的请求消息;Sending, by the cloud server, a request message for subscribing to the original resource of the server device to the server device;
    所述订阅服务端设备的原始资源的请求消息,用于请求所述服务端设备在所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。The request message for subscribing to the original resource of the server device is used to request the server device to send the changed original resource expression to the cloud server when the original resource expression on the server device changes .
  49. 根据权利要求42至48任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 42 to 48, wherein the method further comprises:
    所述云服务器接收到发生变化的资源的资源表述的情况下,所述云服务器基于所述发生变化的资源的资源表述,更新所述影子设备的资源。When the cloud server receives the resource expression of the changed resource, the cloud server updates the resource of the shadow device based on the resource expression of the changed resource.
  50. 根据权利要求42至49任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 42 to 49, wherein the method further comprises:
    所述云服务器向所述服务端设备发送更新服务端设备的资源表述的请求消息;所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的统一资源标识符URI为需要更新资源表述的原始资源的URI。The cloud server sends a request message for updating the resource expression of the server device to the server device; in the request message for updating the resource expression of the server device, the uniform resource identifier URI of the target resource requested to be updated is that it needs to be updated The URI of the original resource represented by the resource.
  51. 根据权利要求50所述的方法,其中,所述目标资源的URI不包括服务端设备标识。The method according to claim 50, wherein the URI of the target resource does not include a server device identifier.
  52. 根据权利要求48至51任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 48 to 51, wherein the method further comprises:
    所述云服务器接收更新服务端设备的资源表述的请求响应消息;The cloud server receives a request response message for updating the resource expression of the server device;
    所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。The request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  53. 根据权利要求52所述的方法,其中,所述方法还包括:The method of claim 52, wherein the method further comprises:
    所述云服务器基于所述更新服务端设备的资源表述的请求响应消息,更新所述影子设备的资源。The cloud server updates the resource of the shadow device based on the request response message for updating the resource expression of the server device.
  54. 根据权利要求42至53任一项所述的方法,其中,所述影子设备的设备标识与所述服务端设备的设备标识相同。The method according to any one of claims 42 to 53, wherein the device ID of the shadow device is the same as the device ID of the server device.
  55. 一种服务端设备,所述服务端设备包括:A server-side device, the server-side device includes:
    第一发送单元,配置为向云服务器发送创建影子设备请求消息,所述创建影子设备请求消息用于请求所述云服务器生成所述服务端设备的影子设备;The first sending unit is configured to send a shadow device creation request message to a cloud server, where the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device;
    第一接收单元,配置为接收创建影子设备请求响应消息。The first receiving unit is configured to receive a shadow device creation request response message.
  56. 根据权利要求55所述的服务端设备,其中,所述创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。The server device according to claim 55, wherein the shadow device creation request message comprises: a shadow device creation request message for shadow generation resources.
  57. 根据权利要求55或56所述的服务端设备,其中,所述创建影子设备请求消息包括下述中 的至少一项:The server device according to claim 55 or 56, wherein the shadow device creation request message includes at least one of the following:
    服务端设备标识和所述服务端设备的原始资源表述。The server device identifier and the original resource expression of the server device.
  58. 根据权利要求57所述的服务端设备,其中,所述创建影子设备请求消息还包括:The server device according to claim 57, wherein the creating shadow device request message further comprises:
    所述服务端设备的影子同步资源。The shadow synchronization resource of the server device.
  59. 根据权利要求55至58任一项所述的服务端设备,其中,所述创建影子设备请求响应消息,用于指示所述影子设备创建成功。The server device according to any one of claims 55 to 58, wherein the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  60. 根据权利要求55至59任一项所述的服务端设备,其中,所述第一发送单元,还配置为向所述云服务器发送第一资源同步请求消息;The server device according to any one of claims 55 to 59, wherein the first sending unit is further configured to send a first resource synchronization request message to the cloud server;
    所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第一资源同步请求消息包括服务端设备标识。The first resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the first resource synchronization request message includes the server device identifier.
  61. 根据权利要求60所述的服务端设备,其中,所述第一接收单元,还配置为接收所述云服务器发送的第一资源同步请求响应消息,所述第一资源同步请求响应消息用于指示资源同步成功。The server device according to claim 60, wherein the first receiving unit is further configured to receive a first resource synchronization request response message sent by the cloud server, and the first resource synchronization request response message is used to indicate Resource synchronization is successful.
  62. 根据权利要求60或61所述的服务端设备,其中,所述资源同步的目标资源的统一资源标识符URI为资源表述发生变化的原始资源的URI。The server device according to claim 60 or 61, wherein the uniform resource identifier URI of the target resource for resource synchronization is the URI of the original resource whose resource expression has changed.
  63. 根据权利要求55至62任一项所述的服务端设备,其中,所述第一接收单元,还配置为接收所述云服务器发送的第二资源同步请求消息;The server device according to any one of claims 55 to 62, wherein the first receiving unit is further configured to receive a second resource synchronization request message sent by the cloud server;
    所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第二资源同步请求消息包括服务端设备标识。The second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
  64. 根据权利要求63所述的服务端设备,其中,所述第一发送单元,还配置为向所述云服务器发送第二资源同步请求响应消息,所述第二资源同步请求响应消息用于指示资源同步成功。The server device according to claim 63, wherein the first sending unit is further configured to send a second resource synchronization request response message to the cloud server, and the second resource synchronization request response message is used to indicate resource The synchronization is successful.
  65. 根据权利要求63或64所述的服务端设备,其中,所述资源同步的目标资源的URI为需要更新资源表述的原始资源的URI。The server device according to claim 63 or 64, wherein the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression needs to be updated.
  66. 根据权利要求60或63任一项所述的服务端设备,其中,所述资源同步的目标资源的URI为影子同步资源的URI。The server device according to any one of claims 60 or 63, wherein the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
  67. 根据权利要求63或64所述的服务端设备,其中,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。The server device according to claim 63 or 64, wherein the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
  68. 一种云服务器,所述云服务器包括:A cloud server, the cloud server includes:
    第二接收单元,配置为接收服务端设备发送的创建影子设备请求消息;The second receiving unit is configured to receive a shadow device creation request message sent by the server device;
    第一处理单元,配置为基于所述创建影子设备请求消息,生成所述服务端设备的影子设备。The first processing unit is configured to generate a shadow device of the server device based on the shadow device creation request message.
  69. 根据权利要求68所述的云服务器,其中,所述创建影子设备请求消息包括:针对影子生成资源的创建影子设备请求消息。The cloud server according to claim 68, wherein the shadow device creation request message comprises: a shadow device creation request message for shadow generation resources.
  70. 根据权利要求68或69所述的云服务器,其中,所述创建影子设备请求消息包括下述中的至少一项:The cloud server according to claim 68 or 69, wherein the shadow device creation request message includes at least one of the following:
    服务端设备标识和所述服务端设备的原始资源表述。The server device identifier and the original resource expression of the server device.
  71. 根据权利要求70所述的云服务器,其中,所述创建影子设备请求消息还包括:The cloud server according to claim 70, wherein the shadow device creation request message further comprises:
    所述服务端设备的影子同步资源。The shadow synchronization resource of the server device.
  72. 根据权利要求68至71任一项所述的云服务器,其中,所述影子设备的设备标识与所述服务端设备的设备标识相同;The cloud server according to any one of claims 68 to 71, wherein the device identifier of the shadow device is the same as the device identifier of the server device;
    和/或,所述影子设备的复制资源统一资源标识符URI与所述服务端设备的原始资源URI相同。And/or, the uniform resource identifier URI of the duplicate resource of the shadow device is the same as the original resource URI of the server device.
  73. 根据权利要求72所述的云服务器,其中,所述影子设备的资源包括影子同步资源。The cloud server according to claim 72, wherein the resources of the shadow device comprise shadow synchronization resources.
  74. 根据权利要求68至73任一项所述的云服务器,其中,所述云服务器还包括:The cloud server according to any one of claims 68 to 73, wherein the cloud server further comprises:
    第二发送单元,配置为向所述服务端设备发送创建影子设备请求响应消息,所述创建影子设备请求响应消息用于指示所述影子设备创建成功。The second sending unit is configured to send a shadow device creation request response message to the server device, where the shadow device creation request response message is used to indicate that the shadow device is successfully created.
  75. 根据权利要求68至74任一项所述的云服务器,其中,所述第一处理单元,还配置为将所述影子设备的复制资源链接发布至所述云服务器的资源发现目录。The cloud server according to any one of claims 68 to 74, wherein the first processing unit is further configured to publish the copy resource link of the shadow device to the resource discovery directory of the cloud server.
  76. 根据权利要求75所述的云服务器,其中,所述云服务器的资源发现目录中公布的影子设备的复制资源的URI包括服务端设备标识。The cloud server according to claim 75, wherein the URI of the copy resource of the shadow device published in the resource discovery directory of the cloud server includes a server device identifier.
  77. 根据权利要求68至76任一项所述的云服务器,其中,所述第二接收单元,还配置为接收所述服务端设备发送的第一同步资源请求消息;所述第一资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第一资源同步请求消息包括服务端设备标识。The cloud server according to any one of claims 68 to 76, wherein the second receiving unit is further configured to receive a first synchronization resource request message sent by the server device; the first resource synchronization request message Used to request the server device to synchronize resources with the shadow device, and the first resource synchronization request message includes the server device identifier.
  78. 根据权利要求77所述的云服务器,其中,所述云服务器还包括:The cloud server of claim 77, wherein the cloud server further comprises:
    第三发送单元,配置为向所述服务端设备发送第一资源同步请求响应消息,所述第一资源同步请求响应消息用于指示资源同步成功。The third sending unit is configured to send a first resource synchronization request response message to the server device, where the first resource synchronization request response message is used to indicate successful resource synchronization.
  79. 根据权利要求77或78所述的云服务器,其中,所述资源同步的目标资源的URI为资源表述发生变化的原始资源的URI。The cloud server according to claim 77 or 78, wherein the URI of the target resource of the resource synchronization is the URI of the original resource whose resource expression has changed.
  80. 根据权利要求68至79任一项所述的云服务器,其中,所述云服务器还包括:The cloud server according to any one of claims 68 to 79, wherein the cloud server further comprises:
    第四发送单元,配置为向所述服务端设备发送第二资源同步请求消息;A fourth sending unit, configured to send a second resource synchronization request message to the server device;
    所述第二资源同步请求消息用于请求所述服务端设备与所述影子设备进行资源同步,所述第二资源同步请求消息包括服务端设备标识。The second resource synchronization request message is used to request the server device to perform resource synchronization with the shadow device, and the second resource synchronization request message includes the server device identifier.
  81. 根据权利要求80所述的云服务器,其中,所述第二接收单元,还配置为接收所述服务端设备发送的第二资源同步请求响应消息,所述第二资源同步请求响应消息用于指示资源同步成功。The cloud server according to claim 80, wherein the second receiving unit is further configured to receive a second resource synchronization request response message sent by the server device, and the second resource synchronization request response message is used to indicate Resource synchronization is successful.
  82. 根据权利要求80或81所述的云服务器,其中,所述资源同步的目标资源的URI为需要更新资源表述的原始资源的URI。The cloud server according to claim 80 or 81, wherein the URI of the target resource for resource synchronization is the URI of the original resource whose resource expression needs to be updated.
  83. 根据权利要求77或80所述的云服务器,其中,所述资源同步的目标资源的URI为影子同步资源的URI。The cloud server according to claim 77 or 80, wherein the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
  84. 根据权利要求68至83任一项所述的云服务器,其中,所述第一处理单元,还配置为更新所述云服务器上的影子设备的资源表述。The cloud server according to any one of claims 68 to 83, wherein the first processing unit is further configured to update the resource expression of the shadow device on the cloud server.
  85. 根据权利要求80或81所述的云服务器,其中,所述第二资源同步请求消息中目标资源的URI不包括服务端设备标识。The cloud server according to claim 80 or 81, wherein the URI of the target resource in the second resource synchronization request message does not include the server device identifier.
  86. 一种服务端设备,所述服务端设备包括:A server-side device, the server-side device includes:
    第五发送单元,配置为向云服务器发送资源链接对应的资源表述,所述资源链接由所述服务端设备发布到所述云服务器;A fifth sending unit, configured to send a resource expression corresponding to a resource link to a cloud server, and the resource link is published by the server device to the cloud server;
    所述资源表述用于所述云服务器生成所述服务端设备的影子设备。The resource expression is used by the cloud server to generate the shadow device of the server device.
  87. 根据权利要求86所述的服务端设备,其中,所述服务端设备还包括:The server device according to claim 86, wherein the server device further comprises:
    第三接收单元,接收所述云服务器发送的获取资源表述的请求消息。The third receiving unit receives the request message for obtaining the resource expression sent by the cloud server.
  88. 根据权利要求87所述的服务端设备,其中,所述获取资源表述的请求消息包括:The server device according to claim 87, wherein the request message for obtaining the resource expression comprises:
    获取所述服务端设备发布到所述云服务器的一个资源链接对应的资源表述。Acquire a resource expression corresponding to a resource link published by the server device to the cloud server.
  89. 根据权利要求88所述的服务端设备,其中,所述第五发送单元,配置为向所述云服务器发送一个资源链接对应的资源表述。The server device according to claim 88, wherein the fifth sending unit is configured to send a resource expression corresponding to a resource link to the cloud server.
  90. 根据权利要求87所述的服务端设备,其中,所述获取资源表述的请求消息包括:The server device according to claim 87, wherein the request message for obtaining the resource expression comprises:
    获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。Obtain resource expressions corresponding to all resource links published by the server device to the cloud server.
  91. 根据权利要求90所述的服务端设备,其中,所述第五发送单元,配置为向所述云服务器发送全部资源链接对应的资源表述,所述全部资源链接由所述服务端设备发布到所述云服务器。The server device according to claim 90, wherein the fifth sending unit is configured to send resource expressions corresponding to all resource links to the cloud server, and the all resource links are published by the server device to the cloud server. The cloud server.
  92. 根据权利要求86至91任一项所述的服务端设备,其中,所述服务端设备还包括:The server device according to any one of claims 86 to 91, wherein the server device further comprises:
    第四接收单元,配置为接收所述云服务器发送的订阅服务端设备的原始资源的请求消息;The fourth receiving unit is configured to receive a request message for subscribing to the original resource of the server device sent by the cloud server;
    所述订阅服务端设备的原始资源的请求消息,用于所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。The request message for subscribing to the original resource of the server device is used to send the changed original resource expression to the cloud server when the original resource expression on the server device changes.
  93. 根据权利要求86至92任一项所述的服务端设备,其中,所述服务端设备还包括:The server device according to any one of claims 86 to 92, wherein the server device further comprises:
    第五接收单元,配置为接收所述云服务器发送的更新服务端设备的资源表述的请求消息;所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的统一资源标识符URI为需要更新资源表述的原始资源的URI。The fifth receiving unit is configured to receive a request message for updating the resource expression of the server device sent by the cloud server; in the request message for updating the resource expression of the server device, the uniform resource identifier URI of the target resource requested to be updated The URI of the original resource that needs to be updated.
  94. 根据权利要求93所述的服务端设备,其中,所述目标资源的URI不包括服务端设备标识。The server device according to claim 93, wherein the URI of the target resource does not include the server device identifier.
  95. 根据权利要求92至94任一项所述的服务端设备,其中,所述第五发送单元,还配置为向所述云服务器发送更新服务端设备的资源表述的请求响应消息;The server device according to any one of claims 92 to 94, wherein the fifth sending unit is further configured to send a request response message for updating the resource expression of the server device to the cloud server;
    所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。The request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  96. 一种云服务器,所述云服务器包括:A cloud server, the cloud server includes:
    第六接收单元,配置为获取资源链接对应的资源表述,所述资源链接由服务端设备发布到所述云服务器;The sixth receiving unit is configured to obtain the resource expression corresponding to the resource link, and the resource link is published by the server device to the cloud server;
    第二处理单元,配置为基于所述资源表述,生成所述服务端设备的影子设备。The second processing unit is configured to generate a shadow device of the server device based on the resource expression.
  97. 根据权利要求96所述的云服务器,其中,所述云服务器还包括:The cloud server of claim 96, wherein the cloud server further comprises:
    第六发送单元,配置为向所述服务端设备发送获取资源表述请求消息。The sixth sending unit is configured to send a resource expression acquisition request message to the server device.
  98. 根据权利要求97所述的云服务器,其中,所述第六接收单元,配置为获取所述服务端发 布到所述云服务器的一个资源链接对应的资源表述。The cloud server according to claim 97, wherein the sixth receiving unit is configured to obtain a resource expression corresponding to a resource link posted by the server to the cloud server.
  99. 根据权利要求98所述的云服务器,其中,所述第六接收单元,配置为接收所述服务端设备发送的一个资源链接对应的资源表述。The cloud server according to claim 98, wherein the sixth receiving unit is configured to receive a resource expression corresponding to a resource link sent by the server device.
  100. 根据权利要求97所述的云服务器,其中,所述第六接收单元,配置为获取所述服务端设备发布到所述云服务器的全部资源链接对应的资源表述。The cloud server according to claim 97, wherein the sixth receiving unit is configured to obtain resource expressions corresponding to all resource links published by the server device to the cloud server.
  101. 根据权利要求100所述的云服务器,其中,所述第六接收单元,配置为接收所述服务端设备发送的全部资源链接对应的资源表述,所述全部资源链接由所述服务端设备发布到所述云服务器。The cloud server according to claim 100, wherein the sixth receiving unit is configured to receive resource expressions corresponding to all resource links sent by the server device, and the all resource links are published by the server device to The cloud server.
  102. 根据权利要求96至101任一项所述的云服务器,其中,所述方法还包括:The cloud server according to any one of claims 96 to 101, wherein the method further comprises:
    第七发送单元,配置为向所述服务端设备发送订阅服务端设备的原始资源的请求消息;A seventh sending unit, configured to send a request message for subscribing to the original resource of the server device to the server device;
    所述订阅服务端设备的原始资源的请求消息,用于请求所述服务端设备在所述服务端设备上的原始资源表述发生变化的情况下,向所述云服务器发送发生变化的原始资源表述。The request message for subscribing to the original resource of the server device is used to request the server device to send the changed original resource expression to the cloud server when the original resource expression on the server device changes .
  103. 根据权利要求96至102任一项所述的云服务器,其中,所述第六接收单元接收到发生变化的资源的资源表述的情况下,所述第二处理单元,配置为基于所述发生变化的资源的资源表述,更新所述影子设备的资源。The cloud server according to any one of claims 96 to 102, wherein when the sixth receiving unit receives the resource expression of the changed resource, the second processing unit is configured to be configured based on the changed resource The resource representation of the resource, update the resource of the shadow device.
  104. 根据权利要求96至103任一项所述的云服务器,其中,所述云服务器还包括:The cloud server according to any one of claims 96 to 103, wherein the cloud server further comprises:
    第八发送单元,配置为向所述服务端设备发送更新服务端设备的资源表述的请求消息;所述更新服务端设备的资源表述的请求消息中,请求更新的目标资源的统一资源标识符URI为需要更新资源表述的原始资源的URI。The eighth sending unit is configured to send a request message for updating the resource expression of the server device to the server device; in the request message for updating the resource expression of the server device, the uniform resource identifier URI of the target resource requested to be updated The URI of the original resource that needs to be updated.
  105. 根据权利要求104所述的云服务器,其中,所述目标资源的URI不包括服务端设备标识。The cloud server according to claim 104, wherein the URI of the target resource does not include a server device identifier.
  106. 根据权利要求102至105任一项所述的云服务器,其中,所述第六接收单元,还配置为接收更新服务端设备的资源表述的请求响应消息;The cloud server according to any one of claims 102 to 105, wherein the sixth receiving unit is further configured to receive a request response message for updating the resource expression of the server device;
    所述更新服务端设备的资源表述的请求响应消息,用于指示所述服务端设备更新资源成功。The request response message for updating the resource expression of the server device is used to indicate that the server device has successfully updated the resource.
  107. 根据权利要求106所述的云服务器,其中,所述第二处理单元,配置为基于所述更新服务端设备的资源表述的请求响应消息,更新所述影子设备的资源。The cloud server according to claim 106, wherein the second processing unit is configured to update the resource of the shadow device based on the request response message for updating the resource expression of the server device.
  108. 根据权利要求96至107任一项所述的云服务器,其中,所述影子设备的设备标识与所述服务端设备的设备标识相同。The cloud server according to any one of claims 96 to 107, wherein the device identifier of the shadow device is the same as the device identifier of the server device.
  109. 一种服务端设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,A server device includes a processor and a memory for storing a computer program that can run on the processor, wherein:
    所述处理器用于运行所述计算机程序时,执行权利要求1至13任一项所述的影子设备的生成方法的步骤。When the processor is used to run the computer program, it executes the steps of the shadow device generating method according to any one of claims 1 to 13.
  110. 一种云服务器,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,A cloud server includes a processor and a memory for storing computer programs that can run on the processor, where:
    所述处理器用于运行所述计算机程序时,执行权利要求14至31任一项所述的影子设备的生成方法的步骤。When the processor is used to run the computer program, it executes the steps of the shadow device generating method according to any one of claims 14 to 31.
  111. 一种服务端设备,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,A server device includes a processor and a memory for storing a computer program that can run on the processor, wherein:
    所述处理器用于运行所述计算机程序时,执行权利要求32至41任一项所述的影子设备的生成方法的步骤。When the processor is used to run the computer program, it executes the steps of the shadow device generating method according to any one of claims 32 to 41.
  112. 一种云服务器,包括处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,A cloud server includes a processor and a memory for storing computer programs that can run on the processor, where:
    所述处理器用于运行所述计算机程序时,执行权利要求42至54任一项所述的影子设备的生成方法的步骤。When the processor is used to run the computer program, it executes the steps of the shadow device generating method according to any one of claims 42 to 54.
  113. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求1至13任一项所述的影子设备的生成方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device according to any one of claims 1 to 13 is realized.
  114. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求14至31任一项所述的影子设备的生成方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device according to any one of claims 14 to 31 is realized.
  115. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求32至41任一项所述的影子设备的生成方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device according to any one of claims 32 to 41 is realized.
  116. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现权利要求42至54任一项所述的影子设备的生成方法。A storage medium storing an executable program, and when the executable program is executed by a processor, the method for generating a shadow device according to any one of claims 42 to 54 is realized.
PCT/CN2019/097579 2019-07-24 2019-07-24 Method for generating shadow device, device, and storage medium WO2021012234A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980092716.XA CN113454586A (en) 2019-07-24 2019-07-24 Method and device for generating shadow device and storage medium
PCT/CN2019/097579 WO2021012234A1 (en) 2019-07-24 2019-07-24 Method for generating shadow device, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/097579 WO2021012234A1 (en) 2019-07-24 2019-07-24 Method for generating shadow device, device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021012234A1 true WO2021012234A1 (en) 2021-01-28

Family

ID=74192483

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/097579 WO2021012234A1 (en) 2019-07-24 2019-07-24 Method for generating shadow device, device, and storage medium

Country Status (2)

Country Link
CN (1) CN113454586A (en)
WO (1) WO2021012234A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037771A (en) * 2021-03-29 2021-06-25 北京金山云网络技术有限公司 Method and device for controlling device shadow, storage medium and electronic device
CN114726806A (en) * 2022-03-29 2022-07-08 驭势(上海)汽车科技有限公司 Intelligent device shadow management method, system, device, equipment and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116264546A (en) * 2021-12-15 2023-06-16 ***通信有限公司研究院 Digital twin network construction method and network element

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105634889A (en) * 2016-01-29 2016-06-01 深圳市美贝壳科技有限公司 Family cloud system, method and device
CN107003836A (en) * 2014-10-27 2017-08-01 艾拉物联公司 For the smart template of the consumer device connected
CN108696575A (en) * 2017-04-10 2018-10-23 艾拉物联公司 The third-party application control of equipment in platform of internet of things
CN109074036A (en) * 2016-04-21 2018-12-21 飞利浦照明控股有限公司 System and method for the monitoring and control based on cloud to physical environment
WO2019078489A1 (en) * 2017-10-19 2019-04-25 에스케이텔레콤 주식회사 Method and server device for providing internet of things platform service

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446439B (en) * 2018-09-30 2022-09-06 青岛海尔科技有限公司 Resource directory selection method, device, system and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107003836A (en) * 2014-10-27 2017-08-01 艾拉物联公司 For the smart template of the consumer device connected
CN105634889A (en) * 2016-01-29 2016-06-01 深圳市美贝壳科技有限公司 Family cloud system, method and device
CN109074036A (en) * 2016-04-21 2018-12-21 飞利浦照明控股有限公司 System and method for the monitoring and control based on cloud to physical environment
CN108696575A (en) * 2017-04-10 2018-10-23 艾拉物联公司 The third-party application control of equipment in platform of internet of things
WO2019078489A1 (en) * 2017-10-19 2019-04-25 에스케이텔레콤 주식회사 Method and server device for providing internet of things platform service

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037771A (en) * 2021-03-29 2021-06-25 北京金山云网络技术有限公司 Method and device for controlling device shadow, storage medium and electronic device
CN113037771B (en) * 2021-03-29 2022-11-08 北京金山云网络技术有限公司 Method and device for controlling device shadow, storage medium and electronic device
CN114726806A (en) * 2022-03-29 2022-07-08 驭势(上海)汽车科技有限公司 Intelligent device shadow management method, system, device, equipment and medium

Also Published As

Publication number Publication date
CN113454586A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
WO2021012234A1 (en) Method for generating shadow device, device, and storage medium
WO2018219280A1 (en) Method and system for supporting edge computing
AU2021277736A1 (en) Pdu type setting method, ue policy setting method, and related entity
WO2019042110A1 (en) Subscription publication method, and server
CN114145054A (en) System and method for supporting traffic steering through service function chains
US20210250886A1 (en) Method, apparatus, and system for determining synchronization cycle
WO2018024121A1 (en) Network function (nf) management method and nf management device
EP3054625B1 (en) M2m data query and scheduling method, query and scheduling device and system
WO2019120073A1 (en) Data transmission method, device and system
WO2020042848A1 (en) Network slice management method and apparatus
EP2874376A1 (en) Method and system for information synchronization between cloud storage gateways, and cloud storage gateway
KR20200097336A (en) Method and apparatus for establishing session
CN112654100B9 (en) Information processing method and related network equipment
WO2015109950A1 (en) Service resource group implementation method and apparatus
US10051552B2 (en) Method for realizing resource attribute notification, and common service entity
WO2018228165A1 (en) Data transmission method and device
WO2021100577A1 (en) Management device and subscriber information synchronization method
WO2021253244A1 (en) Resource publishing method and apparatus, gateway, cloud platform and computer storage medium
CN107547593B (en) Method, device and distributed system for realizing log synchronization
CN113454966B (en) Method and device for generating shadow device and storage medium
WO2021072672A1 (en) Method and apparatus for subscribing to resource
EP2908479B1 (en) Method, apparatus and system for implementing tunnel processing
WO2020191639A1 (en) Communication method for device, device and storage medium
EP4027663A1 (en) Unmanned aerial vehicle flight area management method and related device
WO2021115464A1 (en) Network slice selection method and related device

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

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

Country of ref document: EP

Kind code of ref document: A1