CN111629018B - Resource synchronization method, device, equipment and storage medium - Google Patents

Resource synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN111629018B
CN111629018B CN201910153428.2A CN201910153428A CN111629018B CN 111629018 B CN111629018 B CN 111629018B CN 201910153428 A CN201910153428 A CN 201910153428A CN 111629018 B CN111629018 B CN 111629018B
Authority
CN
China
Prior art keywords
service
resource
equipment
type
shadow
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910153428.2A
Other languages
Chinese (zh)
Other versions
CN111629018A (en
Inventor
唐海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910153428.2A priority Critical patent/CN111629018B/en
Priority to PCT/CN2020/070927 priority patent/WO2020173232A1/en
Publication of CN111629018A publication Critical patent/CN111629018A/en
Application granted granted Critical
Publication of CN111629018B publication Critical patent/CN111629018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a resource synchronization method, a resource synchronization device, equipment and a storage medium, wherein the method is applied to the Internet of things, the Internet of things comprises service equipment and network equipment, shadow equipment corresponding to the service equipment is arranged in the network equipment, and the method comprises the following steps: the service equipment acquires the position information of service resources in the network equipment, wherein the service resources correspond to the shadow equipment; and the service equipment synchronizes service resources with the network equipment according to the position information. The reliability of resource synchronization is improved.

Description

Resource synchronization method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technology of internet of things, in particular to a resource synchronization method, device, equipment and storage medium.
Background
A plurality of service devices are arranged in the Internet of things system, and the service devices are entities for providing resources. Shadow devices corresponding to the service devices may be deployed in network devices (e.g., cloud platforms, gateways, etc.), and the shadow devices may provide services such as data queries, modifications, etc. to the guest devices.
In order for the service device and the network device to provide the correct service to the client device, the data in the service device and the network device need to be kept synchronized. In the prior art, an information synchronization table and a shadow synchronization resource are usually set in a service device and a network device, and the information synchronization table includes an update timestamp and a synchronization timestamp of the resource. When the service equipment determines that the update time stamp and the synchronization time stamp of one service resource are different, the service resource is sent to the shadow synchronization resource in the network equipment, the shadow synchronization resource in the network equipment determines the position of the service resource in the network equipment, and the service resource in the network equipment is updated according to the position of the service resource, so that the synchronization of the service resource is realized. The process of resource synchronization from the network device to the service device is similar.
However, in the above process, when the shadow synchronization resource is abnormal, the resource synchronization between the service device and the network device is abnormal, and the reliability of the resource synchronization is poor.
Disclosure of Invention
The embodiment of the application provides a resource synchronization method, a resource synchronization device and a storage medium, and the reliability of resource synchronization is improved.
In a first aspect, an embodiment of the present application may provide a resource synchronization method, which is applied to an internet of things, where the internet of things includes a service device and a network device, and the network device is provided with a shadow device corresponding to the service device, and the method includes:
the service equipment acquires the position information of the service resource in the network equipment, wherein the service resource corresponds to the shadow equipment;
and the service equipment synchronizes the service resource with the network equipment according to the position information.
In a second aspect, an embodiment of the present application may provide a resource synchronization method, which is applied to an internet of things, where the internet of things includes a service device and a network device, and the network device is provided with a shadow device corresponding to the service device, and the method includes:
the network equipment acquires the position information of service resources in the service equipment, wherein the service resources correspond to the shadow equipment;
and the network equipment synchronizes the service resources with the service equipment according to the position information.
In a third aspect, an embodiment of the present application may provide a resource synchronization apparatus, which is applied to a service device in an internet of things, where the internet of things further includes a network device, and the network device is provided with a shadow device corresponding to the service device, and the apparatus includes a processing module, where the processing module is configured to:
acquiring the position information of the service resource in the network equipment, wherein the service resource corresponds to the shadow equipment;
and synchronizing the service resource with the network equipment according to the position information.
In a fourth aspect, an embodiment of the present application may provide a resource synchronization apparatus, which is applied to a network device in an internet of things, where the internet of things further includes a service device, the network device is provided with a shadow device corresponding to the service device, the apparatus includes a processing module, where the processing module is configured to:
acquiring position information of service resources in the service equipment, wherein the service resources correspond to the shadow equipment;
and synchronizing the service resources with the service equipment according to the position information.
In a fifth aspect, an embodiment of the present application may provide a service apparatus, including: a transceiver, a processor, a memory;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to cause the service device to perform the resource synchronization method of any one of the first aspects.
In a sixth aspect, an embodiment of the present application may provide a network device, including: a transceiver, a processor, a memory;
the memory stores computer execution instructions;
the processor executes computer-executable instructions stored by the memory, causing the processor to perform the resource synchronization method of any of the second aspects.
In a sixth aspect, embodiments of the present application may provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the computer-readable storage medium is used for implementing the resource synchronization method according to any one of the first aspect.
In a seventh aspect, this application embodiment may provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the computer-readable storage medium is used to implement the resource synchronization method according to any one of the second aspects.
According to the resource synchronization method, the resource synchronization device, the resource synchronization equipment and the storage medium, the service equipment can acquire the resource information of the service resource, and the resource information comprises the position information of the service resource in the network equipment, and the service equipment synchronizes the service resource with the network equipment according to the position information. In the process, the information synchronization table and the shadow synchronization resource do not need to be maintained in the service equipment and the network equipment, so that the resource synchronization process is simplified, and the reliability of resource synchronization is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the description below are some embodiments of the present application, and those skilled in the art can obtain other drawings based on the drawings without inventive labor.
Fig. 1 is a schematic diagram of an internet of things system applied in an embodiment of the present application;
fig. 2 is a schematic flowchart of a resource synchronization method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a method for generating resource information of service resources in service equipment according to an embodiment of the present application;
fig. 4 is a flowchart illustrating another resource synchronization method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a method for generating resource information of a service resource corresponding to a shadow device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a resource synchronization apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another resource synchronization apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another resource synchronization apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another source synchronization apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a service device provided in an embodiment of the present application;
fig. 11 is a schematic structural diagram of a network device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and in the claims, and in the drawings, of the embodiments of the application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Before introducing the solutions provided in the embodiments of the present application, a network system applied in the embodiments of the present application will be described below. Fig. 1 is a schematic diagram of an internet of things system applied in the embodiment of the present application. As shown in fig. 1, the internet of things system includes a service device 11, a network device 12, a configuration device 13, and a client device 14. It is understood that, in practical applications, the service device 11, the configuration device 13 and the client device 14 may be one or more, and this fig. 1 is only taken as an example. The service device 11 is connected to the network device 12 and the configuration device 13, respectively, and the network device 12 is also connected to the configuration device 13 and the client device 14, respectively. The connection between the above devices may be a wired connection or a wireless connection, which is not specifically limited in this embodiment of the present application.
The service device 11 may be an entity providing resources, and may be a data acquisition device such as a sensor or a data acquisition card, an electrical component device such as a switch, a socket, or a lamp, or an electronic device such as an air conditioner, a washing machine, a refrigerator, a sound box, or a television. Of course, the above is only some possible examples of the service device 11, and the service device 11 may also be other intelligent hardware devices that can provide resources and implement corresponding functional services, which is not described herein again in this embodiment of the present application. The service device 11 may be referred to as an Open Connectivity Foundation (OCF) service end entity, a resource provider, or a resource device.
The network device 12 may be a device for performing shadow device deployment, that is, a shadow device 121 corresponding to the service device 11 may be deployed in the network device 12, and the shadow device 121 deployed in the network device 12 is a virtual device (or referred to as a virtual network device). The resources in the service device 11 and the resources corresponding to the shadow device 121 in the network device 12 need to be synchronized, so that the resources corresponding to the service device 11 and the shadow device 121 are the same. For example, the network device 12 may be a cloud platform, gateway, or the like. Optionally, the network device 12 is a device that does not need to be dormant, that is, the network device 12 is a device that can continuously operate.
The configuration device 13 is used to configure the shadow device 121 in the network device 12 and the service device 11. For example, the configuration device 13 may send a configuration instruction to the service device 11 to make the service device 11 request to generate the corresponding shadow device 121 in the network device 12, and the configuration device 13 may also send information such as a service identifier for generating the shadow device in the network device 12, an identifier for generating a resource of the shadow device, and the like to the service device 11. The configuration device 13 may also configure resources and the like that the shadow device corresponding to the service device 11 has. For example, the configuration device 13 may be a client device such as a mobile phone or a computer.
The entity that the client device 14 can access the resource may be a terminal device installed with an OCF client application, and the terminal device may be any one of a desktop computer, a notebook computer, a Personal Digital Assistant (PDA), a smart phone, a tablet computer, and the like. Client devices 14 may also be referred to as OCF client devices, user devices, or customer premise equipment, etc.
Based on the current technology, an information synchronization table and a shadow synchronization resource need to be maintained in a service device and a network device. When any resource of any one of the service device and the network device changes, the content in the information synchronization table needs to be updated, so that the maintenance complexity of the information synchronization table is high, and the resource synchronization complexity is high. When any one of the information synchronization table and the shadow synchronization resource is abnormal, the resource synchronization between the service device and the network device is abnormal, and the reliability of the resource synchronization is poor.
In this application, the location information of the resource in the network device is included in the service device, so that when the resource in the service device is updated, the service device can synchronize the updated resource with the network device according to the location information of the resource in the network device. The location information of the resource in the service device is included in the network device, so that when the resource in the network device is updated, the network device can synchronize the updated resource with the service device according to the location information of the resource in the service device. The information synchronization table and the shadow synchronization resources do not need to be maintained in the network equipment and the network equipment, so that the resource synchronization process is simplified, and the reliability of the resource synchronization is improved.
The technical solution described in the present application will be described in detail by specific examples. It should be noted that the following embodiments may be independent or combined with each other, and the description of the same or similar contents is not repeated in different embodiments.
Fig. 2 is a schematic flowchart of a resource synchronization method according to an embodiment of the present application. In the embodiment shown in fig. 2, a process of synchronizing the service resource to the network device by the service device is taken as an example for explanation. Referring to fig. 2, the method may include:
s201, the service equipment acquires the position information of the service resource in the network equipment.
The shadow device referred to in the present application refers to a device deployed in a network device, and the shadow device may be a virtual device, and may also be referred to as a virtual network device.
Wherein the service resource corresponds to the shadow device. That is, the service resource is a service resource corresponding to the shadow device.
One or more shadow devices may be deployed in the network device, where a shadow device shown in this application is a shadow device corresponding to a service device shown in this application.
Optionally, the function of the shadow device corresponding to one service device may be a part of the functions of the service device.
For example, assuming that the service device is a temperature sensor having a function of detecting a temperature, a function of providing a temperature value inquiry, a function of alarming when the temperature exceeds a preset temperature range, a function of modifying the preset temperature range, etc., the shadow device may have a function of providing a temperature value inquiry and a function of modifying the preset temperature range.
It should be noted that the location information of the service resource in the network device may refer to the location information of the service resource in the corresponding shadow device.
Optionally, the service device may include one or more service resources, where the service resource referred to in this application may be any service resource of the service device, and the service resource may also be referred to as an OFC resource.
Optionally, the service resource may be a functional resource of the service device, and the functional resource of the service device is related to a function of the service device, for example, when the temperature sensor of the service device is used, the functional resource of the service device is a temperature resource. When the service device is a humidity sensor, then the functional resource of the service device may be a humidity resource.
Optionally, one service device may correspond to at least one service resource.
The number of service resources corresponding to a service device is related to the number of functions the service device has. Optionally, the number of service resources corresponding to the service device is the same as the function data of the service device. For example, when the service device is a temperature sensor, it is assumed that the temperature sensor has two functions as follows: function 1, provide the current temperature value. And 2, alarming when the temperature exceeds a preset temperature range. The temperature sensor has two service resources: one is the current temperature value resource corresponding to function 1, and the other is the temperature range resource corresponding to function 2.
Optionally, the Resource information of the service Resource in the service device may include a Uniform Resource Identifier (URI) of the service Resource, a type of the service Resource, a general interface of the service Resource, a functional attribute of the service Resource, and location information of the service Resource in the network device.
The URI of a service resource is used to indicate the address of the service resource, which can be accessed through a resource URI of a service resource. For example, the URI of a service resource can be represented by "href", the value of which is the URI of the service resource.
The type of the service resource may be represented by "rt", and the value of "rt" is the type of the service resource. In the present application, a type of service resource may include two types, one is a functional type of service resource, for example, a temperature type, a humidity type, a speed type, and the like. The other is a synchronization type of the service resource, for example, a push type and a subscription type, where the push type means that when the service resource of the service device is updated, the service device actively synchronizes the updated resource with the network device. The subscription type means that the service device can subscribe to resource changes of the shadow device, so that after the service resource corresponding to the shadow device is updated, the network device sends the updated resource to the service device. It should be noted that, because the shadow device is deployed in the network device, the service resource corresponding to the shadow device may also be referred to as a resource in the network device.
The generic interface of a service resource specifies a method for operating (e.g., viewing, synchronizing, modifying, etc.) the service resource, that is, when operating a service resource, the service resource needs to be operated by the method specified by the generic interface corresponding to the service resource. For example, the generic interface of the service resource may be represented by "if", and the value of "if" is the generic interface of the service resource.
The attribute information of the service resource is used to indicate a value of the service resource, for example, if the service resource is a resource with a current temperature value, the attribute information of the service resource is the current temperature value, and if the service resource is a resource with a temperature range, the attribute information of the service resource is the temperature range.
The location information of the service resource in the network device may be a URI of the service resource in the network device. When the type of the service resource includes a push type, the push target "may represent location information of the service resource in the network device, and a value of the" push target "is the location information of the service resource in the network device. When the type of the service resource includes the subscription type, the location information of the service resource in the network device may be represented by an observation target "observed target", and a value of the "observed target" is the location information of the service resource in the network device.
Optionally, the resource information of the service device may further include a synchronization interface used for the synchronization operation. For example, the synchronization interface used by the synchronization operation may be represented by "qif", and the value of "qif" is the synchronization interface used by the synchronization operation. Wherein the generic interface comprises a synchronous interface. The synchronous interface is an interface used for resource synchronization between the devices.
Optionally, the resource information of the service device may further include a resource type of the synchronization operation, that is, the resource type of the synchronization between the service device and the network device in a push manner or a subscription manner. For example, the resource type of the synchronization operation can be represented by "qrt", and the value of "qrt" is the resource type of the synchronization operation.
For example, the resource information of the current temperature value resource may be as follows:
{"rt":[“oic.r.temperature”,"oic.r.pushproxy"],
"if":["oic.if.s","oic.if.baseline"],
"temperature":20,
"pushtarget":"coaps://[fe80::b1d6]:2222/temperature",
"qif":["oic.if.s"],
"qrt":["oic.r.temperature"]
}
as can be known from the resource information of the current temperature value resource, the type of the current temperature value resource includes "oic.r.temperature" and "oic.r.pushproxy", where "oic.r.temperature" indicates that the type of the current temperature value resource is the temperature value type, and "oic.r.pushproxy" indicates that the type of the current temperature value resource is the push type. Common interfaces for current temperature value resources include "oic. The attribute information of the current temperature value resource (i.e., the current temperature value) is 20. The location information of the current temperature value resource in the network device is "maps:// [ fe80:: b1d 6:: 2222/temperature", that is, the URI of the current temperature value resource in the network device is "maps:// [ fe80:: b1d 6: 2222/temperature", wherein [ fe80:: b1d6]:2222 is endpoint information (or is called Internet Protocol (IP) Address), and one service resource is associated with at least one endpoint information. The synchronization interface used for performing the synchronization operation in the push mode is "oic. The resource type synchronized by the push method is "oic.
For example, the resource information of the temperature range resource may be as follows:
{"rt":[“oic.r.temperatureRange”,"oic.r.observeproxy"],
"if":["oic.if.a","oic.if.baseline"],
"temperatureRange":[0,30],
“observetarget":"coaps://[fe80::b1d6]:2222/temperatureRange",
"qif":["oic.if.a"],
"qrt":["oic.r.temperatureRange"]
}
as can be seen from the resource information of the temperature range resource, the type of the temperature range resource includes "oic.r.temperature range" and "oic.r.ob serverproxy", where "oic.r.temperature range" indicates that the type of the temperature range resource is the temperature range type, and "oic.r.pushproxy" indicates that the type of the temperature range resource is the subscription type. Common interfaces for temperature range resources include "oic. if.a" and "oic. if.baseline". The attribute information (temperature range) of the temperature range resource is [0, 30 ]. The location information of the temperature range resource in the network device is "maps:// [ fe80:: b1d 6:: 2222/temporal range," i.e., the URI of the temperature range resource in the network device is "maps:// [ fe80:: b1d 6: 2222/temporal range. The synchronization interface used for performing the synchronization operation in the subscription mode is "oic. The resource type for synchronization by push is "oic.
S202, the service equipment synchronizes service resources with the network equipment according to the position information.
Optionally, the service device may obtain the type of the service resource first, and synchronize the service resource with the network device according to the location information when it is determined that the type of the service resource is a push type or a subscription type.
Optionally, when the types of the service resources are different, the process of synchronizing the service resources by the service device and the network device according to the location information is also different, and the following two possible situations may be included:
one possible scenario is: the type of service resource is a push type.
When the type of the service resource is a push type, the service device may determine whether the service resource in the service device is updated, and after the service device determines that the service resource is updated, the service device may send the service resource to the network device according to the type and the location information of the service resource. Optionally, after the network device receives the service resource, the service resource may be synchronized to a shadow device corresponding to the service device.
Optionally, after one service resource in the service device is updated, the service device may determine whether the type of the service resource includes a push type, and if so, the service device may send the service resource to the network device according to the push type and location information of the service resource in the network device. Optionally, after the network device receives the service resource, the service resource may be synchronized to a shadow device corresponding to the service device.
Optionally, the service device may send an update request to the network device, where the update request includes location information of the service resource in the network device and the updated service resource, so that the network device updates the service resource in the location information according to the update request.
Optionally, when the resource information includes the synchronization interface, the service device may send the service resource to the network device according to the synchronization interface in the resource information.
It should be noted that, the service device sending the service resource according to the synchronization interface in the resource information by the network device means that the service device sends the service resource to the network device according to the method indicated by the synchronization interface in the resource information.
Another possible scenario is: the type of service resource is a subscription type.
Optionally, when the type of the service resource of the service device is a subscription type, the service device may subscribe to a change of the shadow device corresponding to the service resource, and after the resource corresponding to the shadow device is updated, the updated resource is sent to the service device.
Optionally, when the service device determines that the type of one service resource includes the subscription type, the service device sends a subscription request of the service resource to the network device according to the type and the location information of the service resource. Optionally, the subscription request may include location information of the service resource in the network device. Correspondingly, after the service resource corresponding to the shadow device in the network device is updated, the network device sends the service resource to the service device according to the subscription request.
Optionally, when the resource information includes the synchronization interface, the service device sends a subscription request to the network device through the synchronization interface in the resource information.
It should be noted that, the service device sending the subscription request to the network device through the synchronization interface in the resource information means that the service device sends the subscription request to the network device through a method indicated by the synchronization interface in the resource information.
According to the resource synchronization method provided by the embodiment of the application, the service equipment can acquire the resource information of the service resource, the resource information comprises the position information of the service resource in the network equipment, and the service equipment synchronizes the service resource with the network equipment according to the position information. In the process, the information synchronization table and the shadow synchronization resource do not need to be maintained in the service equipment and the network equipment, so that the resource synchronization process is simplified, and the reliability of the resource synchronization is improved.
On the basis of the embodiment shown in fig. 2, optionally, before the service device synchronizes the resource to the network device, the resource information of the service resource needs to be generated in the service device. Next, a process of the service device generating resource information of the service resource will be described in detail.
Fig. 3 is a flowchart illustrating a method for generating resource information of a service resource in service equipment according to an embodiment of the present application. Referring to fig. 3, the method may include:
s301, the configuration device sends a configuration instruction to the service device.
The configuration instruction is used to instruct to add a push type or a subscription type to the service resource in the service device, that is, to add a push type or a subscription type to the type of the service resource.
Optionally, the configuration instruction may be further configured to instruct to add location information to the service resource in the service device, where the location information refers to location information of the service resource in the network device.
Optionally, the configuration instruction may be further configured to instruct to add a synchronization interface and a synchronization resource type to the service resource;
optionally, the configuration instruction may further include at least one of an identifier of the service resource, a synchronization interface, and a type of the service resource.
When the configuration instruction includes the identity of the service resource, the configuration instruction may instruct to add a push type or a subscription type to the service resource indicated by the identity of the service resource.
When the configuration instruction includes a synchronous interface, the configuration instruction may instruct to add a push type or a subscription type to a service resource corresponding to the synchronous interface, where the service resource corresponding to the synchronous interface may be a service resource using the synchronous interface.
When the configuration instruction includes a type of service resource, then the configuration instruction may instruct to add a push type or a subscription type to the service resource of the type of service resource.
S302, the configuration device sends a shadow device generation instruction to the service device.
The shadow device generation instruction is used for indicating the service device to request to generate a shadow device corresponding to the service device in the network device.
Optionally, the shadow device generation instruction may further include at least one of an identification of the service resource, a synchronization interface, and a type of the service resource.
Optionally, the identifier of the service resource included in the shadow device generation instruction is the same as the identifier of the service resource included in the configuration instruction. The synchronization interface included in the shadow device generation instruction is the same as the synchronization interface included in the configuration instruction. The type of the service resource included in the shadow device generation instruction is the same as the type of the service resource included in the configuration instruction.
It should be noted that in S301 and S302, the configuration device may also send a configuration instruction and a shadow device generation instruction to the service device in the form of one instruction.
S303, the service equipment adds a push type or a subscription type in the resource information of the service resource in the service equipment according to the configuration instruction.
Optionally, a push type or a subscription type may be added to the initial resource information of the service resource. The initial resource of the service resource comprises the URI of the service resource, the type of the service resource, the general interface of the service resource and the functional attribute of the service resource. The type of the service resource in the initial resource includes a functionality type of the service resource, for example, a temperature type, a humidity type, a speed type, and the like. The type of service resource in the initial resource does not include a push type or a subscription type.
For example, the initial resource information of the current temperature value resource may be as follows:
{"rt":[“oic.r.temperature”],
"if":["oic.if.s","oic.if.baseline"],
"temperature":20
}
optionally, if the configuration information includes an identifier of the service resource, the service device adds a push type or a subscription type to initial resource information of the service resource indicated by the service resource identifier.
Optionally, if the configuration information includes a synchronization interface, the service device adds a push type or a subscription type to initial resource information of a service resource corresponding to the synchronization interface.
Optionally, if the configuration information includes the type of the service resource, the service device adds a push type or a subscription type to the initial resource information of the service resource of the type of the service resource.
It should be noted that, if the configuration information does not include at least one of the identifier of the service resource, the synchronization interface, and the type of the service resource, the service device may add a push type or a subscription type in the initial resource information of all the service resources, or add a push type or a subscription type in the initial resource information of the preset service resource, or add a push type or a subscription type in the initial resource information of the service resource corresponding to the preset interface type, or add a push type or a subscription type in the initial resource information of the preset type of service resource.
S304, the service equipment adds at least one attribute in the resource information of the service resource.
It should be noted that S304 is an optional step. S304 is performed, for example, when the configuration instruction is further used to instruct adding location information for the service resource, and/or the configuration instruction is further used to instruct adding a synchronization interface and a synchronization resource type for the service resource.
Optionally, when the configuration instruction is further used to instruct to add location information to the service resource, the at least one attribute includes a location attribute. When the configuration instruction is used to instruct the addition of a synchronization interface and a synchronization resource type for the service resource, then the at least one attribute comprises a synchronization interface attribute or a synchronization resource type attribute.
Optionally, if the configuration information includes an identifier of the service resource, the service device adds at least one attribute to initial resource information of the service resource indicated by the service resource identifier.
Optionally, if the configuration information includes a synchronization interface, the service device adds at least one attribute to initial resource information of a service resource corresponding to the synchronization interface.
Optionally, if the configuration information includes the type of the service resource, the service device adds at least one attribute to the initial resource information of the service resource of the type of the service resource.
It should be noted that, if the configuration information does not include at least one of the identifier of the service resource, the synchronization interface, and the type of the service resource, the service device may add at least one attribute to the initial resource information of all the service resources, or add at least one attribute to the initial resource information of the preset service resource, or add at least one attribute to the initial resource information of the service resource corresponding to the preset interface type, or add at least one attribute to the initial resource information of the service resource of the preset type.
It should be noted that S303 to S304 may be executed sequentially or in parallel, and the execution order of S303 to S304 is not specifically limited in this application.
Alternatively, S303 and S304 may be implemented by one step.
S305, the service device sends a shadow device generation request to the network device.
The shadow device generation request is used for requesting the network device to generate a shadow device corresponding to the service device, and the shadow device generation request includes resource information of service resources in the service device.
Optionally, the shadow device generates resource information of the service resource in the service device, which needs to be synchronized in the network device, which may be included in the request.
For example, assuming that the service device includes service resource 1 and service resource 2, if the resource information of service resource 1 needs to be synchronized in the network device, the shadow device generates a request carrying the resource information of service resource 1. If the resource information of the service resource 2 needs to be synchronized in the network device, the shadow device generates a request carrying the resource information of the service resource 2. If the resource information of the service resource 1 and the service resource 2 needs to be synchronized in the network device, the shadow device generates a request carrying the resource information of the service resource 1 and the service resource 2.
Optionally, if the configuration information includes an identifier of the service resource, the shadow device generation request includes resource information of the service resource indicated by the identifier of the service resource in the service device.
Optionally, if the configuration information includes the synchronization interface, the shadow device generation request includes resource information of a service resource corresponding to the synchronization interface in the service device.
Optionally, if the configuration information includes the type of the service resource, the shadow device generation request includes resource information of the service resource in the service device and of the type of the service resource.
It should be noted that, if the service device adds at least one attribute to the resource information of the first service resource, the shadow device generates the request including the resource information of the first service resource.
Optionally, the shadow device generation request may further include device resource information of the service device, where the device resource information may include information of a type, an identifier, a general interface, and the like of the service device.
For example, the device resource information and annotations may be as follows:
{
"href"/oic/d ",// address of device (e.g., URI)
"rep":{
"rt" [ "oic.wk.d", "oic.d.sensor" ]// type of service equipment
"if" [ "oic. if. s", "oic. if. Baseline" ],// interface of service equipment
"di": Original _ Device _ ID ",// identification of serving Device
"icv": ocf.2.0.0 "// OCF version of service equipment
"dmv": ocf.res.1.0.0 "// service equipment's functional resource version
"dmn": foo labs "// device name of service device
"dmno": bar product xxx "// service equipment manufacturer
}
}
Optionally, the shadow device generation request may further include a resource synchronization mode of the service device, where the resource synchronization mode of the service device is a push synchronization mode or a subscription synchronization mode.
S306, the network device generates the shadow device and the resource information of the service resource corresponding to the shadow device.
Optionally, the network device may create resource information of a service resource corresponding to the shadow device in the network device, for example, the network device may determine the resource information in the shadow device generation request as the resource information of the service resource corresponding to the shadow device.
S307, the network device sends the resource information corresponding to the shadow device to the service device.
The resource information corresponding to the shadow device may include location information of the service resource in the network device, a synchronization interface, and a synchronization resource type, where the synchronization resource type is a push type or a subscription type.
Optionally, the resource information corresponding to the shadow device sent by the network device to the service device may further include other information, which is not specifically limited in this embodiment of the present application.
S308, the service equipment assigns values to at least one attribute according to the resource information corresponding to the shadow equipment to obtain the resource information of the service resource.
Optionally, the service device sets the value of the location attribute as location information; the service equipment sets the value of the attribute of the synchronous interface as the synchronous interface; the serving device sets the value of the synchronization resource type attribute to the synchronization resource type.
In the embodiment shown in fig. 3, the configuration device may send a configuration instruction to the service device, where the configuration instruction indicates that the service device is a new push type or a subscription type for the service resource, and after the service device requests the network device to create a shadow device, the network device creates a shadow device corresponding to the service device, and returns resource information corresponding to the shadow device to the service device. The service device may generate resource information of the service resource according to the configuration instruction and the resource information corresponding to the shadow device, so that the resource information of the service resource includes a synchronization type (a push type or a subscription type) of the service resource and location information of the service resource in the network device. Accordingly, when the service resource in the service device is updated, the service device may send the updated service resource to the network device according to the synchronization type (push type or subscription type) of the service resource and the location information of the service resource in the network device.
The embodiments shown in fig. 2-3 are explained in detail below by way of example 1 and example 2.
Example 1: and adding a push type for the current temperature value resource in the service equipment.
Before adding a push type to the current temperature value resource in the service device, the initial resource information of the current temperature value resource in the service device is as follows:
{"rt":[“oic.r.temperature”],
"if":["oic.if.s","oic.if.baseline"],
"temperature":20
}
step one, when a push synchronization mode needs to be added to the current temperature value resource in the service equipment, the service equipment is configured through configuration equipment. Alternatively, the configuration device may configure the service device in the following two ways.
One implementation is as follows:
the shadow device configuration resource is included in the service device (for example, the shadow device configuration resource may be oic.wk.shadow.conf), and is used to request that the shadow device is generated in the network device, and initially, the shadow device configuration resource is as follows:
{
service identifier of resource configured by ' si ', ' v/shadow device, initial value is null
"sgr" ",// URI of shadow device configuration resource, the initial value is null
"sgi"// generating an indication of a shadow device with an initial value of null
"pushproxy"// resource synchronization mode initial value is null
}
The configuration device may request to update the shadow device configuration resource in the service device, for example, the configuration device may request to update the resource synchronization mode attribute in the shadow device configuration resource, the service device may update the shadow device configuration resource according to the request sent by the configuration device, and the updated shadow device configuration resource is as follows:
{
"si" "Shadow _ Service _ ID"// Service identification of Shadow device configuration resource
"sgr": copies:// [ fe80:: b1d 6: 1111/oic/shadow/gen ",// URI of shadow device configuration resource
True,// generating an indication of a shadow device "sgi
"pushproxy"/resource synchronization mode, when the value is true, it means that the service equipment supports push synchronization mode
}
After the shadow device configuration resource in the service device is updated, when the service device requests the network device to generate the shadow device according to the shadow device configuration resource, the service device can obtain the location information of the current temperature value resource in the network device.
The other realization mode is as follows:
the service device includes a synchronization mode resource (for example, the resource type of the synchronization mode resource may be oic.r.shadow.synchronized), where the synchronization mode resource is used to indicate a synchronization mode of the resource, and initially, the synchronization mode resource is as follows:
{
"rt": oil.r.show. syncextended ",// synchronized resource type
"if" [ "oic.if.rw", "oic.if.baseline" ],// interface of synchronization mode resource
Rsm/resource synchronization mode attribute, initial value is null
}
The configuration device may request to update the synchronization mode resource in the service device, for example, the configuration device may request to update the resource synchronization mode attribute in the synchronization mode resource, and the service device may update the synchronization mode resource according to the request sent by the configuration device, where the updated synchronization mode resource is as follows:
{
"rt": oil.r.show. syncextended ",// synchronized resource type
"if" [ "oic.if.rw", "oic.if.baseline" ],// interface of synchronization mode resource
"rsm"// resource synchronization mode attribute, when the value is pushproxy, it means that the service device supports push synchronization mode
}
After the synchronization mode resource in the service device is updated, when the service device requests the network device to generate the shadow device according to the synchronization mode resource, the service device can obtain the location information of the current temperature value resource in the network device.
And step two, the service equipment sends a configuration success response to the configuration equipment.
Step three, after the service device sends a configuration success response to the configuration device, the service device may add a push synchronization type and at least one attribute to the initial resource information of the current temperature value resource, where the at least one attribute includes a location attribute, a synchronization interface attribute, and a synchronization resource type attribute, and the updated initial resource information is as follows:
{"rt":[“oic.r.temperature”,"oic.r.pushproxy"],
"if":["oic.if.s","oic.if.baseline"],
"temperature":20,
"pushtarget":"",
"qif":[""],
"qrt":[""]
}
the values of the location attribute "pushtarget", the synchronization interface attribute "qif", and the synchronization resource type attribute "qrt" in the initial resource information after the above update are null.
Step four, the service equipment sends a shadow equipment generation request to the network equipment.
Optionally, the content included in the shadow device generation request may be as follows:
Figure BDA0001982144920000101
Figure BDA0001982144920000111
step five, the network device generates the shadow device according to the shadow device generation request, and generates the following resource information for the shadow device:
1: discovery resource/oic/res
2: platform resource/oic/p
3: replicated device resources/oic/d of service device
The/oic/d resource information is as follows:
Figure BDA0001982144920000112
4: device resource/oic/shadow/info of shadow device corresponding to service device
The/oic/shadow/info resource information is as follows:
Figure BDA0001982144920000113
5: resource information/temperature of copied current temperature value resource
The/temperature resource information is as follows:
Figure BDA0001982144920000114
step six, after the network device generates the shadow device, the network device sends a shadow device generation success response to the service device, and the content of the response may be as follows:
Figure BDA0001982144920000121
step seven, the service device assigns at least one attribute newly added in the initial information of the current temperature value resource according to the response received in the step six and the updated initial resource information in the step three to obtain the resource information of the current temperature value, wherein the resource information is as follows:
Figure BDA0001982144920000122
step eight, the configuration tool can configure the access authority of the shadow device.
When it needs to be described, the process of configuring the access right of the shadow device may refer to the prior art, and is not described herein again.
Step nine, when the current temperature detected by the service equipment (temperature sensor) is 25 degrees, the service equipment updates the resource information of the current temperature value resource obtained in the step seven as follows:
Figure BDA0001982144920000123
step ten, because the resource information of the current temperature value resource includes "oic.r.pushproxy", the service device sends the current temperature value resource to the network device according to the resource information, for example, the service device may send an update request to the network device through an "oic.if.s" interface, where the URI of the request to update the resource is maps:// [ fe80:: b1d 6:2222/temperature, and the update request may include the following latest expression of the current temperature value resource:
Figure BDA0001982144920000124
step eleven, the network equipment updates the resources at the positions of the maps:/[ fe80:: b1d 6:: 2222/temperature according to the update request, so that the current temperature value in the current temperature value resources in the network equipment is updated to 25 degrees.
Example 2: and adding a subscription type for the temperature range resource in the service equipment.
Before adding a subscription type to the temperature range resource in the service device, the initial resource information of the temperature range resource in the service device is as follows:
{"rt":[“oic.r.temperatureRange”],
"if":["oic.if.a","oic.if.baseline"],
"temperatureRange":[0,30]
}
step one, when a subscription synchronization mode needs to be added for temperature range resources in service equipment, the service equipment is configured through configuration equipment. Alternatively, the configuration device may configure the service device in the following two ways.
One implementation is as follows:
the shadow device configuration resource is included in the service device (for example, the shadow device configuration resource may be oic.wk.shadow.conf), and is used to request that the shadow device is generated in the network device, and initially, the shadow device configuration resource is as follows:
{
service identifier of resource configured by ' si ', ' v/shadow device, initial value is null
"sgr" ",// URI of shadow device configuration resource, the initial value is null
"sgi"// generating an indication of a shadow device with an initial value of null
Observeproxy// resource synchronization mode, the initial value is null
}
The configuration device may request to update the shadow device configuration resource in the service device, for example, the configuration device may request to update the resource synchronization mode attribute in the shadow device configuration resource, the service device may update the shadow device configuration resource according to the request sent by the configuration device, and the updated shadow device configuration resource is as follows:
{
"si" "Shadow _ Service _ ID"// Service identification of Shadow device configuration resource
"sgr": copies:// [ fe80:: b1d 6: 1111/oic/shadow/gen ",// URI of shadow device configuration resource
True,// generating an indication of a shadow device "sgi
"observproxy": true,// resource synchronization mode, when the value is true, it means that the service device supports the subscription synchronization mode
}
After the shadow device configuration resource in the service device is updated, when the service device requests the network device to generate the shadow device according to the shadow device configuration resource, the service device can acquire the location information of the temperature range resource in the network device.
The other realization mode is as follows:
the service device includes a synchronization mode resource (for example, the synchronization mode resource may be oic.r.show.syncmethod), where the synchronization mode resource is used to indicate a synchronization mode of the resource, and initially, the synchronization mode resource is as follows:
{
"rt": oil.r.show. syncextended ",// synchronized resource type
"if" [ "oic.if.rw", "oic.if.baseline" ],// interface of synchronization mode resource
Rsm/resource synchronization mode attribute, initial value is null
}
The configuration device may request to update the synchronization mode resource in the service device, for example, the configuration device may request to update the resource synchronization mode attribute in the synchronization mode resource, and the service device may update the synchronization mode resource according to the request sent by the configuration device, where the updated synchronization mode resource is as follows:
{
"rt", oil, r, show, sync, resource type,// sync, etc
"if" [ "oic.if.rw", "oic.if.baseline" ],// interface of synchronization mode resource
"rsm"// resource synchronization mode attribute, when the value is observeproxy, it means that the service equipment supports the subscription synchronization mode
}
After the synchronization mode resource in the service device is updated, when the service device requests the network device to generate the shadow device according to the synchronization mode resource, the service device may obtain the location information of the temperature range resource in the network device.
And step two, the service equipment sends a configuration success response to the configuration equipment.
After the service device sends the configuration success response to the configuration device, a subscription synchronization type and at least one attribute are added to the initial resource information of the temperature range resource, wherein the at least one attribute comprises a position attribute, a synchronization interface attribute and a synchronization resource type attribute, and the updated initial resource information is as follows:
Figure BDA0001982144920000141
the values of the location attribute "observetarget", the synchronization interface attribute "qif", and the synchronization resource type attribute "qrt" in the initial resource information after the above-described update are null.
Step four, the service equipment sends a shadow equipment generation request to the network equipment.
Optionally, the content included in the shadow device generation request may be as follows:
Figure BDA0001982144920000142
Figure BDA0001982144920000151
step five, the network device generates the shadow device according to the shadow device generation request, and generates the following resource information for the shadow device:
1: discovery resource/oic/res
2: platform resource/oic/p
3: replicated device resources/oic/d of service device
The/oic/d resource information is as follows:
Figure BDA0001982144920000152
4: device resource/oic/shadow/info of shadow device corresponding to service device
The/oic/shadow/info resource information is as follows:
Figure BDA0001982144920000153
5: resource information/temperature range of replicated temperature range resources
The/temporal range resource information is as follows:
Figure BDA0001982144920000154
step six, after the network device generates the shadow device, the network device sends a successful response of the shadow device generation to the service device, and the content of the response may be as follows:
Figure BDA0001982144920000155
step seven, the service device assigns at least one attribute newly added in the initial information of the temperature range resource according to the response received in the step six and the updated initial resource information in the step three to obtain the resource information of the current temperature value, wherein the resource information is as follows:
Figure BDA0001982144920000156
Figure BDA0001982144920000161
step eight, the configuration tool can configure the access authority of the shadow device.
When it needs to be described, the process of configuring the access right of the shadow device may refer to the prior art, and is not described herein again.
Step nine, the service equipment sends a subscription request to the network equipment.
Since the resource information of the temperature range resource of the service device includes "oic.r.observeproxy", the service device sends a subscription request to the network device according to the resource information, so as to request to observe the temperature range resource corresponding to the shadow device of the service device in the network device.
For example, the service device may send a subscription request to the network device through an "oic.if.a" interface, the operation mode of the service device requesting the observed temperature range resource may be reading, the target resource of the reading request is a temperature range resource copied on the network device, and the URI of the request is the URI of the temperature range resource: maps:// [ fe80:: b1d6]:2222/temperature range.
Step ten, the network equipment receives the subscription request of the service equipment.
Optionally, the network device may send a first subscription response to the serving device, where the first subscription response indicates that the network device accepts the subscription request of the serving device.
Step eleven, when the user adjusts the temperature range resource in the network device through the client device, for example, the temperature range is adjusted to [10,20], then the resource information of the latest temperature range resource in the network device is as follows:
Figure BDA0001982144920000162
and step twelve, the network equipment sends the temperature range resource to the service equipment according to the resource information of the temperature range resource.
Optionally, the network device may send a second subscription response to the service device, where the second subscription response includes the updated resource information of the temperature range resource, and the updated resource information of the temperature range resource is shown in the resource information in step eleven.
Step thirteen, the service equipment updates the resource at the locations of maps:// [ fe80:: b1d 6:: 2222/temporal range according to the update request, so as to realize the update of the temperature range in the temperature range resource in the service equipment to [10,20 ].
Fig. 4 is a flowchart illustrating another resource synchronization method according to an embodiment of the present application. In the embodiment shown in fig. 4, a process of synchronizing the service resource from the network device to the service device is taken as an example for explanation. Referring to fig. 4, the method may include:
s401, the network equipment acquires the position information of the service resource in the service equipment, and the service resource corresponds to the shadow equipment.
It should be noted that the execution process of S401 may refer to the execution process of S201, and is not described herein again.
S402, the network equipment synchronizes service resources with the service equipment according to the position information.
Optionally, when the type of the service resource is a push type, after the service resource in the network device is updated, the network device sends the service resource in the service device to the service device according to the type and the location information of the service resource.
Optionally, when the type of the service resource is a subscription type, the network device sends a subscription request of the service resource to the service device according to the type and the location information of the service resource; after the service resources in the service equipment are updated, the network equipment receives the service resources in the service equipment sent by the service equipment according to the subscription request.
It should be noted that the execution process of S402 may refer to the execution process of S202, and is not described herein again.
According to the resource synchronization method provided by the embodiment of the application, the network equipment can acquire the resource information of the service resource, the resource information comprises the position information of the service resource in the service equipment, and the network equipment synchronizes the service resource with the service equipment according to the position information. In the process, the information synchronization table and the shadow synchronization resource do not need to be maintained in the service equipment and the network equipment, so that the resource synchronization process is simplified, and the reliability of resource synchronization is improved.
On the basis of the embodiment shown in fig. 4, optionally, before the service device synchronizes the resource to the network device, resource information of the service resource corresponding to the shadow device needs to be generated in the network device. Next, a process of the network device generating resource information of the service resource corresponding to the shadow device will be described in detail.
Fig. 5 is a flowchart illustrating a method for generating resource information of a service resource corresponding to a shadow device according to an embodiment of the present application. Referring to fig. 5, the method may include:
s501, the configuration equipment sends a configuration instruction to the service equipment.
S502, the configuration equipment sends a network equipment generation instruction to the service equipment.
It should be noted that the execution processes of S501-S502 may refer to the execution processes of S301-S302, and are not described herein again.
S503, the service device generates a request to the network device shadow device.
It should be noted that the execution process of S503 may refer to S305, and is not described herein again.
Optionally, the shadow device generation request may further include a resource synchronization mode, where the resource synchronization mode is a push synchronization mode or a subscription synchronization mode.
S504, the network device generates a shadow device and generates resource information of service resources corresponding to the shadow device.
Optionally, the network device may first obtain initial resource information of the service resource in the shadow device generation request, and add a push type or a subscription type to the initial resource information.
It should be noted that, the process of adding the push type or the subscription type in the initial resource information by the network device may refer to the execution process of S303, which is not described herein again.
Optionally, the network device further adds at least one attribute to the initial resource information of the service resource, and assigns a value to the at least one attribute.
It should be noted that, the process of adding at least one attribute in the initial resource information by the network device may be referred to as S304, and the process of assigning a value to at least one attribute by the network device may be referred to as S308, which is not described herein again.
In the embodiment shown in fig. 5, after the configuration device configures the service device, when the service device requests the network device to generate the shadow device, a resource synchronization mode (a push synchronization mode or a subscription synchronization mode) is carried in the shadow device generation request, and correspondingly, when the network device generates resource information of the service resource corresponding to the shadow device, a synchronization type (a push type or a subscription type) of the service resource and location information of the service resource in the service device are added in the resource information. Correspondingly, when a service resource (a service resource corresponding to a shadow device in the network device) in the network device is updated, the network device may send the updated service resource to the service device according to the synchronization type (push type or subscription type) of the service resource and the location information of the service resource in the service device.
On the basis of the embodiments shown in fig. 4 to fig. 5, the following describes in detail the process of adding a push type and a subscription type to a service resource by using specific examples.
Example 3: and adding a push type for a temperature range resource in the network equipment (the temperature range resource corresponding to the shadow equipment in the network equipment).
Before adding a push type to the current temperature value resource in the service device, the initial resource information of the temperature range resource in the service device is as follows:
Figure BDA0001982144920000171
step one, when a push synchronization mode needs to be added to service resources in the network equipment, the service equipment is configured through configuration equipment.
It should be noted that, step one in example 3 may refer to step one in example 1, and is not described herein again.
And step two, the service equipment sends a configuration success response to the configuration equipment.
And step three, the service equipment sends a shadow equipment generation request to the network equipment.
Optionally, the shadow device generation request may be as follows:
Figure BDA0001982144920000181
step five, the network device generates the shadow device according to the shadow device generation request, and generates the following resource information for the shadow device:
1: discovery resource/oic/res
2: platform resource/oic/p
3: replicated device resources/oic/d of service device
The/oic/d resource information is as follows:
Figure BDA0001982144920000182
4: device resource/oic/shadow/info of shadow device corresponding to service device
The/oic/shadow/info resource information is as follows:
Figure BDA0001982144920000183
Figure BDA0001982144920000191
5: resource information/temperature range of replicated temperature range resources
The/temporal range resource information is as follows:
Figure BDA0001982144920000192
step six, after the network device generates the shadow device, the network device sends a successful response of the shadow device generation to the service device, and the content of the response may be as follows:
Figure BDA0001982144920000193
and step seven, the configuration tool can configure the access authority of the shadow device.
When it needs to be described, the process of configuring the access right of the shadow device may refer to the prior art, and is not described herein again.
Step eight, when the user adjusts the temperature range resource in the network device (or the shadow device) through the client device, for example, the temperature range is adjusted to [10,20], then the resource information of the latest temperature range resource in the network device is as follows:
Figure BDA0001982144920000194
step ten, because the resource information of the temperature range resource includes "oic.r.pushproxy", the network device sends the temperature range resource to the service device according to the resource information, for example, the network device may send an update request to the service device through an "oic.if.a" interface, and the URI requesting to update the resource is maps:// [ fe80:: b1d 6:2222/temporal range, and the update request may include the following latest expression of the temperature range resource:
Figure BDA0001982144920000195
Figure BDA0001982144920000201
step eleven, the service equipment updates the resources at the locations of maps:// [ fe80:: b1d 6:: 2222/temporal range according to the update request so as to update the temperature range in the temperature range resources in the service equipment to [10,20 ].
Example 4: and adding a subscription type for the current temperature value resource in the network equipment.
Before adding the subscription type to the current temperature value resource in the service device, the initial resource information of the temperature range resource in the service device is as follows:
Figure BDA0001982144920000202
step one, when a subscription synchronization mode needs to be added for a current temperature value resource in network equipment (a current temperature value corresponding to shadow equipment in the network equipment), configuring service equipment through configuration equipment.
It should be noted that step one in example 4 may refer to step one in example 2, and is not described here again.
And step two, the service equipment sends a configuration success response to the configuration equipment.
And step three, the service equipment sends a shadow equipment generation request to the network equipment.
Optionally, the shadow device generation request may be as follows:
Figure BDA0001982144920000203
Figure BDA0001982144920000211
step five, the network device generates the shadow device according to the shadow device generation request, and generates the following resource information for the shadow device:
1: discovery resource/oic/res
2: platform resource/oic/p
3: replicated device resources/oic/d of service device
The/oic/d resource information is as follows:
Figure BDA0001982144920000212
4: device resource/oic/shadow/info of shadow device corresponding to service device
The/oic/shadow/info resource information is as follows:
Figure BDA0001982144920000213
5: resource information/temperature of copied current temperature value resource
The/temperature resource information is as follows:
Figure BDA0001982144920000214
step six, after the network device generates the shadow device, the network device sends a successful response of the shadow device generation to the service device, and the content of the response may be as follows:
Figure BDA0001982144920000215
and step seven, the configuration tool can configure the access authority of the shadow device.
When it needs to be described, the process of configuring the access right of the shadow device may refer to the prior art, and is not described herein again.
Step eight, the network equipment sends a subscription request to the service equipment.
Since the resource information of the current temperature value resource of the network device (the current temperature value resource corresponding to the shadow device in the network device) includes "oic.r.
For example, the network device may send a subscription request to the service device through an "oic.if.s" interface, the operation mode of the current temperature value resource corresponding to the shadow device that the network device requests to observe may be reading, the target resource of the reading request is a current temperature value resource copied on the service device, and the URI of the request is a URI of the current temperature value resource: maps:// [ fe80:: b1d6]: 2222/temperature.
Step nine, the service equipment receives the subscription request of the network equipment.
Optionally, the service device may send a first subscription response to the network device, where the first subscription response indicates that the service device accepts the subscription request of the network device.
Step ten, when the current temperature detected by the service equipment (temperature sensor) is 25 degrees, the service equipment updates the resource information of the current temperature value resource obtained in the step six as follows:
Figure BDA0001982144920000221
step eleven, the service equipment sends the current temperature value resource to the network equipment according to the resource information of the current temperature value resource.
Optionally, the service device may send a second subscription response to the network device, where the second subscription response includes the resource information of the updated current temperature value resource, and the resource information of the updated current temperature value resource is shown in the resource information in step ten.
Step twelve, the network device updates the resources at the locations of maps:// [ fe80:: b1d 6:: 2222/temperature according to the update request, so as to update the current temperature value in the current temperature value resource corresponding to the shadow device in the network device to 25 degrees.
Fig. 6 is a schematic structural diagram of a resource synchronization apparatus according to an embodiment of the present application. This resource synchronization device 10 can be applied to service equipment in the internet of things, the internet of things further includes network equipment, a shadow device corresponding to the service equipment is provided in the network equipment, the device includes a processing module 11, wherein, the processing module 11 is configured to:
acquiring the position information of the service resource in the network equipment, wherein the service resource corresponds to the shadow equipment;
and synchronizing the service resource with the network equipment according to the position information.
The resource synchronization apparatus 10 provided in the embodiment of the present application can execute the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In a possible implementation, the type of the service resource is a push type or a subscription type.
Fig. 7 is a schematic structural diagram of another resource synchronization apparatus according to an embodiment of the present application. Based on the embodiment shown in fig. 6, please refer to fig. 7, the resource synchronization apparatus 10 further includes a transceiver module 12, wherein the transceiver module 12 is configured to:
after the service resource in the service equipment is updated, the service resource in the service equipment is sent to the network equipment according to the type of the service resource and the position information, wherein the type of the service resource is a push type.
In a possible embodiment, the transceiver module 12 is further configured to:
sending a subscription request of the service resource to the network equipment according to the type of the service resource and the position information, wherein the type of the service resource is a subscription type;
and after the service resource in the network equipment is updated, receiving the service resource in the network equipment sent by the network equipment according to the subscription request.
In a possible implementation, the location information is a uniform resource identifier URI of the service resource in the network device.
In a possible implementation manner, the processing module 11 is specifically configured to obtain the location information from resource information of the service resource in the service device.
In a possible implementation manner, the transceiver module 12 is further configured to receive a configuration instruction sent by a configuration device before the processing module 11 obtains the location information in the resource information of the service resource in the service device, where the configuration instruction is used to indicate that a type of the service resource is added to the service resource;
the processing module 11 is further configured to add a push type or a subscription type in the resource information of the service resource in the service device according to the configuration instruction.
In a possible embodiment, the configuration instruction is further configured to instruct to add location information to the service resource; the processing module 11 is further configured to:
according to the configuration instruction, adding a position attribute in the resource information of the service resource in the service equipment;
setting the value of the location attribute as the location information of the service resource in the network device.
In a possible implementation, the configuration instruction is further configured to instruct to add a synchronization interface and a synchronization resource type to the service resource; the processing module 11 is further configured to:
according to the configuration instruction, adding a synchronous interface attribute and a synchronous resource type attribute in the resource information of the service resource in the service equipment;
setting the value of the synchronization interface attribute as a synchronization interface and the value of the synchronization resource type attribute as a synchronization resource type.
In a possible implementation manner, before the processing module 11 sets the value of the synchronization interface attribute as a synchronization interface and the value of the synchronization resource type attribute as a synchronization resource type, the transceiver module 12 is further configured to:
sending a shadow device generation request to the network device, wherein the shadow device generation request comprises resource information of the service resource in the service device and a resource synchronization mode of the service device, and the resource synchronization mode is a push synchronization mode or a subscription synchronization mode;
and receiving the position information of the service resource in the network equipment, the synchronous interface and the synchronous resource type sent by the network equipment.
In a possible embodiment, the configuration instruction includes at least one of an identification of the service resource, a synchronization interface, and a type of service resource.
In a possible implementation, the transceiver module 12 is specifically configured to:
and acquiring a synchronous interface, and sending the service resource to the network equipment through the synchronous interface according to the type of the service resource and the position information.
In a possible implementation, the transceiver module 12 is specifically configured to:
and acquiring a synchronous interface, and sending the subscription request to the network equipment through the synchronous interface according to the type of the service resource and the position information.
The resource synchronization apparatus 10 provided in the embodiment of the present application may execute the technical solutions shown in the foregoing method embodiments, and the implementation principle and the beneficial effects are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of another resource synchronization apparatus according to an embodiment of the present application. This resource synchronization device 20 can be applied to the network device in the internet of things, the internet of things further includes a service device, a shadow device corresponding to the service device is provided in the network device, the device includes a processing module 21, wherein the processing module 21 is configured to:
acquiring position information of service resources in the service equipment, wherein the service resources correspond to the shadow equipment;
and synchronizing the service resources with the service equipment according to the position information.
The resource synchronization apparatus 20 provided in the embodiment of the present application may execute the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In a possible embodiment, the type of the service resource is a push type or a subscription type.
Fig. 9 is a schematic structural diagram of another source synchronization apparatus according to an embodiment of the present application. Based on the embodiment shown in fig. 8, please refer to fig. 9, the resource synchronization apparatus 20 further includes a transceiver module 22, where the transceiver module 22 is configured to:
after the service resource in the network equipment is updated, the service resource in the service equipment is sent to the service equipment according to the type of the service resource and the position information, wherein the type of the service resource is a push type.
In a possible implementation, the transceiver module 22 is further configured to:
sending a subscription request of the service resources to the service equipment according to the types of the service resources and the position information, wherein the types of the service resources are subscription types;
and after the service resources in the service equipment are updated, receiving the service resources in the service equipment sent by the service equipment according to the subscription request.
In a possible implementation, the location information is a uniform resource identifier URI of the service resource in the network device.
In a possible implementation manner, the transceiver module 22 is further configured to receive a shadow device generation request sent by a service device before the processing module 21 acquires location information of a service resource in the service device, where the shadow device generation request includes resource information of the service resource in the service device and a resource synchronization manner of the service device, and the resource synchronization manner is a push synchronization manner or a subscription synchronization manner;
the processing module 21 is further configured to generate resource information of the shadow device and the service resource corresponding to the shadow device according to the shadow device generation request.
In a possible implementation manner, the type of the service resource in the resource information of the service resource corresponding to the shadow device includes a push type or a subscription type.
In a possible implementation manner, the resource information of the service resource corresponding to the shadow device includes a location attribute and a value of the location attribute, and the value of the location attribute is location information of the service resource in the service device.
In a possible implementation manner, the resource information of the service resource corresponding to the shadow device includes a synchronization interface attribute, a value of the synchronization interface attribute, the synchronization resource type attribute, and a value of the synchronization resource type attribute, where the value of the synchronization interface attribute is a synchronization interface, and the value of the synchronization type attribute is a synchronization resource type.
In a possible implementation manner, the transceiver module 22 is specifically configured to acquire a synchronization interface, and send the service resource to the service device through the synchronization interface according to the type of the service resource and the location information.
In a possible implementation manner, the transceiver module 22 is specifically configured to acquire a synchronous interface, and send the subscription request to the service device through the synchronous interface according to the type of the service resource and the location information.
The resource synchronization apparatus 20 provided in the embodiment of the present application may execute the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
Fig. 10 is a schematic structural diagram of a service device according to an embodiment of the present application. As shown in fig. 10, the service apparatus 30 may include: a transceiver 31, a memory 32, a processor 33. The transceiver 31 may include: a transmitter and a receiver. The transmitter may also be referred to as a sender, a transmitter, a sending port or a sending interface, and the like, and the receiver may also be referred to as a receiver, a receiving port or a receiving interface, and the like. Illustratively, the transceiver 31, the memory 32, and the processor 33 are connected to each other by a bus 34.
Memory 32 is used to store program instructions;
the processor 33 is configured to execute the program instructions stored in the memory to cause the service device 30 to perform any of the resource synchronization methods described above.
The transmitter in the transceiver 31 may be configured to perform the sending function of the serving device in the resource synchronization method.
The receiver of the transceiver 31 may be configured to perform the receiving function of the serving device in the resource synchronization method.
Embodiments of the present application may also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the resource synchronization method performed by any one of the service devices shown above.
Embodiments of the present application may also provide a computer program product, which may be executed by a process, for example, by the processor 33 of the service device 30, and when the computer program product is executed, the resource synchronization method executed by any of the service devices shown above may be implemented.
The service device, the computer-readable storage medium, and the computer program product according to the embodiments of the present application may execute the resource synchronization method executed by any one of the service devices described above, and specific implementation processes and beneficial effects thereof are described above and are not described herein again.
Fig. 11 is a schematic structural diagram of a network device according to an embodiment of the present application. As shown in fig. 11, the network device 40 may include: a transceiver 41, a memory 42, and a processor 43. The transceiver 41 may include: a transmitter and a receiver. The transmitter may also be referred to as a sender, a transmitter, a sending port, a sending interface, and the like, and the receiver may also be referred to as a receiver, a receiving port, a receiving interface, and the like. Illustratively, the transceiver 41, the memory 42, and the processor 43 are connected to each other by a bus 44.
The memory 42 is used to store program instructions;
the processor 43 is configured to execute the program instructions stored in the memory to perform the resource synchronization method performed by any of the network devices shown above.
The transmitter in the transceiver 41 may be configured to perform the transmitting function of the network device in the resource synchronization method.
The receiver in the transceiver 41 may be configured to perform a receiving function of the network device in the resource synchronization method.
Embodiments of the present application may also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the resource synchronization method performed by any of the network devices shown above.
Embodiments of the present application may also provide a computer program product, which may be executed by a process, for example, by the processor 43 of the network device 40, and when the computer program product is executed, the resource synchronization method executed by any of the network devices shown above may be implemented.
The network device, the computer-readable storage medium, and the computer program product according to the embodiments of the present application may execute the resource synchronization method executed by the network device, and specific implementation processes and beneficial effects thereof are described above and will not be described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The computer program may be stored in a computer readable storage medium. The computer program, when executed by a processor, performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (37)

1. A resource synchronization method is applied to the Internet of things, the Internet of things comprises service equipment and network equipment, shadow equipment corresponding to the service equipment is arranged in the network equipment, the shadow equipment is virtual equipment, and the method comprises the following steps:
the service equipment acquires the type of service resources and the position information of the service resources in the network equipment, wherein the service resources correspond to the shadow equipment, and the position information is the position information of the service resources in the shadow equipment;
the service equipment synchronizes the service resource with the network equipment according to the type of the service resource and the position information;
the service equipment acquires the position information of the service resource in the network equipment, and the method comprises the following steps:
the service equipment acquires the position information from the resource information of the service resources in the service equipment;
the service equipment synchronizes the service resource with the network equipment according to the type of the service resource and the position information, and the method comprises the following steps:
determining a process mode for synchronizing the service resources according to the types of the service resources, wherein the types of the service resources are push types or subscription types;
and based on the determined process mode, synchronizing the service resource with the network equipment according to the position information.
2. The method of claim 1, wherein the type of the service resource is a push type;
correspondingly, the synchronizing, by the service device, the service resource with the network device according to the location information includes:
after the service resource in the service equipment is updated, the service equipment sends the service resource in the service equipment to the network equipment according to the type of the service resource and the position information.
3. The method of claim 1, wherein the type of the service resource is a subscription type;
correspondingly, the synchronizing, by the service device, the service resource with the network device according to the location information includes:
the service equipment sends a subscription request of the service resource to the network equipment according to the type of the service resource and the position information;
after the service resource in the network device is updated, the service device receives the service resource in the network device sent by the network device according to the subscription request.
4. A method according to any of claims 1-3, characterized in that said location information is a uniform resource identifier, URI, of said service resource in said network device.
5. The method according to claim 4, wherein before the serving device obtains the location information from the resource information of the serving resource in the serving device, the method further comprises:
the service equipment receives a configuration instruction sent by configuration equipment, wherein the configuration instruction is used for indicating the type of service resources added to the service resources;
and the service equipment adds a push type or a subscription type in the resource information of the service resources in the service equipment according to the configuration instruction.
6. The method of claim 5, wherein the configuration instruction is further used to instruct adding location information to the service resource; the method further comprises the following steps:
the service equipment adds a position attribute in the resource information of the service resource in the service equipment according to the configuration instruction;
and the service equipment sets the value of the position attribute as the position information of the service resource in the network equipment.
7. The method of claim 6, wherein the configuration instruction is further used to instruct to add a synchronization interface and a synchronization resource type to the service resource; the method further comprises the following steps:
the service equipment adds a synchronous interface attribute and a synchronous resource type attribute in the resource information of the service resources in the service equipment according to the configuration instruction;
the service equipment sets the value of the synchronous interface attribute as a synchronous interface and sets the value of the synchronous resource type attribute as a synchronous resource type.
8. The method as claimed in claim 7, wherein before the service device sets the value of the synchronization interface attribute as a synchronization interface and the value of the synchronization resource type attribute as a synchronization resource type, the method further comprises:
the service equipment sends a shadow equipment generation request to the network equipment, wherein the shadow equipment generation request comprises resource information of the service resources in the service equipment and a resource synchronization mode of the service equipment, and the resource synchronization mode is a push synchronization mode or a subscription synchronization mode;
and the service equipment receives the position information of the service resource in the network equipment, the synchronous interface and the synchronous resource type which are sent by the network equipment.
9. The method according to any of claims 5-8, wherein the configuration instruction comprises at least one of an identification of the service resource, a synchronization interface, a type of service resource.
10. The method of claim 2, wherein the sending, by the serving device to the network device, the service resource in the serving device according to the type of the service resource and the location information comprises:
the service equipment acquires a synchronous interface;
and the service equipment sends the service resources to the network equipment through the synchronous interface according to the type of the service resources and the position information.
11. The method of claim 3, wherein the sending, by the serving device, the subscription request for the service resource to the network device according to the type of the service resource and the location information comprises:
the service equipment acquires a synchronous interface;
and the service equipment sends the subscription request to the network equipment through the synchronous interface according to the type of the service resource and the position information.
12. A resource synchronization method is applied to the Internet of things, the Internet of things comprises service equipment and network equipment, shadow equipment corresponding to the service equipment is arranged in the network equipment, the shadow equipment is virtual equipment, and the method comprises the following steps:
the network equipment acquires the type of the service resource and the position information of the service resource in the service equipment, wherein the service resource corresponds to the shadow equipment;
the network equipment synchronizes the service resources with the service equipment according to the types of the service resources and the position information;
the network device obtaining the location information of the service resource in the service device includes:
the network equipment acquires the position information from the resource information of the service resources in the network equipment;
the network device synchronizes the service resource with the service device according to the type of the service resource and the location information, including:
determining a process mode for synchronizing the service resources according to the types of the service resources, wherein the types of the service resources are push types or subscription types;
and synchronizing the service resources with the service equipment according to the position information based on the determined process mode.
13. The method of claim 12, wherein the type of the service resource is a push type;
correspondingly, the synchronizing, by the network device, the service resource with the service device according to the location information includes:
after the service resource in the network equipment is updated, the network equipment sends the service resource in the service equipment to the service equipment according to the type of the service resource and the position information.
14. The method of claim 12, wherein the type of service resource is a subscription type;
correspondingly, the synchronizing, by the network device, the service resource with the service device according to the location information includes:
the network equipment sends a subscription request of the service resource to the service equipment according to the type of the service resource and the position information;
after the service resource in the service device is updated, the network device receives the service resource in the service device sent by the service device according to the subscription request.
15. The method according to any of claims 12-14, wherein the location information is a uniform resource identifier, URI, of the service resource in the network device.
16. The method according to any one of claims 12-14, wherein the network device obtains the location information of the service resource in the service device, and further comprising:
the network equipment receives a shadow equipment generation request sent by service equipment, wherein the shadow equipment generation request comprises resource information of the service resource in the service equipment and a resource synchronization mode of the service equipment, and the resource synchronization mode is a push synchronization mode or a subscription synchronization mode;
and the network equipment generates the shadow equipment and resource information of the service resources corresponding to the shadow equipment according to the shadow equipment generation request.
17. The method of claim 16, wherein the type of the service resource in the resource information of the service resource corresponding to the shadow device comprises a push type or a subscription type.
18. The method of claim 16, wherein the resource information of the service resource corresponding to the shadow device includes a location attribute and a value of the location attribute, and the value of the location attribute is location information of the service resource in the service device.
19. The method according to claim 17, wherein the resource information of the service resource corresponding to the shadow device includes a synchronization interface attribute, a value of the resource synchronization mode attribute, and a value of the resource synchronization mode attribute, the value of the synchronization interface attribute is a synchronization interface, and the value of the resource synchronization mode attribute is a resource synchronization mode.
20. The method of claim 13, wherein the network device sends the service resource in the service device to the service device according to the type of the service resource and the location information, and wherein the sending comprises:
the network equipment acquires a synchronous interface;
and the network equipment sends the service resources to the service equipment through the synchronous interface according to the type of the service resources and the position information.
21. The method of claim 14, wherein the network device sends a subscription request for the service resource to the service device according to the type of the service resource and the location information, and wherein the sending comprises:
the network equipment acquires a synchronous interface;
and the network equipment sends the subscription request to the service equipment through the synchronous interface according to the type of the service resource and the position information.
22. The utility model provides a resource synchronization device, its characterized in that is applied to the service equipment in the thing networking, the thing networking still includes network equipment, be provided with in the network equipment the shadow equipment that service equipment corresponds, shadow equipment is virtual device, the device includes processing module, wherein, processing module is used for:
acquiring the type of the service resource and the position information of the service resource in the network equipment, wherein the service resource corresponds to the shadow equipment, and the position information is the position information of the service resource in the shadow equipment;
synchronizing the service resource with the network device according to the type of the service resource and the location information;
the processing module is specifically configured to obtain the location information from the resource information of the service resource in the service device;
the processing module is specifically configured to:
determining a process mode for synchronizing the service resources according to the types of the service resources, wherein the types of the service resources are push types or subscription types;
and synchronizing the service resources with the network equipment according to the position information based on the determined process mode.
23. The apparatus of claim 22, further comprising a transceiver module, wherein the transceiver module is configured to:
after the service resource in the service equipment is updated, the service resource in the service equipment is sent to the network equipment according to the type of the service resource and the position information, wherein the type of the service resource is a push type.
24. The apparatus of claim 22, further comprising a transceiver module, wherein the transceiver module is configured to:
sending a subscription request of the service resource to the network equipment according to the type of the service resource and the position information, wherein the type of the service resource is a subscription type;
and after the service resources in the network equipment are updated, receiving the service resources in the network equipment sent by the network equipment according to the subscription request.
25. The apparatus of claim 24,
the transceiver module is further configured to receive a configuration instruction sent by a configuration device before the processing module obtains the location information from the resource information of the service resource in the service device, where the configuration instruction is used to indicate that a type of the service resource is added to the service resource;
the processing module is further configured to add a push type or a subscription type to the resource information of the service resource in the service device according to the configuration instruction.
26. The apparatus of claim 25, wherein the configuration instructions are further configured to instruct adding location information for the service resource; the processing module is further configured to:
according to the configuration instruction, adding a position attribute in the resource information of the service resource in the service equipment;
setting the value of the location attribute as location information of the service resource in the network device.
27. The apparatus of claim 26, wherein the configuration instruction comprises at least one of an identification of the service resource, a synchronization interface, and a type of service resource.
28. The utility model provides a resource synchronization device, its characterized in that is applied to the network equipment in the thing networking, still include service equipment in the thing networking, be provided with in the network equipment the shadow equipment that service equipment corresponds, shadow equipment is virtual device, the device includes processing module, wherein, processing module is used for:
acquiring the type of the service resource and the position information of the service resource in the service equipment, wherein the service resource corresponds to the shadow equipment;
synchronizing the service resource with the service equipment according to the position information;
the processing module is specifically configured to: acquiring the position information from the resource information of the service resource in the network equipment;
the processing module is specifically configured to:
determining a process mode for synchronizing the service resources according to the types of the service resources, wherein the types of the service resources are push types or subscription types;
and based on the determined process mode, synchronizing the service resources with the service equipment according to the position information.
29. The apparatus of claim 28, further comprising a transceiver module, wherein the transceiver module is configured to:
after the service resource in the network equipment is updated, the service resource in the service equipment is sent to the service equipment according to the type of the service resource and the position information, wherein the type of the service resource is a push type.
30. The apparatus of claim 28, wherein; the apparatus further comprises a transceiver module, wherein the transceiver module is configured to:
sending a subscription request of the service resources to the service equipment according to the types of the service resources and the position information, wherein the types of the service resources are subscription types;
and after the service resources in the service equipment are updated, receiving the service resources in the service equipment sent by the service equipment according to the subscription request.
31. The apparatus of claim 29 or 30,
the transceiver module is further configured to receive a shadow device generation request sent by a service device before the processing module obtains location information of a service resource in the service device, where the shadow device generation request includes resource information of the service resource in the service device and a resource synchronization mode of the service device, and the resource synchronization mode is a push synchronization mode or a subscription synchronization mode;
the processing module is further configured to generate resource information of the shadow device and the service resource corresponding to the shadow device according to the shadow device generation request.
32. The apparatus of claim 31, wherein the type of the service resource in the resource information of the service resource corresponding to the shadow device comprises a push type or a subscription type.
33. The apparatus of claim 31, wherein the resource information of the service resource corresponding to the shadow device includes a location attribute and a value of the location attribute, and wherein the value of the location attribute is location information of the service resource in the service device.
34. A service device, comprising: a transceiver, a processor, a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to cause the service device to perform the resource synchronization method of any of claims 1 to 11.
35. A network device, comprising: a transceiver, a processor, a memory;
the memory stores computer-executable instructions;
the processor executing the computer-executable instructions stored by the memory causes the processor to perform the resource synchronization method of any of claims 12 to 21.
36. A computer-readable storage medium having stored thereon computer-executable instructions for implementing the resource synchronization method of any one of claims 1 to 11 when executed by a processor.
37. A computer-readable storage medium having stored thereon computer-executable instructions for implementing the resource synchronization method of any one of claims 12 to 21 when executed by a processor.
CN201910153428.2A 2019-02-28 2019-02-28 Resource synchronization method, device, equipment and storage medium Active CN111629018B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910153428.2A CN111629018B (en) 2019-02-28 2019-02-28 Resource synchronization method, device, equipment and storage medium
PCT/CN2020/070927 WO2020173232A1 (en) 2019-02-28 2020-01-08 Resource synchronization method, apparatus, and device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910153428.2A CN111629018B (en) 2019-02-28 2019-02-28 Resource synchronization method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111629018A CN111629018A (en) 2020-09-04
CN111629018B true CN111629018B (en) 2022-07-08

Family

ID=72239127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910153428.2A Active CN111629018B (en) 2019-02-28 2019-02-28 Resource synchronization method, device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN111629018B (en)
WO (1) WO2020173232A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022087796A1 (en) * 2020-10-26 2022-05-05 Oppo广东移动通信有限公司 Zigbee device attribute subscription method and apparatus, and device
CN113010789A (en) * 2021-03-24 2021-06-22 珠海格力电器股份有限公司 Air conditioning unit data pushing method and device, computer equipment and storage medium
CN113037771B (en) * 2021-03-29 2022-11-08 北京金山云网络技术有限公司 Method and device for controlling device shadow, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447582A (en) * 2011-12-31 2012-05-09 中兴通讯股份有限公司 Resource synchronization method and device
CN107911492A (en) * 2017-12-27 2018-04-13 浙江力石科技股份有限公司 The method and device that equipment accesses in platform of internet of things
CN108111617A (en) * 2017-12-27 2018-06-01 浙江力石科技股份有限公司 The implementation method and device of rule control in platform of internet of things
CN109154802A (en) * 2016-03-31 2019-01-04 江森自控科技公司 HVAC device registration in distributed building management system
CN109344004A (en) * 2018-09-03 2019-02-15 郑州云海信息技术有限公司 A kind of memory database backup management method, device, terminal and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100188412A1 (en) * 2009-01-28 2010-07-29 Microsoft Corporation Content based cache for graphics resource management
CN102186164B (en) * 2011-02-18 2014-04-02 华为技术有限公司 Method and management device for operating device resource
CN103227803A (en) * 2012-01-30 2013-07-31 华为技术有限公司 Internet of thing resource obtaining method, client and internet of thing resource devices
WO2014185754A1 (en) * 2013-05-16 2014-11-20 엘지전자 주식회사 Method for subscription and notification in m2m communication system and apparatus for same
CN107968805B (en) * 2016-10-20 2020-10-27 华为技术有限公司 Event notification method and server
CN107800597B (en) * 2017-09-30 2021-08-13 广东美的制冷设备有限公司 Data transmission method and device for household appliance and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447582A (en) * 2011-12-31 2012-05-09 中兴通讯股份有限公司 Resource synchronization method and device
CN109154802A (en) * 2016-03-31 2019-01-04 江森自控科技公司 HVAC device registration in distributed building management system
CN107911492A (en) * 2017-12-27 2018-04-13 浙江力石科技股份有限公司 The method and device that equipment accesses in platform of internet of things
CN108111617A (en) * 2017-12-27 2018-06-01 浙江力石科技股份有限公司 The implementation method and device of rule control in platform of internet of things
CN109344004A (en) * 2018-09-03 2019-02-15 郑州云海信息技术有限公司 A kind of memory database backup management method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN111629018A (en) 2020-09-04
WO2020173232A1 (en) 2020-09-03

Similar Documents

Publication Publication Date Title
CN111629018B (en) Resource synchronization method, device, equipment and storage medium
KR100750142B1 (en) Method and Apparatus for Synchronizing Content with a Collection of Home Devices
CN109542865A (en) Distributed cluster system configuration file synchronous method, device, system and medium
CN108833979B (en) Pre-configuration file importing method of dual-system convergence terminal and dual-system convergence terminal
CN108173691B (en) Cross-device aggregation method and device
CN102752294B (en) Method and system for synchronizing data of multiple terminals on basis of equipment capacity
CN111404628B (en) Time synchronization method and device
CN103812900A (en) Data synchronization method, device and system
CN108495157A (en) A kind of synchronizing information acquisition methods of smart television
US20120079053A1 (en) Information Synchronization Method, Apparatus and System
CN113099440A (en) Network configuration method, device, equipment and system
CN102457553A (en) Off-line SaaS (software as a service) application software realization method based on B/S (browser/server) mode
CN109150844B (en) Method, device and system for determining digital certificate
CN111314394A (en) Resource publishing method, device, equipment and storage medium of Internet of things
CN109981694B (en) Synchronization method, server and terminal
CN103236894B (en) Clock synchronizing method and device in a kind of seamless redundant network
CN110166823A (en) Throw screen method and relevant apparatus
WO2018210081A1 (en) Method and apparatus for updating augmented reality software, and terminal and storage medium
CN113242313B (en) Data synchronization method, system, device, server and storage medium
CN109413118A (en) A kind of method, apparatus that realizing session synchronization and storage medium, program product
CN105426732A (en) Network based USBKey multiplexing method and network remote end
CN103997508A (en) Method and apparatus for concentrated fixture storage
JP7463458B2 (en) Setting information providing device, setting information providing method, and program
CN114884852B (en) Node interaction and protocol identification method, device, equipment and computer medium
CN117478449B (en) Control method and device of third party equipment, electronic equipment and medium

Legal Events

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