WO2021102643A1 - Method and apparatus for notification of member update in collection resource - Google Patents

Method and apparatus for notification of member update in collection resource Download PDF

Info

Publication number
WO2021102643A1
WO2021102643A1 PCT/CN2019/120680 CN2019120680W WO2021102643A1 WO 2021102643 A1 WO2021102643 A1 WO 2021102643A1 CN 2019120680 W CN2019120680 W CN 2019120680W WO 2021102643 A1 WO2021102643 A1 WO 2021102643A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
subscription
field
collective
update
Prior art date
Application number
PCT/CN2019/120680
Other languages
French (fr)
Chinese (zh)
Inventor
吕小强
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2019/120680 priority Critical patent/WO2021102643A1/en
Priority to CN201980097386.3A priority patent/CN113994643B/en
Publication of WO2021102643A1 publication Critical patent/WO2021102643A1/en

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

Definitions

  • This application relates to the technical field of the Internet of Things, and in particular to a notification technology for member updates of collective resources.
  • the subscription device can subscribe to a specific resource or function of the target device, and the above resources can be called target resources.
  • the target resource changes, it will actively notify the subscribing device.
  • the mobile phone subscribes to the onoff state of the smart door at home.
  • the subscription technology can also be used to detect changes in specific resource members.
  • the members included in the target resource change, it will also actively notify the subscribing device.
  • there is also a kind of resource which can be called a collective resource.
  • a collective resource can contain multiple resources, and the contained resource is called a member of the collective resource.
  • a collective resource can be generated, and smart devices such as smart doors, refrigerators, air conditioners, and lights in the home can be used as members of the collective resource.
  • the subscription target device receives the subscription device’s collection resource member update After the subscription request is made, if a change in the collection resource is detected, a notification message is sent to the subscription device, and the notification message carries the changed collection resource.
  • the related technology has at least the following problems: Because the notification message for the member update of the collective resource includes the current member of the collective resource, that is, the member after the change. Therefore, the subscribing device needs to subscribe to multiple information at the same time, such as subscribing to the notification of adding members, subscribing to the notification of deleting members, etc., resulting in the need to receive two notification messages when the members change, such as the notification message of member update subscription and the increase The notification message of the member can determine the changed content and the changed content of the collection resource.
  • a technical problem to be solved by some embodiments of this application is that the subscription device can determine the changed content and the changed content of the collection resource through a notification message updated by a member, saving system resources, and subscribing to the target device can also be There is no need to maintain more subscription relationships, which simplifies the processing flow.
  • An embodiment of the present application provides a method for notifying member updates of a collective resource.
  • the method includes: if a member update is detected in the collective resource, recording the updated member of the collective resource in a first resource in the collective resource; Send a member update notification message to the subscribing device subscribed to the member update notification, where the notification message includes the first resource.
  • An embodiment of the present application also provides a device for notifying member updates of collective resources.
  • the device includes: a recording module configured to record the updated information in the first resource in the collective resource after the member update is detected in the collective resource.
  • a member in a collective resource a sending module, used to send a member update notification message to a subscription device subscribed to a member update notification, the notification message including the first resource.
  • An embodiment of the present application further provides an electronic device, including: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores one or more programs that can be executed by the at least one processor ; One or more programs contain instructions that, when executed by at least one processor, cause at least one processor to execute the aforementioned method for notifying member updates of collective resources.
  • An embodiment of the present application also provides a non-volatile computer storage medium that stores a program that can be executed by a processor.
  • the program is executed by the processor, the aforementioned method for notifying the update of collective resource members is implemented.
  • the embodiment of this application now creates a resource dedicated to recording member changes for the collection resource in advance, that is, the first resource. Therefore, as long as the subscription device completes the subscription for member update, it will subscribe after the member update occurs.
  • the target device will send a notification message of the updated collection resource to the subscribing device, and the first resource, as one of the members of the collection resource, will be carried in the notification message of the member update subscription, so that the subscribing device can only send a subscription request message You can get all the information in the notification message, such as the updated collection resource and the changes in the collection resource.
  • the subscription target device does not need to maintain more subscription relationships, which simplifies the processing flow.
  • the structure of the first resource includes: a first field for recording the modification mode, and a second field for recording the modified member; the updated member is recorded in the first resource in the collection resource, including: In one field, the modification mode of the modified member in the collective resource is recorded; in the second field, the identifier of the modified member in the collective resource is recorded.
  • the second field records the identifier of the modified member, so that the first resource can accurately and effectively record the changes in the collection resource.
  • recording the modification method of the modified member in the collection resource in the first field includes: recording the creation interface in the first field, which is used to indicate that the modification method of the modified member is member addition; or, in the first field In the record delete interface, it is used to indicate that the modification method of the modified member is member deletion; or, the record link addition interface in the first field is used to indicate that the modification method of the modified member is member link addition; or, in The link deletion interface is recorded in the first field, which is used to indicate that the modification method of the modified member is member link deletion.
  • the second field is an array, and the identifier of the modified member is recorded through an array, so that a notification message can carry multiple modified member information.
  • the creation of the first resource is triggered after receiving the subscription request of the subscription device.
  • the creation of the first resource is triggered after the collective resource is generated and it is determined that the collective resource is a collective resource that allows subscription.
  • the following methods are used to detect whether the collective resource has a member update: if it is detected that the collective resource is modified by any of the following interfaces, it is determined that the collective resource has a member update: the creation interface for creating new members, The delete interface for deleting members, the link addition interface for adding member links, and the link deletion interface for deleting member links. Since the members of the collection resource can be modified by creating an interface, deleting an interface, linking a new interface, and linking a delete interface, when it is detected that the collection resource is modified by any one of the interfaces, it is determined that there is a member update for the collection resource. In order to ensure that the first resource resource can record the changes of the collective resource in a timely and accurate manner.
  • Figure 1 is an interactive flow chart of a message subscription/notification cycle in related technologies
  • Figure 2 is an interactive flowchart of subscription devices initiating various types of subscriptions in related technologies
  • Fig. 3 is a flowchart of a method for notifying update of collective resource members according to the first embodiment of the present application
  • FIG. 4 is an interactive flowchart of the method for notifying the update of collective resource members according to the first embodiment of the present application
  • FIG. 5 is an interactive flowchart of the method for notifying update of collective resource members according to the second embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of a notification device for updating members of a collective resource according to a third embodiment of the present application.
  • Fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
  • the first embodiment of the present application relates to a method for notifying updates of collective resource members.
  • This embodiment is applied to a subscription target device, and a subscription process between the subscription target device and the subscription device is shown in FIG. 1.
  • the subscribing device initiates a subscription request message to the subscribing target device.
  • the request message carries the identity of the subscribing device Fr, the subscribed resource identity To, the message request identity Ri used to complete the request and response binding, and the operation type Op (such as Delete operation, add operation, etc.) and the subscription identifier Obs used to indicate that the request message is a subscription message.
  • the subscription target device After receiving the subscription request message, the subscription target device authenticates the request, establishes a monitoring mechanism, and replies a response message to the subscription device.
  • This message is to answer the subscription request message of the subscribing device: the subscription message has been received and monitoring is started.
  • the subscription target device detects that the message requested by the subscription device has changed, it will send a notification message to notify the subscription device of the changed content.
  • the message request identifier (Ri) of the above subscription request message, response message, and notification message are the same. So far, a message subscription/notification cycle is completed. If the subscription content needs to be canceled, a request message is sent again, and the subscription identifier Obs parameter is set to cancel the subscription.
  • Figure 1 shows the subscription process of a subscription type for a certain resource (the resource can be a collection resource) on the subscription target device.
  • the interface that can complete the change of the subscription collection resource member includes: member update interface (oic.if .ll), create interface (oic.if.create), delete interface (oic.if.delete), link add interface (oic.if.linkadd), and link delete interface (oic.if.linkremove). Therefore, in the current related technology, it is necessary to initiate various types of subscription processes for the same collective resource through various types of interfaces. As shown in Figure 2, steps 10 and 11 are completed through the member update interface (oic.if.ll). The membership of the collection resource updates the subscription for changes.
  • the subscription device can only obtain the member information after the collection resource has changed. It needs to compare with the member information of the previous version to know the changed member; steps 20 and 21, through the creation interface (oic.if.create) to complete the creation of a new member's subscription to the collection resource. After completing this type of subscription, the subscription device will only receive a new member in the collection resource.
  • the notification message is the information of the newly created member; in steps 30 and 31, the subscription of the deleted member of the collection resource is completed through the delete interface (oic.if.delete).
  • the subscribed device is in the Only when the member is deleted from the collection resource, the notification message will be received, and the notification message is the information of the deleted member; Steps 40 and 41, complete the addition of the collection resource through the link addition interface (oic.if.linkadd) New member link subscription.
  • the subscribing device will only receive a notification message when a new member link is added to the collection resource.
  • the notification message is the information of the newly added new member link; step 50 And 51.
  • the subscription of the delete member link of the collection resource is completed through the link delete interface (oic.if.linkremove).
  • the subscription device will only receive the member link when the member link is deleted from the collection resource.
  • the notification message is the information of the deleted member link. It can be seen that the subscription device needs to initiate various types of subscriptions through multiple interfaces in order to determine the changed content and the changed content of the collection resource.
  • This embodiment aims to solve how to make the subscribing device initiate a type of subscription to the target collection resource through only one interface, so that the changed content and the changed content of the collection resource can be determined, so as to save system resources and subscribe to the target device at the same time. It is also unnecessary to maintain more subscription relationships, which simplifies the processing flow.
  • the first resource is created for the collective resource subscribed by the subscribing device in advance, and the created first resource is used as one of the members in the collective resource.
  • the updated member is recorded in the first resource, such as adding a new member to the collection resource, or deleting a member from the collection resource, etc.; to subscribe to a member update notification
  • the member update notification message sent by the subscribing device includes the first resource. Since the first resource is one of the members of the collective resource, the notification message for member update will carry the first resource with the updated member information, so that the subscribing device can determine the changed content of the collective resource through a notification message And the changed content.
  • the subscription target device detects whether there is a member update in the collective resource. If there is a member update, it proceeds to step 302; otherwise, it returns to step 301 to continue to detect whether there is a member update in the collective resource.
  • the collective resource is the collective resource subscribed by the subscribed device.
  • the collection resource when the collection resource is modified by the oic.if.create interface, it means to create a new resource, and by adding a link to the newly created resource in the collection resource, the new resource is regarded as one of the collection resources New member; when the collection resource is modified by the oic.if.delete interface, it means to delete a specified resource and delete the resource from the member list of the collection resource; when the collection resource is oic.if.linkadd When the interface is modified, it means that a new specified resource is added as a member to the collection resource.
  • the specified resource has already been established, and the specified resource is added to the collection resource as a new member by adding a link;
  • the collection resource is modified by the oic.if.linkremove interface, it means that in the collection resource, a specified member is deleted by deleting the member link, and the resource corresponding to the deleted member remains unchanged.
  • the subscription target device needs to monitor in real time whether the collection resource subscribed by the subscribed device is any one of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove
  • the interface is modified. If it is detected that the collective resource has been modified by any one of the interfaces, it is determined that there is a member update for the collective resource, and step 302 is entered.
  • Step 302 Record the updated member in the member update resource.
  • a new first resource is created for the collection resource in advance: member update resource.
  • the creation of the member update resource is triggered.
  • the member update resource is dedicated to recording member changes in the collection resource, and the member update resource is prohibited from being deleted, and is always a member of the collection resource.
  • the member update resource can be created directly in the collection resource or outside the collection resource. By adding the link to the member update resource in the collection resource, the newly created member update resource is regarded as a member of the collection resource. .
  • the embodiment of this application does not limit the creation location of the member update resource. Since the member update resource is created for the collection resource, in specific implementation, priority can be given to directly creating the member update resource in the collection resource.
  • the structure of the first resource that is, the member update resource includes at least: a first field for recording the modification mode, and a second field for recording the modified member.
  • the member update resource can be set to the following structure:
  • rt represents the resource type
  • oic.r.updateinfo is the type used to indicate the member update resource
  • oic.if.r represents the read-only interface, that is, the member update resource is only allowed to be read and cannot be modified
  • update_method is used to record the modification method of the updated member, that is, the first field mentioned above.
  • the modification method includes any one of member addition, member deletion, member link addition, and member link deletion, that is, it can be in the first field Record any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove to indicate the modification method of the updated member; update_target is used to record the identification of the modified member, That is, the second field mentioned above.
  • update_target can be in the form of an array, such as [A; B; C; D...], where A, B, C, and D all represent the members to be modified. Because when the collection resource is modified through any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove, the modified member may be greater than one. Therefore, pass The update_target is designed as an array form, which can carry multiple modified member information in one notification message.
  • the update method can be recorded by the update_method in the member update resource, and the updated member can be recorded by the update_targe in the member update resource.
  • Step 303 Send a member update notification message to the subscribing device subscribed to the member update notification.
  • the subscribing device in this embodiment initiates a subscription request to the subscribing target device through the member update interface (oic.if.ll), and once the subscribing target device detects that the collection resource has been updated, it sends a notification to the subscribing device
  • the notification message includes all members of the updated collection resource, that is, the member update resource that records the content of the member change will also be one of the members of the collection resource.
  • the notification message is carried in the notification message and sent to the subscribing device, so that the subscribing device The changed collection resource and the changes in the collection resource can be obtained directly through the notification message.
  • step 303 After step 303, return to step 301 to continue to detect whether there is a member update in the collective resource.
  • the collection resource has been modified by any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd and oic.if.linkremove, it is necessary to enter steps 302 and 303 to Ensure that the subscription device can obtain the changes in the collection resources and the changed content in a timely manner.
  • the subscription device sends a subscription request for a collection of resources to the subscription target device.
  • the subscribing device only needs to send a subscription request to the subscribing target device through the oic.if.ll interface to subscribe to the member update notification of a certain collection resource, instead of using oic.if.create, oic.if.delete , Oic.if.linkadd, and oic.if.linkremove interfaces send subscription requests to the subscription target device.
  • the subscription target device receives a subscription request initiated by the subscription device through any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove, the subscription target device An error response can be directly fed back to the subscribing device to indicate that the subscribing device only needs to initiate a subscription through the oic.if.ll interface.
  • step 402 after the subscription target device receives the subscription request sent through the oic.if.ll interface, it creates a first resource for the subscribed collection resource, that is, creates a member update resource for the collection resource, which is used to record the collection resource.
  • step 403 after the subscription target device confirms that it can complete the subscription of the collection resource, it starts to monitor the target resource, and returns to the subscribing device a response message of successful subscription.
  • step 404 when the membership of the subscribed collection resource changes, such as when the collection resource is modified by the oic.if.create, oic.if.delete, oic.if.linkadd or oic.if.linkremove interface,
  • the subscription target device will complete the modification of the member update resource according to the way the collection resource is modified and the modified member.
  • the collection resource originally contained 3 members: smart switch 1, smart TV, and member update resources.
  • the collection resource is modified through the oic.if.create interface (for example, smart switch 2 is also added to the collection resource), Modify the member update resource, record the modification mode as member addition in the update_method of the member update resource, and record the identification of the smart switch 2 in the update_target of the member update resource.
  • the revised collection resource contains 4 members: smart switch 1, smart switch 2, smart TV, and member update resources.
  • step 405 the subscription target device generates a notification message, and the notification message includes all members of the modified collection resource.
  • the revised member update resources are as follows:
  • the modified collection resources are as follows:
  • the subscription target device sends the generated notification message to the subscription device.
  • the subscribing device can obtain the current status of the members of the subscribed collection resource and the current updated members in one notification message.
  • the subscription is initiated through the collection of resources through interfaces such as oic.if.ll, oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove.
  • the subscription device of this embodiment only needs to initiate a subscription request through oic.if.ll, which simplifies the process of subscribing to collection resource member changes, and the subscription target device does not need to maintain more subscription relationships, which reduces the subscription target device. Burden.
  • the notification message for the respective interface will be triggered, and the subscription message of oic.if.ll will also be triggered.
  • the subscription device needs to be combined Only these two notification messages can determine the change of the collective resource.
  • the subscribing device can obtain all the information in the notification message only by sending a subscription message through the oic.if.ll interface, which simplifies the information interaction between the subscribing device and the subscription target device.
  • the second embodiment of the present application relates to a method for notifying updates of collective resource members.
  • This embodiment is roughly the same as the first embodiment. The difference is that in the first embodiment, the creation of the first resource is triggered after the subscription request of the subscribing device is received. However, in this embodiment, the creation of the first resource is triggered after the collection resource is generated and it is determined that the collection resource is a collection resource allowed to be subscribed.
  • step 501 when the subscription target device generates a collection resource that is allowed to be subscribed, it triggers the creation of the first resource for the collection resource, that is, the creation of a member for the collection resource.
  • Update resources The role and structure of the member update resource have been described in detail in the first embodiment, and will not be repeated here.
  • Step 502 The subscribing device sends a subscription request to the subscribing target device through the oic.if.ll interface to subscribe to the member update notification of the collection resource. This step is similar to step 401, and will not be repeated here.
  • Step 503 After the subscription target device confirms that it can complete the subscription of the collection resource, it starts to monitor the target resource, and returns to the subscribing device a response message of successful subscription.
  • Step 504 When the membership of the subscribed collective resource changes, the subscription target device will complete the modification of the member update resource according to the way the collective resource is modified and the modified member.
  • Step 505 The subscription target device generates a notification message, and the notification message includes all members of the modified collection resource.
  • Step 506 The subscription target device sends the generated notification message to the subscription device.
  • Steps 503 to 506 are similar to steps 403 to 406 in the first embodiment, and will not be repeated here.
  • member update resources can be created not only during the subscription process, but also when the collection resource is generated. That is, if a collection resource supports subscription, a member update resource can be created when the collection resource is generated. , That is, the member update resource, even if there is no subscription relationship, the member update resource is always included in the collection resource as one of the members. Member update resources can be created at different times, so that the embodiments of the present application can be implemented flexibly.
  • the third embodiment of the present application relates to a notification device for member update of a collective resource. As shown in FIG. 6, it includes: a recording module 601, which is used to perform a record in the first resource in the collective resource after the member update is detected in the collective resource. Record the members in the updated collection resource; the sending module 602 is configured to send a member update notification message to the subscription device subscribed to the member update notification, and the notification message includes the first resource.
  • the structure of the first resource includes at least: a first field for recording the modification mode, and a second field for recording the modified member.
  • the recording module 601 includes: a first field recording submodule 6011, used to record in the first field the modification mode of the member that is modified in the collection resource; the second field recording submodule 6012, used to record the collection resource in the second field The ID of the modified member in.
  • the first field recording submodule 6011 is specifically used to record the creation interface in the first field, and is used to indicate that the modification method of the modified member is member addition; or, to record the deletion interface in the first field , Used to indicate that the modification method of the modified member is member deletion; or, record the link addition interface in the first field, which is used to indicate that the modification method of the modified member is member link addition; or, in the first field
  • the record link deletion interface is used to indicate that the modification method of the modified member is member link deletion.
  • the second field may be an array.
  • the first resource is specifically triggered to be created after receiving a subscription request from the subscribing device; or, the first resource is specifically triggered to be created after generating a collective resource and determining that the collective resource is a collective resource that allows subscription.
  • the recording module 601 detects whether the collective resource has a member update in the following way: if it is detected that the collective resource has been modified by any of the following interfaces, it is determined that the collective resource has a member update: the creation of a new member Interface, delete interface for deleting members, link addition interface for adding member links, and link deletion interface for deleting member links.
  • this embodiment is an example of a device corresponding to the first or second embodiment, and this embodiment can be implemented in cooperation with the first or second embodiment.
  • the related technical details mentioned in the first or second embodiment are still valid in this embodiment, and in order to reduce repetition, they will not be repeated here.
  • the related technical details mentioned in this embodiment can also be applied in the first or second embodiment.
  • modules involved in this embodiment are all logical modules.
  • a logical unit can be a physical unit, it can also be a part of a physical unit, or it can be implemented as a combination of multiple physical units.
  • this embodiment does not introduce units that are not closely related to solving the technical problems proposed by the present invention, but this does not indicate that there are no other units in this embodiment.
  • the fourth embodiment of the present application relates to an electronic device.
  • the electronic device can be any kind of Internet of Things devices that can be subscribed.
  • the electronic device includes: at least one processor 701; The memory 702 communicatively connected to the processor 701; and a communication component 703 that is communicatively connected to the processor 701 and the memory 702.
  • the communication component 703 receives and sends data under the control of the processor 701; wherein the memory 702 stores at least one
  • the instructions executed by the processor 701 are executed by at least one processor 701 to implement the method for notifying an update of a collective resource member in any one of the foregoing embodiments of the present application.
  • the memory 702 and the processor 701 are connected in a bus manner.
  • the bus may include any number of interconnected buses and bridges.
  • the bus connects one or more various circuits of the processor 701 and the memory 702 together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all well-known in the art, and therefore, no further description will be given herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 701.
  • the processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 702 may be used to store data used by the processor 701 when performing operations.
  • the fifth embodiment of the present invention relates to a non-volatile storage medium for storing computer-readable programs.
  • the computer readable program implements the above method embodiments when executed by the processor.
  • the program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

Abstract

Provided in some embodiments of the present application is a method for the notification of a member update in a collection resource. The method comprises: detecting whether there is member update in a collection resource (301); if so, recording an updated member in a member update resource (302); and sending a member update notification message to a subscription device subscribing to a member update notification (303). By means of the method, a subscription device can determine, by initiating one type of subscription to a target collection resource by means of only one interface, the changed content and the content after the change of the collection resource, so as to save system resources. Moreover, the subscription target device also does not need to maintain more subscription relationships, thereby simplifying the processing flow.

Description

集合资源成员更新的通知方法和装置Method and device for notifying update of collective resource members 技术领域Technical field
本申请涉及物联网技术领域,特别涉及一种集合资源成员更新的通知技术。This application relates to the technical field of the Internet of Things, and in particular to a notification technology for member updates of collective resources.
背景技术Background technique
在物联网技术中存在一种订阅技术,在订阅设备可以订阅目标设备的某个特定的资源或者功能,上述资源可以被称为目标资源。当目标资源发生变化的时候,会主动通知给订阅设备。例如手机订阅了家里智能门的开关状态(onoff),当智能门的状态从关(onoff=0)变为开(onoff=1)时智能门会主动发送一个通知消息给手机,在通知消息中包含了现在智能门的状态是开(onoff=1)。There is a subscription technology in the Internet of Things technology. The subscription device can subscribe to a specific resource or function of the target device, and the above resources can be called target resources. When the target resource changes, it will actively notify the subscribing device. For example, the mobile phone subscribes to the onoff state of the smart door at home. When the state of the smart door changes from off (onoff=0) to open (onoff=1), the smart door will actively send a notification message to the mobile phone, in the notification message Including the current state of the smart door is on (onoff = 1).
除了监测订阅目标设备的某个特定值(如灯的状态是开还是关)的变化外,该订阅技术还可以用于对特定资源成员变化的检测。当目标资源内包含的成员发生变化时,也会主动通知给订阅设备。也就是说,还存在一种资源,可称其为集合资源,集合资源可以包含有多个资源,被包含的资源被称之为集合资源的成员。例如,可以生成一个集合资源,将家里的智能门、冰箱、空调以及灯等智能设备作为该集合资源的成员。如果需要获知该集合资源的变化,如新增了一个成员,或删除了一个成员,则需要向订阅目标设备发起集合资源成 员更新的订阅请求,订阅目标设备在接收到订阅设备的集合资源成员更新的订阅请求后,若检测到该集合资源发生变化后,则向该订阅设备发送一个通知消息,该通知消息携带变化后的集合资源。In addition to monitoring changes in a specific value of the subscription target device (such as whether the state of the light is on or off), the subscription technology can also be used to detect changes in specific resource members. When the members included in the target resource change, it will also actively notify the subscribing device. In other words, there is also a kind of resource, which can be called a collective resource. A collective resource can contain multiple resources, and the contained resource is called a member of the collective resource. For example, a collective resource can be generated, and smart devices such as smart doors, refrigerators, air conditioners, and lights in the home can be used as members of the collective resource. If you need to know the change of the collection resource, such as adding a new member or deleting a member, you need to initiate a subscription request for the collection resource member update to the subscription target device. The subscription target device receives the subscription device’s collection resource member update After the subscription request is made, if a change in the collection resource is detected, a notification message is sent to the subscription device, and the notification message carries the changed collection resource.
发明人发现相关技术至少存在以下问题:由于针对集合资源成员更新的通知消息中,包括的是集合资源当前的成员,即变化后的成员。因此,需要订阅设备同时订阅多种信息,如订阅增加成员的通知,订阅删除成员的通知等,导致在成员发生变化的时候,需要分别接收两个通知消息,如成员更新订阅的通知消息和增加成员的通知消息,才能确定该集合资源的变化内容和变化后的内容。The inventor found that the related technology has at least the following problems: Because the notification message for the member update of the collective resource includes the current member of the collective resource, that is, the member after the change. Therefore, the subscribing device needs to subscribe to multiple information at the same time, such as subscribing to the notification of adding members, subscribing to the notification of deleting members, etc., resulting in the need to receive two notification messages when the members change, such as the notification message of member update subscription and the increase The notification message of the member can determine the changed content and the changed content of the collection resource.
发明内容Summary of the invention
本申请部分实施例所要解决的一个技术问题在于,使得订阅设备可以通过一个成员更新的通知消息,就能确定该集合资源的变化内容和变化后的内容,节约系统资源,同时订阅目标设备也可以不必维护更多的订阅关系,简化了处理流程。A technical problem to be solved by some embodiments of this application is that the subscription device can determine the changed content and the changed content of the collection resource through a notification message updated by a member, saving system resources, and subscribing to the target device can also be There is no need to maintain more subscription relationships, which simplifies the processing flow.
本申请的一个实施例提供了一种集合资源成员更新的通知方法,该方法包括:若检测到集合资源存在成员更新,则在集合资源中的第一资源中记录更新的集合资源中的成员;向订阅有成员更新通知的订阅设备发送成员更新的通知消息,所述通知消息包括第一资源。An embodiment of the present application provides a method for notifying member updates of a collective resource. The method includes: if a member update is detected in the collective resource, recording the updated member of the collective resource in a first resource in the collective resource; Send a member update notification message to the subscribing device subscribed to the member update notification, where the notification message includes the first resource.
本申请的一个实施例还提供了一种集合资源成员更新的通知装置,该装置包括:记录模块,用于在检测到集合资源存在成员更新后,在集合资源中的第一资源中记录更新的集合资源中的成员;发送模块,用于向订阅有成员更新通知的订阅设备发送成员更新的通知消息,所述通知消息包括第一资源。An embodiment of the present application also provides a device for notifying member updates of collective resources. The device includes: a recording module configured to record the updated information in the first resource in the collective resource after the member update is detected in the collective resource. A member in a collective resource; a sending module, used to send a member update notification message to a subscription device subscribed to a member update notification, the notification message including the first resource.
本申请的一个实施例还提供了一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的一个或多个程序;一个或多个程序包含指令,该指令在被至少一个处理器执行时,使得至少一个处理器执行前述的集合资源成员更新的通知方法。An embodiment of the present application further provides an electronic device, including: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores one or more programs that can be executed by the at least one processor ; One or more programs contain instructions that, when executed by at least one processor, cause at least one processor to execute the aforementioned method for notifying member updates of collective resources.
本申请的一个实施例还提供了一种非易失性计算机存储介质,存储有可被处理器执行的程序,该程序在被处理器执行时,实现前述的集合资源成员更新的通知方法。An embodiment of the present application also provides a non-volatile computer storage medium that stores a program that can be executed by a processor. When the program is executed by the processor, the aforementioned method for notifying the update of collective resource members is implemented.
本申请实施例现对于现有技术而言,通过预先为集合资源创建一个专用于记录成员变化的资源,即第一资源,因此,只要订阅设备完成了成员更新的订阅,在发生成员更新后订阅目标设备就会给订阅设备发送更新后的集合资源的通知消息,而第一资源作为集合资源的成员之一,会携带在成员更新订阅的通知消息中,使得订阅设备可以仅发送一个订阅请求消息就可以在通知消息中获取所有的信息,如更新后的集合资源,以及集合资源中发生的变化,与此同时,订阅目标设备也可以不必维护更多的订阅关系,简化了处理流程。For the prior art, the embodiment of this application now creates a resource dedicated to recording member changes for the collection resource in advance, that is, the first resource. Therefore, as long as the subscription device completes the subscription for member update, it will subscribe after the member update occurs. The target device will send a notification message of the updated collection resource to the subscribing device, and the first resource, as one of the members of the collection resource, will be carried in the notification message of the member update subscription, so that the subscribing device can only send a subscription request message You can get all the information in the notification message, such as the updated collection resource and the changes in the collection resource. At the same time, the subscription target device does not need to maintain more subscription relationships, which simplifies the processing flow.
另外,第一资源的结构包括:用于记录修改方式的第一字段,以及用于记录被修改的成员的第二字段;在集合资源中的第一资源中记录更新的成员,包括:在第一字段中记录所述集合资源中被修改的成员的修改方式;在第二字段中记录所述集合资源中被修改的成员的标识。通过第一字段记录修改方式,第二字段记录被修改的成员的标识,使得第一资源可以准确有效的记录集合资源发生的变化。In addition, the structure of the first resource includes: a first field for recording the modification mode, and a second field for recording the modified member; the updated member is recorded in the first resource in the collection resource, including: In one field, the modification mode of the modified member in the collective resource is recorded; in the second field, the identifier of the modified member in the collective resource is recorded. Through the modification of the first field record, the second field records the identifier of the modified member, so that the first resource can accurately and effectively record the changes in the collection resource.
另外,在第一字段中记录集合资源中被修改的成员的修改方式,包括:在第一字段中记录创建接口,用于指示被修改的成员的修改方式为成员增加;或,在第一字段中记录删除接口,用于指示被修改的成员的修改方式为成员删除;或,在第一字段中记录链接新增接口,用于指示被修改的成员的修改方式为成员链接增加;或,在第一字段中记录链接删除接口,用于指示被修改的成员的修改方式为成员链接删除。In addition, recording the modification method of the modified member in the collection resource in the first field includes: recording the creation interface in the first field, which is used to indicate that the modification method of the modified member is member addition; or, in the first field In the record delete interface, it is used to indicate that the modification method of the modified member is member deletion; or, the record link addition interface in the first field is used to indicate that the modification method of the modified member is member link addition; or, in The link deletion interface is recorded in the first field, which is used to indicate that the modification method of the modified member is member link deletion.
另外,第二字段为一数组,通过一个数组来记录被修改的成员的标识,从而在一个通知消息中可携带多个被修改的成员信息。In addition, the second field is an array, and the identifier of the modified member is recorded through an array, so that a notification message can carry multiple modified member information.
另外,在接收到订阅设备的订阅请求后触发所述第一资源的创建。In addition, the creation of the first resource is triggered after receiving the subscription request of the subscription device.
另外,在生成所述集合资源且确定所述集合资源为允许订阅的集合资源后触发所述第一资源的创建。In addition, the creation of the first resource is triggered after the collective resource is generated and it is determined that the collective resource is a collective resource that allows subscription.
另外,通过以下方式检测所述集合资源是否存在成员更新:若检测到所述集合资源被以下任意一个接口修改,则判定所述集合资源存在成员更新:用于创建新成员的创建接口、用于删除成员的删除接口、用于新增成员链接的链接新增接口、用于删除成员链接的链接删除接口。由于通过创建接口、删除接口、链接新增接口以及链接删除接口均可实现对集合资源中的成员修改,因此,在检测到集合资源被其中任意一个接口修改时,均判定集合资源存在成员更新,以保证第一资源资源能够及时准确的记录到集合资源的变化。In addition, the following methods are used to detect whether the collective resource has a member update: if it is detected that the collective resource is modified by any of the following interfaces, it is determined that the collective resource has a member update: the creation interface for creating new members, The delete interface for deleting members, the link addition interface for adding member links, and the link deletion interface for deleting member links. Since the members of the collection resource can be modified by creating an interface, deleting an interface, linking a new interface, and linking a delete interface, when it is detected that the collection resource is modified by any one of the interfaces, it is determined that there is a member update for the collection resource. In order to ensure that the first resource resource can record the changes of the collective resource in a timely and accurate manner.
附图说明Description of the drawings
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplified descriptions do not constitute a limitation on the embodiments.
图1是相关技术中一个消息订阅/通知周期的交互流程图;Figure 1 is an interactive flow chart of a message subscription/notification cycle in related technologies;
图2是相关技术中订阅设备发起各类型订阅的交互流程图;Figure 2 is an interactive flowchart of subscription devices initiating various types of subscriptions in related technologies;
图3是根据本申请第一实施例中的集合资源成员更新的通知方法流程图;Fig. 3 is a flowchart of a method for notifying update of collective resource members according to the first embodiment of the present application;
图4是根据本申请第一实施例中的集合资源成员更新的通知方法交互流程图;FIG. 4 is an interactive flowchart of the method for notifying the update of collective resource members according to the first embodiment of the present application;
图5是根据本申请第二实施例中的集合资源成员更新的通知方法交互流程图;FIG. 5 is an interactive flowchart of the method for notifying update of collective resource members according to the second embodiment of the present application; FIG.
图6是根据本申请第三实施例中的集合资源成员更新的通知装置结构示意图;Fig. 6 is a schematic structural diagram of a notification device for updating members of a collective resource according to a third embodiment of the present application;
图7是根据本申请第四实施例中的电子设备的结构示意图。Fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请部分实施例进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objectives, technical solutions, and advantages of the present application clearer, some embodiments of the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请第一实施例涉及一种集合资源成员更新的通知方法。本实施例应用在订阅目标设备,订阅目标设备与订阅设备之间的一个订阅过程如图1所示。由订阅设备向订阅目标设备发起一个订阅请求消息,该请求消息中携带订阅设备的标识Fr、订阅的资源标识To、用来完成请求和应答的绑定的消息请求标识Ri、操作类型Op(如删除操作、新增操作等)以及用于指示该请求消息为订阅消息的订阅标识Obs。订阅目标设备在收到该订阅请求消息之后,认证该请求并建立监测机制,并向订阅设备回复一个应答消息。该消息的目的是应答订阅 设备的订阅请求消息:已收到订阅消息,并开始监测。当订阅目标设备监测到订阅设备请求的消息发生变化之后,会发送一个通知消息以将变更后的内容通知给订阅设备。上述订阅请求消息、应答消息以及通知消息的消息请求标识(Ri)是一致的。至此完成了一个消息订阅/通知的周期。如果需要取消该订阅内容,则再次发送一请求消息,并将订阅标识Obs参数设定为取消订阅。The first embodiment of the present application relates to a method for notifying updates of collective resource members. This embodiment is applied to a subscription target device, and a subscription process between the subscription target device and the subscription device is shown in FIG. 1. The subscribing device initiates a subscription request message to the subscribing target device. The request message carries the identity of the subscribing device Fr, the subscribed resource identity To, the message request identity Ri used to complete the request and response binding, and the operation type Op (such as Delete operation, add operation, etc.) and the subscription identifier Obs used to indicate that the request message is a subscription message. After receiving the subscription request message, the subscription target device authenticates the request, establishes a monitoring mechanism, and replies a response message to the subscription device. The purpose of this message is to answer the subscription request message of the subscribing device: the subscription message has been received and monitoring is started. When the subscription target device detects that the message requested by the subscription device has changed, it will send a notification message to notify the subscription device of the changed content. The message request identifier (Ri) of the above subscription request message, response message, and notification message are the same. So far, a message subscription/notification cycle is completed. If the subscription content needs to be canceled, a request message is sent again, and the subscription identifier Obs parameter is set to cancel the subscription.
图1所示的是对订阅目标设备上某个资源(资源可以是集合资源)的一种订阅类型的订阅过程,然而,能够完成订阅集合资源成员变化的接口包括:成员更新接口(oic.if.ll)、创建接口(oic.if.create)、删除接口(oic.if.delete)、链接新增接口(oic.if.linkadd)以及链接删除接口(oic.if.linkremove)。因此,在目前的相关技术中,需要通过各类型接口对同一种集合资源发起各类型的订阅过程,如图2所示,步骤10和11,通过成员更新接口(oic.if.ll)完成对集合资源的成员更新变化的订阅,在完成该类型订阅后,订阅设备仅能获得该集合资源变化后的成员信息,需要和前一个版本的成员信息进行比对,才能获知发生变化的成员;步骤20和21,通过创建接口(oic.if.create)完成该集合资源的创建新成员的订阅,在完成该类型订阅后,订阅设备在该集合资源中增加了新成员的情况下,才会收到通知消息,通知消息为创建的新成员的信息;步骤30和31,通过删除接口(oic.if.delete)完成该集合资源的删除成员的订阅,在完成该类型订阅后,订阅设备在该集合资源中删除了成员的情况下,才会收到通知消息,通知消息为删除的成员的信息;步骤40和41,通过链接新增接口(oic.if.linkadd)完成该集合资源的新增新成员链接的订阅,在完成该类型订阅后,订阅设备在该集合资源中增加了新成员链接的情况下,才会收到通知消息,通知消息为新增的新成员链接的 信息;步骤50和51,通过链接删除接口(oic.if.linkremove)完成该集合资源的删除成员链接的订阅,在完成该类型订阅后,订阅设备在该集合资源中删除了成员链接的情况下,才会收到通知消息,通知消息为删除的成员链接的信息。由此可见,需要订阅设备通过多种接口发起各种类型的订阅,才能确定该集合资源的变化内容和变化后的内容。Figure 1 shows the subscription process of a subscription type for a certain resource (the resource can be a collection resource) on the subscription target device. However, the interface that can complete the change of the subscription collection resource member includes: member update interface (oic.if .ll), create interface (oic.if.create), delete interface (oic.if.delete), link add interface (oic.if.linkadd), and link delete interface (oic.if.linkremove). Therefore, in the current related technology, it is necessary to initiate various types of subscription processes for the same collective resource through various types of interfaces. As shown in Figure 2, steps 10 and 11 are completed through the member update interface (oic.if.ll). The membership of the collection resource updates the subscription for changes. After this type of subscription is completed, the subscription device can only obtain the member information after the collection resource has changed. It needs to compare with the member information of the previous version to know the changed member; steps 20 and 21, through the creation interface (oic.if.create) to complete the creation of a new member's subscription to the collection resource. After completing this type of subscription, the subscription device will only receive a new member in the collection resource. To the notification message, the notification message is the information of the newly created member; in steps 30 and 31, the subscription of the deleted member of the collection resource is completed through the delete interface (oic.if.delete). After this type of subscription is completed, the subscribed device is in the Only when the member is deleted from the collection resource, the notification message will be received, and the notification message is the information of the deleted member; Steps 40 and 41, complete the addition of the collection resource through the link addition interface (oic.if.linkadd) New member link subscription. After this type of subscription is completed, the subscribing device will only receive a notification message when a new member link is added to the collection resource. The notification message is the information of the newly added new member link; step 50 And 51. The subscription of the delete member link of the collection resource is completed through the link delete interface (oic.if.linkremove). After this type of subscription is completed, the subscription device will only receive the member link when the member link is deleted from the collection resource. To the notification message, the notification message is the information of the deleted member link. It can be seen that the subscription device needs to initiate various types of subscriptions through multiple interfaces in order to determine the changed content and the changed content of the collection resource.
本实施例旨在解决如何使得订阅设备仅通过一种接口对目标集合资源发起一种类型的订阅,就能确定该集合资源的变化内容和变化后的内容,以节约系统资源,同时订阅目标设备也可以不必维护更多的订阅关系,简化了处理流程。This embodiment aims to solve how to make the subscribing device initiate a type of subscription to the target collection resource through only one interface, so that the changed content and the changed content of the collection resource can be determined, so as to save system resources and subscribe to the target device at the same time. It is also unnecessary to maintain more subscription relationships, which simplifies the processing flow.
在本实施例中,预先为订阅设备订阅的集合资源,创建第一资源,创建的第一资源作为该集合资源中的成员之一。一旦检测到集合资源存在成员更新,则在该第一资源中记录更新的成员,如在该集合资源新增了一个成员,或在该集合资源删除了一个成员等;向订阅有成员更新通知的订阅设备发送的成员更新的通知消息中,包括该第一资源。由于第一资源是集合资源中的成员之一,因此,成员更新的通知消息中,将携带记录有更新成员信息的第一资源,使得订阅设备通过一个通知消息就能确定该集合资源的变化内容和变化后的内容。下面对本实施例的集合资源成员更新的通知方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。In this embodiment, the first resource is created for the collective resource subscribed by the subscribing device in advance, and the created first resource is used as one of the members in the collective resource. Once a member update is detected in the collection resource, the updated member is recorded in the first resource, such as adding a new member to the collection resource, or deleting a member from the collection resource, etc.; to subscribe to a member update notification The member update notification message sent by the subscribing device includes the first resource. Since the first resource is one of the members of the collective resource, the notification message for member update will carry the first resource with the updated member information, so that the subscribing device can determine the changed content of the collective resource through a notification message And the changed content. The following specifically describes the implementation details of the method for notification of member update of a collective resource in this embodiment. The following content is provided for ease of understanding and is not necessary for implementing this solution.
如图3所示,在步骤301中,订阅目标设备检测集合资源中是否存在成员更新,若存在成员更新,则进入步骤302,否则,返回步骤301,继续检测集合资源中是否存在成员更新。其中,集合资源为被订阅设备订阅的集合资源。As shown in FIG. 3, in step 301, the subscription target device detects whether there is a member update in the collective resource. If there is a member update, it proceeds to step 302; otherwise, it returns to step 301 to continue to detect whether there is a member update in the collective resource. Among them, the collective resource is the collective resource subscribed by the subscribed device.
具体地说,由于通过创建接口(oic.if.create)、删除接口 (oic.if.delete)、链接新增接口(oic.if.linkadd)以及链接删除接口(oic.if.linkremove),均可完成对集合资源的修改。其中,当该集合资源被oic.if.create接口修改的时候,意味着创建一个新的资源,并通过在该集合资源中添加新创建资源的链接,将该新的资源作为该集合资源的一个新成员;当该集合资源被oic.if.delete接口修改的时候,意味着删除一个指定的资源,并将该资源从该集合资源的成员列表中删除;当该集合资源被oic.if.linkadd接口修改的时候,意味着在该集合资源中新增加一个指定的资源为成员,这个指定的资源是已经建立的,通过增加链接的方式将该指定的资源作为新成员加入到该集合资源中;当该集合资源被oic.if.linkremove接口修改的时候,意味着在该集合资源中,通过删除成员链接的方式删除一个指定的成员,这个被删除的成员所对应的资源是保持不变的。Specifically, due to the creation of interfaces (oic.if.create), deletion of interfaces (oic.if.delete), link addition (oic.if.linkadd) and link deletion interfaces (oic.if.linkremove), all The modification of the collection resource can be completed. Among them, when the collection resource is modified by the oic.if.create interface, it means to create a new resource, and by adding a link to the newly created resource in the collection resource, the new resource is regarded as one of the collection resources New member; when the collection resource is modified by the oic.if.delete interface, it means to delete a specified resource and delete the resource from the member list of the collection resource; when the collection resource is oic.if.linkadd When the interface is modified, it means that a new specified resource is added as a member to the collection resource. The specified resource has already been established, and the specified resource is added to the collection resource as a new member by adding a link; When the collection resource is modified by the oic.if.linkremove interface, it means that in the collection resource, a specified member is deleted by deleting the member link, and the resource corresponding to the deleted member remains unchanged.
因此,在本步骤中,订阅目标设备需要实时的监测被订阅设备订阅的集合资源是否被oic.if.create、oic.if.delete、oic.if.linkadd以及oic.if.linkremove中的任意一个接口进行了修改,若检测到该集合资源被其中的任意一个接口进行了修改,则判定该集合资源存在成员更新,进入步骤302。Therefore, in this step, the subscription target device needs to monitor in real time whether the collection resource subscribed by the subscribed device is any one of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove The interface is modified. If it is detected that the collective resource has been modified by any one of the interfaces, it is determined that there is a member update for the collective resource, and step 302 is entered.
步骤302,在成员更新资源中记录更新的成员。具体地说,预先为该集合资源创建一个新的第一资源:成员更新资源。如在接收到订阅设备的订阅请求后,触发成员更新资源的创建。该成员更新资源作为集合资源中的一个新成员,专用于记录该集合资源中的成员变化,并且,该成员更新资源禁止被删除,始终作为集合资源中的一个成员。该成员更新资源可以直接创建在集合资源中,也可以创建在集合资源外,通过在该集合资源中添加该成员更新资源的链接的方式,将新创建的该成员更新资源作为集合资源的一个成员。本申请实施例对 成员更新资源的创建位置不做限定。由于成员更新资源是针对该集合资源创建的,因此,在具体实现中,可以优先考虑将成员更新资源直接创建在集合资源中。Step 302: Record the updated member in the member update resource. Specifically, a new first resource is created for the collection resource in advance: member update resource. For example, after receiving the subscription request of the subscribing device, the creation of the member update resource is triggered. As a new member in the collection resource, the member update resource is dedicated to recording member changes in the collection resource, and the member update resource is prohibited from being deleted, and is always a member of the collection resource. The member update resource can be created directly in the collection resource or outside the collection resource. By adding the link to the member update resource in the collection resource, the newly created member update resource is regarded as a member of the collection resource. . The embodiment of this application does not limit the creation location of the member update resource. Since the member update resource is created for the collection resource, in specific implementation, priority can be given to directly creating the member update resource in the collection resource.
具体地,第一资源,即成员更新资源的结构至少包括:用于记录修改方式的第一字段,以及用于记录被修改的成员的第二字段。Specifically, the structure of the first resource, that is, the member update resource includes at least: a first field for recording the modification mode, and a second field for recording the modified member.
在一个具体的应用中,可将成员更新资源设置成如下结构:In a specific application, the member update resource can be set to the following structure:
/updateinformation(成员更新资源)/updateinformation (member update resource)
{{
rt:oic.r.updateinfort:oic.r.updateinfo
if:oic.if.rif:oic.if.r
update_method://修改该资源使用的接口create delete linkadd linkremove中的一种update_method://Modify the interface used by the resource create delete linkadd linkremove
update_target://被修改的成员的标识update_target://ID of the member being modified
其中,rt表示资源类型,oic.r.updateinfo为用于指示成员更新资源的类型;if表示访问接口,oic.if.r表示只读接口,即该成员更新资源只允许读取,不能修改;update_method用于记录更新的成员的修改方式,即上述的第一字段,修改方式包括成员增加、成员删除、成员链接增加、成员链接删除中的任意一种,也就是说,可以在第一字段中记录oic.if.create、oic.if.delete、oic.if.linkadd以及oic.if.linkremove中的任意一个接口,以指示更新的成员的修改方式;update_target用于记录被修改的成员的标识,即上述的第二字段。Among them, rt represents the resource type, oic.r.updateinfo is the type used to indicate the member update resource; if represents the access interface, oic.if.r represents the read-only interface, that is, the member update resource is only allowed to be read and cannot be modified; update_method is used to record the modification method of the updated member, that is, the first field mentioned above. The modification method includes any one of member addition, member deletion, member link addition, and member link deletion, that is, it can be in the first field Record any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove to indicate the modification method of the updated member; update_target is used to record the identification of the modified member, That is, the second field mentioned above.
值得一提的是,update_target可以是一个数组形式,如[A;B;C;D…],其中,A,B,C和D均表示被修改的成员。由于在通过oic.if.create、 oic.if.delete、oic.if.linkadd以及oic.if.linkremove中的任意一个接口对集合资源进行修改时,修改的成员都有可能大于一个,因此,通过将update_target设计为一个数组形式,可以在一个通知消息中携带多个被修改的成员信息。It is worth mentioning that update_target can be in the form of an array, such as [A; B; C; D...], where A, B, C, and D all represent the members to be modified. Because when the collection resource is modified through any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove, the modified member may be greater than one. Therefore, pass The update_target is designed as an array form, which can carry multiple modified member information in one notification message.
由此可见,在每一次检测到集合资源中存在成员更新,均可通过成员更新资源中的update_method记录更新的成员的修改方式,通过成员更新资源中的update_targe记录更新的成员。It can be seen that every time a member update is detected in the collection resource, the update method can be recorded by the update_method in the member update resource, and the updated member can be recorded by the update_targe in the member update resource.
步骤303,向订阅有成员更新通知的订阅设备发送成员更新的通知消息。具体地说,本实施例中的订阅设备通过成员更新接口(oic.if.ll)向订阅目标设备发起订阅请求,一旦订阅目标设备检测到集合资源发生了成员更新,则向该订阅设备反馈通知消息,通知消息中包括更新后的集合资源的所有成员,即记录有成员变化内容的成员更新资源也会作为该集合资源的成员之一,携带在该通知消息,发送给订阅设备,使得订阅设备可直接通过该通知消息,获取到变化后的集合资源以及集合资源发生的变化。Step 303: Send a member update notification message to the subscribing device subscribed to the member update notification. Specifically, the subscribing device in this embodiment initiates a subscription request to the subscribing target device through the member update interface (oic.if.ll), and once the subscribing target device detects that the collection resource has been updated, it sends a notification to the subscribing device The notification message includes all members of the updated collection resource, that is, the member update resource that records the content of the member change will also be one of the members of the collection resource. The notification message is carried in the notification message and sent to the subscribing device, so that the subscribing device The changed collection resource and the changes in the collection resource can be obtained directly through the notification message.
在步骤303后,回到步骤301,继续检测集合资源中是否存在成员更新。在每一次检测到集合资源被oic.if.create、oic.if.delete、oic.if.linkadd以及oic.if.linkremove中的任意一个接口进行了修改后,均需要进入步骤302和303,以保证订阅设备可以及时的获取到集合资源发生的变化以及变化后的内容。After step 303, return to step 301 to continue to detect whether there is a member update in the collective resource. Each time it is detected that the collection resource has been modified by any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd and oic.if.linkremove, it is necessary to enter steps 302 and 303 to Ensure that the subscription device can obtain the changes in the collection resources and the changed content in a timely manner.
本实施例的订阅设备与订阅目标设备的交互流程如图4所示,在步骤401中,订阅设备向订阅目标设备发送集合资源的订阅请求。在本实施例中,订阅设备仅需要通过oic.if.ll接口向订阅目标设备发送订阅请求,订阅某个集合 资源的成员更新通知,而无需再通过oic.if.create、oic.if.delete、oic.if.linkadd以及oic.if.linkremove等接口向订阅目标设备发送订阅请求。在实际应用中,若订阅目标设备接收到订阅设备通过oic.if.create、oic.if.delete、oic.if.linkadd以及oic.if.linkremove中的任意一个接口发起的订阅请求,订阅目标设备可以直接向订阅设备反馈一个错误响应,以指示该订阅设备只需通过oic.if.ll接口发起订阅即可。The interaction flow between the subscription device and the subscription target device in this embodiment is shown in FIG. 4, in step 401, the subscription device sends a subscription request for a collection of resources to the subscription target device. In this embodiment, the subscribing device only needs to send a subscription request to the subscribing target device through the oic.if.ll interface to subscribe to the member update notification of a certain collection resource, instead of using oic.if.create, oic.if.delete , Oic.if.linkadd, and oic.if.linkremove interfaces send subscription requests to the subscription target device. In practical applications, if the subscription target device receives a subscription request initiated by the subscription device through any one of the interfaces of oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove, the subscription target device An error response can be directly fed back to the subscribing device to indicate that the subscribing device only needs to initiate a subscription through the oic.if.ll interface.
在步骤402中,订阅目标设备收到通过oic.if.ll接口发送的订阅请求后,为被订阅的集合资源创建第一资源,即为集合资源创建成员更新资源,用于记录该集合资源中更新的成员,成员更新资源的具体结构已在上文中详细说明,在此不再赘述。In step 402, after the subscription target device receives the subscription request sent through the oic.if.ll interface, it creates a first resource for the subscribed collection resource, that is, creates a member update resource for the collection resource, which is used to record the collection resource The updated members and the specific structure of member update resources have been described in detail above, so I won't repeat them here.
在步骤403中,订阅目标设备确认可以完成该集合资源的订阅之后,开始监测目标资源,并返回给订阅设备一个订阅成功的应答消息。In step 403, after the subscription target device confirms that it can complete the subscription of the collection resource, it starts to monitor the target resource, and returns to the subscribing device a response message of successful subscription.
在步骤404中,当订阅的集合资源的成员关系发生变化的时候,如该集合资源被oic.if.create、oic.if.delete、oic.if.linkadd或oic.if.linkremove接口修改时,订阅目标设备会根据该集合资源被修改的方式和修改的成员,完成成员更新资源的修改。In step 404, when the membership of the subscribed collection resource changes, such as when the collection resource is modified by the oic.if.create, oic.if.delete, oic.if.linkadd or oic.if.linkremove interface, The subscription target device will complete the modification of the member update resource according to the way the collection resource is modified and the modified member.
例如,该集合资源原先包含3个成员:智能开关1、智能电视以及成员更新资源,在通过oic.if.create接口修改该集合资源时(如将智能开关2也加入到该集合资源中),对成员更新资源进行修改,在该成员更新资源的update_method中记录修改方式为成员增加,在该成员更新资源的update_target中记录智能开关2的标识。修改后的集合资源包含了4个成员:智能开关1、智能开关2、智能电视以及成员更新资源。For example, the collection resource originally contained 3 members: smart switch 1, smart TV, and member update resources. When the collection resource is modified through the oic.if.create interface (for example, smart switch 2 is also added to the collection resource), Modify the member update resource, record the modification mode as member addition in the update_method of the member update resource, and record the identification of the smart switch 2 in the update_target of the member update resource. The revised collection resource contains 4 members: smart switch 1, smart switch 2, smart TV, and member update resources.
在步骤405中,订阅目标设备生成通知消息,通知消息中包含修改后的集合资源的所有成员。针对上述案例,修改后的成员更新资源如下:In step 405, the subscription target device generates a notification message, and the notification message includes all members of the modified collection resource. In response to the above case, the revised member update resources are as follows:
Figure PCTCN2019120680-appb-000001
Figure PCTCN2019120680-appb-000001
修改后的集合资源如下所示:The modified collection resources are as follows:
Figure PCTCN2019120680-appb-000002
Figure PCTCN2019120680-appb-000002
Figure PCTCN2019120680-appb-000003
Figure PCTCN2019120680-appb-000003
在步骤406中,订阅目标设备将生成的通知消息发送给订阅设备。通过上述样式的通知消息,订阅设备可以在一个通知消息中就能获取到订阅的集合资源的成员现状以及本次更新的成员。In step 406, the subscription target device sends the generated notification message to the subscription device. Through the above-mentioned notification message, the subscribing device can obtain the current status of the members of the subscribed collection resource and the current updated members in one notification message.
由此可见,相对现有技术中的需要通过oic.if.ll、oic.if.create、oic.if.delete、oic.if.linkadd以及oic.if.linkremove等各接口分别集合资源发起订阅而言,本实施例的订阅设备只需要通过oic.if.ll发起一次订阅请求,可以简化对集合资源成员变化订阅的流程,订阅目标设备也可以不必维护更多的订阅关系,减轻了订阅目标设备的负担。而且,在目前的相关技术中,在集合资源被create、delete、linkadd、linkremove等接口修改后会触发针对各自接口的通知消息,也一定会触发oic.if.ll的订阅消息,订阅设备需要结合这两个通知消息才可以确定集合资源发生的变化。而在本实施例中,订阅设备可以仅通过oic.if.ll接口发送一个订阅消息就可以在通知消息中获取所有的信息,简化了订阅设备与订阅目标设备之间的信息交互。It can be seen that, compared with the need in the prior art, the subscription is initiated through the collection of resources through interfaces such as oic.if.ll, oic.if.create, oic.if.delete, oic.if.linkadd, and oic.if.linkremove. In other words, the subscription device of this embodiment only needs to initiate a subscription request through oic.if.ll, which simplifies the process of subscribing to collection resource member changes, and the subscription target device does not need to maintain more subscription relationships, which reduces the subscription target device. Burden. Moreover, in the current related technology, after the collection resource is modified by the interface of create, delete, linkadd, linkremove, etc., the notification message for the respective interface will be triggered, and the subscription message of oic.if.ll will also be triggered. The subscription device needs to be combined Only these two notification messages can determine the change of the collective resource. In this embodiment, the subscribing device can obtain all the information in the notification message only by sending a subscription message through the oic.if.ll interface, which simplifies the information interaction between the subscribing device and the subscription target device.
本申请第二实施例涉及一种集合资源成员更新的通知方法。本实施例与第一实施例大致相同,区别在于,在第一实施例中,是在接收到订阅设备的订阅请求后触发第一资源的创建。而在本实施例中,在生成集合资源且确定集合资源为允许订阅的集合资源后触发第一资源的创建。The second embodiment of the present application relates to a method for notifying updates of collective resource members. This embodiment is roughly the same as the first embodiment. The difference is that in the first embodiment, the creation of the first resource is triggered after the subscription request of the subscribing device is received. However, in this embodiment, the creation of the first resource is triggered after the collection resource is generated and it is determined that the collection resource is a collection resource allowed to be subscribed.
本实施例的订阅设备与订阅目标设备的交互流程如图5所示,步骤501, 订阅目标设备在生成允许被订阅的集合资源时,触发为集合资源创建第一资源,即为集合资源创建成员更新资源。该成员更新资源的作用与结构已在第一实施例中详细描述,在此不再赘述。The interaction flow between the subscription device and the subscription target device of this embodiment is shown in Figure 5. In step 501, when the subscription target device generates a collection resource that is allowed to be subscribed, it triggers the creation of the first resource for the collection resource, that is, the creation of a member for the collection resource. Update resources. The role and structure of the member update resource have been described in detail in the first embodiment, and will not be repeated here.
步骤502,订阅设备通过oic.if.ll接口向订阅目标设备发送订阅请求,订阅集合资源的成员更新通知。本步骤与步骤401类似,在此不再赘述。Step 502: The subscribing device sends a subscription request to the subscribing target device through the oic.if.ll interface to subscribe to the member update notification of the collection resource. This step is similar to step 401, and will not be repeated here.
步骤503,订阅目标设备确认可以完成该集合资源的订阅之后,开始监测目标资源,并返回给订阅设备一个订阅成功的应答消息。Step 503: After the subscription target device confirms that it can complete the subscription of the collection resource, it starts to monitor the target resource, and returns to the subscribing device a response message of successful subscription.
步骤504,当订阅的集合资源的成员关系发生变化的时候,订阅目标设备会根据该集合资源被修改的方式和修改的成员,完成成员更新资源的修改。Step 504: When the membership of the subscribed collective resource changes, the subscription target device will complete the modification of the member update resource according to the way the collective resource is modified and the modified member.
步骤505,订阅目标设备生成通知消息,通知消息中包含修改后的集合资源的所有成员。Step 505: The subscription target device generates a notification message, and the notification message includes all members of the modified collection resource.
步骤506,订阅目标设备将生成的通知消息发送给订阅设备。Step 506: The subscription target device sends the generated notification message to the subscription device.
步骤503至步骤506与第一实施例中的步骤403至步骤406类似,在此不再赘述。Steps 503 to 506 are similar to steps 403 to 406 in the first embodiment, and will not be repeated here.
由此可见,成员更新资源不仅可以是在订阅的过程中创建,也可以是在集合资源生成时创建,即如果一个集合资源支持订阅则在该集合资源生成时即可创建一个成员更新类型的资源,即成员更新资源,即使没有订阅关系存在时,成员更新资源也始终作为成员之一,包含在该集合资源中。成员更新资源可在不同的时机创建,使得本申请的实施例可灵活多变的实现。It can be seen that member update resources can be created not only during the subscription process, but also when the collection resource is generated. That is, if a collection resource supports subscription, a member update resource can be created when the collection resource is generated. , That is, the member update resource, even if there is no subscription relationship, the member update resource is always included in the collection resource as one of the members. Member update resources can be created at different times, so that the embodiments of the present application can be implemented flexibly.
本申请第三实施例涉及一种集合资源成员更新的通知装置,如图6所示,包括:记录模块601,用于在检测到集合资源存在成员更新后,在集合资源中的第一资源中记录更新的集合资源中的成员;发送模块602,用于向订阅有成 员更新通知的订阅设备发送成员更新的通知消息,所述通知消息包括第一资源。The third embodiment of the present application relates to a notification device for member update of a collective resource. As shown in FIG. 6, it includes: a recording module 601, which is used to perform a record in the first resource in the collective resource after the member update is detected in the collective resource. Record the members in the updated collection resource; the sending module 602 is configured to send a member update notification message to the subscription device subscribed to the member update notification, and the notification message includes the first resource.
在一个具体的例子中,第一资源的结构至少包括:用于记录修改方式的第一字段,以及用于记录被修改的成员的第二字段。记录模块601包括:第一字段记录子模块6011,用于在第一字段中记录集合资源中被修改的成员的修改方式;第二字段记录子模块6012,用于在第二字段中记录集合资源中被修改的成员的标识。In a specific example, the structure of the first resource includes at least: a first field for recording the modification mode, and a second field for recording the modified member. The recording module 601 includes: a first field recording submodule 6011, used to record in the first field the modification mode of the member that is modified in the collection resource; the second field recording submodule 6012, used to record the collection resource in the second field The ID of the modified member in.
在一个具体的例子中,第一字段记录子模块6011具体用于在第一字段中记录创建接口,用于指示被修改的成员的修改方式为成员增加;或,在第一字段中记录删除接口,用于指示被修改的成员的修改方式为成员删除;或,在第一字段中记录链接新增接口,用于指示被修改的成员的修改方式为成员链接增加;或,在第一字段中记录链接删除接口,用于指示被修改的成员的修改方式为成员链接删除。In a specific example, the first field recording submodule 6011 is specifically used to record the creation interface in the first field, and is used to indicate that the modification method of the modified member is member addition; or, to record the deletion interface in the first field , Used to indicate that the modification method of the modified member is member deletion; or, record the link addition interface in the first field, which is used to indicate that the modification method of the modified member is member link addition; or, in the first field The record link deletion interface is used to indicate that the modification method of the modified member is member link deletion.
在一个具体的例子中,第二字段可以为一数组。In a specific example, the second field may be an array.
在一个具体的例子中,第一资源具体在接收到订阅设备的订阅请求后被触发创建;或者,第一资源具体在生成集合资源且确定集合资源为允许订阅的集合资源后被触发创建。In a specific example, the first resource is specifically triggered to be created after receiving a subscription request from the subscribing device; or, the first resource is specifically triggered to be created after generating a collective resource and determining that the collective resource is a collective resource that allows subscription.
在一个具体的例子中,记录模块601通过以下方式检测所述集合资源是否存在成员更新:若检测到集合资源被以下任意一个接口修改,则判定集合资源存在成员更新:用于创建新成员的创建接口、用于删除成员的删除接口、用于新增成员链接的链接新增接口、用于删除成员链接的链接删除接口。In a specific example, the recording module 601 detects whether the collective resource has a member update in the following way: if it is detected that the collective resource has been modified by any of the following interfaces, it is determined that the collective resource has a member update: the creation of a new member Interface, delete interface for deleting members, link addition interface for adding member links, and link deletion interface for deleting member links.
不难发现,本实施方式为与第一或第二实施方式相对应的装置实施例,本实施方式可与第一或第二实施方式互相配合实施。第一或第二实施方式中提 到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一或第二实施方式中。It is not difficult to find that this embodiment is an example of a device corresponding to the first or second embodiment, and this embodiment can be implemented in cooperation with the first or second embodiment. The related technical details mentioned in the first or second embodiment are still valid in this embodiment, and in order to reduce repetition, they will not be repeated here. Correspondingly, the related technical details mentioned in this embodiment can also be applied in the first or second embodiment.
另外,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。In addition, the modules involved in this embodiment are all logical modules. In practical applications, a logical unit can be a physical unit, it can also be a part of a physical unit, or it can be implemented as a combination of multiple physical units. . In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by the present invention, but this does not indicate that there are no other units in this embodiment.
本申请第四实施例涉及一种电子设备,该电子设备可以是任意一种可被订阅的物联网设备,如图7所示,该电子设备包括:至少一个处理器701;以及,与至少一个处理器701通信连接的存储器702;以及,与处理器701和存储器702通信连接的通信组件703,通信组件703在处理器701的控制下接收和发送数据;其中,存储器702存储有可被至少一个处理器701执行的指令,指令被至少一个处理器701执行以实现本申请上述任一实施例的集合资源成员更新的通知方法。The fourth embodiment of the present application relates to an electronic device. The electronic device can be any kind of Internet of Things devices that can be subscribed. As shown in FIG. 7, the electronic device includes: at least one processor 701; The memory 702 communicatively connected to the processor 701; and a communication component 703 that is communicatively connected to the processor 701 and the memory 702. The communication component 703 receives and sends data under the control of the processor 701; wherein the memory 702 stores at least one The instructions executed by the processor 701 are executed by at least one processor 701 to implement the method for notifying an update of a collective resource member in any one of the foregoing embodiments of the present application.
其中,存储器702和处理器701采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器701和存储器702的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器701。The memory 702 and the processor 701 are connected in a bus manner. The bus may include any number of interconnected buses and bridges. The bus connects one or more various circuits of the processor 701 and the memory 702 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all well-known in the art, and therefore, no further description will be given herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 701.
处理器701负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器702可以被用于存储处理器701在执行操作时所使用的数据。The processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 702 may be used to store data used by the processor 701 when performing operations.
上述产品可执行本申请各实施例所提供的方法,具备执行方法相应的功能模块和有益效果,未在本实施方式中详尽描述的技术细节,可参见本申请实施方式所提供的方法。The above-mentioned products can execute the methods provided in the various embodiments of the present application, and have the corresponding functional modules and beneficial effects for executing the methods. For technical details that are not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.
本发明第五实施方式涉及一种非易失性存储介质,用于存储计算机可读程序。计算机可读程序被处理器执行时实现上述方法实施例。The fifth embodiment of the present invention relates to a non-volatile storage medium for storing computer-readable programs. The computer readable program implements the above method embodiments when executed by the processor.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method of the foregoing embodiments can be implemented by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
本领域的普通技术人员可以理解,上述各实施例是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific embodiments for realizing the present application, and in actual applications, various changes can be made to them in form and details without departing from the spirit and spirit of the present application. range.

Claims (16)

  1. 一种集合资源成员更新的通知方法,包括:A notification method for member update of collection resources, including:
    若检测到集合资源存在成员更新,则在所述集合资源中的第一资源中记录更新的所述集合资源中的成员;向订阅有成员更新通知的订阅设备发送成员更新的通知消息,其中,所述通知消息包括所述第一资源。If a member update is detected in the collective resource, the updated member in the collective resource is recorded in the first resource in the collective resource; a member update notification message is sent to the subscription device subscribed to the member update notification, wherein, The notification message includes the first resource.
  2. 如权利要求1所述的方法,其中,所述第一资源的结构至少包括:用于记录修改方式的第一字段,以及用于记录被修改的成员的第二字段;The method according to claim 1, wherein the structure of the first resource includes at least: a first field for recording the modification mode, and a second field for recording the modified member;
    所述在所述集合资源中的第一资源中记录更新的所述集合资源中的成员,包括:The member in the collective resource that is updated in the first resource in the collective resource includes:
    在所述第一字段中记录所述集合资源中被修改的成员的修改方式;Record the modification mode of the modified member in the collection resource in the first field;
    在所述第二字段中记录所述集合资源中被修改的成员的标识。The identification of the modified member in the collection resource is recorded in the second field.
  3. 如权利要求2所述的方法,其中,所述在所述第一字段中记录所述集合资源中被修改的成员的修改方式,包括:3. The method according to claim 2, wherein the recording in the first field the modification mode of the modified member in the collective resource comprises:
    在所述第一字段中记录创建接口,用于指示被修改的成员的修改方式为成员增加;或,Record the creation interface in the first field, which is used to indicate that the modification method of the modified member is member addition; or,
    在所述第一字段中记录删除接口,用于指示被修改的成员的修改方式为成员删除;或,Record the delete interface in the first field, which is used to indicate that the modification method of the modified member is member deletion; or,
    在所述第一字段中记录链接新增接口,用于指示被修改的成员的修改方式为成员链接增加;或,Record the link addition interface in the first field, which is used to indicate that the modification method of the modified member is member link addition; or,
    在所述第一字段中记录链接删除接口,用于指示被修改的成员的修改方式为成员链接删除。The link deletion interface is recorded in the first field, which is used to indicate that the modification mode of the modified member is member link deletion.
  4. 如权利要求2或3所述的方法,其中,所述第二字段为一数组。The method of claim 2 or 3, wherein the second field is an array.
  5. 如权利要求1至4中任一项所述的方法,其中,在接收到所述订阅设备的订阅请求后触发所述第一资源的创建。The method according to any one of claims 1 to 4, wherein the creation of the first resource is triggered after receiving the subscription request of the subscription device.
  6. 如权利要求1至4中任一项所述的方法,其中,在生成所述集合资源且确定所述集合资源为允许订阅的集合资源后触发所述第一资源的创建。The method according to any one of claims 1 to 4, wherein the creation of the first resource is triggered after generating the collective resource and determining that the collective resource is a collective resource that allows subscription.
  7. 如权利要求1至6中任一项所述的方法,其中,通过以下方式检测所述集合资源是否存在成员更新:The method according to any one of claims 1 to 6, wherein the detection of whether there is a member update of the collective resource is performed in the following manner:
    若检测到所述集合资源被以下任意一个接口修改,则判定所述集合资源存在成员更新:If it is detected that the collective resource is modified by any one of the following interfaces, it is determined that there is a member update for the collective resource:
    用于创建新成员的创建接口、用于删除成员的删除接口、用于新增成员链接的链接新增接口、用于删除成员链接的链接删除接口。The creation interface used to create new members, the delete interface used to delete members, the link addition interface used to add member links, and the link delete interface used to delete member links.
  8. 一种集合资源成员更新的通知装置,包括:A notification device for member update of a collective resource includes:
    记录模块,用于在检测到集合资源存在成员更新后,在所述集合资源中的第一资源中记录更新的所述集合资源中的成员;A recording module, configured to record the updated member in the collective resource in the first resource in the collective resource after detecting that the collective resource has a member update;
    发送模块,用于向订阅有成员更新通知的订阅设备发送成员更新的通知消息,所述通知消息包括所述第一资源。The sending module is configured to send a member update notification message to the subscription device subscribed to the member update notification, and the notification message includes the first resource.
  9. 根据权利要求8所述的装置,其中,所述第一资源的结构至少包括:用于记录修改方式的第一字段,以及用于记录被修改的成员的第二字段;8. The apparatus according to claim 8, wherein the structure of the first resource at least comprises: a first field for recording a modification method, and a second field for recording the member that is modified;
    所述记录模块包括:The recording module includes:
    第一字段记录子模块,用于在所述第一字段中记录所述集合资源中被修改的成员的修改方式;The first field recording sub-module is used to record the modification mode of the modified member in the collection resource in the first field;
    第二字段记录子模块,用于在所述第二字段中记录所述集合资源中被修改的成员的标识。The second field recording submodule is used to record the identifier of the modified member in the collection resource in the second field.
  10. 根据权利要求9所述的装置,其中,所述第一字段记录子模块具体用于在所述第一字段中记录创建接口,用于指示被修改的成员的修改方式为成员增加;或,在所述第一字段中记录删除接口,用于指示被修改的成员的修改方式为成员删除;或,在所述第一字段中记录链接新增接口,用于指示被修改的成员的修改方式为成员链接增加;或,在所述第一字段中记录链接删除接口,用于指示被修改的成员的修改方式为成员链接删除。The apparatus according to claim 9, wherein the first field recording submodule is specifically configured to record a creation interface in the first field, and is used to indicate that the modification method of the modified member is member addition; or, The deletion interface is recorded in the first field, which is used to indicate that the modification method of the modified member is member deletion; or, the link addition interface is recorded in the first field to indicate that the modification method of the modified member is The member link is added; or, the link deletion interface is recorded in the first field, which is used to indicate that the modification method of the modified member is the member link deletion.
  11. 根据权利要求9或10所述的装置,其中,所述第二字段为一数组。The device according to claim 9 or 10, wherein the second field is an array.
  12. 根据权利要求8至11中任一项所述的装置,其中,所述第一资源具体在接收到所述订阅设备的订阅请求后被触发创建。The apparatus according to any one of claims 8 to 11, wherein the first resource is specifically triggered to be created after receiving a subscription request of the subscription device.
  13. 根据权利要求8至11中任一项所述的装置,其中,所述第一资源具体在生成所述集合资源且确定所述集合资源为允许订阅的集合资源后被触发创建。The apparatus according to any one of claims 8 to 11, wherein the first resource is specifically triggered to be created after the collective resource is generated and it is determined that the collective resource is a collective resource that allows subscription.
  14. 根据权利要求8至13中任一项所述的装置,其中,所述记录模块具体在检测到所述集合资源被以下任意一个接口修改后,判定所述集合资源存在成员更新:The apparatus according to any one of claims 8 to 13, wherein the recording module specifically determines that the collective resource has a member update after detecting that the collective resource is modified by any one of the following interfaces:
    用于创建新成员的创建接口、用于删除成员的删除接口、用于新增成员链接的链接新增接口、用于删除成员链接的链接删除接口。The creation interface used to create new members, the delete interface used to delete members, the link addition interface used to add member links, and the link delete interface used to delete member links.
  15. 一种电子设备,包括:An electronic device including:
    至少一个处理器;At least one processor;
    存储器,与所述至少一个处理器通信连接;其中,A memory, which is in communication connection with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的一个或多个程序;The memory stores one or more programs that can be executed by the at least one processor;
    所述一个或多个程序包含指令,所述指令在被至少一个处理器执行时,使得所述至少一个处理器执行如权利要求1至7中任意一项所述的集合资源成员更新的通知方法。The one or more programs include instructions that, when executed by at least one processor, cause the at least one processor to execute the method for notifying an update of a collective resource member according to any one of claims 1 to 7 .
  16. 一种计算机可读存储介质,存储有可被处理器执行的程序,所述程序在被处理器执行时,实现如权利要求1至7中任意一项所述的集合资源成员更新的通知方法。A computer-readable storage medium storing a program executable by a processor, and when the program is executed by the processor, the method for notifying the update of collective resource members according to any one of claims 1 to 7 is realized.
PCT/CN2019/120680 2019-11-25 2019-11-25 Method and apparatus for notification of member update in collection resource WO2021102643A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/120680 WO2021102643A1 (en) 2019-11-25 2019-11-25 Method and apparatus for notification of member update in collection resource
CN201980097386.3A CN113994643B (en) 2019-11-25 2019-11-25 Method and device for notifying update of collection resource members

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/120680 WO2021102643A1 (en) 2019-11-25 2019-11-25 Method and apparatus for notification of member update in collection resource

Publications (1)

Publication Number Publication Date
WO2021102643A1 true WO2021102643A1 (en) 2021-06-03

Family

ID=76129090

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/120680 WO2021102643A1 (en) 2019-11-25 2019-11-25 Method and apparatus for notification of member update in collection resource

Country Status (2)

Country Link
CN (1) CN113994643B (en)
WO (1) WO2021102643A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104639429A (en) * 2015-02-12 2015-05-20 青岛海尔智能家电科技有限公司 Message notification method and device of cloud platform
CN105406953A (en) * 2014-09-15 2016-03-16 青岛海尔智能家电科技有限公司 Method and apparatus for aggregating notification messages
WO2016173194A1 (en) * 2015-04-30 2016-11-03 中兴通讯股份有限公司 Updating method, device and system for information about resources

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102255931B (en) * 2010-05-21 2017-04-05 山东金佳园科技股份有限公司 Unified Notification Method and system under a kind of Internet of Things framework
CN103795689A (en) * 2012-10-29 2014-05-14 中兴通讯股份有限公司 Resource subscription method and device
CN105376706B (en) * 2014-08-29 2019-12-31 青岛海尔智能家电科技有限公司 Method and device for subscribing equipment position information
CN109905431B (en) * 2017-12-08 2021-01-26 京东方科技集团股份有限公司 Message processing method and system, storage medium and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105406953A (en) * 2014-09-15 2016-03-16 青岛海尔智能家电科技有限公司 Method and apparatus for aggregating notification messages
CN104639429A (en) * 2015-02-12 2015-05-20 青岛海尔智能家电科技有限公司 Message notification method and device of cloud platform
WO2016173194A1 (en) * 2015-04-30 2016-11-03 中兴通讯股份有限公司 Updating method, device and system for information about resources

Also Published As

Publication number Publication date
CN113994643B (en) 2023-05-09
CN113994643A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
US20210097477A1 (en) Container image management system for distributed clusters
US11184227B2 (en) Method and apparatus for updating configuration object
US10169026B2 (en) Transferring operating environment of registered network to unregistered network
WO2019184151A1 (en) External data-based method and system for constructing various triggering mechanisms for executing smart contract in blockchain network
CN110598280B (en) Equipment simulation system and method and computer readable storage medium
US20150128060A1 (en) Method and apparatus of providing application program information in mobile terminal device
US9047350B2 (en) System and method for managing relationships among resources
US20140229504A1 (en) System and method for managing database in data distribution service
US10122598B2 (en) Subscription watch lists for event handling
CN111312352B (en) Data processing method, device, equipment and medium based on block chain
WO2019109923A1 (en) Message processing method and system, storage medium and electronic device
WO2020207194A1 (en) Blockchain-based iot device changing method and apparatus
CN116402446B (en) Cargo management method, device, medium and electronic equipment
US10044838B2 (en) Method of automatically setting protocol in programmable logic controller system
WO2021102643A1 (en) Method and apparatus for notification of member update in collection resource
US20230045914A1 (en) Method and apparatus for controlling device in internet of things, and gateway device and storage medium
US20210194967A1 (en) Subscription server, subscription terminal, information subscription method and system
CN115422277A (en) Data source connection pool control method and device and server
US11153388B2 (en) Workflow engine framework for cross-domain extension
US20220150348A1 (en) Method for Service Decision Distribution Among Multiple Terminal Devices and System
US8701123B2 (en) Apparatus and method for transmitting events occurring in a controlled device to a control device in a web based system
KR102077093B1 (en) Device and method to share image received from user terminal with other user terminals
US11734656B1 (en) Distributed device rating system
CN114510282B (en) Method, device, equipment and storage medium for running automation application
US11750700B2 (en) Method, device, computer-readable medium, and system for managing transactions

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19953923

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19953923

Country of ref document: EP

Kind code of ref document: A1