WO2021102691A1 - 资源订阅方法、装置、计算机设备和存储介质 - Google Patents

资源订阅方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2021102691A1
WO2021102691A1 PCT/CN2019/120995 CN2019120995W WO2021102691A1 WO 2021102691 A1 WO2021102691 A1 WO 2021102691A1 CN 2019120995 W CN2019120995 W CN 2019120995W WO 2021102691 A1 WO2021102691 A1 WO 2021102691A1
Authority
WO
WIPO (PCT)
Prior art keywords
subscription
target resource
notification message
information
resource
Prior art date
Application number
PCT/CN2019/120995
Other languages
English (en)
French (fr)
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/120995 priority Critical patent/WO2021102691A1/zh
Priority to CN201980097312.XA priority patent/CN113940037B/zh
Publication of WO2021102691A1 publication Critical patent/WO2021102691A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast

Definitions

  • This application relates to the field of communications, in particular to a resource subscription method, device, computer equipment and storage medium.
  • the user end sends a subscription request to the subscription server.
  • the subscription server After the subscription server authenticates the subscription request, the subscription server starts to monitor whether the message subscribed by the subscription request is updated. When it is detected that the subscription request message is updated, it will be updated. The content of the message is sent to the client.
  • an embodiment of the present application provides a resource subscription method, and the method includes:
  • a first notification message is generated; the first notification message includes update information and auxiliary information, and the update information includes the content or content of the updated target resource.
  • the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message;
  • the method further includes:
  • the step of generating the first notification message is performed.
  • the determining whether the target resource supports carrying ancillary information in a notification message includes:
  • the determining whether the target resource supports carrying ancillary information in a notification message includes:
  • the resource information of the target resource carries the ancillary information identifier, and the function of carrying the ancillary information in the notification message of the target resource is enabled, it is determined that the target resource supports carrying the ancillary information in the notification message.
  • the method further includes:
  • the function enable instruction is used to instruct the notification message for enabling the target resource to carry an auxiliary information function.
  • the function activation instruction includes an accessory parameter identifier, and if the value of the accessory parameter identifier is a first value, the notification message for instructing to activate the target resource carries the accessory information function.
  • the method after receiving the function enable instruction sent by the subscription device, the method further includes:
  • the second notification message includes the auxiliary information of the target resource.
  • the determining whether the target resource supports carrying ancillary information in a notification message includes:
  • the value of the subscription identifier of the target resource indicates that the notification message carries subsidiary information, and the resource information of the target resource carries the subsidiary information identifier, it is determined that the target resource supports carrying subsidiary information in the notification message.
  • the subscription request includes the value of the subscription identifier; the value of the subscription identifier is used to indicate whether to carry subsidiary information in the notification message or cancel the subscription.
  • the value of the subscription identifier is the third value, it indicates that the notification message does not carry auxiliary information
  • the method further includes:
  • the query request carries a target resource identifier
  • the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the auxiliary information includes at least one of the following information: resource interface information of the target resource; updating the device identification of the target resource; updating the user name of the user to which the device of the target resource belongs; updating The user identification ID of the user to which the device of the target resource belongs; the update time of the target resource; the update type of the target resource.
  • the update type includes local update, remote update, manual update or scene update.
  • the method further includes:
  • the step of generating the first notification message is performed.
  • the method further includes:
  • a subscription response is sent to the subscription device;
  • the subscription response includes the current value of the attribute of the target resource and preset subsidiary information, the preset subsidiary information It is a null value or a preset default value.
  • an embodiment of the present application provides a resource subscription method, and the method includes:
  • a first notification message sent by the target subscription device is received.
  • the first notification message includes update information and auxiliary information, and the update information includes the content or all of the updated target resource.
  • the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message.
  • the method further includes:
  • the determining whether the target resource supports carrying ancillary information in a notification message includes:
  • the resource information of the target resource carries the ancillary information identifier, it is determined that the target resource supports carrying the ancillary information in the notification message.
  • the method further includes:
  • the function enable instruction is used to instruct to enable the function of carrying auxiliary information of the notification message of the target resource.
  • the function activation instruction includes an accessory parameter identifier, and if the value of the accessory parameter identifier is a first value, it instructs to enable the function of carrying accessory information of the notification message of the target resource.
  • the method further includes:
  • the second notification message is sent after the subscription target device turns on the attachment information carrying function of the notification message of the target resource according to the function activation instruction, the The second notification message includes a message of auxiliary information of the target resource.
  • the subscription request includes the value of the subscription identifier; the value of the subscription identifier is used to indicate whether to carry subsidiary information in the notification message or cancel the subscription.
  • the value of the subscription identifier is the second value, it indicates that the notification message carries subsidiary information
  • the value of the subscription identifier is the third value, it indicates that the notification message does not carry auxiliary information
  • the value of the subscription identifier is the fourth value, it is instructed to cancel the subscription.
  • the method further includes:
  • the query request carries a target resource identifier
  • the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the auxiliary information includes at least one of the following information: resource interface information of the target resource; updating the device identification of the target resource; updating the user name of the user to which the device of the target resource belongs; updating The user ID of the user to which the device of the target resource belongs; the update time of the target resource; the update type of the target resource.
  • the update type includes local update, remote update, manual update or scene update.
  • the method further includes:
  • the target resource supports subscription, and the target resource supports carrying auxiliary information in a notification message, sending the subscription request to the subscription target device.
  • the method further includes:
  • the subscription response After the subscription request is sent to the subscription target device, a subscription response sent by the subscription target device is received; the subscription response includes the current value of the attribute of the target resource and preset auxiliary information, and the preset
  • the ancillary information is a null value or a preset default value.
  • an embodiment of the present application provides a resource subscription device, the device includes:
  • the generating module is configured to generate a first notification message if the target resource update is monitored after receiving the subscription request sent by the subscribing device; the first notification message includes update information and auxiliary information, and the update information includes updated information The content of the target resource or the updated content of the target resource; the subscription request is used to request the subscription to support the target resource that carries subsidiary information in the notification message;
  • the sending module is configured to send the first notification message to the subscription device.
  • an embodiment of the present application provides a resource subscription device, the device includes: a processing module and a receiving module;
  • the processing module is configured to receive, through the receiving module, a first notification message sent by the target subscription device after sending a subscription request to the subscription target device, the first notification message includes update information and auxiliary information, and the update
  • the information includes the updated content of the target resource or the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message.
  • an embodiment of the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any one of the first aspects. step.
  • an embodiment of the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the method of any one of the methods in the second aspect is implemented. step.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, wherein the computer program is characterized in that, when the computer program is executed by a processor, the method of any one of the second aspects is implemented step.
  • the resource subscription method, apparatus, computer equipment, and storage medium provided by the embodiments of the present application, after receiving the subscription request sent by the subscription device, if the target resource update is monitored, the first notification message is generated, and the first notification message is sent to
  • the subscribing device since the first notification message includes update information and auxiliary information, the subscribing device can not only perceive the content of the target resource change, but also perceive the ancillary information of the target resource change.
  • the auxiliary information helps the subscriber to complete more abundant information. Scenarios, and the subscription device can determine follow-up operations based on the auxiliary information to meet more user needs.
  • FIG. 1 is a schematic diagram of an application scenario of a resource subscription method provided by an embodiment of the application
  • Figure 2 is a flowchart of a resource subscription method provided by an embodiment
  • FIG. 3 is a flowchart of a resource subscription method provided by an embodiment
  • Figure 4 is a flowchart of a resource subscription method provided by an embodiment
  • Figure 5 is a flowchart of a resource subscription method provided by an embodiment
  • Fig. 6 is a flowchart of a resource subscription method provided by an embodiment
  • FIG. 7 is an interactive flowchart of a method for subscribing to resources provided by an embodiment
  • FIG. 8 is an interactive flowchart of a method for subscribing to resources provided by an embodiment
  • FIG. 9 is an interactive flowchart of a method for subscribing to resources provided by an embodiment
  • FIG. 10 is a block diagram of an apparatus for subscribing to resources provided by an embodiment
  • FIG. 11 is a block diagram of an apparatus for subscribing to resources provided by an embodiment
  • FIG. 12 is a block diagram of an apparatus for subscribing to resources provided by an embodiment
  • FIG. 13 is a block diagram of an apparatus for subscribing to resources provided by an embodiment
  • Figure 14 is a block diagram of a computer device provided by an embodiment
  • Fig. 15 is a block diagram of a computer device provided by an embodiment.
  • FIG. 1 is a schematic diagram of an application scenario of a resource subscription method provided by an embodiment of the application.
  • this scenario includes a subscription device 1 and a subscription target device 2.
  • the subscription device 1 and the subscription target device 2 perform data transmission through the network, and the subscription device 1 can subscribe to the subscription target device 2 for required resources.
  • the subscription device 1 may subscribe to news, advertisements, etc. from the subscription target device 2.
  • the subscription device 1 may be a terminal such as a mobile phone, a computer, an iPad, a game console, and a handheld terminal
  • the subscription target device 2 may be a terminal device, a server, a cloud platform, a server cluster, etc., and the embodiment of the application is not limited to this.
  • the subscribing device can only obtain the changed value of the target resource from the subscribing target device.
  • the subscribing device (user) may need to perceive some auxiliary information about the target resource being modified, such as: who is When and how to modify the target resource, therefore, the existing resource subscription method is difficult to meet the needs of more and more users. Therefore, the technical problem solved by this solution is how to carry the auxiliary information in the current notification message.
  • the resource subscription method provided in the embodiment of the present application can also be used to solve other technical problems, and is not limited to this.
  • Fig. 2 is a flowchart of a resource subscription method provided by an embodiment.
  • the subject of execution of this method is the subscription target device 2 in the scenario shown in Figure 1.
  • This embodiment relates to the subscription target device sending updated information and auxiliary information to the subscription device when it detects that the target resource subscribed by the subscription device changes.
  • the specific implementation process of the notification message As shown in Figure 2, the method includes the following steps:
  • a first notification message is generated; the first notification message includes update information and auxiliary information, and the update information includes the content of the updated target resource or the target resource The updated content of the; subscription request is used to request subscription to support the target resource that carries subsidiary information in the notification message.
  • the subscription request may include the identifier of the target resource, the identifier of the subscribed device, the request identifier used to complete the binding of the request and the response, the operation type, the subscription identifier, etc.
  • the target resource update can be that part of the content of the target resource is updated, or all the content of the target resource is updated, which is not limited in the embodiment of the present application.
  • the update information may include the content of the updated target resource or the updated content of the target resource, where the content of the updated target resource refers to all the updated and unupdated content of the updated target resource.
  • the update of the target resource Content refers to the content that has been updated in the target resource.
  • the target resource includes content A, content B, and content C.
  • Content A, content B, and content C can be updated at the same time, and one or two of them can be updated.
  • the update information can include updated content A, updated content B, and unupdated content C, or update information It is also possible to include only the updated content A and the updated content B, but not the unupdated content C.
  • the ancillary information may include the time when the target resource is updated, the device name or ID of the updated target resource, the name of the user to which the device updating the target resource belongs, the method of updating the target resource, etc., which are not limited in the embodiment of the present application.
  • the subsidiary information includes at least one of the following information:
  • the user name of the user to which the device of the target resource belongs
  • the update type of the target resource is the update type of the target resource.
  • the device identification (n-deviceid) of the update target resource can be the name, number, physical address, etc. of the device that updates the target resource
  • the user name (n-nickname) of the user to which the device that updates the target resource belongs can be the update target resource
  • the user ID (n-userid) of the user to which the device belongs to update the target resource can be the ID number, mobile phone number, account of the network software, etc. of the user to which the target resource is updated.
  • the update time (n-time) of the resource is the time when the target resource is modified.
  • the update type (n-updatemode) includes local (local) update, remote (remote) update, manual (manul) update, or scene (scene) update.
  • the local update can be to update the target resource through Bluetooth, infrared, WIFI, etc.
  • the remote update can be to update the target resource outside the local area network through the terminal.
  • the user uses 3G, 4G, 5G and other communication methods through the mobile phone to update the target resource.
  • the office updates a certain device resource in the home, or updates a certain resource in the home LAN through the cloud platform; manual updates can be used in scenarios such as door locks and device startup.
  • scene update refers to the update of the target resource due to a scene change, for example, the light intensity caused by the change of the light of the photosensitive lamp The change.
  • n-deviceid is the Device ID of the initiator of the update operation
  • n-time is the update that occurred.
  • n-deviceid is the identity of the cloud platform, n-time is the time when the update occurs, and n-userid is the user ID registered on the cloud platform; if it is a manul operation, n-time is the update occurrence If it is a scene operation, n-time is the time when the update occurred; if it is sent remotely, it must have n-userid, that is, n-userid is the user ID registered on the cloud platform, and n-deviceid is the update operation initiated Party’s DeviceID; if n-nickname can be obtained, it can be filled in in the above 4 update types.
  • the subscribing device when the subscribing device needs to subscribe to resources from the subscription target device, it can send a subscription request to the subscription target device.
  • the subscription request can carry the identifier of the target resource, and the target resource of the subscription request supports the notification
  • the message carries ancillary information.
  • the subscription target device After the subscription target device receives the subscription request, it starts to monitor the status of the target resource. Every time it detects that the target resource has changed, it starts to collect auxiliary information, and generates a first notification message based on the updated information and auxiliary information, and the first notification The message is sent to the subscribing device.
  • S202 Send the first notification message to the subscribing device.
  • the subscription target device after the subscription target device detects the change in the sending of the target resource, it generates the first notification message from the updated information and the auxiliary information of the target resource, and sends the first notification message to the subscribing device so that the user can use the subscription device in time. View the latest news content.
  • the first notification message is generated, and the first notification message is sent to the subscribing device, because the first notification message Including update information and ancillary information, so that the subscription device can not only perceive the change content of the target resource, but also perceive the ancillary information of the target resource change.
  • This ancillary information helps the subscriber to complete a richer scenario, and the subscribing device can follow The ancillary information determines the follow-up operations to meet more user needs.
  • Fig. 3 is a flowchart of a resource subscription method provided by an embodiment.
  • the subject of execution of this method is the subscription device 1 in the scenario shown in Figure 1.
  • This embodiment relates to the subscription device receiving a notification message carrying update information and auxiliary information sent by the subscription target device after sending a subscription request to the subscription target device.
  • the specific implementation process. As shown in Figure 3, the method includes the following steps:
  • the subsidiary information includes at least one of the following information:
  • the user name of the user to which the device of the target resource belongs
  • the update type of the target resource is the update type of the target resource.
  • the update type (n-updatemode) includes local (local) update, remote (remote) update, manual (manul) update, or scene (scene) update.
  • the subscription device after the subscription device sends a subscription request to the subscription target device, it receives the first notification message sent by the target subscription device. Since the first notification message includes update information and auxiliary information, the subscription device can not only perceive The change content of the target resource can also perceive the auxiliary information of the target resource change.
  • the auxiliary information helps the subscriber to complete a richer scenario, and the subscribing device can determine the follow-up operation based on the auxiliary information to meet more user needs .
  • the first notification message carries subsidiary information. Then, during the resource subscription process, both the subscribing device and the subscription target device need to determine whether the target resource supports carrying the subsidiary information in the notification message. Information, when it is determined that the target resource supports carrying auxiliary information in the notification message, the subscription target device can carry the auxiliary information in the notification message when it detects that the target resource changes.
  • the execution subject of the method is the subscription target device.
  • the above resource subscription method may further include the following steps:
  • S401 Determine whether the target resource supports carrying auxiliary information in the notification message.
  • the subscription target device before generating the first notification message, the subscription target device needs to first detect whether the target resource supports carrying auxiliary information in the notification message. If the target resource supports carrying auxiliary information in the notification message, the first notification is generated news. It should be noted that "determining whether the target resource supports carrying ancillary information in the notification message" can be executed after receiving the subscription request, or after dividing each resource, it can be determined whether each resource supports carrying ancillary information in the notification message. The information is executed before the subscription request is received, or it may also be executed when the target resource is monitored to be updated, which is not limited in the embodiment of the present application.
  • the target resource supports carrying auxiliary information in the notification message. It should be noted that the step of "determining whether the target resource supports carrying ancillary information in the notification message" of the subscribing device needs to be performed before sending the subscription request to ensure that the subscribing device needs to perceive the ancillary information, and the subscription supports carrying the ancillary information in the notification message.
  • the target resource for ancillary information is not limited to any one of the target resource supports carrying ancillary information in the notification message.
  • the subscription target device also needs to determine whether the target resource supports subscription.
  • the resource subscription method may further include: determining whether the target resource supports subscription, and whether the target resource supports carrying ancillary information in the notification message; if the target resource supports subscription, and the target resource is supported in the notification message If the auxiliary information is carried, the step of generating the first notification message is executed.
  • the subscription target device when the target resource supports subscription, and the target resource supports carrying auxiliary information in the notification message, after receiving the subscription request from the subscribing device, the subscription target device can generate a carry if it detects that the target resource is updated.
  • the first notification message of the ancillary information For example, the bm attribute value in the p attribute of the target resource is a bitmask type. When the second bit of the bm attribute value is 1, it means that the resource supports subscription; in addition, if the rt attribute of the target resource contains oic.r.nainfo indicates that the notification message of the resource can carry ancillary information.
  • the target resource supports subscription, and whether the target resource supports carrying ancillary information in the notification message; the target resource supports subscription, and the target resource It supports performing corresponding operations when the notification message carries auxiliary information, and determines that the subscribing device can subscribe to the target resource that can carry the auxiliary information in the notification message, ensuring the reliability of resource subscription.
  • the method of "determining whether the target resource supports carrying ancillary information in the notification message" is different.
  • the following describes how to determine whether the target resource supports carrying ancillary information in the notification message in different scenarios.
  • an oic.r.nainfo resource type can be added to the resource information of the target resource, and the resource of the oic.r.nainfo type supports the ancillary information carried in the notification message.
  • oic.r.nainfo appears in the rt attribute of the target resource of this resource type, which means that the target resource is capable of carrying ancillary information in the notification message.
  • determining whether the target resource supports carrying auxiliary information in the notification message includes: if the resource information of the target resource carries the auxiliary information identifier, determining that the target resource supports carrying the auxiliary information in the notification message.
  • each resource has corresponding resource information
  • the device accessory information identifier (oic.r.nainfo) in the resource information can indicate that the resource supports carrying accessory information in the notification message, for example, if the target resource The oic.r.nainfo identifier is included in the rt attribute, which indicates that the target resource supports carrying auxiliary information in the notification message.
  • the method for the subscribing device to determine whether the target resource supports carrying auxiliary information in the notification message is similar to that of the subscribing target device, and will not be repeated here.
  • the resource subscription method provided by the embodiment of this application can add an ancillary information identifier to the resource information of the target resource to indicate that the target resource supports the carrying of ancillary information in the notification message.
  • the method is simple and easy to implement, flexible and convenient, and can ensure that the The ancillary information is sent to the subscribing device along with the update information of the target resource, which helps the subscriber to complete a richer scenario and meet user needs.
  • the notification message for the resource must include auxiliary information, but in actual use, the resource supports carrying auxiliary information in the notification message, and may also need Control or configure whether it is necessary to carry auxiliary information in the notification message.
  • nainfoflag boolean type
  • the subscribing device can modify the nainfoflag attribute to control whether it needs to carry auxiliary information in the notification message of the target resource.
  • For the subscription target device determine whether the target resource supports carrying auxiliary information in the notification message, including: if the resource information of the target resource carries the auxiliary information identifier, and the notification message of the target resource carries the auxiliary information function is enabled, then determine the target The resource supports carrying ancillary information in the notification message.
  • the subscription target device needs to detect whether the resource information of the target resource carries the ancillary information identifier, and whether the notification message of the target resource carries the ancillary information function is enabled, if it is detected that the resource information of the target resource carries the ancillary information Information identification, and if the function of carrying auxiliary information in the notification message of the target resource is enabled, it is determined that the target resource supports carrying auxiliary information in the notification message.
  • the above resource subscription method further includes: receiving a function activation instruction sent by the subscribing device; the function activation instruction is used to instruct the notification of turning on the target resource
  • the message carries the function of ancillary information.
  • the function activation instruction includes an accessory parameter identifier, and if the value of the accessory parameter identifier is the first value, the notification message instructing to activate the target resource carries the accessory information function.
  • the subscribing device when it determines that the notification message for the target resource needs to be turned on, it can send a function enable instruction to the subscription target device to instruct the subscription target device to start the target resource.
  • the notification message carries the auxiliary information.
  • the accessory parameter identifier Nainfoflag
  • the value of Nainfoflag can be configured in the function activation instruction. If the value of the accessory parameter identifier is the first value, the notification message indicating to activate the target resource carries the accessory information function.
  • the first value can be assigned to true, 1, etc., or other assignment methods, and this embodiment is not limited to this.
  • a function shutdown instruction can also be sent to the subscribed target device, for example, the value of the auxiliary parameter identifier is set in addition to the first value in the function shutdown instruction For example, setting the value of the auxiliary parameter identifier to false, 0, etc., is not limited to this in this embodiment.
  • the method further includes: sending a second notification message to the subscribing device; the second notification message includes auxiliary information of the target resource.
  • the function enable instruction sent by the subscribing device causes the value of Nainfoflag to change, which is equivalent to the target resource being updated. Therefore, a second notification message carrying auxiliary information can also be sent to the subscribing device to inform the subscribing device of the target Changes in resources.
  • a function enable instruction can be sent to the subscribing target device to instruct to enable the target The function of carrying auxiliary information in the notification message of the resource.
  • the subscribing device determines that the target resource supports carrying ancillary information in the notification message, and finds that the value of Nainfoflag of the target resource is false, it will send the subscription target device a function enable instruction carrying the value of Nainfoflag to indicate that it is enabled
  • the notification message of the target resource carries the auxiliary information function.
  • the subscribing device can also receive a second notification message sent by the subscribing target device; the second notification message is sent after the subscribing target device turns on the attachment information function of the notification message of the target resource according to the function opening instruction ,
  • the second notification message includes a message of auxiliary information of the target resource.
  • the subscribing device can also flexibly control whether to enable the target resource to carry the auxiliary information in the notification message by setting the value of the auxiliary parameter identifier. Function, adapt to a variety of scenarios.
  • the subscribing device chooses during the subscription process whether it needs to carry subsidiary information in the notification message, and can also control whether it needs to carry subsidiary information in the notification message by setting the value of the subscription identifier in the subscription request.
  • determining whether the target resource supports carrying subsidiary information in the notification message includes: if the value of the subscription identifier of the target resource indicates that the notification message carries subsidiary information, and the resource information of the target resource carries the subsidiary information identifier, then Determine that the target resource supports carrying auxiliary information in the notification message.
  • the subscription target device can detect whether the value of the subscription identifier in the subscription request sent by the subscription device indicates that the notification message carries subsidiary information, and the resource information of the target resource carries the subsidiary information identifier to determine whether the target resource supports Carry ancillary information in the notification message.
  • the value of the subscription identifier (obs) carried in the subscription request is 1, it means that it is a subscription message without auxiliary information in the notification message; if the value of obs is 2 it means that it is a subscription message that needs to carry auxiliary information in the notification message; if If the value of the subscription identifier (obs) carried in the subscription request is 1, and the resource information of the target resource carries the accessory information identifier oic.r.nainfo, it is determined that the target resource supports carrying accessory information in the notification message.
  • the subscription identifier can be assigned in the subscription request, that is, ,
  • the subscription request includes the value of the subscription identifier; the value of the subscription identifier is used to indicate whether to carry subsidiary information in the notification message or cancel the subscription.
  • the value of the subscription identifier is the second value, it indicates that the notification message carries subsidiary information; if the value of the subscription identifier is the third value, it indicates that the notification message does not carry subsidiary information; if the value of the subscription identifier is the first Four values indicate cancellation of subscription.
  • the subscription identifier obs is the identifier header of the subscription message.
  • the subscription request can
  • the subscription identifier is assigned to indicate that the notification message carrying the attached information function of the target resource is turned on. This method allows the device to be flexibly configured according to requirements, and the subscription identifier is assigned in the subscription request, which reduces the signaling overhead.
  • the subscription target device can also perform the following steps:
  • S501 Receive a query request sent by a subscribing device.
  • the subscribing device when it needs to obtain the resource information of the target resource, it may send a query request carrying the target resource identifier to the subscribing target device, and the query request may also include the identifier of the subscribing device.
  • the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the subscription target device when the subscription target device receives the query request sent by the subscribing device, it obtains the target resource identifier therein, finds the resource information of the resource corresponding to the target resource identifier, and sends the resource information in the query response. Subscribe to the device.
  • the resource information includes an accessory information identifier, which is used to indicate that the target resource supports carrying accessory information in the notification message. If there is no accessory information identifier in the resource information, it identifies that the target resource does not support carrying accessory information in the notification message.
  • the subscription device can perform the following steps:
  • S602. Receive a query response sent by the subscription target device; the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the subscribing device can send a query request carrying the target resource identifier to the subscribing target device, and the subscribing target device sends the query response carrying the resource information of the target resource to the subscribing device for the subscription device Whether the target resource supports carrying auxiliary information in the notification message helps the subscribing device obtain the auxiliary information of the changed target resource, and perform subsequent operations based on the auxiliary information to meet user needs.
  • the subscription target device may also send a subscription response to the subscribing device.
  • the subscription target device may also perform this step: after receiving the subscription request sent by the subscribing device, send a subscription response to the subscribing device; the subscription response includes the current value of the attribute of the target resource and preset subsidiary information, and the preset subsidiary The information is empty or a preset default value.
  • the subscribing device can also perform this step: after sending the subscription request to the subscribing target device, receive the subscription response sent by the subscribing target device; the subscription response includes the current value of the attribute of the target resource and preset subsidiary information, and the preset subsidiary The information is empty or a preset default value.
  • the current value of the attribute of the target resource can be added to the subscription response.
  • the subscription response is equivalent to a notification message. Since the current target resource has not been updated,
  • the ancillary information in the subscription response can be set to a null value or set to a default value to ensure the integrity of the notification message.
  • the subscribing device sends a query request to the subscribing target device.
  • the query request carries the resource identifier of the target resource.
  • the subscription target device sends a query response to the subscription device.
  • the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the subscribing device determines whether the target resource supports carrying auxiliary information in the notification message.
  • the subscribing device may send to the subscribing target device a subscription request for requesting to subscribe to support the target resource carrying the auxiliary information in the notification message.
  • the judgment method is that the bm attribute value in the p attribute of the target resource is a bitmask (bit mask) type.
  • bitmask bit mask
  • the second bit of the bm attribute value is 1, it means that subscription is supported; in addition, if the rt attribute of the target resource contains oic.r.nainfo indicates that the notification message of the resource can carry ancillary information.
  • the subscribing device sends a subscription request to the subscription target device.
  • the subscribing device receives the subscription response sent by the subscribing target device.
  • the subscription response includes the current value of the attribute of the target resource and preset auxiliary information
  • the preset auxiliary information is a null value or a preset default value.
  • the target resource is updated.
  • the subscription target device collects the updated subsidiary information of the target resource.
  • the subscription target device sends a notification message to the subscription device.
  • the notification message includes the first notification message including update information and auxiliary information
  • the update information includes the updated content of the target resource or the updated content of the target resource.
  • the resource subscription method provided by the embodiment of this application can add an ancillary information identifier to the resource information of the target resource to indicate that the target resource supports the carrying of ancillary information in the notification message.
  • the method is simple and easy to implement, flexible and convenient, and can ensure that the The ancillary information is sent to the subscribing device along with the update information of the target resource, which helps the subscriber to complete a richer scenario and meet user needs.
  • Figure 8 is an interactive flowchart of a method for subscribing to resources provided by an embodiment. This embodiment involves adding an attribute nainfoflag (boolean type) to the resource information.
  • the subscribing device can modify the nainfoflag attribute to control whether it needs to be in the target resource.
  • the specific implementation process of the ancillary information carried in the notification message includes the following steps:
  • the subscribing device sends a query request to the subscribing target device.
  • the query request carries the resource identifier of the target resource.
  • the subscription target device sends a query response to the subscription device.
  • the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the subscribing device determines whether the target resource supports carrying auxiliary information in the notification message.
  • the subscribing device may send to the subscribing target device a subscription request for requesting to subscribe to support the target resource carrying the auxiliary information in the notification message.
  • the judgment method is that the bm attribute value in the p attribute of the target resource is a bitmask (bit mask) type.
  • bitmask bit mask
  • the second bit of the bm attribute value is 1, it means that subscription is supported; in addition, if the rt attribute of the target resource contains oic.r.nainfo indicates that the notification message of the resource can carry ancillary information.
  • the subscribing device sends a subscription request to the subscription target device.
  • S805 The subscribing device receives the subscription response sent by the subscribing target device.
  • the subscription response includes the current value of the attribute of the target resource and preset auxiliary information
  • the preset auxiliary information is a null value or a preset default value.
  • the subscribing device sends a function activation instruction to the target subscribing device.
  • the function opening instruction is used to instruct to open the target resource notification message carrying auxiliary information function
  • the function opening command includes the auxiliary parameter identifier, and if the value of the auxiliary parameter identifier is the first value, it indicates that the notification message carrying the target resource is enabled.
  • Information function is used to instruct to open the target resource notification message carrying auxiliary information function
  • the subscribing device finds that the value of nainfoflag is false, it needs to enable the function of carrying auxiliary information in the notification message of the target resource; then it sends a function enable instruction carrying the value of Nainfoflag to true to the subscribing target device, instructing to enable the target The function of carrying auxiliary information in the notification message of the resource.
  • the second notification message is sent after the subscription target device starts the auxiliary information carrying function of the notification message of the target resource according to the function activation instruction, and the second notification message includes the message of the auxiliary information of the target resource.
  • the target resource is updated.
  • the subscription target device collects the updated subsidiary information of the target resource.
  • the subscription target device sends a notification message to the subscription device.
  • the notification message includes the first notification message including update information and auxiliary information
  • the update information includes the updated content of the target resource or the updated content of the target resource.
  • the subscribing device can also flexibly control whether to enable the target resource to carry the auxiliary information in the notification message by setting the value of the auxiliary parameter identifier. Function, adapt to a variety of scenarios.
  • Figure 9 is an interactive flow chart of a method for subscribing to resources provided by an embodiment. This embodiment relates to the subscribing device's selection during the subscription process whether it needs to carry subsidiary information in the notification message. You can also set the subscription identifier in the subscription request. Value to control the specific implementation process of whether it is necessary to carry auxiliary information in the notification message. As shown in Figure 9, the method includes the following steps:
  • the subscribing device sends a query request to the subscribing target device.
  • the query request carries the resource identifier of the target resource.
  • the subscription target device sends a query response to the subscription device.
  • the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the subscribing device determines whether the target resource supports carrying auxiliary information in the notification message.
  • the subscribing device may send to the subscribing target device a subscription request for requesting to subscribe to support the target resource carrying the auxiliary information in the notification message.
  • the judgment method is that the bm attribute value in the p attribute of the target resource is a bitmask (bit mask) type.
  • bitmask bit mask
  • the second bit of the bm attribute value is 1, it means that subscription is supported; in addition, if the rt attribute of the target resource contains oic.r.nainfo indicates that the notification message of the resource can carry ancillary information.
  • the subscription device sends a subscription request carrying the value of the subscription identifier to the subscription target device.
  • the subscribing device receives the subscription response sent by the subscribing target device.
  • the subscription response includes the current value of the attribute of the target resource and preset auxiliary information
  • the preset auxiliary information is a null value or a preset default value.
  • the subscription target device collects the updated subsidiary information of the target resource.
  • the subscription target device sends a notification message to the subscription device.
  • the notification message includes the first notification message including update information and auxiliary information
  • the update information includes the updated content of the target resource or the updated content of the target resource.
  • the subscription request can
  • the subscription identifier is assigned to indicate that the notification message carrying the attached information function of the target resource is turned on. This method allows the device to be flexibly configured according to requirements, and the subscription identifier is assigned in the subscription request, which reduces the signaling overhead.
  • steps in the flowcharts of FIGS. 2-9 are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least part of the steps in Figures 2-9 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
  • a resource subscription device including:
  • the generating module 11 is configured to generate a first notification message if the target resource update is monitored after receiving the subscription request sent by the subscribing device; the first notification message includes update information and auxiliary information, and the update information includes the updated target resource The updated content of the content or target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message;
  • the sending module 12 is used to send the first notification message to the subscribing device.
  • the device further includes:
  • the determining module 13 is configured to determine whether the target resource supports carrying auxiliary information in a notification message; if the target resource supports carrying auxiliary information in a notification message, trigger the generating module 11 to execute the first notification message generation A step of.
  • the determining module 13 is configured to determine that the target resource supports carrying the auxiliary information in the notification message if the resource information of the target resource carries the ancillary information identifier.
  • the determining module 13 is configured to determine the target resource if the resource information of the target resource carries the ancillary information identifier, and the notification message of the target resource carries the ancillary information function is enabled, then determine the target The resource supports carrying ancillary information in the notification message.
  • the device further includes:
  • the receiving module 14 is configured to receive a function activation instruction sent by the subscription device; the function activation instruction is used to instruct the notification message for activation of the target resource to carry an ancillary information function.
  • the function activation instruction includes an accessory parameter identifier, and if the value of the accessory parameter identifier is a first value, the notification message for instructing to activate the target resource carries the accessory information function.
  • the sending module 12 is further configured to send a second notification message to the subscription device; the second notification message includes the auxiliary information of the target resource.
  • the determining module 13 is configured to determine if the value of the subscription identifier of the target resource indicates that the notification message carries subsidiary information, and the resource information of the target resource carries the subsidiary information identifier, The target resource supports carrying auxiliary information in the notification message.
  • the subscription request includes the value of the subscription identifier; the value of the subscription identifier is used to indicate whether to carry subsidiary information in the notification message or cancel the subscription.
  • the value of the subscription identifier if the value of the subscription identifier is the second value, it indicates that the notification message carries auxiliary information; if the value of the subscription identifier is the third value, it indicates that the notification message does not carry auxiliary information; if The value of the subscription identifier is the fourth value, which indicates to cancel the subscription.
  • the device further includes:
  • the receiving module 14 is configured to receive a query request sent by the subscription device; the query request carries a target resource identifier;
  • the sending module 12 is further configured to send a query response to the subscription device; the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the auxiliary information includes at least one of the following information:
  • the update type of the target resource is the update type of the target resource.
  • the update type includes local update, remote update, manual update or scene update.
  • the device further includes:
  • the determining module 13 is configured to determine whether the target resource supports subscription, and whether the target resource supports carrying auxiliary information in a notification message; if the target resource supports subscription, and the target resource supports being included in a notification message Carrying auxiliary information triggers the generating module 11 to execute the step of generating the first notification message.
  • the sending module 12 is further configured to send a subscription response to the subscription device after receiving the subscription request sent by the subscription device; the subscription response includes information about the attributes of the target resource The current value and preset auxiliary information, where the preset auxiliary information is a null value or a preset default value.
  • a resource subscription device including: a processing module 21 and a receiving module 22;
  • the processing module 21 is configured to receive a first notification message sent by the target subscription device through the receiving module 22 after sending a subscription request to the subscription target device.
  • the first notification message includes update information and auxiliary information.
  • the update information includes the updated content of the target resource or the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message.
  • the device further includes:
  • the determining module 23 is configured to determine whether the target resource supports carrying ancillary information in the notification message.
  • the determining module 23 is configured to, if the resource information of the target resource carries an accessory information identifier, determine that the target resource supports carrying accessory information in a notification message.
  • the device further includes:
  • the sending module 24 is configured to send a function enable instruction to the target subscription device; the function enable instruction is used to instruct to enable the function of carrying auxiliary information of the notification message of the target resource.
  • the function activation instruction includes an accessory parameter identifier, and if the value of the accessory parameter identifier is a first value, it instructs to enable the function of carrying accessory information of the notification message of the target resource.
  • the receiving module 22 is further configured to receive a second notification message sent by the subscription target device; the second notification message is a notification that the subscription target device starts the target resource according to the function enable instruction After the message carrying the auxiliary information function is sent, the second notification message includes the message of the auxiliary information of the target resource.
  • the subscription request includes the value of the subscription identifier; the value of the subscription identifier is used to indicate whether to carry subsidiary information in the notification message or cancel the subscription.
  • the value of the subscription identifier is the second value, it indicates that the notification message carries subsidiary information
  • the value of the subscription identifier is the third value, it indicates that the notification message does not carry auxiliary information
  • the value of the subscription identifier is the fourth value, it is instructed to cancel the subscription.
  • the device further includes:
  • the sending module 24 is configured to send a query request to the subscription target device; the query request carries a target resource identifier;
  • the receiving module 22 is further configured to receive a query response sent by the subscription target device; the query response includes resource information of the target resource corresponding to the target resource identifier.
  • the auxiliary information includes at least one of the following information:
  • the update type of the target resource is the update type of the target resource.
  • the update type includes local update, remote update, manual update or scene update.
  • the device further includes:
  • the determining module 23 is configured to determine whether the target resource supports subscription, and whether the target resource supports carrying ancillary information in a notification message; if the target resource supports subscription, and the target resource supports being included in the notification message If the auxiliary information is carried, the subscription request is sent to the subscription target device of the trigger sending module 24.
  • the resource subscription device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • Each module in the above-mentioned resource subscription device can be implemented in whole or in part by software, hardware and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a subscription target device, and its internal structure diagram may be as shown in FIG. 14.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store resource subscription data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a resource subscription method.
  • a computer device is provided.
  • the computer device may be a subscription device, and its internal structure diagram may be as shown in FIG. 15.
  • the computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a resource subscription method.
  • the display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, trackball or touch pad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
  • FIG. 14 and FIG. 15 are only block diagrams of part of the structure related to the solution of the present application, and do not constitute a limitation on the computer equipment to which the solution of the present application is applied.
  • the computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.
  • a computer device including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when the processor executes the computer program:
  • a first notification message is generated; the first notification message includes update information and auxiliary information, and the update information includes the content or content of the updated target resource.
  • the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message;
  • a computer device including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when the processor executes the computer program:
  • a first notification message sent by the target subscription device is received.
  • the first notification message includes update information and auxiliary information, and the update information includes the content or all of the updated target resource.
  • the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • a first notification message is generated; the first notification message includes update information and auxiliary information, and the update information includes the content or content of the updated target resource.
  • the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message;
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • a first notification message sent by the target subscription device is received.
  • the first notification message includes update information and auxiliary information, and the update information includes the content or all of the updated target resource.
  • the updated content of the target resource; the subscription request is used to request to subscribe to support the target resource that carries subsidiary information in the notification message.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请涉及一种资源订阅方法、装置、计算机设备和存储介质,该方法包括:在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;将所述第一通知消息发送给所述订阅设备,该附属信息有助于订阅方完成更丰富的场景,并且,订阅设备可以根据附属信息确定后续操作,以满足更多的用户需求。

Description

资源订阅方法、装置、计算机设备和存储介质 技术领域
本申请涉及通信领域,特别是涉及一种资源订阅方法、装置、计算机设备和存储介质。
背景技术
随着技术的发展,物联网以及智能家居应用逐渐进入人们的生活之中。用户可以通过终端上的应用(Application,APP)向新闻提供商设备订阅喜欢的新闻主题(例如体育、明星等),当上述主题的新闻发生更新时,新闻提供商设备就会向用户的APP推送对应的新闻消息,以供用户可以及时的阅读该消息,这就是最“典型”的订阅场景。
现有技术中,用户端向订阅服务器发送订阅请求,订阅服务器对该订阅请求认证通过后,开始监测该订阅请求订阅的消息是否更新,当检测到该订阅请求订阅的消息更新时,将更新后的消息内容发送给用户端。
申请内容
基于此,有必要提供一种资源订阅方法、装置、计算机设备和存储介质。
第一方面,本申请的实施例提供一种资源订阅方法,所述方法包括:
在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
将所述第一通知消息发送给所述订阅设备。
在一个实施例中,所述方法还包括:
确定所述目标资源是否支持在通知消息中携带附属信息;
若所述目标资源支持在通知消息中携带附属信息,则执行所述生成第一通知消息的步骤。
在一个实施例中,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
若所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
若所述目标资源的资源信息中携带附属信息标识,且,所述目标资源的通知消息中携带附属信息功能被开启,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,所述方法还包括:
接收所述订阅设备发送的功能开启指令;所述功能开启指令用于指示开启所述目标资源的通知消息中携带附属信息功能。
在一个实施例中,所述功能开启指令包括附属参数标识,若所述附属参数标识的值为第一值,则指示开启所述目标资源的通知消息中携带附属信息功能。
在一个实施例中,所述接收所述订阅设备发送的功能开启指令之后,还包括:
向所述订阅设备发送第二通知消息;所述第二通知消息包括所述目标资源的附属信息。
在一个实施例中,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
若所述目标资源的订阅标识的值指示通知消息中携带附属信息,且,所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,所述订阅请求包括所述订阅标识的值;所述订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
在一个实施例中,若所述订阅标识的值为第二值,则指示通知消息中携带附属信息;
若所述订阅标识的值为第三值,则指示通知消息中不携带附属信息;
若所述订阅标识的值为第四值,则指示取消订阅。
在一个实施例中,所述方法还包括:
接收所述订阅设备发送的查询请求;所述查询请求携带目标资源标识;
向所述订阅设备发送查询响应;所述查询响应中包括所述目标资源标识对应的目标资源的资源信息。
在一个实施例中,所述附属信息包括以下信息中的至少一个:所述目标资源的资源接口信息;更新所述目标资源的设备标识;更新所述目标资源的设备所属用户的用户名;更新所述目标资源的设备所属用户的用户标识ID;所述目标资源的更新时间;所述目标资源的更新类型。
在一个实施例中,所述更新类型包括本地更新、远程更新、手动更新或场景更新。
在一个实施例中,所述方法还包括:
确定所述目标资源是否支持订阅,以及,所述目标资源是否支持在通知消息中携带附属信息;
若所述目标资源支持订阅,且,所述目标资源支持在通知消息中携带附属信息,则执行所述生成第一通知消息的步骤。
在一个实施例中,所述方法还包括:
在接收所述订阅设备发送的所述订阅请求之后,向所述订阅设备发送订阅响应;所述订阅响应中包括所述目标资源的属性的当前值和预设附属信息,所述预设附属信息为空值或者预设的默认值。
第二方面,本申请的实施例提供一种资源订阅方法,所述方法包括:
在向订阅目标设备发送订阅请求之后,接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
在一个实施例中,所述方法还包括:
确定所述目标资源是否支持在通知消息中携带附属信息。
在一个实施例中,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
若所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,所述方法还包括:
向所述目标订阅设备发送功能开启指令;所述功能开启指令用于指示开启所述目标资源的通知消息的携带附属信息功能。
在一个实施例中,所述功能开启指令包括附属参数标识,若所述附属参数标识的值为第一值,则指示开启所述目标资源的通知消息的携带附属信息功能。
在一个实施例中,所述方法还包括:
接收所述订阅目标设备发送的第二通知消息;所述第二通知消息为所述订阅目标设备根据所述功能开启指令开启所述目标资源的通知消息的携带附属信息功能之后发送的,所述第二通知消息包括所述目标资源的附属信息的消息。
在一个实施例中,所述订阅请求包括订阅标识的值;所述订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
在一个实施例中,若所述订阅标识的值为第二值,则指示通知消息中携带附属信息;
若所述订阅标识的值为第三值,则指示通知消息中不携带附属信息;
若所述订阅标识的值为第四值,则指示取消订阅。
在一个实施例中,所述方法还包括:
向所述订阅目标设备发送查询请求;所述查询请求携带目标资源标识;
接收所述订阅目标设备发送的查询响应;所述查询响应中包括所述目标资源标识对应的目标资源的资源信息。
在一个实施例中,所述附属信息包括以下信息中的至少一个:所述目标资源的资源接口信息;更新所述目标资源的设备标识;更新所述目标资源的设备所属用户的用户名;更新所述目标资源的设备所属用户的用户ID;所述目标资源的更新时间;所述目标资源的更新类型。
在一个实施例中,所述更新类型包括本地更新、远程更新、手动更新或场景更新。
在一个实施例中,所述方法还包括:
确定所述目标资源是否支持订阅,以及,所述目标资源是否支持在通知消息中携带附属信息;
若所述目标资源支持订阅,且,所述目标资源支持在通知消息中携带附属信息,则向所述订阅目标设备发送所述订阅请求。
在一个实施例中,所述方法还包括:
在向所述订阅目标设备发送所述订阅请求之后,接收所述订阅目标设备发送的订阅响应;所述订阅响应中包括所述目标资源的属性的当前值和预设附属信息,所述预设附属信息为空值或者预设的默认值。
第三方面,本申请实施例提供一种资源订阅装置,所述装置包括:
生成模块,用于在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
发送模块,用于将所述第一通知消息发送给所述订阅设备。
第四方面,本申请实施例提供一种资源订阅装置,所述装置包括:处理模块和接收模块;
所述处理模块用于在向订阅目标设备发送订阅请求之后,通过所述接收模块接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
第五方面,本申请实施例提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现第一方面中任一项所述方法的步骤。
第六方面,本申请实施例提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现第二方面中任一项所述方法的步骤。
第七方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面中任一项所述的方法的步骤。
第八方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现第二方面中任一项所述的方法的步骤。
本申请实施例提供的资源订阅方法、装置、计算机设备和存储介质,在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息,并将第一通知消息发送给订阅设备,由于第一通知消息包括更新信息和附属信息,使得订阅设备不仅能感知目标资源的变化内容,还可以感知到目标资源变化的附属信息,该附属信息有助于订阅方完成更丰富的场景,并且,订阅设备可以根据附属信息确定后续操作,以满足更多的用户需求。
附图说明
图1为本申请实施例提供的一种资源订阅方法的应用场景示意图;
图2为一个实施例提供的一种资源订阅方法的流程图;
图3为一个实施例提供的一种资源订阅方法的流程图;
图4为一个实施例提供的一种资源订阅方法的流程图;
图5为一个实施例提供的一种资源订阅方法的流程图;
图6为一个实施例提供的一种资源订阅方法的流程图;
图7为一个实施例提供的订阅资源方法的交互流程图;
图8为一个实施例提供的订阅资源方法的交互流程图;
图9为一个实施例提供的订阅资源方法的交互流程图;
图10为一个实施例提供的订阅资源装置的框图;
图11为一个实施例提供的订阅资源装置的框图;
图12为一个实施例提供的订阅资源装置的框图;
图13为一个实施例提供的订阅资源装置的框图;
图14为一个实施例提供的计算机设备的框图;
图15为一个实施例提供的计算机设备的框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
图1为本申请实施例提供的一种资源订阅方法的应用场景示意图。如图1所示,该场景中包括订阅设备1和订阅目标设备2,订阅设备1和订阅目标设备2之间通过网络进行数据传输,订阅设备1可以向订阅目标设备2订阅所需的资源,例如,订阅设备1可以向订阅目标设备2订阅新闻、广告等。其中,订阅设备1可以为手机、电脑、iPad、游戏机、手持终端等终端,订阅目标设备2可以为终端设备、服务器、云平台、服务器集群等,本申请实施例中不以此为限。
在当前的技术架构下,订阅设备只能向订阅目标设备获取目标资源变化后的值,而在现实场景中订阅设备(用户)可能需要感知一些关于目标资源被修改的附属信息,例如:谁在什么时候通过什么方法修改了目标资源,因此,现有的资源订阅方法难以满足越来越多用户的需求。故,本方案的解决的技术问题就是在当前的通知消息中如何携带这些附属信息。需要说明的是,本申请实施例提供的资源订阅方法还可以用来解决其它技术问题,并不以此为限。
图2为一个实施例提供的一种资源订阅方法的流程图。该方法的执行主体为图1所示场景中的订阅目标设备2,本实施例涉及的是订阅目标设备在监测到订阅设备订阅的目标资源发生变化时,向订阅设备发送携带更新信息和附属信息的通知消息的具体实现过程。如图2所示,该方法包括以下步骤:
S201、在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;第一通知消息包括更新信息和附属信息,更新信息包括更新后的目标资源的内容或目标资源的更新内容;订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
其中,订阅请求中可以包括目标资源的标识、订阅设备的标识、用于完成请求和应答的绑定的请求标识、操作类型、订阅标识等。目标资源更新可以是目标资源的部分内容被更新,也可以是目标资源的全部内容被更新,本申请实施例中不加以限制。更新信息可以包括更新后的目标资源的内容或目标资源的更新内容,其中,更新后的目标资源的内容指的是更新后的目标资源中被更新和没有被更新的所有内容,目标资源的更新内容指的是目标资源中被更新过过的内容,例如,目标资源包括内容A、内容B和内容C,内容A、内容B和内容C可以同时被更新,可以是其中的一两项被更新,比如,目标资源中的内容A和内容B被更新,内容C没有被更新,则更新信息中可以包括更新后的内容A、更新后的内容B和未被更新的内容C,或者,更新信息中也可以只包括更新后的内容A、更新后的内容B,而不包括未被更新的内容C。附属信息中可以包括目标资源被更新的时间、更新目标资源的设备名称或者ID、更新目标资源的设备所属用户的名称、更新目标资源的方式等,本申请实施例中不加以限制。
可选地,附属信息包括以下信息中的至少一个:
目标资源的资源接口信息;
更新目标资源的设备标识;
更新目标资源的设备所属用户的用户名;
更新目标资源的设备所属用户的用户ID;
目标资源的更新时间;
目标资源的更新类型。
其中,更新目标资源的设备标识(n-deviceid)可以是更新目标资源的设备的名称、编号、物理地址等,更新目标资源的设备所属用户的用户名(n-nickname)可以是更新目标资源的设备所属用户的姓 名、代码、昵称等,更新目标资源的设备所属用户的用户ID(n-userid)可以是更新目标资源的设备所属用户的身份证号码、手机号码、网络软件的账号等,目标资源的更新时间(n-time)为目标资源被修改的时间。
进一步地,更新类型(n-updatemode)包括本地(local)更新、远程(remote)更新、手动(manul)更新或场景(scene)更新。其中,本地更新可以是通过蓝牙、红外线、WIFI等方式对目标资源进行更新;远程更新可以是通过终端在局域网外对目标资源进行更新,例如,用户通过手机使用3G、4G、5G等通信方式在办公室对家庭中某个设备资源进行更新,或者,通过云平台对家庭局域网中的某个资源进行更新等;手动更新可以用于门锁、设备启动等场景中,例如,用户通过指纹识别开锁、启动设备,或者,通过钥匙开门等操作来改变门锁、设备等资源的状态;场景更新指的是由于场景变换使得目标资源被更新,例如,感光照明灯随着光线的改变而引起的灯光强度的变化。上述实施例仅是距离说明各种更新类型,本申请实施例中并不以此为限。
需要说明的是,在一些场景中,不同的更新类型也会引起其它附属信息的变化,例如,如果是local操作,则n-deviceid为更新操作发起方的Device ID,n-time是更新发生的时间;如果是remote操作,则n-deviceid为云平台的标识,n-time是更新发生的时间,n-userid为在云平台上注册的用户ID;如果是manul操作则n-time是更新发生的时间;如果是scene操作则n-time是更新发生的时间;如果是远程发送则必须有n-userid,也即n-userid为在云平台上注册的用户ID,n-deviceid为更新操作发起方的DeviceID;对于n-nickname如果能够获取到,则在上述4种更新类型中都可以填写。
在本实施例中,当订阅设备需要向订阅目标设备订阅资源时,可以向订阅目标设备发送订阅请求,该订阅请求中可以携带目标资源的标识,并且,该订阅请求订阅的目标资源支持在通知消息中携带附属信息。订阅目标设备接收到该订阅请求之后,开始监测目标资源的状态,每次监测到目标资源发生了变化时,开始收集附属信息,并根据更新信息和附属信息生成第一通知消息,将第一通知消息发送给订阅设备。
S202、将第一通知消息发送给订阅设备。
在本实施例中,订阅目标设备监测到目标资源发送变化之后,将更新信息和目标资源的附属信息生成第一通知消息,并将第一通知消息发送给订阅设备,以供用户通过订阅设备及时查看到最新的消息内容。
本申请实施例提供的资源订阅方法,在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息,并将第一通知消息发送给订阅设备,由于第一通知消息包括更新信息和附属信息,使得订阅设备不仅能感知目标资源的变化内容,还可以感知到目标资源变化的附属信息,该附属信息有助于订阅方完成更丰富的场景,并且,订阅设备可以根据附属信息确定后续操作,以满足更多的用户需求。
图3为一个实施例提供的一种资源订阅方法的流程图。该方法的执行主体为图1所示场景中的订阅设备1,本实施例涉及的是订阅设备在向订阅目标设备发送订阅请求之后,接收订阅目标设备发送的携带更新信息和附属信息的通知消息的具体实现过程。如图3所示,该方法包括以下步骤:
S301、在向订阅目标设备发送订阅请求之后,接收目标订阅设备发送的第一通知消息,第一通知消息包括更新信息和附属信息,更新信息包括更新后的目标资源的内容或目标资源的更新内容;订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
可选地,附属信息包括以下信息中的至少一个:
目标资源的资源接口信息;
更新目标资源的设备标识;
更新目标资源的设备所属用户的用户名;
更新目标资源的设备所属用户的用户ID;
目标资源的更新时间;
目标资源的更新类型。
进一步地,更新类型(n-updatemode)包括本地(local)更新、远程(remote)更新、手动(manul)更新或场景(scene)更新。
本申请实施例的实现原理可参见图2所示实施例的实现原理,此处不再赘述。
本申请实施例提供的资源订阅方法,订阅设备向订阅目标设备发送订阅请求之后,接收目标订阅设备发送的第一通知消息,由于第一通知消息包括更新信息和附属信息,使得订阅设备不仅能感知目标资源的变化内容,还可以感知到目标资源变化的附属信息,该附属信息有助于订阅方完成更丰富的场景,并且,订阅设备可以根据附属信息确定后续操作,以满足更多的用户需求。
在图2和图3所示实施例的基础上,第一通知消息中携带附属信息,那么,在资源订阅过程中,订阅设备和订阅目标设备均需要确定目标资源是否支持在通知消息中携带附属信息,当确定目标资源支持在通知消息中携带附属信息时,订阅目标设备在监测到该目标资源发生变化时,可以在通知消息中携带附属信息。
可选地,如图4所示,该方法的执行主体为订阅目标设备,如图4所示,上述资源订阅方法还可以包括以下步骤:
S401、确定目标资源是否支持在通知消息中携带附属信息。
S402、若目标资源支持在通知消息中携带支持附属信息,则执行生成第一通知消息的步骤。
在本实施例中,生成第一通知消息之前,订阅目标设备需要先检测目标资源是否支持在通知消息中携带附属信息,若该目标资源支持在通知消息中携带支持附属信息,则生成第一通知消息。需要说明的是,“确定目标资源是否支持在通知消息中携带附属信息”可以是在接收到订阅请求之后执行,也可以是在划分好各个资源之后就确定各个资源是否支持在通知消息中携带附属信息,也即是在接收到订阅请求之前执行,或者,也可以是在监测到目标资源更新时执行,本申请实施例中并不加以限制。
相应的,对于订阅设备,也可以在资源订阅过程中确定目标资源是否支持在通知消息中携带附属信息。需要说明的是,订阅设备“确定目标资源是否支持在通知消息中携带附属信息”的步骤需要在发送订阅请求之前来执行,以确保订阅设备在需要感知附属信息时,订阅支持在通知消息中携带附属信息的目标资源。
进一步地,订阅目标设备还需要确定目标资源是否支持订阅。则对于订阅目标设备,该资源订阅方法还可以包括:确定目标资源是否支持订阅,以及,目标资源是否支持在通知消息中携带附属信息;若目标资源支持订阅,且,目标资源支持在通知消息中携带附属信息,则执行生成第一通知消息的步骤。
在本实施例中,当目标资源支持订阅,且,目标资源支持在通知消息中携带附属信息时,订阅目标设备在收到订阅设备的订阅请求之后,若监测到目标资源更新,则可以生成携带附属信息的第一通知消息。例如,目标资源的p属性中的bm属性值是一个位掩码(bitmask)类型,当bm属性值的第二位是1时表示该资源支持订阅;另外在目标资源的rt属性中如果包含了oic.r.nainfo则表示该资源的通知消息可以携带附属信息。
同理,对于订阅设备,也需要确定目标资源是否支持订阅,以及,目标资源是否支持在通知消息中携带附属信息;若目标资源支持订阅,且,目标资源支持在通知消息中携带附属信息,则向订阅目标设备发送订阅请求。其实现原理与订阅目标设备类似,此处不再赘述。
本实施例提供的资源订阅方法,对于订阅设备和订阅目标设备,均需要确定目标资源是否支持订阅,以及,目标资源是否支持在通知消息中携带附属信息;在目标资源支持订阅,且,目标资源支持在通知消息中携带附属信息时执行相应的操作,确定订阅设备可以订阅到能在通知消息中携带附属信息的目标资源,保证了资源订阅的可靠性。
不同的场景下,“确定目标资源是否支持在通知消息中携带附属信息”的方式也不相同,下面分多个方案分别描述不同场景下如何确定目标资源是否支持在通知消息中携带附属信息。
方案一
本实施例中,可以在目标资源的资源信息中添加一个oic.r.nainfo资源类型,该oic.r.nainfo类型的资源支持在通知消息中携带的附属信息。例如,该资源类型的目标资源的rt属性中出现oic.r.nainfo,意 味着该目标资源有能力在通知消息中携带附属信息。
对于订阅目标设备,确定目标资源是否支持在通知消息中携带附属信息,包括:若目标资源的资源信息中携带附属信息标识,则确定目标资源支持在通知消息中携带附属信息。
在本实施例中,每个资源都有相应的资源信息,可以在资源信息中设备附属信息标识(oic.r.nainfo)来表示该资源支持在通知消息中携带附属信息,例如,若目标资源的rt属性中包括oic.r.nainfo标识,则表示该目标资源支持在通知消息中携带附属信息。
在本实施例中,订阅设备确定目标资源是否支持在通知消息中携带附属信息的方法和订阅目标设备类似,此处不再赘述。
本申请实施例提供的资源订阅方法,可以在目标资源的资源信息中添加一个附属信息标识,用来表示目标资源支持在通知消息中携带附属信息,该方法简单易行,灵活方便,可以保证将附属信息随同目标资源的更新信息一起发送给订阅设备,有助于订阅方完成更丰富的场景,满足用户需求。
方案二
在方案一中只要目标资源的资源类型包含oic.r.nainfo则针对该资源的通知消息中必定包含附属信息,但是在实际的使用过程中该资源支持在通知消息中携带附属信息,还可能需要控制或者配置是否需要在通知消息中携带附属信息。方案二与方案一的区别就是在资源中增加一个属性nainfoflag(boolean类型),订阅设备可以通过修改该nainfoflag属性来控制是否需要在目标资源的通知消息中携带附属信息。
对于订阅目标设备,确定目标资源是否支持在通知消息中携带附属信息,包括:若目标资源的资源信息中携带附属信息标识,且,目标资源的通知消息中携带附属信息功能被开启,则确定目标资源支持在通知消息中携带附属信息。
在本实施例中,订阅目标设备需要检测目标资源的资源信息中是否携带附属信息标识,且,目标资源的通知消息中携带附属信息功能是否被开启,若检测到目标资源的资源信息中携带附属信息标识,且,目标资源的通知消息中携带附属信息功能被开启,则确定目标资源支持在通知消息中携带附属信息。
其中,该目标资源的通知消息中携带附属信息功能是否被开启由订阅设备来控制,则上述资源订阅方法还包括:接收订阅设备发送的功能开启指令;功能开启指令用于指示开启目标资源的通知消息的中携带附属信息功能。可选地,功能开启指令包括附属参数标识,若附属参数标识的值为第一值,则指示开启目标资源的通知消息中携带附属信息功能。
在本实施例中,当订阅设备确定需要开启目标资源的通知消息的中携带附属信息功能时,可以向订阅目标设备发送功能开启指令,指示订阅目标设备开启目标资源的通知消息的中携带附属信息功能。例如,可以在功能开启指令中配置附属参数标识(Nainfoflag)以及Nainfoflag的值,若附属参数标识的值为第一值,则指示开启目标资源的通知消息中携带附属信息功能。可选地,该第一值可以为true、1等赋值,也可以是其它的赋值方式,本实施例中不以此为限。可选地,当不需要开启目标资源的通知消息的中携带附属信息功能时,还可以向订阅目标设备发送功能关闭指令,例如,在功能关闭指令将附属参数标识的值设置为除第一值之外的其它值,比如,将附属参数标识的值设置为false、0等,本实施例中不以此为限。
进一步地,接收订阅设备发送的功能开启指令之后,还包括:向订阅设备发送第二通知消息;第二通知消息包括目标资源的附属信息。
在本实施例中,订阅设备发送的功能开启指令导致Nainfoflag的值发生变化,也相当于目标资源被更新,因此,还可以向订阅设备发送携带附属信息的第二通知消息,以告知订阅设备目标资源的变化情况。
相应的,对于订阅设备,在确定了目标资源支持在通知消息中携带附属信息后,若需要开启目标资源的通知消息的携带附属信息功能,则可以向订阅目标设备发送功能开启指令,指示开启目标资源的通知消息的携带附属信息功能。例如,若订阅设备,在确定了目标资源支持在通知消息中携带附属信息后,发现目标资源的Nainfoflag的值为false,则向订阅目标设备发送携带Nainfoflag的值为true的功能开启 指令,指示开启目标资源的通知消息的携带附属信息功能。
进一步地,订阅设备发送功能开启指令之后,还可以接收订阅目标设备发送的第二通知消息;第二通知消息为订阅目标设备根据功能开启指令开启目标资源的通知消息的携带附属信息功能之后发送的,第二通知消息包括目标资源的附属信息的消息。
本申请实施例提供的资源订阅方法,在确定目标资源支持在通知消息中携带附属信息后,订阅设备还可以通过设置附属参数标识的值的方式灵活控制是否开启目标资源的通知消息中携带附属信息功能,适应多种场景。
方案三
订阅设备在订阅过程中进行选择是否需要在通知消息中携带附属信息,还可以通过设置订阅请求中订阅标识的值来控制是否需要在通知消息中携带附属信息。
对于订阅目标设备,确定目标资源是否支持在通知消息中携带附属信息,包括:若目标资源的订阅标识的值指示通知消息中携带附属信息,且,目标资源的资源信息中携带附属信息标识,则确定目标资源支持在通知消息中携带附属信息。
在本实施例中,订阅目标设备可以检测订阅设备发送的订阅请求中订阅标识的值是否指示通知消息中携带附属信息,且,目标资源的资源信息中携带附属信息标识,以确定目标资源是否支持在通知消息中携带附属信息。例如,在订阅请求中如果携带的订阅标识(obs)的值为1表示是通知消息中不带附属信息的订阅消息;obs的值为2表示是通知消息中需携带附属信息的订阅消息;若订阅请求中如果携带的订阅标识(obs)的值为1,且,目标资源的资源信息中携带附属信息标识oic.r.nainfo,则确定目标资源支持在通知消息中携带附属信息。
对于订阅设备,当订阅设备确定目标资源的资源信息中携带附属信息标识oic.r.nainfo,需要开启目标资源的通知消息的携带附属信息功能时,可以在订阅请求中对订阅标识赋值,也即,订阅请求包括订阅标识的值;订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
可选地,若订阅标识的值为第二值,则指示通知消息中携带附属信息;若订阅标识的值为第三值,则指示通知消息中不携带附属信息;若订阅标识的值为第四值,则指示取消订阅。
在本实施例中,订阅标识obs就是订阅消息的标识header。本方案扩展obs参数的值;当obs=0时为普通订阅(不带附属信息),obs=1时为取消订阅,obs=2时为通知消息需要携带附属信息的订阅。Obs也可以采用其它的赋值方式,本申请实施例中并不以此为限。
本申请实施例提供的资源订阅方法,当订阅设备确定目标资源的资源信息中携带附属信息标识oic.r.nainfo,需要开启目标资源的通知消息的携带附属信息功能时,可以在订阅请求中对订阅标识赋值,来指示开启目标资源的通知消息的携带附属信息功能,该方法可设备可以根据需求灵活的配置,且,在订阅请求中对订阅标识赋值,减少了信令开销。
在上述方案一、方案二、方案三种多次用到了的目标资源的资源信息,订阅目标设备侧存储了每个资源的资源信息,订阅设备则需要向订阅目标设备获取目标资源的资源信息。如图5所示,订阅目标设备还可以执行以下步骤:
S501、接收订阅设备发送的查询请求。
在本实施例中,订阅设备需要获取目标资源的资源信息时,可以向订阅目标设备发送携带目标资源标识的查询请求,该查询请求中还可以包括订阅设备的标识。
S502、向订阅设备发送查询响应;查询响应中包括目标资源标识对应的目标资源的资源信息。
在本实施例中,订阅目标设备接收到订阅设备发送的查询请求时,获取其中的目标资源标识,查找到该目标资源标识对应的资源的资源信息,将该资源信息携带在查询响应中发送给订阅设备。该资源信息中包括附属信息标识,用于指示该目标资源支持在通知消息中携带附属信息,若该资源信息中没有附属信息标识,则标识该目标资源不支持在通知消息中携带附属信息。
相应的,如图6所示,订阅设备可以执行以下步骤:
S601、向订阅目标设备发送查询请求;查询请求携带目标资源标识。
S602、接收订阅目标设备发送的查询响应;查询响应中包括目标资源标识对应的目标资源的资源信息。
图6所示实施例的实现原理和图5所示实施例的时限原理类似,此处不再赘述。
图5和图6所示的资源订阅方法,订阅设备可以向订阅目标设备发送携带目标资源标识的查询请求,订阅目标设备将携带目标资源的资源信息的查询响应发送给订阅设备,以供订阅设备确实目标资源是否支持在通知消息中携带附属信息,有助于订阅设备获取到变化的目标资源的附属信息,依据该附属信息执行后续的操作,满足用户需求。
在上述实施例的基础上,订阅设备发送订阅请求之后,订阅目标设备还可以向订阅设备发送订阅响应。可选地,订阅目标设备还可以执行该步骤:在接收订阅设备发送的订阅请求之后,向订阅设备发送订阅响应;订阅响应中包括目标资源的属性的当前值和预设附属信息,预设附属信息为空值或者预设的默认值。
相应的,订阅设备还可以执行该步骤:在向订阅目标设备发送订阅请求之后,接收订阅目标设备发送的订阅响应;订阅响应中包括目标资源的属性的当前值和预设附属信息,预设附属信息为空值或者预设的默认值。
在本实施例中,当订阅目标设备接收到订阅设备发送的订阅请求之后,可以在订阅响应中添加目标资源的属性的当前值,该订阅响应相当于通知消息,由于当前目标资源还没有更新,对于附属信息来说,订阅响应中的附属信息可以设置为空值,或者是设置为默认值,以保证通知消息的完整性。
图7为一个实施例提供的订阅资源方法的交互流程图,该实施例涉及的是在目标资源的资源信息中添加一个附属信息标识oic.r.nainfo,来指示该目标资源支持在通知消息中携带的附属信息的具体实现过程。如图7所示,该方法包括以下步骤:
S701、订阅设备向订阅目标设备发送查询请求。
其中,所述查询请求中携带目标资源的资源标识。
S702、订阅目标设备向订阅设备发送查询响应。
其中,查询响应中包括目标资源标识对应的目标资源的资源信息。
S703、订阅设备判定目标资源是否支持在通知消息中携带附属信息。
在本实施例中,若订阅设备判定目标资源支持在通知消息中携带附属信息,则可以向订阅目标设备发送用于请求订阅支持在通知消息中携带附属信息的目标资源的订阅请求。判断的方法为目标资源的p属性中的bm属性值是一个bitmask(位掩码)类型,当bm属性值的第二位是1时表示支持订阅;另外在目标资源的rt属性中如果包含了oic.r.nainfo则表示该资源的通知消息可以携带附属信息。
S704、订阅设备向订阅目标设备发送订阅请求。
S705、订阅设备接收订阅目标设备发送的订阅响应。
其中,订阅响应中包括目标资源的属性的当前值和预设附属信息,预设附属信息为空值或者预设的默认值。
S706、目标资源被更新。
S707、订阅目标设备收集目标资源被更新的附属信息。
S708、订阅目标设备向订阅设备发送通知消息。
其中,通知消息中包括第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容。
本申请实施例提供的资源订阅方法,可以在目标资源的资源信息中添加一个附属信息标识,用来表示目标资源支持在通知消息中携带附属信息,该方法简单易行,灵活方便,可以保证将附属信息随同目标资源的更新信息一起发送给订阅设备,有助于订阅方完成更丰富的场景,满足用户需求。
图8为一个实施例提供的订阅资源方法的交互流程图,该实施例涉及的是在资源信息中增加一个属性nainfoflag(boolean类型),订阅设备可以通过修改该nainfoflag属性来控制是否需要在目标资源的通知消息中携带附属信息的具体实现过程。如图8所示,该方法包括以下步骤:
S801、订阅设备向订阅目标设备发送查询请求。
其中,所述查询请求中携带目标资源的资源标识。
S802、订阅目标设备向订阅设备发送查询响应。
其中,查询响应中包括目标资源标识对应的目标资源的资源信息。
S803、订阅设备判定目标资源是否支持在通知消息中携带附属信息。
在本实施例中,若订阅设备判定目标资源支持在通知消息中携带附属信息,则可以向订阅目标设备发送用于请求订阅支持在通知消息中携带附属信息的目标资源的订阅请求。判断的方法为目标资源的p属性中的bm属性值是一个bitmask(位掩码)类型,当bm属性值的第二位是1时表示支持订阅;另外在目标资源的rt属性中如果包含了oic.r.nainfo则表示该资源的通知消息可以携带附属信息。
S804、订阅设备向订阅目标设备发送订阅请求。
S805、订阅设备接收订阅目标设备发送的订阅响应。
其中,订阅响应中包括目标资源的属性的当前值和预设附属信息,预设附属信息为空值或者预设的默认值。
S806、订阅设备向目标订阅设备发送功能开启指令。
其中,功能开启指令用于指示开启目标资源的通知消息的携带附属信息功能,功能开启指令包括附属参数标识,若附属参数标识的值为第一值,则指示开启目标资源的通知消息的携带附属信息功能。
在本实施例中,如果订阅设备发现nainfoflag的值为false,则需要开启目标资源的通知消息的携带附属信息功能;则向订阅目标设备发送携带Nainfoflag的值为true的功能开启指令,指示开启目标资源的通知消息的携带附属信息功能。
S807、订阅目标设备向订阅设备发送第二通知消息。
其中,第二通知消息为订阅目标设备根据功能开启指令开启目标资源的通知消息的携带附属信息功能之后发送的,第二通知消息包括目标资源的附属信息的消息。
S808、目标资源被更新。
S809、订阅目标设备收集目标资源被更新的附属信息。
S810、订阅目标设备向订阅设备发送通知消息。
其中,通知消息中包括第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容。
本申请实施例提供的资源订阅方法,在确定目标资源支持在通知消息中携带附属信息后,订阅设备还可以通过设置附属参数标识的值的方式灵活控制是否开启目标资源的通知消息中携带附属信息功能,适应多种场景。
图9为一个实施例提供的订阅资源方法的交互流程图,该实施例涉及的是订阅设备在订阅过程中进行选择是否需要在通知消息中携带附属信息,还可以通过设置订阅请求中订阅标识的值来控制是否需要在通知消息中携带附属信息的具体实现过程。如图9所示,该方法包括以下步骤:
S901、订阅设备向订阅目标设备发送查询请求。
其中,所述查询请求中携带目标资源的资源标识。
S902、订阅目标设备向订阅设备发送查询响应。
其中,查询响应中包括目标资源标识对应的目标资源的资源信息。
S903、订阅设备判定目标资源是否支持在通知消息中携带附属信息。
在本实施例中,若订阅设备判定目标资源支持在通知消息中携带附属信息,则可以向订阅目标设备发送用于请求订阅支持在通知消息中携带附属信息的目标资源的订阅请求。判断的方法为目标资源的p属性中的bm属性值是一个bitmask(位掩码)类型,当bm属性值的第二位是1时表示支持订阅;另外在目标资源的rt属性中如果包含了oic.r.nainfo则表示该资源的通知消息可以携带附属信息。
S904、订阅设备向订阅目标设备发送携带订阅标识的值的订阅请求。
例如,在订阅请求中如果携带的订阅标识(obs)的值为1表示是通知消息中不带附属信息的订阅 消息;obs的值为2表示是通知消息中需携带附属信息的订阅消息;若订阅请求中如果携带的订阅标识(obs)的值为1,且,目标资源的资源信息中携带附属信息标识oic.r.nainfo,则确定目标资源支持在通知消息中携带附属信息。
S905、订阅设备接收订阅目标设备发送的订阅响应。
其中,订阅响应中包括目标资源的属性的当前值和预设附属信息,预设附属信息为空值或者预设的默认值。
S906、目标资源被更新。
S907、订阅目标设备收集目标资源被更新的附属信息。
S908、订阅目标设备向订阅设备发送通知消息。
其中,通知消息中包括第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容。
本申请实施例提供的资源订阅方法,当订阅设备确定目标资源的资源信息中携带附属信息标识oic.r.nainfo,需要开启目标资源的通知消息的携带附属信息功能时,可以在订阅请求中对订阅标识赋值,来指示开启目标资源的通知消息的携带附属信息功能,该方法可设备可以根据需求灵活的配置,且,在订阅请求中对订阅标识赋值,减少了信令开销。
应该理解的是,虽然图2-9的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-9中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图10所示,提供了一种资源订阅装置,包括:
生成模块11,用于在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;第一通知消息包括更新信息和附属信息,更新信息包括更新后的目标资源的内容或目标资源的更新内容;订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
发送模块12,用于将第一通知消息发送给订阅设备。
在一个实施例中,如图11所示该装置还包括:
确定模块13,用于确定所述目标资源是否支持在通知消息中携带附属信息;若所述目标资源支持在通知消息中携带附属信息,则触发所述生成模块11执行所述生成第一通知消息的步骤。
在一个实施例中,所述确定模块13,用于若所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,所述确定模块13,用于若所述目标资源的资源信息中携带附属信息标识,且,所述目标资源的通知消息中携带附属信息功能被开启,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,如图11所示,该装置还包括:
接收模块14,用于接收所述订阅设备发送的功能开启指令;所述功能开启指令用于指示开启所述目标资源的通知消息中携带附属信息功能。
在一个实施例中,所述功能开启指令包括附属参数标识,若所述附属参数标识的值为第一值,则指示开启所述目标资源的通知消息中携带附属信息功能。
在一个实施例中,所述发送模块12,还用于向所述订阅设备发送第二通知消息;所述第二通知消息包括所述目标资源的附属信息。
在一个实施例中,所述确定模块13,用于若所述目标资源的订阅标识的值指示通知消息中携带附属信息,且,所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,所述订阅请求包括所述订阅标识的值;所述订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
在一个实施例中,若所述订阅标识的值为第二值,则指示通知消息中携带附属信息;若所述订阅标识的值为第三值,则指示通知消息中不携带附属信息;若所述订阅标识的值为第四值,则指示取消订阅。
在一个实施例中,如图11所示,该装置还包括:
接收模块14,用于接收所述订阅设备发送的查询请求;所述查询请求携带目标资源标识;
发送模块12,还用于向所述订阅设备发送查询响应;所述查询响应中包括所述目标资源标识对应的目标资源的资源信息。
在一个实施例中,所述附属信息包括以下信息中的至少一个:
所述目标资源的资源接口信息;
更新所述目标资源的设备标识;
更新所述目标资源的设备所属用户的用户名;
更新所述目标资源的设备所属用户的用户标识ID;
所述目标资源的更新时间;
所述目标资源的更新类型。
在一个实施例中,所述更新类型包括本地更新、远程更新、手动更新或场景更新。
在一个实施例中,如图11所示,该装置还包括:
确定模块13,用于确定所述目标资源是否支持订阅,以及,所述目标资源是否支持在通知消息中携带附属信息;若所述目标资源支持订阅,且,所述目标资源支持在通知消息中携带附属信息,则触发所述生成模块11执行所述生成第一通知消息的步骤。
在一个实施例中,所述发送模块12还用于在接收所述订阅设备发送的所述订阅请求之后,向所述订阅设备发送订阅响应;所述订阅响应中包括所述目标资源的属性的当前值和预设附属信息,所述预设附属信息为空值或者预设的默认值。
在一个实施例中,如图12所示,提供了一种资源订阅装置,包括:处理模块21和接收模块22;
所述处理模块21用于在向订阅目标设备发送订阅请求之后,通过所述接收模块22接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
在一个实施例中,如图13所示,该装置还包括:
确定模块23,用于确定所述目标资源是否支持在通知消息中携带附属信息。
在一个实施例中,确定模块23,用于若所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
在一个实施例中,如图13所示,该装置还包括:
发送模块24,用于向所述目标订阅设备发送功能开启指令;所述功能开启指令用于指示开启所述目标资源的通知消息的携带附属信息功能。
在一个实施例中,所述功能开启指令包括附属参数标识,若所述附属参数标识的值为第一值,则指示开启所述目标资源的通知消息的携带附属信息功能。
在一个实施例中,接收模块22还用于接收所述订阅目标设备发送的第二通知消息;所述第二通知消息为所述订阅目标设备根据所述功能开启指令开启所述目标资源的通知消息的携带附属信息功能之后发送的,所述第二通知消息包括所述目标资源的附属信息的消息。
在一个实施例中,所述订阅请求包括订阅标识的值;所述订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
在一个实施例中,若所述订阅标识的值为第二值,则指示通知消息中携带附属信息;
若所述订阅标识的值为第三值,则指示通知消息中不携带附属信息;
若所述订阅标识的值为第四值,则指示取消订阅。
在一个实施例中,如图13所示,该装置还包括:
发送模块24,用于向所述订阅目标设备发送查询请求;所述查询请求携带目标资源标识;
接收模块22,还用于接收所述订阅目标设备发送的查询响应;所述查询响应中包括所述目标资源标识对应的目标资源的资源信息。
在一个实施例中,所述附属信息包括以下信息中的至少一个:
所述目标资源的资源接口信息;
更新所述目标资源的设备标识;
更新所述目标资源的设备所属用户的用户名;
更新所述目标资源的设备所属用户的用户ID;
所述目标资源的更新时间;
所述目标资源的更新类型。
在一个实施例中,所述更新类型包括本地更新、远程更新、手动更新或场景更新。
在一个实施例中,如图13所示,该装置还包括:
确定模块23,用于确定所述目标资源是否支持订阅,以及,所述目标资源是否支持在通知消息中携带附属信息;若所述目标资源支持订阅,且,所述目标资源支持在通知消息中携带附属信息,则向触发发送模块24所述订阅目标设备发送所述订阅请求。
在一个实施例中,接收模块22,还用于在向所述订阅目标设备发送所述订阅请求之后,接收所述订阅目标设备发送的订阅响应;所述订阅响应中包括所述目标资源的属性的当前值和预设附属信息,所述预设附属信息为空值或者预设的默认值。
上述实施例提供的一种资源订阅装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
关于资源订阅装置的具体限定可以参见上文中对于资源订阅方法的限定,在此不再赘述。上述资源订阅装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是订阅目标设备,其内部结构图可以如图14所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储资源订阅数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种资源订阅方法。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是订阅设备,其内部结构图可以如图15所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种资源订阅方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图14和图15中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:
在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
将所述第一通知消息发送给所述订阅设备。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:
在向订阅目标设备发送订阅请求之后,接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
上述实施例提供的一种计算机设备,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
将所述第一通知消息发送给所述订阅设备。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
在向订阅目标设备发送订阅请求之后,接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
上述实施例提供的一种计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (34)

  1. 一种资源订阅方法,其特征在于,所述方法包括:
    在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
    将所述第一通知消息发送给所述订阅设备。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    确定所述目标资源是否支持在通知消息中携带附属信息;
    若所述目标资源支持在通知消息中携带附属信息,则执行所述生成第一通知消息的步骤。
  3. 根据权利要求2所述的方法,其特征在于,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
    若所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
  4. 根据权利要求2所述的方法,其特征在于,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
    若所述目标资源的资源信息中携带附属信息标识,且,所述目标资源的通知消息中携带附属信息功能被开启,则确定所述目标资源支持在通知消息中携带附属信息。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    接收所述订阅设备发送的功能开启指令;所述功能开启指令用于指示开启所述目标资源的通知消息中携带附属信息功能。
  6. 根据权利要求5所述的方法,其特征在于,所述功能开启指令包括附属参数标识,若所述附属参数标识的值为第一值,则指示开启所述目标资源的通知消息中携带附属信息功能。
  7. 根据权利要求5所述的方法,其特征在于,所述接收所述订阅设备发送的功能开启指令之后,还包括:
    向所述订阅设备发送第二通知消息;所述第二通知消息包括所述目标资源的附属信息。
  8. 根据权利要求2所述的方法,其特征在于,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
    若所述目标资源的订阅标识的值指示通知消息中携带附属信息,且,所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
  9. 根据权利要求8所述的方法,其特征在于,所述订阅请求包括所述订阅标识的值;所述订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
  10. 根据权利要求9所述的方法,其特征在于,
    若所述订阅标识的值为第二值,则指示通知消息中携带附属信息;
    若所述订阅标识的值为第三值,则指示通知消息中不携带附属信息;
    若所述订阅标识的值为第四值,则指示取消订阅。
  11. 根据权利要求3-10任一项所述的方法,其特征在于,所述方法还包括:
    接收所述订阅设备发送的查询请求;所述查询请求携带目标资源标识;
    向所述订阅设备发送查询响应;所述查询响应中包括所述目标资源标识对应的目标资源的资源信息。
  12. 根据权利要求1-10任一项所述的方法,其特征在于,所述附属信息包括以下信息中的至少一个:
    所述目标资源的资源接口信息;
    更新所述目标资源的设备标识;
    更新所述目标资源的设备所属用户的用户名;
    更新所述目标资源的设备所属用户的用户标识ID;
    所述目标资源的更新时间;
    所述目标资源的更新类型。
  13. 根据权利要求11所述的方法,其特征在于,所述更新类型包括本地更新、远程更新、手动更新或场景更新。
  14. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    确定所述目标资源是否支持订阅,以及,所述目标资源是否支持在通知消息中携带附属信息;
    若所述目标资源支持订阅,且,所述目标资源支持在通知消息中携带附属信息,则执行所述生成第一通知消息的步骤。
  15. 根据权利要求1-10任一项所述的方法,其特征在于,所述方法还包括:
    在接收所述订阅设备发送的所述订阅请求之后,向所述订阅设备发送订阅响应;所述订阅响应中包括所述目标资源的属性的当前值和预设附属信息,所述预设附属信息为空值或者预设的默认值。
  16. 一种资源订阅方法,其特征在于,所述方法包括:
    在向订阅目标设备发送订阅请求之后,接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
  17. 根据权利要求16所述的方法,其特征在于,所述方法还包括:
    确定所述目标资源是否支持在通知消息中携带附属信息。
  18. 根据权利要求17所述的方法,其特征在于,所述确定所述目标资源是否支持在通知消息中携带附属信息,包括:
    若所述目标资源的资源信息中携带附属信息标识,则确定所述目标资源支持在通知消息中携带附属信息。
  19. 根据权利要求18所述的方法,其特征在于,所述方法还包括:
    向所述目标订阅设备发送功能开启指令;所述功能开启指令用于指示开启所述目标资源的通知消息的携带附属信息功能。
  20. 根据权利要求19所述的方法,其特征在于,所述功能开启指令包括附属参数标识,若所述附属参数标识的值为第一值,则指示开启所述目标资源的通知消息的携带附属信息功能。
  21. 根据权利要求19所述的方法,其特征在于,所述方法还包括:
    接收所述订阅目标设备发送的第二通知消息;所述第二通知消息为所述订阅目标设备根据所述功能开启指令开启所述目标资源的通知消息的携带附属信息功能之后发送的,所述第二通知消息包括所述目标资源的附属信息的消息。
  22. 根据权利要求18所述的方法,其特征在于,所述订阅请求包括订阅标识的值;所述订阅标识的值用于指示是否在通知消息中携带附属信息或取消订阅。
  23. 根据权利要求22所述的方法,其特征在于,
    若所述订阅标识的值为第二值,则指示通知消息中携带附属信息;
    若所述订阅标识的值为第三值,则指示通知消息中不携带附属信息;
    若所述订阅标识的值为第四值,则指示取消订阅。
  24. 根据权利要求18-23任一项所述的方法,其特征在于,所述方法还包括:
    向所述订阅目标设备发送查询请求;所述查询请求携带目标资源标识;
    接收所述订阅目标设备发送的查询响应;所述查询响应中包括所述目标资源标识对应的目标资源的资源信息。
  25. 根据权利要求16-23任一项所述的方法,其特征在于,所述附属信息包括以下信息中的至少一个:
    所述目标资源的资源接口信息;
    更新所述目标资源的设备标识;
    更新所述目标资源的设备所属用户的用户名;
    更新所述目标资源的设备所属用户的用户ID;
    所述目标资源的更新时间;
    所述目标资源的更新类型。
  26. 根据权利要求25所述的方法,其特征在于,所述更新类型包括本地更新、远程更新、手动更新或场景更新。
  27. 根据权利要求16所述的方法,其特征在于,所述方法还包括:
    确定所述目标资源是否支持订阅,以及,所述目标资源是否支持在通知消息中携带附属信息;
    若所述目标资源支持订阅,且,所述目标资源支持在通知消息中携带附属信息,则向所述订阅目标设备发送所述订阅请求。
  28. 根据权利要求16-23任一项所述的方法,其特征在于,所述方法还包括:
    在向所述订阅目标设备发送所述订阅请求之后,接收所述订阅目标设备发送的订阅响应;所述订阅响应中包括所述目标资源的属性的当前值和预设附属信息,所述预设附属信息为空值或者预设的默认值。
  29. 一种资源订阅装置,其特征在于,所述装置包括:
    生成模块,用于在接收到订阅设备发送的订阅请求之后,若监测到目标资源更新,生成第一通知消息;所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源;
    发送模块,用于将所述第一通知消息发送给所述订阅设备。
  30. 一种资源订阅装置,其特征在于,所述装置包括:处理模块和接收模块;
    所述处理模块用于在向订阅目标设备发送订阅请求之后,通过所述接收模块接收所述目标订阅设备发送的第一通知消息,所述第一通知消息包括更新信息和附属信息,所述更新信息包括更新后的目标资源的内容或所述目标资源的更新内容;所述订阅请求用于请求订阅支持在通知消息中携带附属信息的目标资源。
  31. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至15中任一项所述方法的步骤。
  32. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求16至28中任一项所述方法的步骤。
  33. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至15中任一项所述的方法的步骤。
  34. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求16至28中任一项所述的方法的步骤。
PCT/CN2019/120995 2019-11-26 2019-11-26 资源订阅方法、装置、计算机设备和存储介质 WO2021102691A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/120995 WO2021102691A1 (zh) 2019-11-26 2019-11-26 资源订阅方法、装置、计算机设备和存储介质
CN201980097312.XA CN113940037B (zh) 2019-11-26 2019-11-26 资源订阅方法、装置、计算机设备和存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/120995 WO2021102691A1 (zh) 2019-11-26 2019-11-26 资源订阅方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021102691A1 true WO2021102691A1 (zh) 2021-06-03

Family

ID=76129117

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/120995 WO2021102691A1 (zh) 2019-11-26 2019-11-26 资源订阅方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN113940037B (zh)
WO (1) WO2021102691A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114172957A (zh) * 2021-12-02 2022-03-11 Oppo广东移动通信有限公司 订阅系统、方法、电子设备、服务器、存储介质及产品
CN114598567A (zh) * 2022-03-03 2022-06-07 深圳市元征科技股份有限公司 通信方法、设备及存储介质
WO2023108653A1 (zh) * 2021-12-17 2023-06-22 Oppo广东移动通信有限公司 订阅权限信息处理方法、装置、计算机设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884987B (zh) * 2022-04-24 2024-03-29 青岛海信医疗设备股份有限公司 获取设备状态信息的方法、装置及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783849A (zh) * 2004-12-03 2006-06-07 腾讯科技(深圳)有限公司 一种基于即时通讯平台的消息订阅方法和系统
CN102479228A (zh) * 2010-11-30 2012-05-30 英业达股份有限公司 在线词典更新资料的推送系统及其方法
CN102572112A (zh) * 2012-02-14 2012-07-11 中国民航信息网络股份有限公司 一种基于iPhone手机平台的移动航班动态通知系统及其方法
CN103647803A (zh) * 2013-11-22 2014-03-19 北京奇虎科技有限公司 一种移动终端订阅内容的方法及装置
US8825962B1 (en) * 2010-04-20 2014-09-02 Facebook, Inc. Push-based cache invalidation notification
CN106330953A (zh) * 2016-09-20 2017-01-11 北京搜狐新动力信息技术有限公司 一种智能路由器设备、服务器设备及其数据处理方法
CN110311959A (zh) * 2019-06-19 2019-10-08 广州华多网络科技有限公司 消息推送与页面更新的方法、装置及数据处理系统

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001216184A (ja) * 2000-01-31 2001-08-10 Sony Corp 送信装置、受信装置、送受信システム、送信方法、および受信方法
CN100579126C (zh) * 2007-09-21 2010-01-06 腾讯科技(深圳)有限公司 一种邮件订阅方法和服务器
CN102118479A (zh) * 2011-01-26 2011-07-06 宇龙计算机通信科技(深圳)有限公司 一种通讯录更新方法、服务器及系统
CN102904960B (zh) * 2012-10-19 2016-05-18 北京奇虎科技有限公司 一种基于rss的信息同步系统及方法
CN106790676B (zh) * 2013-12-05 2020-07-07 华为技术有限公司 订阅通知的实现方法和装置
CN105228111A (zh) * 2014-06-13 2016-01-06 中兴通讯股份有限公司 资源订阅处理方法及装置
CN108366096A (zh) * 2018-01-17 2018-08-03 深圳市金立通信设备有限公司 一种信息订阅方法、终端及计算机可读存储介质
CN110351698B (zh) * 2018-04-04 2022-04-05 华为技术有限公司 事件订阅的方法、装置和系统
WO2019205557A1 (zh) * 2018-04-24 2019-10-31 海信集团有限公司 物联网设备的资源订阅

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783849A (zh) * 2004-12-03 2006-06-07 腾讯科技(深圳)有限公司 一种基于即时通讯平台的消息订阅方法和系统
US8825962B1 (en) * 2010-04-20 2014-09-02 Facebook, Inc. Push-based cache invalidation notification
CN102479228A (zh) * 2010-11-30 2012-05-30 英业达股份有限公司 在线词典更新资料的推送系统及其方法
CN102572112A (zh) * 2012-02-14 2012-07-11 中国民航信息网络股份有限公司 一种基于iPhone手机平台的移动航班动态通知系统及其方法
CN103647803A (zh) * 2013-11-22 2014-03-19 北京奇虎科技有限公司 一种移动终端订阅内容的方法及装置
CN106330953A (zh) * 2016-09-20 2017-01-11 北京搜狐新动力信息技术有限公司 一种智能路由器设备、服务器设备及其数据处理方法
CN110311959A (zh) * 2019-06-19 2019-10-08 广州华多网络科技有限公司 消息推送与页面更新的方法、装置及数据处理系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114172957A (zh) * 2021-12-02 2022-03-11 Oppo广东移动通信有限公司 订阅系统、方法、电子设备、服务器、存储介质及产品
CN114172957B (zh) * 2021-12-02 2024-05-14 Oppo广东移动通信有限公司 订阅系统、方法、电子设备、服务器、存储介质及产品
WO2023108653A1 (zh) * 2021-12-17 2023-06-22 Oppo广东移动通信有限公司 订阅权限信息处理方法、装置、计算机设备及存储介质
CN114598567A (zh) * 2022-03-03 2022-06-07 深圳市元征科技股份有限公司 通信方法、设备及存储介质

Also Published As

Publication number Publication date
CN113940037A (zh) 2022-01-14
CN113940037B (zh) 2023-09-05

Similar Documents

Publication Publication Date Title
WO2021102691A1 (zh) 资源订阅方法、装置、计算机设备和存储介质
CN110619220A (zh) 对神经网络模型加密的方法及装置、存储介质
CN105204743A (zh) 用于语音和视频通讯的交互控制方法及装置
US10430441B1 (en) Tagging resources of a remote computing service based on locality
KR101719599B1 (ko) 네트워크에 액세스하는 방법, 장치, 프로그램 및 기록매체
CN109275042A (zh) 一种弹幕消息的分发方法、装置、终端和存储介质
CN111338971B (zh) 应用测试方法、装置、电子设备及存储介质
CN102970207B (zh) 一种即时通信方法、客户端装置和即时通信系统
US10079787B2 (en) Method and apparatus for creating group and exiting group
US11144655B2 (en) Control viewing access to documents in collaborative scenarios using facial recognition from webcams
CN112131135B (zh) 一种密文运算调试方法、系统和用于密文运算调试的装置
CN108009269B (zh) 显示页面数据的方法、装置
CN116743496A (zh) 设备远程操作方法、装置、计算机设备和存储介质
US20150242501A1 (en) Social network address book
CN106656479B (zh) 设备密码鉴权方法、服务器和终端
CN110995767B (zh) 一种请求处理方法及装置
CN109948012B (zh) 序列号的生成方法、装置及存储介质
CN106992882B (zh) 路由器文件迁移方法和装置
CN113347222B (zh) 一种数据处理方法、装置和电子设备
CN115277273B (zh) 资源共享方法及资源共享的装置
CN115333877B (zh) 信息处理方法、装置、终端和存储介质
CN112910871B (zh) 接入人工客服的方法、客服平台及业务平台
CN112804098B (zh) 域名故障线路的切换方法、装置、终端设备及存储介质
CN107453904B (zh) 一种集群管理界面实现方法及系统
CN113918128A (zh) 一种网页部署方法、装置及电子设备

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

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

Country of ref document: EP

Kind code of ref document: A1