A method, device and storage medium for generating a shadow device
The direct interaction between the server device and the cloud server to generate shadow devices solves the problems of complex shadow device generation processes and incomplete functions in the existing technology, and achieves simplified processes and improved functional accuracy.
Patent Information
- Application Number
- CN201980092716.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-24
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2039-07-24
AI Technical Summary
The process of generating shadow devices in the existing technology is complex, requires user participation, affects functional accuracy, and has the problem of incomplete functionality caused by human factors.
The server device sends a request message to create a shadow device to the cloud server. The cloud server generates a shadow device based on the request message, which simplifies the generation process and avoids user participation. It interacts directly with the cloud server through the server device.
It simplifies the generation process of shadow devices, improves functional accuracy, and reduces functional insufficiency caused by human factors.
Smart Images

Figure CN113454586B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a method, device and storage medium for generating a shadow device. Background Art
[0002] In the related art, a shadow device is generated for an Open Connectivity Foundation (OCF) server device, and remote communication is performed with an OCF client device through the shadow device to improve communication processing efficiency. However, the process of generating a shadow device in the related art is complicated; and the generation of a shadow device requires user participation, which affects the function of the shadow device. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present invention provide a method, device and storage medium for generating a shadow device, which can simplify the process of generating a shadow device and improve the function of the shadow device.
[0004] In a first aspect, an embodiment of the present invention provides a method for generating a shadow device, comprising: a server device sends a create shadow device request message to a cloud server, wherein the create shadow device request message is used to request the cloud server to generate a shadow device for the server device; and the server device receives a create shadow device request response message.
[0005] In a second aspect, an embodiment of the present invention provides a method for generating a shadow device, including: a cloud server receiving a request message for creating a shadow device sent by a server device;
[0006] The cloud server generates a shadow device of the server device based on the shadow device creation request message.
[0007] In a third aspect, an embodiment of the present invention provides a method for generating a shadow device, comprising: a server device sending a resource representation corresponding to a resource link to a cloud server, wherein the resource link is published by the server device to the cloud server;
[0008] The resource representation is used by the cloud server to generate a shadow device of the server device.
[0009] In a fourth aspect, an embodiment of the present invention provides a method for generating a shadow device, comprising: a cloud server obtains a resource representation corresponding to a resource link, wherein the resource link is published to the cloud server by a server-side device;
[0010] The cloud server generates a shadow device of the server device based on the resource representation.
[0011] In a fifth aspect, an embodiment of the present invention provides a server device, wherein the server device includes:
[0012] A first sending unit is configured to send a shadow device creation request message to a cloud server, wherein the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device;
[0013] The first receiving unit is configured to receive a create shadow device request response message.
[0014] In a sixth aspect, an embodiment of the present invention provides a cloud server, the cloud server comprising:
[0015] A second receiving unit is configured to receive a request message for creating a shadow device sent by a server device;
[0016] The first processing unit is configured to generate a shadow device of the server device based on the create shadow device request message.
[0017] In a seventh aspect, an embodiment of the present invention provides a server device, the server device comprising:
[0018] A fifth sending unit, configured to send a resource representation corresponding to a resource link to the cloud server, wherein the resource link is published by the server device to the cloud server;
[0019] The resource representation is used by the cloud server to generate a shadow device of the server device.
[0020] In an eighth aspect, an embodiment of the present invention provides a cloud server, the cloud server comprising:
[0021] A sixth receiving unit is configured to obtain a resource representation corresponding to a resource link, wherein the resource link is published by a server device to the cloud server;
[0022] The second processing unit is configured to generate a shadow device of the server device based on the resource representation.
[0023] In the ninth aspect, an embodiment of the present invention provides a server-side device, comprising a processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when running the computer program, executes the steps of the shadow device generation method executed by the above-mentioned server-side device.
[0024] In the tenth aspect, an embodiment of the present invention provides a cloud server, comprising a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is used to execute the steps of the shadow device generation method executed by the above-mentioned cloud server when running the computer program.
[0025] In the eleventh aspect, an embodiment of the present invention provides a storage medium storing an executable program, which, when executed by a processor, implements the method for generating a shadow device executed by the above-mentioned server-side device.
[0026] In a twelfth aspect, an embodiment of the present invention provides a storage medium storing an executable program, which, when executed by a processor, implements a method for generating a shadow device executed by the above-mentioned cloud server.
[0027] The method for generating a shadow device provided by an embodiment of the present invention includes: a server device sends a request message for creating a shadow device to a cloud server; the cloud server receives the request message for creating a shadow device sent by the server device, and generates a shadow device of the server device based on the request message for creating a shadow device. In this way, the shadow device of the server device can be created by direct interaction between the server device and the cloud server; since there is no need for the configurator to participate in the generation process of the shadow device 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 copied resources, thereby avoiding the problem that the generated shadow device cannot accurately serve the functions of the server device due to human factors, thereby improving the functions of the shadow device. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of a process of communication between a client device and a server device of the present invention;
[0029] Figure 2 A schematic diagram of the process of creating a shadow device for a server device and synchronizing the server device with the shadow device according to the present invention;
[0030] Figure 3 A schematic diagram of an optional processing flow of a method for generating a shadow device applied to a server device provided in an embodiment of the present invention;
[0031] Figure 4 A schematic diagram of an optional processing flow of a method for generating a shadow device applied to a cloud server provided in an embodiment of the present invention;
[0032] Figure 5 A schematic diagram of a detailed processing flow of a method for generating a shadow device provided by an embodiment of the present invention;
[0033] Figure 6 A schematic diagram of a detailed processing flow of another method for generating a shadow device provided by an embodiment of the present invention;
[0034] Figure 7 A schematic diagram of another optional processing flow of a method for generating a shadow device applied to a server device provided in an embodiment of the present invention;
[0035] Figure 8 A schematic diagram of another optional processing flow of a method for generating a shadow device applied to a cloud server provided in an embodiment of the present invention;
[0036] Fig. 9 A schematic diagram of a detailed processing flow of another method for generating a shadow device provided by an embodiment of the present invention;
[0037] Fig.10 A schematic diagram of the structure of a server device according to an embodiment of the present invention;
[0038] Fig.11 A schematic diagram of the structure of a cloud server according to an embodiment of the present invention;
[0039] Fig.12 A schematic diagram of the structure of another server device according to an embodiment of the present invention;
[0040] Fig.13 This is a schematic diagram of the composition structure of another cloud server according to an embodiment of the present invention;
[0041] Fig.14 The figure is a schematic diagram of the hardware structure of the electronic device according to the embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present invention, the implementation of the embodiments of the present invention is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not intended to limit the embodiments of the present invention.
[0043] Before describing in detail the method for generating a shadow device provided by an embodiment of the present invention, a brief description is first given of information reporting from a terminal device to a network device in the related art.
[0044] Before describing in detail the method for generating a shadow device provided by an embodiment of the present invention, the terms involved in the embodiment of the present invention are briefly described.
[0045] 1) Configurator: A tool that provides cloud server access configuration functions for server-side devices. The functions of the configurator can be implemented by application software.
[0046] 2) Resource links, which represent the reference relationship between OCF resources.
[0047] 3) Endpoint, which is the source or destination of request messages and response messages.
[0048] 4) Server device, which is an OCF server.
[0049] 5) Shadow device: A digital twin device generated for a server device. Other devices can communicate directly with the shadow device, thereby reducing the workload of message processing on the server device and improving the communication efficiency of the system.
[0050] 6) Resource directory, a logical functional entity that supports OCF devices to publish resources and discover resources.
[0051] Next, the OCF devices and the communication between the OCF devices are briefly described.
[0052] OCF is an emerging IoT application layer technology standard organization. OCF has developed a Restful service framework for interconnection between IoT devices. In the OCF Restful service framework, resources are used to express information such as IoT devices, functional services of OCF devices, and the status of OCF devices. Among them, the entity that provides resources is the OCF server device (hereinafter referred to as the server device), and the entity that accesses resources is the OCF client (hereinafter referred to as the client device).
[0053] For example, the control terminal that obtains indoor environmental status data is the client device, and the sensor device that monitors indoor environmental status data is the server device. The business interaction between the client device and the server device is achieved through resource operation methods such as creation, reading, updating, deletion or notification of resources.
[0054] The process of communication between the client device and the server device, such as Figure 1 As shown: the client device sends a resource update request for resources on the server device to the server device. The server device performs corresponding resource operations according to the resource update request and sends a resource update response to the client device; wherein the resource update response carries a description of the resource.
[0055] In an optional embodiment, the resource update request is in the form of:
[0056]
[0057] Accordingly, the update resource response is in the form of:
[0058]
[0059] Here, the update resource request carries the Uniform Resource Identifier (URI) of the resource and the resource operation method; Figure 1 For example, the server device has an environment temperature resource, and the URI of the resource is " / environmentTemperature"; the resource operation method requested by the client device to the server device is the update method POST.
[0060] The resource description includes: resource URI, resource type, resource interface and resource function attributes, etc. The following is a description of the information included in the resource description:
[0061] The URI of the resource is represented by "href" in the resource description, which provides the address of the resource of the OCF server device. The value of "href" is the URI of the specific resource. The OCF client device accesses the resource of the OCF server device through the URI of the resource. Figure 1 The URI of the environment temperature resource is " / environmentTemperature".
[0062] Resource type, represented by "rt" in resource description, indicates the type of resource. Figure 1 The resource type "rt" is "oic.r.temperature", which indicates the temperature resource type.
[0063] Resource interface, represented by "if" in resource description, provides access to resources and responses supported by resources. Figure 1 The resource interface "if" is "oic.if.a", which means the controller interface.
[0064] Resource attributes describe the attribute information of resources in the resource description. Figure 1 In the table, "targetTemperature" indicates the target temperature attribute of the temperature resource, "currentTemperature" indicates the current temperature attribute of the temperature resource, and "temperatureRange" indicates the temperature range attribute of the temperature resource.
[0065] OCF defines a resource discovery resource " / oic / res" that all OCF devices must support. The resource discovery resource is used to discover OCF devices and resources. The resource discovery resource provides the function of device resource discovery. The URI of the resource discovery resource is fixed as " / oic / res".
[0066] To express the relationship between resources, OCF defines resource links, namely resource links; OCF server devices can provide their own resources in the form of resource links, making it easier for OCF client devices to discover the resources of OCF server devices. The content of resource links is as follows:
[0067]
[0068] The resource links include:
[0069] anchor: context URI, indicating the URI of the owner resource that contains the resource link.
[0070] href: target URI, that is, the URI of the target resource referenced in the resource link.
[0071] rt: The resource type identifier of the target resource.
[0072] if: Interfaces supported by the target resource.
[0073] eps: The endpoint where the target resource can be accessed.
[0074] Since the OCF standard protocol uses a constrained application protocol (Constrained Application Protocol, CoAP) to carry OCF messages at the transport layer, 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 resources of the server device through the endpoint. In the parameters of the resource link, the endpoint of the target resource is represented by the "eps" array, 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 resource link example above, the client device can access the target resource " / myLightSwitch" through the message endpoint "coaps: / / [2001:db8:b::c2e5]:22222".
[0075] For some specific scenarios, such as IoT devices that do not need to update their status frequently, the client device can improve the system communication efficiency by communicating with the shadow device of the server device. The OCF cloud server implements shadow services. The shadow service of the OCF cloud service creates a shadow device for each OCF server device. The shadow device can directly respond to the client device's request without obtaining the resource representation of the server device; in this way, the client device can obtain the resource representation of the server device without communicating with the server device, thereby reducing the message processing workload on the server device and improving the communication efficiency of the system.
[0076] In the related art, a shadow device is created for a server device, and the synchronization process between the server device and the shadow device is as follows: Figure 2 As shown, the following steps are included:
[0077] 1. The configurator configures the server device: The configurator performs 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 a shadow device; wherein. The shadow service information includes: a shadow service identifier, a URI of a shadow generation resource, and an indication of generating a shadow device; wherein, the shadow service identifier represents the identification information of the shadow service, the URI of the shadow generation resource provides a URI for accessing the shadow generation resource "oic.wk.shadow.gen" (for example, the URI of the shadow generation resource is / oic / shadow / gen), and the indication of generating a shadow device is used to indicate whether the original device generates a shadow device.
[0078] 2. Generate a shadow device for the server device: Through step 1, the server device obtains the shadow service information, including the URI of the shadow generation resource. The server device sends a request to the cloud server to create a shadow device according to the URI of the shadow generation resource, and 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. The shadow device includes the copied resource information corresponding to the original resource information.
[0079] 3. The configurator configures the shadow device: The configurator performs the configuration process for the shadow device, and the shadow device obtains access control information.
[0080] 4. The cloud server receives a resource update request: The cloud server receives an update request from the client device for the resources copied on the shadow device.
[0081] 5. Synchronization resources between the shadow device and the server device: The server device and the shadow device establish a synchronization relationship through the shadow synchronization resources, and the server device and the shadow device synchronize information.
[0082] 6. The shadow device sends synchronization information to the client device.
[0083] It can be seen that Figure 2 In the process of generating the shadow device shown, the configurator needs to interact with the server device and the cloud server many times, which makes the process of generating the shadow device complicated. In addition, in the process of generating the shadow device, the user needs to select the resources to be copied to the shadow device; if the resources selected by the user are not appropriate, such as selecting security resources (security resources refer to resources related to security communication), or the selected functional resources (functional resources refer to resources related to device functions, such as temperature setting resources for air conditioners) are not comprehensive, the selected functional resources will be synchronized through the shadow device, and the unselected functional resources cannot be synchronized through the shadow device; in this way, the generated shadow device cannot accurately replicate the functions of the original device, thereby affecting the functions of the shadow device.
[0084] Based on the above problems, the present invention provides a method for generating a shadow device. The method for generating a shadow device in an embodiment of the present application can be applied to various communication systems, such as: Global System of Mobilecommunication (GSM) system, 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 for Microwave Access (WiMAX) communication system or 5G system, etc.
[0085] An optional processing flow of a method for generating a shadow device applied to a server device provided in an embodiment of the present invention is as follows: Figure 3 As shown, the following steps are included:
[0086] Step S201: The server device sends a request message for creating a shadow device to the cloud server.
[0087] In an embodiment of the present invention, the shadow device creation request message is used to request the cloud server to generate a shadow device of the server device. The shadow device creation request message includes: a shadow device creation request message for a shadow generation resource.
[0088] In some embodiments, the create shadow device request message includes a server device identifier and / or an original resource representation of the server device.
[0089] In some other embodiments, the shadow device creation request message may include a shadow synchronization resource of the server device in addition to the server device identifier and / or the original resource representation of the server device.
[0090] Step S202: The server device receives a response message to a request to create a shadow device.
[0091] 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.
[0092] After executing step S202, the method further includes:
[0093] Step S203: The server device sends a first resource synchronization request message to the cloud server.
[0094] In an embodiment of the present invention, the first resource synchronization request message is used to request the server device to synchronize resources with the shadow device; wherein the first resource synchronization request message includes a server device identifier.
[0095] In some embodiments, the target URI of the resource synchronization requested by the first resource synchronization request message is the URI of the original resource whose resource representation has changed.
[0096] Step S204: the server device receives a first resource synchronization request response message sent by the cloud server.
[0097] In the embodiment of the present invention, the first resource synchronization request response message is used to indicate that resource synchronization is successful.
[0098] Step S205: The server device receives a second resource synchronization request message sent by the cloud server.
[0099] In an 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 a server device identifier.
[0100] 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 representation needs to be updated, and the URI of the target resource in the second resource synchronization request message does not include a server device identifier.
[0101] Step S206, the server device sends a second resource synchronization request response message to the cloud server;
[0102] In the embodiment of the present invention, the second resource synchronization request response message is used to indicate that resource synchronization is successful.
[0103] It should be noted that, in specific implementation, steps S203 to S204 and steps S205 to S206 may all be executed, or only steps S203 to S204 may be executed, or only steps S205 to S206 may be executed. In the case where steps S203 to S206 are all executed, steps S203 to S204 may occur before steps S205 to S206, or steps S203 to S204 may occur after steps S205 to S206.
[0104] An optional processing flow of a method for generating a shadow device applied to a cloud server provided in an embodiment of the present invention is as follows: Figure 4 As shown, including:
[0105] Step S301: The cloud server receives a request message for creating a shadow device sent by a server device.
[0106] In the embodiment of the present invention, the shadow device creation request message includes: a shadow device creation request message for a shadow generation resource.
[0107] In some embodiments, the create shadow device request message includes a server device identifier and / or an original resource representation of the server device.
[0108] In some other embodiments, the shadow device creation request message may include a shadow synchronization resource of the server device in addition to the server device identifier and / or the original resource representation of the server device.
[0109] In an 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 copied resource URI of the shadow device is the same as the original resource URI of the server device.
[0110] Furthermore, the resources of the shadow device include shadow synchronization resources.
[0111] Step S302: The cloud server generates a shadow device of the server device based on the shadow device creation request message.
[0112] After executing step S302, the method further includes:
[0113] Step S303: The cloud server sends a create shadow device request response message to the server device.
[0114] In the embodiment of the present invention, the shadow device creation request response message is used to indicate that the shadow device is created successfully.
[0115] Step S304: The cloud server publishes the copied resource link of the shadow device to the resource discovery directory of the cloud server.
[0116] In an embodiment of the present invention, the cloud server publishes the copied resource link of the shadow device to the resource discovery directory of the cloud server, that is, the cloud server adds the copied resource link of the shadow device to the resource link of / oic / res of the cloud server.
[0117] Among them, the URI of the copied resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
[0118] After executing step S304, the method further includes:
[0119] Step S305, the cloud server receives a first synchronization resource request message sent by the server device;
[0120] In the embodiment of the present invention, the first resource synchronization request message is used to request the server device to synchronize resources with the shadow device. The first resource synchronization request message includes a server device identifier.
[0121] In some embodiments, the target URI of the resource synchronization requested by the first resource synchronization request message is the URI of the original resource whose resource representation has changed.
[0122] Step S306: The cloud server sends a first resource synchronization request response message to the server device.
[0123] In the embodiment of the present invention, the first resource synchronization request response message is used to indicate that resource synchronization is successful.
[0124] Step S307: The cloud server sends a second resource synchronization request message to the server device.
[0125] In an 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 a server device identifier.
[0126] 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 representation needs to be updated, and the URI of the target resource in the second resource synchronization request message does not include a server device identifier.
[0127] Step S308: The cloud server receives a second resource synchronization request response message sent by the server device.
[0128] The second resource synchronization request response message is used to indicate that resource synchronization is successful.
[0129] It should be noted that, in specific implementation, steps S305 to S306 and steps S307 to S308 may be performed together, or only steps S305 to S306 may be performed, or only steps S307 to S308 may be performed. In the case where steps S305 to S308 are performed together, steps S305 to S306 may occur before steps S307 to S308, or steps S305 to S306 may occur after steps S307 to S308.
[0130] Step S309: The cloud server updates the resource representation of the shadow device on the cloud server.
[0131] against Figure 3 and Figure 4 The method for generating a shadow device shown in FIG. 1 is a detailed processing flow of a method for generating a shadow device provided by an embodiment of the present invention, such as Figure 5 As shown, the following steps are included:
[0132] Step S401, the OCF server device is connected to the OCF cloud server.
[0133] Step S402: The OCF server device sends a request to create a shadow device to the OCF cloud server, requesting the OCF cloud server to generate a shadow device for the OCF server device.
[0134] In the 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 identifier and the original resource representation of the OCF device.
[0135] For example, the OCF server device is an air conditioner with the device ID dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner has two functional resources: current temperature resource (resource URI is / currentTemperature, current temperature value is 25°C) and target temperature resource (resource URI is / targetTemperature, target temperature value is 25°C).
[0136] The target resource URI for requesting to generate a shadow device is / oic / shadow / gen. The resource description provided in the request message is as follows:
[0137]
[0138] Among them, "di" is the device identifier of the air conditioner, and "resources" is the resource description of the current temperature resources and target temperature resources of the air conditioner.
[0139] 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 copied resource URI of the shadow device is the same as the shadow resource URI of the original device.
[0140] For example, the original device is an air conditioner, and the device ID is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner implements two functional resources: current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature). Then the device ID of the shadow device generated by the OCF cloud server is also dc70373c-1e8d-4fb3-962e-017eaa863989, and the shadow device also has two functional resources: current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature). The resource representation of the generated shadow device is as follows:
[0141]
[0142] Among them, "di" is the device identifier of the shadow device of the air conditioner, and "resources" is the resource description of the current temperature resources and target temperature resources of the shadow device of the air conditioner.
[0143] Step S404, the OCF cloud server sends a response to create a shadow device to the OCF server device, indicating that the shadow device is created successfully.
[0144] Step S405: The OCF cloud server publishes the resource link of the shadow device to the resource directory of the OCF cloud server.
[0145] Optionally, the URI of the shadow resource published by the resource catalog plus the device identifier of the OCF device.
[0146] 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 directory is / currentTemperature, and the resource URI of the target temperature resource is / targetTemperature. Then, the current temperature resource URI of the shadow device published in the resource directory is dc70373c-1e8d-4fb3-962e-017eaa863989 / currentTemperature, and the resource URI of the target temperature resource is dc70373c-1e8d-4fb3-962e-017eaa863989 / targetTemperature.
[0147] Step S406: The resource representation on the OCF server device changes, and resource synchronization is required.
[0148] For example, the OCF server device is an air conditioner with the function of monitoring the current temperature. It implements the / currentTemperature resource. When the monitored current temperature changes, the temperature value of the / currentTemperature resource changes. The current temperature value becomes 28°C and needs to be synchronized to the shadow device.
[0149] Step S407: The OCF server device requests resource synchronization with the shadow device on the OCF cloud server. The target URI for requesting resource synchronization is the changed original resource URI, and the device identifier is the original device identifier.
[0150] For example, the current temperature resource / currentTemperature of the OCF device changes, and the current temperature value value becomes 28°C. Then the target resource URI of the shadow device requested for synchronization is / currentTemperature. The resource representation provided in the request message is as follows:
[0151]
[0152]
[0153] Among them, "di" is the device identifier of the air conditioner, and "resources" is the resource description of the current temperature resources of the air conditioner that has changed.
[0154] Step S408: Based on the received resource representation of the original resource, the shadow device of the OCF cloud server updates the resource representation of the corresponding shadow resource.
[0155] For example, according to the resource representation of the original resource in step S407, the current temperature value value of the current temperature resource / currentTemperature of the shadow device is updated to 28°C.
[0156] Step S409: The shadow device on the OCF cloud server sends a resource synchronization response to the OCF server device.
[0157] It should be noted that step S406 to step S409 is an uplink resource synchronization process, that is, a process in which the OCF server device synchronizes resources with the shadow device on the OCF cloud server.
[0158] Step S410: The OCF client device discovers resources of the shadow device through the OCF cloud server.
[0159] For example, an OCF client device discovers a shadow device with a current temperature resource URI of dc70373c-1e8d-4fb3-962e-017eaa863989 / currentTemperature and a target temperature resource URI of dc70373c-1e8d-4fb3-962e-017eaa863989 / targetTemperature.
[0160] Step S411-Step S412, the OCF client device obtains the resource representation of the shadow device, and the OCF cloud server returns the resource representation of the shadow device to the OCF client device.
[0161] 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 that the target temperature is 25°C.
[0162] Step S413: The OCF client device requests to update the resource representation of the shadow device.
[0163] 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 requests to update the target temperature to 20°C.
[0164] Step S414: The shadow device of the OCF cloud server requests resource synchronization to the OCF server device, and the target resource URI for requesting resource synchronization is the original resource URI for which the resource representation needs to be updated.
[0165] 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.
[0166] For example, the shadow device of the OCF cloud server receives a target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989 / targetTemperature request from the OCF client, and the target temperature value value requested to be updated is 20°C. The shadow device removes the device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 from the target resource URI, and requests the original device to synchronize the target resource URI with the target temperature resource / targetTemperature. The resource representation provided in the request message is as follows:
[0167]
[0168] Wherein, "di" is the device identifier of the air conditioner, and "resources" is the resource description of the target temperature resource of the air conditioner requested to be updated.
[0169] Step S415: The OCF server device sends a resource synchronization response to the cloud server, indicating that the resource synchronization is successful.
[0170] Step S416: The shadow device of the OCF cloud server updates its own resource representation.
[0171] Step S417: The shadow device of the OCF cloud server sends the update result of the device resource representation to the OCF client device.
[0172] It should be noted that step S410 to step S417 is a downlink resource synchronization process, that is, a process in which the shadow device on the OCF cloud server synchronizes resources with the OCF server device.
[0173] against Figure 3 and Figure 4 The method for generating a shadow device shown in FIG. 1 is a detailed processing flow of another method for generating a shadow device provided by an embodiment of the present invention, such as Figure 6 As shown, the following steps are included:
[0174] Step S501, the OCF server device is connected to the OCF cloud server.
[0175] Step S502: The OCF server device sends a request to create a shadow device to the OCF cloud server, requesting the OCF cloud server to generate a shadow device for the OCF server device.
[0176] 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 representation of the OCF device.
[0177] In other embodiments, if the OCF server device needs to receive a downlink resource synchronization message sent by a shadow device, the request to create a shadow device also provides a shadow synchronization resource of the original device, and the shadow synchronization resource is a target resource for receiving a resource synchronization message sent by the shadow device to the original device. (If the original device does not need to receive a downlink resource synchronization message, it does not need to provide a shadow synchronization resource, for example, a sensor that only has a temperature reporting function and does not have a temperature adjustment function does not need to receive a downlink temperature control instruction)
[0178] For example, the original device is an air conditioner with a device identifier of dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner has two functional resources: a current temperature resource (the resource URI is / currentTemperature, and the current temperature value is 25°C) and a target temperature resource (the resource URI is / targetTemperature, and the target temperature value is 25°C).
[0179] The target resource URI for requesting to generate a shadow device is / oic / shadow / gen. The resource representation provided in the request message is as follows:
[0180]
[0181] Among them, "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 of the air conditioner's shadow device sending resource synchronization messages to the air conditioner), and "resources" is the resource description of the air conditioner's current temperature resources and target temperature resources.
[0182] 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 the device identifier of the original device, and the copied 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 a shadow synchronization resource, which is the target resource for receiving the resource synchronization message sent by the OCF server device to the shadow device.
[0183] For example, the original device is an air conditioner, and the device ID is dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner implements two functional resources: current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature). Then the device ID of the shadow device generated by the OCF cloud server is also dc70373c-1e8d-4fb3-962e-017eaa863989, and the shadow device also has two functional resources: current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature). The resource representation of the generated shadow device is as follows:
[0184]
[0185]
[0186] Among them, "di" is the device identifier of the air conditioner's shadow device, "ssr" is the shadow synchronization resource of the air conditioner's shadow device, which is used to receive the uplink resource synchronization message (that is, the target resource URI of the air conditioner sending the resource synchronization message to the air conditioner's shadow device), and "resources" is the resource representation of the current temperature resources and target temperature resources of the air conditioner's shadow device.
[0187] Step S504, the OCF cloud server sends a response to create a shadow device to the OCF server device, indicating that the shadow device is created successfully.
[0188] Step S505: The OCF cloud server publishes the resource link of the shadow device to the resource directory of the OCF cloud server.
[0189] Optionally, the URI of the shadow resource published by the resource catalog plus the device identifier of the OCF server device.
[0190] 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 directory is / currentTemperature, and the resource URI of the target temperature resource is / targetTemperature. Then, the current temperature resource URI of the shadow device published in the resource directory is dc70373c-1e8d-4fb3-962e-017eaa863989 / currentTemperature, and the resource URI of the target temperature resource is dc70373c-1e8d-4fb3-962e-017eaa863989 / targetTemperature.
[0191] Step S506: The resource representation on the OCF server device changes, and resource synchronization is required.
[0192] For example, the OCF server device is an air conditioner with the function of monitoring the current temperature. It implements the / currentTemperature resource. When the monitored current temperature changes, the temperature value of the / currentTemperature resource changes. The current temperature value becomes 28°C and needs to be synchronized to the shadow device.
[0193] Step S507, the OCF server device requests resource synchronization with the shadow device on the OCF cloud server, the target URI for requesting resource synchronization is the shadow synchronization resource URI, and the device identifier is the original device identifier.
[0194] For example, the current temperature resource / currentTemperature of the OCF device changes, and the current temperature value value becomes 28°C. Then the target resource URI of the shadow device requested for synchronization is the shadow synchronization resource / oic / shadow / sync. The resource description provided in the request message is as follows:
[0195]
[0196]
[0197] Among them, "di" is the device identifier of the air conditioner, and "resources" is the resource description of the current temperature resources of the air conditioner that has changed.
[0198] Step S508: Based on the received resource representation of the original resource, the shadow device on the OCF cloud server updates the resource representation of the corresponding shadow resource.
[0199] For example, according to the resource representation of the original resource in step S507, the current temperature value value of the current temperature resource / currentTemperature of the shadow device is updated to 28°C.
[0200] Step S509: The shadow device on the OCF cloud server sends a resource synchronization response to the OCF server device.
[0201] 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 synchronizes resources with the shadow device on the OCF cloud server.
[0202] In steps S510 to S513, the OCF client device discovers and obtains the resource representation of the shadow device.
[0203] It should be noted that the processing process of step S510 to step S513 in the embodiment of the present invention is the same as the above-mentioned step S410 to step S413, and will not be repeated here.
[0204] Step S514, the shadow device on the OCF cloud server requests resource synchronization to the OCF server device, and the target resource URI for requesting resource synchronization is the shadow synchronization resource URI.
[0205] 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.
[0206] For example, the shadow device on the OCF cloud server receives a request from the OCF client device to update the target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989 / targetTemperature, and the target temperature value value requested to be updated is 20°C. The shadow device removes the device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 from the target resource URI, and requests the original device to synchronize the target resource URI with the shadow synchronization resource / oic / shadow / sync. The resource representation provided in the request message is as follows:
[0207]
[0208] Wherein, "di" is the device identifier of the air conditioner, and "resources" is the resource description of the target temperature resource of the air conditioner requested to be updated.
[0209] Step S515, the OCF server device sends a resource synchronization response to the OCF cloud server, indicating that the resource synchronization is successful.
[0210] Step S516: The shadow device on the OCF cloud server updates its own resource representation.
[0211] Step S517: The shadow device on the OCF cloud server sends the update result of the device resource representation to the OCF client device.
[0212] It should be noted that steps S510 to S517 are a downlink resource synchronization process, that is, a process in which the shadow device on the OCF cloud server synchronizes resources with the OCF server device.
[0213] Another optional processing flow of the method for generating a shadow device applied to a server device provided in an embodiment of the present invention is as follows: Figure 7 As shown, the following steps are included:
[0214] Step S601: The server device sends a resource description corresponding to a resource link to a cloud server.
[0215] In the embodiment of the present invention, the resource link is published by the server device to the cloud server, and the resource representation is used by the cloud server to generate a shadow device of the server device.
[0216] After executing step S601, the method further includes:
[0217] Step S602: The server device receives a request message for obtaining a resource representation sent by the cloud server.
[0218] In some embodiments, the request message for obtaining a resource representation includes: obtaining a resource representation corresponding to a resource link published by the server device to the cloud server; accordingly, the server device sends a resource representation corresponding to a resource link to the cloud server. In this case, if the cloud server requests to obtain resource representations corresponding to N resource links, it needs to send N request messages for obtaining resource representations to the server device; for each request message for obtaining resource representations, the server device sends N resource representations corresponding to different resource links to the cloud server.
[0219] In some other embodiments, the request message for obtaining resource representation includes: obtaining resource representations corresponding to all resource links published by the server device to the cloud server. Accordingly, the server device sends resource representations corresponding to all resource links of the cloud server to the cloud server. Among them, all resource links are published to the cloud server by the server device. 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); may also be resources related to the function of the server device (such as current temperature resources and target temperature resources); may also be resources related to the function of the server device and configuration resources of the server device (such as / oic / d resources). In some optional embodiments, the resources corresponding to all resource links published by the server device to the cloud server are subscribable resources.
[0220] After executing step S602, the method further includes:
[0221] Step S603: The server device receives a request message sent by the cloud server to subscribe to the original resources of the server device.
[0222] In the embodiment of the present invention, the request message for subscribing to the original resource of the server-side device is used to send the changed original resource representation to the cloud server when the original resource representation on the server-side device changes.
[0223] Step S604: The server device sends the changed original resource representation to the cloud server.
[0224] In some embodiments, the resource representation on the server device changes. Since the cloud server subscribes to the resources of the server device, the server device needs to send the changed resource representation to the cloud server; the cloud server then updates the status of the shadow device on the cloud server with the changed resource representation.
[0225] After executing step S602, the method further includes:
[0226] Step S605: The server device receives a request message sent by the cloud server to update the resource representation of the server device.
[0227] In the embodiment of the present invention, in the request message for updating the resource representation of the server device, the URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
[0228] The URI of the target resource does not include the server device identifier.
[0229] Step S606: The server device sends a request response message to the cloud server to update the resource representation of the server device.
[0230] In the embodiment of the present invention, the request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
[0231] It should be noted that, in the embodiment of the present invention, both step S603-step S604 and step S605-step S606 may be performed, or only step S603-step S604 may be performed, or only step S605-step S606 may be performed. In the case where both step S603 to step S606 are performed, step S603-step S604 may occur before step S605-step S606, or step S603-step S604 may occur after step S605-step S606.
[0232] Another optional processing flow of the method for generating a shadow device applied to a cloud server provided in an embodiment of the present invention is as follows: Figure 8 As shown, the following steps are included:
[0233] Step S701: The cloud server obtains the resource representation corresponding to the resource link.
[0234] In the embodiment of the present invention, the resource link is published by the server device to the cloud server;
[0235] Step S702: The cloud server generates a shadow device of the server device based on the resource representation.
[0236] In the embodiment of the present invention, the device identification of the shadow device is the same as the device identification of the server device.
[0237] After executing step S702, the method further includes:
[0238] Step S703: The cloud server sends a resource representation acquisition request message to the server device.
[0239] In some embodiments, the request message for obtaining a resource representation includes: obtaining a resource representation corresponding to a resource link published by the server device to the cloud server; accordingly, the server device sends a resource representation corresponding to a resource link to the cloud server. In this case, if the cloud server requests to obtain resource representations corresponding to N resource links, it needs to send N request messages for obtaining resource representations to the server device; for each request message for obtaining resource representations, the server device sends N resource representations corresponding to different resource links to the cloud server.
[0240] In some other embodiments, the request message for obtaining resource representation includes: obtaining resource representations corresponding to all resource links published by the server device to the cloud server. Accordingly, the server device sends resource representations corresponding to all resource links of the cloud server to the cloud server. Wherein, all resource links are published by the server device to the cloud server.
[0241] Step S704: the cloud server sends a request message to the server device to subscribe to the original resources of the server device.
[0242] 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 the changed original resource representation to the cloud server when the original resource representation on the server device changes.
[0243] Step S705: When the cloud server receives the resource representation of the changed resource, the server updates the resources of the shadow device based on the resource representation of the changed resource.
[0244] Step S706: The cloud server sends a request message to the server device to update the resource representation of the server device.
[0245] In the embodiment of the present invention, in the request message for updating the resource representation of the server device, the URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
[0246] Optionally, the URI of the target resource does not include the server device identifier.
[0247] Step S707: the cloud server receives a request response message for updating the resource representation of the server device.
[0248] In the embodiment of the present invention, the request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
[0249] Step S708: The cloud server updates the resources of the shadow device based on the request response message for updating the resource representation of the server device.
[0250] It should be noted that, in the embodiment of the present invention, steps S704-S705 and steps S706-S708 may be both executed, or only steps S704-S705 or only steps S706-S708 may be executed. In the case where steps S704 to S708 are both executed, steps S704-S705 may occur before steps S706-S708, or steps S704-S705 may occur after steps S706-S708.
[0251] against Figure 7 and Figure 8 The method for generating a shadow device shown in FIG. 1 is a detailed processing flow of another method for generating a shadow device provided by an embodiment of the present invention, such as Fig. 9 As shown, the following steps are included:
[0252] Step S801, the OCF server device is connected to the OCF cloud server.
[0253] 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 directory of the OCF cloud server.
[0254] For example, the OCF server device is an air conditioner with the device identifier dc70373c-1e8d-4fb3-962e-017eaa863989. The air conditioner has two functional resources: current temperature resource (resource URI is / currentTemperature, current temperature value is 25°C) and target temperature resource (resource URI is / targetTemperature, target temperature value is 25°C).
[0255] The target resource URI of the resource being requested is / oic / rd. The resource link provided in the request message is as follows:
[0256]
[0257] Among them, "di" is the device identifier of the air conditioner, and "resources" is the resource link of the air conditioner, including the resource links of the current temperature resource and the target temperature resource.
[0258] 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:
[0259] Method a: The OCF server device obtains resource representation for each published resource separately; if the OCF server device publishes N resource links, the OCF cloud server needs to send N resource representation acquisition requests to the OCF server device to obtain the resource representation of each resource.
[0260] 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 representation to each published resource.
[0261] For example, the resource links published by the OCF server device include the current temperature resource / currentTemperature and the target temperature resource / currentTemperature. The OCF cloud server sends requests for obtaining resource representations for these two resources respectively, thereby obtaining resource representations of all resources published to the OCF cloud server.
[0262] Method b: Obtain resource descriptions of all resources published by the OCF server device to the OCF cloud server by batch obtaining resource descriptions; in this case, the OCF cloud server only needs to send one request to obtain resource descriptions to the OCF server device to obtain the resource descriptions of all resources published by the OCF server device to the OCF cloud server.
[0263] Step S805b-Step S806b, the OCF cloud server sends a request for batch acquisition of resource representations to the OCF server device, and acquires resource representations of all resources published by the OCF server device to the OCF cloud server.
[0264] For example, the resource URI for batch obtaining OCF device resource representations is / fullStatusQuery, and the OCF cloud server sends a request for obtaining resource representations for the resource URI, thereby obtaining resource representations of all resources published to the OCF cloud server.
[0265] Step S807: The OCF cloud server generates a shadow device for the OCF server device, and the copy resource URI of the generated shadow device is the same as the shadow resource URI of the original device of the OCF server device.
[0266] Here, the device identifier of the shadow device may be the same as or different from the device identifier of the OCF server device (ie, the original device).
[0267] For example, the original device is an air conditioner, which has two functional resources: current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature), the current temperature value is 25℃, and the target temperature value is 25℃. Then the shadow device generated by the OCF cloud server also has two functional resources: current temperature resource (resource URI is / currentTemperature, current temperature value is 25℃) and target temperature resource (resource URI is / targetTemperature, target temperature value is 25℃). The resource representation of the generated shadow device is as follows:
[0268]
[0269] Among them, "di" is the device identifier of the air conditioner's shadow device, which may be the same as or different from the device identifier of the air conditioner itself, and "resources" is the resource description of the air conditioner's shadow device, including the resource description of the shadow device's current temperature resources and target temperature resources.
[0270] 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.
[0271] For example, the shadow device generated by the OCF cloud server for the OCF server device has two functional resources: current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature). The OCF cloud server subscribes to the current temperature resource (resource URI is / currentTemperature) and target temperature resource (resource URI is / targetTemperature) of the OCF server device to obtain resource change notifications of these two original resources.
[0272] Step S809: The resource representation on the OCF server device changes. Since the OCF cloud server subscribes to the resources of the OCF server device, the OCF server device needs to send the changed resource representation to the OCF cloud server.
[0273] For example, the OCF device is an air conditioner that has the function of monitoring the current temperature and implements the / currentTemperature resource. The monitored current temperature changes, and the temperature value of the / currentTemperature resource changes to 28°C. The latest temperature value needs to be sent to the OCF cloud server.
[0274] Step S810, the OCF server device sends a resource update notification synchronization to the OCF cloud server, providing a resource description of the changed resources.
[0275] For example, the current temperature resource / currentTemperature of the OCF server device changes, and the current temperature value value becomes 28°C. The OCF device sends the latest resource representation of the current temperature resource to the OCF cloud server. The resource representation provided in the request message is as follows:
[0276]
[0277] Step S811: The OCF cloud server copies the updated resource representation to the shadow device.
[0278] For example, according to the resource representation of the current temperature resource update provided by the OCF server device in step S810, the current temperature value value of the current temperature resource / currentTemperature of the shadow device on the OCF cloud server is updated to 28°C.
[0279] It should be noted that step S809 to step S811 is an uplink resource synchronization process, that is, a process in which the OCF server device synchronizes resources with the shadow device on the OCF cloud server.
[0280] In steps S812 to S815, the OCF client device discovers and obtains the resource representation of the shadow device.
[0281] Step S816, the OCF cloud server requests to update the resource representation of the OCF server device, and the target resource URI requested to be updated is the resource URI of the OCF server device whose resource representation needs to be updated.
[0282] 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.
[0283] For example, the OCF cloud server receives a target temperature resource dc70373c-1e8d-4fb3-962e-017eaa863989 / targetTemperature from an OCF client device, and the target temperature value value requested to be updated is 20°C. The OCF cloud server removes the device identifier dc70373c-1e8d-4fb3-962e-017eaa863989 from the target resource URI, and the target resource URI of the original device requested to be updated is the target temperature resource / targetTemperature. The resource representation provided in the request message is as follows:
[0284]
[0285] Step S817: The OCF server device sends a resource update response to the OCF cloud server, indicating that the resource update is successful.
[0286] Step S818, the OCF cloud server copies the updated resource representation to the shadow device.
[0287] For example, the OCF cloud server updates the current temperature value value of the target temperature resource / targetTemperature of the shadow device on the OCF cloud server to 20° C. according to the resource representation of the target temperature resource update provided by the OCF server device in step S817 .
[0288] 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 may also wait until it receives the resource change notification sent by the OCF server device and then copy the updated resource representation to the shadow device.
[0289] It should be noted that steps S812 to S818 are a downlink resource synchronization process, that is, a process in which the shadow device of the OCF cloud server performs resource synchronization with the OCF server device.
[0290] Step S819: The shadow device of the OCF cloud server sends the update result of the device resource representation to the OCF client device.
[0291] Step S820: The OCF server device sends a resource update notification to the OCF cloud server based on the resource subscription information, and provides an updated resource representation.
[0292] It should be noted that, in the embodiment of the present invention, steps S809 to S811 and steps S812 to S818 may be both executed, or only steps S809 to S811 may be executed, or only steps S812 to S818 may be executed. In the case where steps S809 to S818 are both executed, steps S809 to S811 may occur before steps S812 to S818, or steps S809 to S811 may occur after steps S812 to S818.
[0293] To implement the above-mentioned method for generating a shadow device, an embodiment of the present invention provides a server device, wherein the composition structure of the server device 900 is as follows: Fig.10 As shown, including:
[0294] The first sending unit 901 is configured to send a create shadow device request message to the cloud server, wherein the create shadow device request message is used to request the cloud server to generate a shadow device of the server device;
[0295] The first receiving unit 902 is configured to receive a create shadow device request response message.
[0296] In some embodiments, the shadow device creation request message includes: a shadow device creation request message for a shadow generation resource. The shadow device creation request message includes at least one of the following: a server device identifier and an original resource representation of the server device.
[0297] In some embodiments, the create shadow device request message also includes: a shadow synchronization resource of the server device.
[0298] In some embodiments, the create shadow device request response message is used to indicate that the shadow device is successfully created.
[0299] In some embodiments, the first sending unit 901 is further configured to send a first resource synchronization request message to the cloud server;
[0300] 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 request message includes a server device identifier.
[0301] 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 that resource synchronization is successful.
[0302] In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource representation has changed.
[0303] In some embodiments, the first receiving unit 902 is further configured to receive a second resource synchronization request message sent by the cloud server;
[0304] The second resource synchronization request message is used to request the server device to synchronize resources with the shadow device, and the second resource synchronization request message includes a server device identifier.
[0305] 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 that resource synchronization is successful.
[0306] In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource representation needs to be updated.
[0307] In some embodiments, the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
[0308] In some embodiments, the URI of the target resource in the second resource synchronization request message does not include a server device identifier.
[0309] In order to implement the above-mentioned method for generating a shadow device, an embodiment of the present invention provides a cloud server, and the composition structure of the cloud server 1000 is as follows: Fig.11 As shown, including:
[0310] The second receiving unit 1001 is configured to receive a request message for creating a shadow device sent by a server device;
[0311] The first processing unit 1002 is configured to generate a shadow device of the server device based on the create shadow device request message.
[0312] In some embodiments, the create shadow device request message includes: a create shadow device request message for a shadow generation resource.
[0313] In some embodiments, the create shadow device request message includes at least one of the following: a server device identifier and an original resource representation of the server device.
[0314] In some embodiments, the create shadow device request message also includes: a shadow synchronization resource of the server device.
[0315] In some embodiments, the device identifier of the shadow device is the same as the device identifier of the server device; and / or, the copied resource URI of the shadow device is the same as the original resource URI of the server device.
[0316] In some embodiments, the resources of the shadow device include shadow synchronization resources.
[0317] In some embodiments, the cloud server further includes:
[0318] The second sending unit 1003 is configured to send a create shadow device request response message to the server device, where the create shadow device request response message is used to indicate that the shadow device is successfully created.
[0319] In some embodiments, the first processing unit 1002 is further configured to publish the copied resource link of the shadow device to the resource discovery directory of the cloud server.
[0320] In some embodiments, the URI of the copied resource of the shadow device published in the resource discovery directory of the cloud server includes a server-side device identifier.
[0321] In some embodiments, the second receiving unit 1001 is also configured to receive a first resource synchronization 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 request message includes a server device identifier.
[0322] In some embodiments, the cloud server further includes:
[0323] 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 that resource synchronization is successful.
[0324] In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource representation has changed.
[0325] In some embodiments, the cloud server further includes:
[0326] The fourth sending unit 1005 is configured to send a second resource synchronization request message to the server device;
[0327] The second resource synchronization request message is used to request the server device to synchronize resources with the shadow device, and the second resource synchronization request message includes a server device identifier.
[0328] 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 that resource synchronization is successful.
[0329] In some embodiments, the URI of the target resource for resource synchronization is the URI of the original resource whose resource representation needs to be updated.
[0330] In some embodiments, the URI of the target resource of the resource synchronization is the URI of the shadow synchronization resource.
[0331] In some embodiments, the first processing unit 1002 is further configured to update the resource representation of the shadow device on the cloud server.
[0332] In some embodiments, the URI of the target resource in the second resource synchronization request message does not include a server device identifier.
[0333] To implement the above-mentioned method for generating a shadow device, an embodiment of the present invention provides another server device, the composition structure of the server device 2000 is as follows: Fig.12 As shown, including:
[0334] A fifth sending unit 2001 is configured to send a resource representation corresponding to a resource link to a cloud server, wherein the resource link is published by the server device to the cloud server;
[0335] The resource representation is used by the cloud server to generate a shadow device of the server device.
[0336] In some embodiments, the server device further includes:
[0337] The third receiving unit 2002 receives a request message for obtaining a resource representation sent by the cloud server.
[0338] In some embodiments, the request message for obtaining a resource representation includes: obtaining a resource representation corresponding to a resource link published by the server device to the cloud server.
[0339] In some embodiments, the fifth sending unit 2001 is configured to send a resource representation corresponding to a resource link to the cloud server.
[0340] In some embodiments, the request message for obtaining resource representation includes: obtaining resource representations corresponding to all resource links published by the server device to the cloud server.
[0341] In some embodiments, the fifth sending unit 2001 is configured to send resource representations corresponding to all resource links to the cloud server, and the all resource links are published by the server device to the cloud server.
[0342] In some embodiments, the server device further includes:
[0343] The fourth receiving unit 2003 is configured to receive a request message for subscribing to the original resources of the server device sent by the cloud server;
[0344] The request message for subscribing to the original resource of the server-side device is used to send the changed original resource representation to the cloud server when the original resource representation on the server-side device changes.
[0345] In some embodiments, the server device further includes:
[0346] The fifth receiving unit 2004 is configured to receive a request message for updating the resource representation of the server device sent by the cloud server; in the request message for updating the resource representation of the server device, the URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
[0347] In some embodiments, the URI of the target resource does not include a server device identifier.
[0348] In some embodiments, the fifth sending unit 2001 is further configured to send a request response message for updating a resource representation of a server-side device to the cloud server;
[0349] The request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
[0350] To implement the above-mentioned method for generating a shadow device, an embodiment of the present invention provides another cloud server, wherein the composition structure of the cloud server 3000 is as follows: Fig.13 As shown, including:
[0351] A sixth receiving unit 3001 is configured to obtain a resource representation corresponding to a resource link, wherein the resource link is published by a server device to the cloud server;
[0352] The second processing unit 3002 is configured to generate a shadow device of the server device based on the resource representation.
[0353] In some embodiments, the cloud server further includes:
[0354] The sixth sending unit 3003 is configured to send a resource representation acquisition request message to the server device.
[0355] In some embodiments, the sixth receiving unit 3001 is configured to obtain a resource representation corresponding to a resource link published by the server to the cloud server.
[0356] In some embodiments, the sixth receiving unit 3001 is configured to receive a resource representation corresponding to a resource link sent by the server device.
[0357] In some embodiments, the sixth receiving unit 3001 is configured to obtain resource representations corresponding to all resource links published by the server device to the cloud server.
[0358] In some embodiments, the sixth receiving unit 3001 is configured to receive resource representations 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.
[0359] In some embodiments, the method further comprises:
[0360] 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;
[0361] 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 representation to the cloud server when the original resource representation on the server device changes.
[0362] In some embodiments, when the sixth receiving unit 3001 receives a resource representation of a changed resource, the second processing unit 3002 is configured to update the resources of the shadow device based on the resource representation of the changed resource.
[0363] In some embodiments, the cloud server further includes:
[0364] The eighth sending unit 3005 is configured to send a request message for updating the resource representation of the server device to the server device; in the request message for updating the resource representation of the server device, the uniform resource identifier URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
[0365] In some embodiments, the URI of the target resource does not include a server device identifier.
[0366] In some embodiments, the sixth receiving unit 3001 is further configured to receive a request response message for updating a resource representation of a server device;
[0367] The request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
[0368] In some embodiments, the second processing unit 3002 is configured to update the resources of the shadow device based on a request response message for updating the resource representation of the server device.
[0369] In some embodiments, the device identifier of the shadow device is the same as the device identifier of the server device.
[0370] 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 an OCF client device.
[0371] An embodiment of the present invention also provides a server device, comprising a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is used to execute the steps of the shadow device generation method executed by the above-mentioned server device when running the computer program.
[0372] An embodiment of the present invention also provides a cloud server, comprising a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is used to execute the steps of the shadow device generation method executed by the above-mentioned cloud server when running the computer program.
[0373] Fig.14700 is a schematic diagram of the hardware structure of an electronic device (server device and 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 a bus system 705. It can be understood that the bus system 705 is used to realize the 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 the sake of clarity, Fig.14 Various buses are labeled as bus system 705.
[0374] It can be understood that the memory 702 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be ROM, programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), ferromagnetic random access memory, flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory 702 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0375] 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 such data include: any computer program for operating on the electronic device 700, such as the application 7022. The program implementing the method of the embodiment of the present invention may be included in the application 7022.
[0376] The method disclosed in the above embodiment of the present invention can 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 the hardware integrated logic circuit in the processor 701 or the instruction in the form of software. The above processor 701 may be a general 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 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 702. The processor 701 reads the information in the memory 702 and completes the steps of the above method in combination with its hardware.
[0377] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general purpose processors, controllers, MCUs, MPUs, or other electronic components to execute the aforementioned method.
[0378] An embodiment of the present application also provides a storage medium for storing a computer program.
[0379] Optionally, the storage medium can be applied to the terminal device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes in the various methods in the embodiments of the present application. For the sake of brevity, they are not repeated here.
[0380] 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, as well as 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 a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0381] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0382] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0383] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating a shadow device, the method comprising: The server device sends a request message for creating a shadow device to the cloud server, wherein the request message for creating a shadow device is used to request the cloud server to generate a shadow device of the server device; wherein the server device is an OCF server of the Internet of Things Application Layer Technical Standards Organization; the shadow device is a digital twin device generated by the server device; the request message for creating a shadow device includes the original resource representation of the server device; the resource representation includes at least one of the following: a uniform resource identifier URI of a resource, a resource type, a resource interface, and functional attributes of a resource; 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 synchronize resources with the shadow device; The server device receives a create shadow device request response message.
2. The method according to claim 1, wherein: The shadow device creation request message includes: a shadow device creation request message for a shadow generation resource.
3. The method according to claim 1 or 2, wherein: The request message for creating a shadow device also includes: Server device identifier.
4. The method according to claim 3, wherein: The request message for creating a shadow device also includes: The shadow synchronization resources of the server device.
5. The method according to claim 1 or 2, wherein: The shadow device creation request response message is used to indicate that the shadow device is created successfully.
6. The method according to claim 1 or 2, wherein: The first resource synchronization request message includes a server device identifier.
7. 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 resource synchronization is successful.
8. The method according to claim 7, wherein: The uniform resource identifier URI of the target resource for resource synchronization is the URI of the original resource whose resource representation has changed.
9. The method according to claim 1 or 2, wherein: The method further comprises: The server device receives 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 synchronize resources with the shadow device, and the second resource synchronization request message includes a server device identifier.
10. 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 resource synchronization is successful.
11. The method according to claim 10, wherein: The URI of the target resource for resource synchronization is the URI of the original resource whose resource representation needs to be updated.
12. The method according to claim 6, wherein: The URI of the target resource for resource synchronization is the URI of the shadow synchronization resource.
13. The method according to claim 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 a request message for creating a shadow device sent by a server device; wherein the server device is an OCF server; the shadow device is a digital twin device generated by the server device; the request message for creating a shadow device includes an original resource representation of the server device; the resource representation includes at least one of the following: a uniform resource identifier URI of a resource, a resource type, a resource interface, and a functional attribute of a resource; The cloud server generates a shadow device of the server device based on the shadow device creation request message; The cloud server receives a first resource synchronization 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.
15. The method according to claim 14, wherein: The shadow device creation request message includes: a shadow device creation request message for a shadow generation resource.
16. The method according to claim 14 or 15, wherein: The request message for creating a shadow device also includes: Server device identifier.
17. The method according to claim 16, wherein: The request message for creating a shadow device also includes: The shadow synchronization resources of the server device.
18. The method according to claim 14 or 15, wherein: The device identification of the shadow device is the same as the device identification of the server device; And / or, the copied resource uniform resource identifier URI of the shadow device is the same as the original resource URI of the server device.
19. The method according to claim 18, wherein: The resources of the shadow device include shadow synchronization resources.
20. The method according to claim 14 or 15, wherein: The method further comprises: The cloud server sends a create shadow device request response message to the server device, where the create shadow device request response message is used to indicate that the shadow device is successfully created.
21. The method according to claim 14 or 15, wherein: The method further comprises: The cloud server publishes the copied resource link of the shadow device to the resource discovery directory of the cloud server.
22. The method according to claim 21, wherein: The URI of the copied resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
23. The method according to claim 14 or 15, wherein: The first resource synchronization request message includes a server device identifier.
24. The method according to 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 resource synchronization is successful.
25. The method according to claim 24, wherein: The URI of the target resource for resource synchronization is the URI of the original resource whose resource representation has changed.
26. The method according to claim 14 or 15, wherein: The method further comprises: 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 synchronize resources with the shadow device, and the second resource synchronization request message includes a server device identifier.
27. The method according to 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 resource synchronization is successful.
28. The method according to claim 27, wherein: The URI of the target resource for resource synchronization is the URI of the original resource whose resource representation needs to be updated.
29. The method of claim 23, wherein: The URI of the target resource for resource synchronization is the URI of the shadow synchronization resource.
30. The method according to claim 14 or 15, wherein: The method further comprises: The cloud server updates the resource representation of the shadow device on the cloud server.
31. The method of claim 27, wherein: The URI of the target resource in the second resource synchronization request message does not include the server device identifier.
32. A method for generating a shadow device, the method comprising: The server device sends a resource representation corresponding to a resource link to the cloud server, and the resource link is published by the server device to the cloud server; The resource description is used by the cloud server to generate a shadow device of the server device; wherein the resource link is a reference relationship between OCF resources; the server device is an OCF server; the shadow device is a digital twin device generated by the server device; the resource description includes at least one of the following: a uniform resource identifier URI of the resource, a resource type, a resource interface, and functional attributes of the resource.
33. The method of claim 32, wherein: The method further comprises: The server device receives a request message for obtaining a resource representation sent by the cloud server.
34. The method of claim 33, wherein: The request message for obtaining resource representation includes: Obtain a resource representation corresponding to a resource link published by the server-side device to the cloud server.
35. The method of claim 34, wherein: The server device sends a resource representation corresponding to the resource link to the cloud server, including: The server device sends a resource representation corresponding to a resource link to the cloud server.
36. The method of claim 33, wherein: The request message for obtaining resource representation includes: Obtain resource representations corresponding to all resource links published by the server-side device to the cloud server.
37. The method of claim 36, wherein: The server device sends a resource representation corresponding to the resource link to the cloud server, including: The server device sends resource representations 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. The method according to any one of claims 32 to 37, wherein: The method further comprises: The server device receives a request message sent by the cloud server to subscribe to the original resources of the server device; The request message for subscribing to the original resource of the server-side device is used to send the changed original resource representation to the cloud server when the original resource representation on the server-side device changes.
39. The method according to any one of claims 32 to 37, wherein: The method further comprises: The server device receives a request message for updating the resource representation of the server device sent by the cloud server; in the request message for updating the resource representation of the server device, the uniform resource identifier URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
40. The method of claim 39, wherein: The URI of the target resource does not include the server device identifier.
41. The method of claim 40, wherein: The method further comprises: The server device sends a request response message to the cloud server to update the resource representation of the server device; The request response message for updating the resource representation 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 a resource representation corresponding to a resource link, wherein the resource link is published to the cloud server by a server device; The cloud server generates a shadow device of the server device based on the resource description; wherein the server device is an OCF server; the resource link is a reference relationship between OCF resources; the shadow device is a digital twin device generated by the server device; the resource description includes at least one of the following: a uniform resource identifier URI of the resource, a resource type, a resource interface, and functional attributes of the resource.
43. The method of claim 42, wherein: The method further comprises: The cloud server sends a resource representation acquisition request message to the server device.
44. The method of claim 43, wherein: The resource representation acquisition request message includes: Obtain a resource representation corresponding to a resource link published by the server to the cloud server.
45. The method of claim 44, wherein: The cloud server obtains a resource representation corresponding to the resource link, including: The cloud server receives a resource representation corresponding to a resource link sent by the server-side device.
46. The method of claim 43, wherein: The resource representation acquisition request message includes: Obtain resource representations corresponding to all resource links published by the server-side device to the cloud server.
47. The method of claim 46, wherein: The cloud server obtains a resource representation corresponding to the resource link, including: The cloud server receives resource representations corresponding to all resource links sent by the server device, and the all resource links are published to the cloud server by the server device.
48. A method according to any one of claims 42 to 47, wherein: The method further comprises: 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 the changed original resource representation to the cloud server when the original resource representation on the server device changes.
49. The method according to any one of claims 42 to 47, wherein: The method further comprises: When the cloud server receives the resource representation of the changed resource, the cloud server updates the resources of the shadow device based on the resource representation of the changed resource.
50. The method according to any one of claims 42 to 47, wherein: The method further comprises: The cloud server sends a request message for updating the resource representation of the server device to the server device; in the request message for updating the resource representation of the server device, the uniform resource identifier URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
51. The method of claim 50, wherein: The URI of the target resource does not include the server device identifier.
52. The method of claim 51, wherein: The method further comprises: The cloud server receives a request response message for updating a resource representation of a server-side device; The request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
53. The method of claim 52, wherein: The method further comprises: The cloud server updates the resources of the shadow device based on the request response message of the resource representation of the update server device.
54. The method according to any one of claims 42 to 47, wherein: The device identification of the shadow device is the same as the device identification of the server device.
55. A server device, comprising: A first sending unit is configured to send a create shadow device request message to a cloud server, wherein the create shadow device request message is used to request the cloud server to generate a shadow device of the server device; It is also 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 synchronize resources with the shadow device; wherein the server device is an OCF server; the shadow device is a digital twin device generated by the server device; the shadow device creation request message includes the original resource representation of the server device; the resource representation includes at least one of the following: a uniform resource identifier URI of a resource, a resource type, a resource interface, and a functional attribute of a resource; The first receiving unit is configured to receive a create shadow device request response message.
56. The server device according to claim 55, wherein: The shadow device creation request message includes: a shadow device creation request message for a shadow generation resource.
57. The server device according to claim 55 or 56, wherein: The request message for creating a shadow device also includes: Server device identifier.
58. The server device according to claim 57, wherein: The request message for creating a shadow device also includes: The shadow synchronization resources of the server device.
59. The server device according to claim 55 or 56, wherein: The shadow device creation request response message is used to indicate that the shadow device is created successfully.
60. According to the server device according to claim 55 or 56, the first resource synchronization request message includes a server device identifier.
61. 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, where the first resource synchronization request response message is used to indicate that resource synchronization is successful.
62. The server device according to claim 61, wherein: The uniform resource identifier URI of the target resource for resource synchronization is the URI of the original resource whose resource representation has changed.
63. The server device according to claim 55 or 56, 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 synchronize resources with the shadow device, and the second resource synchronization request message includes a server device identifier.
64. 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, where the second resource synchronization request response message is used to indicate that resource synchronization is successful.
65. The server device according to claim 64, wherein: The URI of the target resource for resource synchronization is the URI of the original resource whose resource representation needs to be updated.
66. The server device according to claim 63, wherein: The URI of the target resource for resource synchronization is the URI of the shadow synchronization resource.
67. The server device according to claim 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, comprising: A second receiving unit is configured to receive a request message for creating a shadow device sent by a server device; Also configured to receive a first resource synchronization 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; wherein the server device is an OCF server; the shadow device is a digital twin device generated by the server device; the shadow device creation request message includes the original resource representation of the server device; the resource representation includes at least one of the following: a uniform resource identifier URI of a resource, a resource type, a resource interface, and a functional attribute of a resource; The first processing unit is configured to generate a shadow device of the server device based on the create shadow device request message.
69. The cloud server according to claim 68, wherein: The shadow device creation request message includes: a shadow device creation request message for a shadow generation resource.
70. The cloud server according to claim 68 or 69, wherein: The request message for creating a shadow device also includes: Server device identifier.
71. The cloud server according to claim 70, wherein: The request message for creating a shadow device also includes: The shadow synchronization resources of the server device.
72. The cloud server according to claim 68 or 69, wherein: The device identification of the shadow device is the same as the device identification of the server device; And / or, the copied resource uniform resource identifier URI of the shadow device is the same as the original resource URI of the server device.
73. The cloud server according to claim 72, wherein: The resources of the shadow device include shadow synchronization resources.
74. The cloud server according to claim 68 or 69, wherein: The cloud server also includes: The second sending unit is configured to send a create shadow device request response message to the server device, where the create shadow device request response message is used to indicate that the shadow device is successfully created.
75. The cloud server according to claim 68 or 69, wherein: The first processing unit is further configured to publish the copied resource link of the shadow device to the resource discovery directory of the cloud server.
76. The cloud server according to claim 75, wherein: The URI of the copied resource of the shadow device published in the resource discovery directory of the cloud server includes the server device identifier.
77. According to the cloud server of claim 68 or 69, the first resource synchronization request message includes a server device identifier.
78. The cloud server according to claim 77, wherein: The cloud server also includes: 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 that resource synchronization is successful.
79. The cloud server according to claim 78, wherein: The URI of the target resource for resource synchronization is the URI of the original resource whose resource representation has changed.
80. The cloud server according to claim 68 or 69, wherein: The cloud server also includes: 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 synchronize resources with the shadow device, and the second resource synchronization request message includes a server device identifier.
81. 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, where the second resource synchronization request response message is used to indicate that resource synchronization is successful.
82. The cloud server according to claim 81, wherein: The URI of the target resource for resource synchronization is the URI of the original resource whose resource representation needs to be updated.
83. The cloud server according to claim 80, wherein: The URI of the target resource for resource synchronization is the URI of the shadow synchronization resource.
84. The cloud server according to claim 68 or 69, wherein: The first processing unit is further configured to update the resource representation of the shadow device on the cloud server.
85. The cloud server according to claim 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 device, comprising: A fifth sending unit is configured to send a resource representation corresponding to a resource link to the cloud server, wherein the resource link is published by the server device to the cloud server; wherein the server device is an OCF server; the resource link is a reference relationship between OCF resources; and the resource representation includes at least one of the following: a uniform resource identifier URI of a resource, a resource type, a resource interface, and a functional attribute of a resource; The resource representation is used by the cloud server to generate a shadow device of the server device; wherein the shadow device is a digital twin device generated by the server device.
87. The server device according to claim 86, wherein: The server device also includes: The third receiving unit receives a request message for obtaining a resource representation sent by the cloud server.
88. The server device according to claim 87, wherein: The request message for obtaining resource representation includes: Obtain a resource representation corresponding to a resource link published by the server-side device to the cloud server.
89. The server device according to claim 88, wherein: The fifth sending unit is configured to send a resource representation corresponding to a resource link to the cloud server.
90. The server device according to claim 87, wherein: The request message for obtaining resource representation includes: Obtain resource representations corresponding to all resource links published by the server-side device to the cloud server.
91. 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.
92. The server device according to any one of claims 86 to 91, wherein: The server device also includes: A fourth receiving unit, configured to receive a request message for subscribing to original resources of a server-side device sent by the cloud server; The request message for subscribing to the original resource of the server-side device is used to send the changed original resource representation to the cloud server when the original resource representation on the server-side device changes.
93. The server device according to any one of claims 86 to 91, wherein: The server device also includes: The fifth receiving unit is configured to receive a request message for updating the resource representation of the server-side device sent by the cloud server; in the request message for updating the resource representation of the server-side device, the uniform resource identifier URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
94. The server device according to claim 93, wherein: The URI of the target resource does not include the server device identifier.
95. The server device according to claim 94, wherein: The fifth sending unit is further configured to send a request response message for updating a resource representation of a server-side device to the cloud server; The request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
96. A cloud server, comprising: A sixth receiving unit is configured to obtain a resource representation corresponding to a resource link, wherein the resource link is published by a server device to the cloud server; wherein the server device is an OCF server; the resource link is a reference relationship between OCF resources; and the resource representation includes at least one of the following: a uniform resource identifier URI of a resource, a resource type, a resource interface, and a functional attribute of a resource; The second processing unit is configured to generate a shadow device of the server device based on the resource representation; wherein the shadow device is a digital twin device generated by the server device.
97. The cloud server according to claim 96, wherein: The cloud server also includes: The sixth sending unit is configured to send a resource representation acquisition request message to the server device.
98. The cloud server according to claim 97, wherein: The sixth receiving unit is configured to obtain a resource representation corresponding to a resource link published by the server to the cloud server.
99. The cloud server according to claim 98, wherein: The sixth receiving unit is configured to receive a resource representation corresponding to a resource link sent by the server device.
100. 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. 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. The cloud server according to any one of claims 96 to 101, wherein: The cloud server also includes: 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 representation to the cloud server when the original resource representation on the server device changes.
103. The cloud server according to any one of claims 96 to 101, wherein: When the sixth receiving unit receives the resource representation of the changed resource, the second processing unit is configured to update the resources of the shadow device based on the resource representation of the changed resource.
104. The cloud server according to any one of claims 96 to 101, wherein: The cloud server also includes: The eighth sending unit is configured to send a request message for updating the resource representation of the server device to the server device; in the request message for updating the resource representation of the server device, the uniform resource identifier URI of the target resource requested to be updated is the URI of the original resource whose resource representation needs to be updated.
105. The cloud server according to claim 104, wherein: The URI of the target resource does not include the server device identifier.
106. The cloud server according to claim 105, wherein: The sixth receiving unit is further configured to receive a request response message for updating a resource representation of a server device; The request response message for updating the resource representation of the server device is used to indicate that the server device has successfully updated the resource.
107. The cloud server according to claim 106, wherein: The second processing unit is configured to update the resources of the shadow device based on the request response message of the resource representation of the update server device.
108. The cloud server according to claims 96 to 101, wherein: The device identification of the shadow device is the same as the device identification of the server device.
109. A server device comprising a processor and a memory for storing a computer program that can be run on the processor, wherein: The processor is used to execute the steps of the shadow device generation method described in any one of claims 1 to 13 when running the computer program.
110. A cloud server comprising a processor and a memory for storing a computer program that can be run on the processor, wherein: When the processor is used to run the computer program, it executes the steps of the shadow device generation method described in any one of claims 14 to 31.
111. A server device, comprising a processor and a memory for storing a computer program that can be run on the processor, wherein: When the processor is used to run the computer program, it executes the steps of the shadow device generation method described in any one of claims 32 to 41.
112. A cloud server comprising a processor and a memory for storing a computer program that can be run on the processor, wherein: When the processor is used to run the computer program, it executes the steps of the shadow device generation method described in any one of claims 42 to 54.
113. A storage medium storing an executable program, wherein 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 implemented.
114. A storage medium storing an executable program, wherein when the executable program is executed by a processor, the method for generating a shadow device as described in any one of claims 14 to 31 is implemented.
115. A storage medium storing an executable program, wherein when the executable program is executed by a processor, the method for generating a shadow device as described in any one of claims 32 to 41 is implemented.
116. A storage medium storing an executable program, wherein when the executable program is executed by a processor, the method for generating a shadow device as described in any one of claims 42 to 54 is implemented.
