CN113940037A - Resource subscription method and device, computer equipment and storage medium - Google Patents
Resource subscription method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN113940037A CN113940037A CN201980097312.XA CN201980097312A CN113940037A CN 113940037 A CN113940037 A CN 113940037A CN 201980097312 A CN201980097312 A CN 201980097312A CN 113940037 A CN113940037 A CN 113940037A
- Authority
- CN
- China
- Prior art keywords
- subscription
- target resource
- notification message
- information
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application relates to a resource subscription method, a resource subscription device, a computer device and a storage medium, wherein the method comprises the following steps: after a subscription request sent by subscription equipment is received, if the update of target resources is monitored, generating a first notification message; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message; and sending the first notification message to the subscribing device, wherein the attached information helps the subscribing party to complete richer scenes, and the subscribing device can determine subsequent operations according to the attached information so as to meet more user requirements.
Description
The present application relates to the field of communications, and in particular, to a resource subscription method, apparatus, computer device, and storage medium.
With the development of technology, the application of the internet of things and smart homes gradually enters the lives of people. A user may subscribe a favorite news topic (e.g. sports, stars, etc.) to a news provider device through an Application (APP) on a terminal, and when the news of the topic is updated, the news provider device may push a corresponding news message to the APP of the user, so that the user can read the message in time, which is the most "typical" subscription scenario.
In the prior art, a user side sends a subscription request to a subscription server, the subscription server starts to monitor whether a message subscribed by the subscription request is updated or not after the subscription request is authenticated, and when the message subscribed by the subscription request is detected to be updated, the updated message content is sent to the user side.
Content of application
Based on this, there is a need to provide a resource subscription method, apparatus, computer device and storage medium.
In a first aspect, an embodiment of the present application provides a resource subscription method, where the method includes:
after a subscription request sent by subscription equipment is received, if the update of target resources is monitored, generating a first notification message; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message;
sending the first notification message to the subscribing device.
In one embodiment, the method further comprises:
determining whether the target resource supports carrying of the auxiliary information in the notification message;
and if the target resource supports that the notification message carries the auxiliary information, executing the step of generating the first notification message.
In one embodiment, the determining whether the target resource supports carrying of the attached information in the notification message includes:
and if the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
In one embodiment, the determining whether the target resource supports carrying of the attached information in the notification message includes:
and if the resource information of the target resource carries the attached information identifier and the function of carrying the attached information in the notification message of the target resource is started, determining that the target resource supports carrying the attached information in the notification message.
In one embodiment, the method further comprises:
receiving a function starting instruction sent by the subscription equipment; the function starting instruction is used for indicating that the notification message for starting the target resource carries the attached information function.
In an embodiment, the function starting instruction includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, the notification message indicating to start the target resource carries an attached information function.
In an embodiment, after receiving the function starting instruction sent by the subscribing device, the method further includes:
sending a second notification message to the subscribing device; the second notification message includes affiliation information for the target resource.
In one embodiment, the determining whether the target resource supports carrying of the attached information in the notification message includes:
and if the value of the subscription identifier of the target resource indicates that the notification message carries the attached information and the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
In one embodiment, the subscription request includes a value of the subscription identity; and the value of the subscription identifier is used for indicating whether the notification message carries the attached information or cancels the subscription.
In one embodiment, if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information;
if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information;
and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
In one embodiment, the method further comprises:
receiving a query request sent by the subscription equipment; the query request carries a target resource identifier;
sending a query response to the subscribing device; the query response comprises resource information of the target resource corresponding to the target resource identifier.
In one embodiment, 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 equipment of the target resource belongs; updating the user identification ID of the user to which the equipment of the target resource belongs; an update time of the target resource; an update type of the target resource.
In one embodiment, the update type includes a local update, a remote update, a manual update, or a scene update.
In one embodiment, the method further comprises:
determining whether the target resource supports subscription and whether the target resource supports carrying of the attached information in the notification message;
and if the target resource supports subscription and the target resource supports carrying the attached information in the notification message, executing the step of generating the first notification message.
In one embodiment, the method further comprises:
after receiving the subscription request sent by the subscribing device, sending a subscription response to the subscribing device; the subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
In a second aspect, an embodiment of the present application provides a resource subscription method, where the method includes:
after a subscription request is sent to a subscribing target device, receiving a first notification message sent by the target subscribing device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
In one embodiment, the method further comprises:
and determining whether the target resource supports carrying the auxiliary information in the notification message.
In one embodiment, the determining whether the target resource supports carrying of the attached information in the notification message includes:
and if the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
In one embodiment, the method further comprises:
sending a function starting instruction to the target subscription equipment; and the function starting instruction is used for indicating the function of starting the notification message of the target resource and carrying the auxiliary information.
In an embodiment, the function starting instruction includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, it indicates to start an attached information carrying function of the notification message of the target resource.
In one embodiment, the method further comprises:
receiving a second notification message sent by the subscription target device; and the second notification message is sent after the subscription target device starts an auxiliary information carrying function of the notification message of the target resource according to the function starting instruction, and the second notification message comprises the auxiliary information of the target resource.
In one embodiment, the subscription request includes a value of a subscription identity; and the value of the subscription identifier is used for indicating whether the notification message carries the attached information or cancels the subscription.
In one embodiment, if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information;
if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information;
and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
In one embodiment, the method further comprises:
sending a query request to the subscription target device; the query request carries a target resource identifier;
receiving a query response sent by the subscription target device; the query response comprises resource information of the target resource corresponding to the target resource identifier.
In one embodiment, 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 equipment of the target resource belongs; updating the user ID of the user to which the equipment of the target resource belongs; an update time of the target resource; an update type of the target resource.
In one embodiment, the update type includes a local update, a remote update, a manual update, or a scene update.
In one embodiment, the method further comprises:
determining whether the target resource supports subscription and whether the target resource supports carrying of the attached information in the notification message;
and if the target resource supports subscription and the target resource supports the auxiliary information carried in the notification message, sending the subscription request to the subscription target equipment.
In one embodiment, the method further comprises:
after the subscription request is sent to the subscription target device, receiving a subscription response sent by the subscription target device; the subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
In a third aspect, an embodiment of the present application provides a resource subscription device, where the device includes:
the generation module is used for generating a first notification message if the update of the target resource is monitored after a subscription request sent by the subscription equipment is received; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message;
a sending module, configured to send the first notification message to the subscribing device.
In a fourth aspect, an embodiment of the present application provides a resource subscription apparatus, where the apparatus includes: the device comprises a processing module and a receiving module;
the processing module is used for receiving a first notification message sent by a target subscription device through the receiving module after sending a subscription request to a subscription target device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
In a fifth aspect, an embodiment of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method in any one of the first aspect when executing the computer program.
In a sixth aspect, the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method in any one of the second aspects when executing the computer program.
In a seventh aspect, this application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method in any one of the first aspect.
In an eighth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of the second aspects.
According to the resource subscription method, the resource subscription device, the computer equipment and the storage medium, after a subscription request sent by the subscription equipment is received, if the target resource is monitored to be updated, a first notification message is generated and sent to the subscription equipment, the subscription equipment can sense not only the change content of the target resource but also the auxiliary information of the change of the target resource due to the fact that the first notification message comprises the update information and the auxiliary information, the auxiliary information is beneficial to a subscriber to complete richer scenes, and the subscription equipment can determine subsequent operation according to the auxiliary information so as to meet more user requirements.
Fig. 1 is a schematic view of an application scenario of a resource subscription method according to an embodiment of the present application;
FIG. 2 is a flowchart of a resource subscription method according to an embodiment;
FIG. 3 is a flowchart of a resource subscription method according to an embodiment;
FIG. 4 is a flowchart of a resource subscription method according to an embodiment;
FIG. 5 is a flowchart of a resource subscription method according to an embodiment;
FIG. 6 is a flowchart of a resource subscription method according to an embodiment;
FIG. 7 is an interaction flow diagram of a method for subscribing to resources, provided by an embodiment;
FIG. 8 is an interaction flow diagram of a method for subscribing to resources, provided by an embodiment;
FIG. 9 is an interaction flow diagram of a method for subscribing to resources, provided by an embodiment;
FIG. 10 is a block diagram of a means for subscribing to resources, as provided by one embodiment;
FIG. 11 is a block diagram of a means for subscribing to resources, as provided by one embodiment;
FIG. 12 is a block diagram of a subscribe resource device provided by one embodiment;
FIG. 13 is a block diagram of a means for subscribing to resources provided by one embodiment;
FIG. 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 one embodiment.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 is a schematic view of an application scenario of a resource subscription method according to an embodiment of the present application. As shown in fig. 1, the scenario includes a subscribing device 1 and a subscribing target device 2, data transmission is performed between the subscribing device 1 and the subscribing target device 2 through a network, and the subscribing device 1 may subscribe to a required resource from the subscribing target device 2, for example, the subscribing device 1 may subscribe to news, advertisements, and the like from the subscribing target device 2. The subscription device 1 may be a terminal such as a mobile phone, a computer, an iPad, a game machine, and a handheld terminal, and the subscription target device 2 may be a terminal device, a server, a cloud platform, a server cluster, and the like, which is not limited in this embodiment of the application.
Under the current technical architecture, the subscribing device can only obtain the changed value of the target resource from the subscribing target device, and in a real-world scenario, the subscribing device (user) may need to perceive some auxiliary information about the target resource being modified, for example: who modifies the target resource by what method when, therefore, existing resource subscription methods are difficult to meet the demands of more and more users. Therefore, the technical problem to be solved by the present solution is how to carry the attached information in the current notification message. It should be noted that the resource subscription method provided in the embodiment of the present application may also be used to solve other technical problems, and is not limited thereto.
Fig. 2 is a flowchart of a resource subscription method according to an embodiment. An execution subject of the method is a target subscription device 2 in a scene shown in fig. 1, and this embodiment relates to a specific implementation process in which the target subscription device sends a notification message carrying update information and attached information to the subscription device when monitoring that a target resource subscribed by the subscription device changes. As shown in fig. 2, the method comprises the steps of:
s201, after receiving a subscription request sent by a subscription device, if the update of target resources is monitored, generating a first notification message; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
The subscription request may include an identifier of a target resource, an identifier of a subscribing device, a request identifier for completing the binding of the request and the response, an operation type, a subscription identifier, and the like. The target resource update may be that partial content of the target resource is updated, or that all content of the target resource is updated, which is not limited in the embodiment of the present application. The update information may include updated content of the target resource or updated content of the target resource, wherein, the updated content of the target resource refers to all the updated and non-updated content in the updated target resource, the updated content of the target resource refers to the updated content in the target resource, the target resources include, for example, content a, content B, and content C, which may be updated simultaneously, either or both of which may be updated, e.g., content a and content B in the target resource are updated, content C is not updated, the updated content a, the updated content B and the non-updated content C may be included in the update information, alternatively, the update information may include only the updated content a and the updated content B, and may not include the content C that is not updated. The auxiliary information may include time when the target resource is updated, a name or an ID of the device that updates the target resource, a name of a user to which the device that updates the target resource belongs, a method of updating the target resource, and the like, which is not limited in the embodiment of the present application.
Optionally, the auxiliary information comprises at least one of the following information:
resource interface information of the target resource;
updating the equipment identification of the target resource;
updating the user name of the user to which the equipment of the target resource belongs;
updating the user ID of the user to which the equipment of the target resource belongs;
update time of the target resource;
the update type of the target resource.
The device identifier (n-deviceid) for updating the target resource may be a name, a number, a physical address, and the like of the device for updating the target resource, the user name (n-nickname) of the user to which the device for updating the target resource belongs may be a name, a code, a nickname, and the like of the user to which the device for updating the target resource belongs, the user ID (n-userid) of the user to which the device for updating the target resource belongs may be an identity number, a mobile phone number, an account number of network software, and the like of the user to which the device for updating the target resource belongs, and the update time (n-time) of the target resource is the time when the target resource is modified.
Further, the update type (n-update mode) includes a local (local) update, a remote (remote) update, a manual (manual) update, or a scene (scene) update. The local updating can be to update the target resource through bluetooth, infrared ray, WIFI and other modes; the remote update may be to update a target resource outside the local area network through a terminal, for example, a user updates a certain device resource in a home in an office through a mobile phone by using communication methods such as 3G, 4G, 5G, and the like, or updates a certain resource in the home local area network through a cloud platform, and the like; the manual update can be used in the scenes of door lock, equipment starting and the like, for example, a user unlocks and starts the equipment through fingerprint identification, or the state of resources such as the door lock, the equipment and the like is changed through operations such as opening the door by a key and the like; scene update refers to the update of a target resource due to scene change, for example, the change of light intensity of a photosensitive illumination lamp with the change of light. The above embodiments are merely examples of the various update types, and the embodiments of the present application are not limited thereto.
It should be noted that in some scenarios, different update types may also cause changes in other accessory information, for example, if it is a local operation, n-deviceid is a Device ID of an update operation initiator, and n-time is a time when the update occurs; if the operation is remote operation, the n-deviceid is the identification of the cloud platform, the n-time is the time when the update occurs, and the n-userid is the ID of the user registered on the cloud platform; if it is a manul operation then n-time is the time when the update occurred; if it is a scene operation then n-time is the time when the update occurred; if the remote sending is carried out, n-userid is required, namely the n-userid is the user ID registered on the cloud platform, and the n-DeviceID is the DeviceID of the updating operation initiator; if the n-nickname can be acquired, the n-nickname can be filled in the 4 update types.
In this embodiment, when a subscribing device needs to subscribe to a resource from a subscribing target device, a subscription request may be sent to the subscribing target device, where the subscription request may carry an identifier of the target resource, and the target resource subscribed by the subscription request supports carrying of attached information in a notification message. And after receiving the subscription request, the subscribing target device starts to monitor the state of the target resource, starts to collect the auxiliary information each time the target resource is monitored to be changed, generates a first notification message according to the updated information and the auxiliary information, and sends the first notification message to the subscribing device.
S202, the first notification message is sent to the subscription equipment.
In this embodiment, after monitoring that the target resource is changed, the subscribing target device generates the update information and the attached information of the target resource into a first notification message, and sends the first notification message to the subscribing device, so that the user can view the latest message content in time through the subscribing device.
According to the resource subscription method provided by the embodiment of the application, after a subscription request sent by the subscription device is received, if the target resource is monitored to be updated, a first notification message is generated and sent to the subscription device, the subscription device can not only sense the change content of the target resource but also sense the auxiliary information of the change of the target resource due to the fact that the first notification message comprises the update information and the auxiliary information, the auxiliary information is beneficial for a subscriber to complete richer scenes, and the subscription device can determine the follow-up operation according to the auxiliary information so as to meet more user requirements.
Fig. 3 is a flowchart of a resource subscription method according to an embodiment. An execution subject of the method is a subscribing device 1 in a scenario shown in fig. 1, and this embodiment relates to a specific implementation process for receiving a notification message carrying update information and accessory information sent by a subscribing target device after the subscribing device sends a subscription request to the subscribing target device. As shown in fig. 3, the method comprises the steps of:
s301, after a subscription request is sent to a subscription target device, receiving a first notification message sent by the target subscription device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
Optionally, the auxiliary information comprises at least one of the following information:
resource interface information of the target resource;
updating the equipment identification of the target resource;
updating the user name of the user to which the equipment of the target resource belongs;
updating the user ID of the user to which the equipment of the target resource belongs;
update time of the target resource;
the update type of the target resource.
Further, the update type (n-update mode) includes a local (local) update, a remote (remote) update, a manual (manual) update, or a scene (scene) update.
For the implementation principle of the embodiment of the present application, reference may be made to the implementation principle of the embodiment shown in fig. 2, and details are not described here.
According to the resource subscription method provided by the embodiment of the application, after the subscription device sends the subscription request to the subscription target device, the subscription device receives the first notification message sent by the target subscription device, and the first notification message comprises the update information and the auxiliary information, so that the subscription device can not only sense the change content of the target resource, but also sense the auxiliary information of the change of the target resource, the auxiliary information is beneficial to a subscriber to complete richer scenes, and the subscription device can determine the subsequent operation according to the auxiliary information so as to meet more user requirements.
On the basis of the embodiments shown in fig. 2 and fig. 3, the first notification message carries the accessory information, so that in the resource subscription process, both the subscribing device and the subscribing target device need to determine whether the target resource supports carrying the accessory information in the notification message, and when it is determined that the target resource supports carrying the accessory information in the notification message, the subscribing target device may carry the accessory information in the notification message when monitoring that the target resource changes.
Optionally, as shown in fig. 4, an execution subject of the method is a subscription target device, and as shown in fig. 4, the resource subscription method may further include the following steps:
s401, whether the target resource supports carrying the auxiliary information in the notification message is determined.
S402, if the target resource supports that the support auxiliary information is carried in the notification message, executing the step of generating the first notification message.
In this embodiment, before generating the first notification message, the subscribing target device needs to detect whether the target resource supports that the notification message carries the attached information, and if the target resource supports that the notification message carries the supported attached information, generate the first notification message. It should be noted that "determining whether the target resource supports carrying the auxiliary information in the notification message" may be performed after receiving the subscription request, or may be performed after dividing each resource, that is, before receiving the subscription request, or may be performed when monitoring that the target resource is updated, which is not limited in the embodiment of the present application.
Correspondingly, for the subscribing device, it may also be determined whether the target resource supports carrying the attached information in the notification message in the resource subscription process. It should be noted that the step of determining, by the subscribing device, whether the target resource supports carrying the auxiliary information in the notification message "needs to be performed before sending the subscription request, so as to ensure that the subscribing device subscribes the target resource that supports carrying the auxiliary information in the notification message when the subscribing device needs to perceive the auxiliary information.
Further, the subscribing target device also needs to determine whether the target resource supports the subscription. For the subscribing target device, the resource subscribing method may further include: determining whether the target resource supports subscription and whether the target resource supports carrying of the attached information in the notification message; and if the target resource supports subscription and the target resource supports the auxiliary information carried in the notification message, executing the step of generating the first notification message.
In this embodiment, when the target resource supports subscription and the target resource supports carrying the attached information in the notification message, after the subscription target device receives the subscription request from the subscribing device, if it is monitored that the target resource is updated, a first notification message carrying the attached information may be generated. For example, the bm attribute value in the p attribute of the target resource is of a bitmask (bitmask) type, and when the second bit of the bm attribute value is 1, it indicates that the resource supports subscription; in addition, if the rt attribute of the target resource contains oic.r.naiinfo, the notification message indicating the resource may carry the attached information.
Similarly, for the subscribing device, it is also required to determine whether the target resource supports subscription and whether the target resource supports carrying the attached information in the notification message; and if the target resource supports subscription and the target resource supports the auxiliary information carried in the notification message, sending a subscription request to the subscription target equipment. The implementation principle is similar to that of the subscription target device, and is not described herein again.
In the resource subscription method provided in this embodiment, for both the subscription device and the subscription target device, it is required to determine whether the target resource supports subscription, and whether the target resource supports carrying of the attached information in the notification message; and when the target resource supports subscription and the target resource supports the auxiliary information carried in the notification message, corresponding operation is executed, and the subscription equipment is determined to subscribe the target resource which can carry the auxiliary information in the notification message, so that the reliability of resource subscription is ensured.
In different scenarios, the manner of "determining whether the target resource supports carrying the auxiliary information in the notification message" is different, and how to determine whether the target resource supports carrying the auxiliary information in the notification message in different scenarios is described in a plurality of schemes below.
Scheme one
In this embodiment, an oic.r.naifo resource type may be added to the resource information of the target resource, where the oic.r.naifo resource supports the attached information carried in the notification message. For example, the occurrence of oic.r.naiinfo in the rt attribute of the target resource of the resource type means that the target resource has the ability to carry the attached information in the notification message.
For a subscribing target device, determining whether a target resource supports carrying of attached information in a notification message includes: and if the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
In this embodiment, each resource has corresponding resource information, and a device attachment information identifier (oic.r.naffo) in the resource information may indicate that the resource supports carrying attachment information in the notification message, for example, if an rt attribute of the target resource includes the oic.r.naffo identifier, it indicates that the target resource supports carrying attachment information in the notification message.
In this embodiment, the method for the subscribing device to determine whether the target resource supports carrying the attached information in the notification message is similar to that of the subscribing target device, and is not described herein again.
The resource subscription method provided by the embodiment of the application can add an auxiliary information identifier in the resource information of the target resource to indicate that the target resource supports carrying of the auxiliary information in the notification message, is simple, feasible, flexible and convenient, can ensure that the auxiliary information is sent to the subscription equipment along with the update information of the target resource, is beneficial to a subscriber to complete richer scenes, and meets the user requirements.
Scheme two
In the first scheme, as long as the resource type of the target resource contains oic.r.naifo, the notification message for the resource necessarily contains the auxiliary information, but in the actual use process, the resource supports carrying the auxiliary information in the notification message, and it may also need to control or configure whether the auxiliary information needs to be carried in the notification message. The difference between the second scheme and the first scheme is that an attribute nainfoflag (borolean type) is added in the resource, and the subscribing device can control whether the notification message of the target resource needs to carry the auxiliary information by modifying the nainfoflag attribute.
For a subscribing target device, determining whether a target resource supports carrying of attached information in a notification message includes: and if the resource information of the target resource carries the attached information identifier and the function of carrying the attached information in the notification message of the target resource is started, determining that the target resource supports carrying the attached information in the notification message.
In this embodiment, the subscribing target device needs to detect whether the resource information of the target resource carries the attached information identifier, and whether the notification message of the target resource carries the attached information function is turned on, and if it is detected that the resource information of the target resource carries the attached information identifier and the notification message of the target resource carries the attached information function is turned on, it is determined that the target resource supports carrying the attached information in the notification message.
Wherein, if the notification message of the target resource carries the attached information function and is controlled by the subscribing device, the resource subscribing method further comprises: receiving a function starting instruction sent by subscription equipment; the function starting instruction is used for indicating that the notification message of the target resource is started to carry the auxiliary information function. Optionally, the function starting instruction includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, the notification message indicating to start the target resource carries an attached information function.
In this embodiment, when the subscription device determines that the notification message of the target resource needs to be started carries the auxiliary information function, a function starting instruction may be sent to the subscription target device, and the subscription target device may be instructed to start the auxiliary information function carried in the notification message of the target resource. For example, an attached parameter identifier (nainflag) and a value of the nainflag may be configured in the function opening instruction, and if the value of the attached parameter identifier is a first value, the notification message indicating to open the target resource carries the attached information function. Optionally, the first value may be assigned as true, 1, or other assignment manners, which is not limited in this embodiment. Optionally, when the notification message of the target resource does not need to be turned on and carries the attached information function, a function turning-off instruction may also be sent to the subscription target device, for example, the function turning-off instruction sets the value of the attached parameter identifier to another value besides the first value, for example, sets the value of the attached parameter identifier to false, 0, and the like, which is not limited in this embodiment.
Further, after receiving the function opening instruction sent by the subscribing device, the method further includes: sending a second notification message to the subscribing device; the second notification message includes the affiliation information of the target resource.
In this embodiment, the function-opening instruction sent by the subscribing device causes the value of the nainflag to change, which is also equivalent to that the target resource is updated, so that a second notification message carrying the attached information may also be sent to the subscribing device to notify the subscribing device of the change condition of the target resource.
Correspondingly, for the subscribing device, after it is determined that the target resource supports carrying the auxiliary information in the notification message, if the auxiliary information carrying function of the notification message of the target resource needs to be started, a function starting instruction can be sent to the subscribing target device to instruct to start the auxiliary information carrying function of the notification message of the target resource. For example, if the subscribing device finds that the value of the nainflag of the target resource is false after determining that the target resource supports carrying the auxiliary information in the notification message, it sends a function start instruction carrying the nainflag of true to the subscribing target device, and indicates to start the auxiliary information carrying function of the notification message of the target resource.
Further, after the subscribing device sends the function starting instruction, a second notification message sent by the subscribing target device can be received; and 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 starting instruction, and the second notification message comprises the auxiliary information of the target resource.
According to the resource subscription method provided by the embodiment of the application, after the target resource is determined to support the auxiliary information carried in the notification message, the subscription device can flexibly control whether the auxiliary information carried in the notification message of the target resource is started or not by setting the value of the auxiliary parameter identifier, so that the resource subscription method is suitable for various scenes.
Scheme three
The subscribing device selects whether the notification message needs to carry the auxiliary information in the subscription process, and can also control whether the notification message needs to carry the auxiliary information by setting the value of the subscription identifier in the subscription request.
For a subscribing target device, determining whether a target resource supports carrying of attached information in a notification message includes: and if the value of the subscription identifier of the target resource indicates that the notification message carries the attached information and the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
In this embodiment, the subscribing target device may detect whether a value of a subscription identifier in a subscription request sent by the subscribing device indicates that the notification message carries the attached information, and the resource information of the target resource carries the attached information identifier, so as to determine whether the target resource supports carrying the attached information in the notification message. For example, if the value of the carried subscription identifier (obs) in the subscription request is 1, it indicates that the subscription request is a subscription message without attached information in the notification message; the obs value of 2 indicates that the notification message needs to carry the subscription message of the auxiliary information; and if the value of the subscription identifier (obs) carried in the subscription request is 1 and the accessory information identifier oic.r.naiinfo is carried in the resource information of the target resource, determining that the target resource supports carrying the accessory information in the notification message.
For the subscription device, when the subscription device determines that the resource information of the target resource carries the attached information identifier oic.r.naiinfo and the function of carrying the attached information of the notification message of the target resource needs to be started, the subscription identifier may 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 for indicating whether to carry the attached information in the notification message or cancel the subscription.
Optionally, if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information; if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information; and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
In this embodiment, the subscription identity obs is the identity header of the subscription message. The scheme expands the value of the obs parameter; when obs is 0, the subscription is normal subscription (without the attached information), when obs is 1, the subscription is cancelled, and when obs is 2, the subscription with the attached information is needed for the notification message. Other assignment methods may be adopted for the Obs, which is not limited in the embodiment of the present application.
According to the resource subscription method provided by the embodiment of the application, when the subscription device determines that the resource information of the target resource carries the accessory information identifier oic.r.naifo and needs to start the accessory information carrying function of the notification message of the target resource, the subscription identifier can be assigned in the subscription request to indicate the accessory information carrying function of the notification message of the target resource.
In the resource information of the target resource used for multiple times in the first, second, and third schemes, the subscribing target device side stores the resource information of each resource, and the subscribing device needs to acquire the resource information of the target resource from the subscribing target device. As shown in fig. 5, the subscription target device may further perform the following steps:
s501, receiving a query request sent by a subscribing device.
In this embodiment, when the subscribing device needs to acquire the resource information of the target resource, a query request carrying the identifier of the target resource may be sent to the subscribing target device, and the query request may further include the identifier of the subscribing device.
S502, sending a query response to the subscribing device; the query response includes resource information of the target resource corresponding to the target resource identifier.
In this embodiment, when receiving a query request sent by a subscribing device, a subscribing target device obtains a target resource identifier therein, finds resource information of a resource corresponding to the target resource identifier, carries the resource information in a query response, and sends the query response to the subscribing device. The resource information includes an attached information identifier for indicating that the target resource supports carrying the attached information in the notification message, and if the resource information does not have the attached information identifier, identifying that the target resource does not support carrying the attached information in the notification message.
Accordingly, as shown in fig. 6, the subscribing device may perform the following steps:
s601, sending a query request to a subscription target device; the query request carries a target resource identifier.
S602, receiving a query response sent by a subscription target device; the query response includes resource information of the target resource corresponding to the target resource identifier.
The implementation principle of the embodiment shown in fig. 6 is similar to the time limit principle of the embodiment shown in fig. 5, and is not described here again.
In the resource subscription method shown in fig. 5 and fig. 6, the subscribing device may send a query request carrying a target resource identifier to the subscribing target device, and the subscribing target device sends a query response carrying resource information of the target resource to the subscribing device, so as to determine whether the subscribing device supports that the target resource carries the accessory information in the notification message, which is helpful for the subscribing device to obtain the accessory information of the changed target resource, and execute subsequent operations according to the accessory information, so as to meet the user requirement.
On the basis of the above embodiment, after the subscribing device sends the subscription request, the subscribing target device may also send a subscription response to the subscribing device. Optionally, the subscribing target device may further perform the step of: after receiving a subscription request sent by a subscription device, sending a subscription response to the subscription device; the subscription response includes a current value of the attribute of the target resource and preset auxiliary information, and the preset auxiliary information is a null value or a preset default value.
Accordingly, the subscribing device can also perform the step of: after sending a subscription request to the subscription target device, receiving a subscription response sent by the subscription target device; the subscription response includes a current value of the attribute of the target resource and preset auxiliary information, and the preset auxiliary information is a null value or a preset default value.
In this embodiment, after the subscription target device receives the subscription request sent by the subscribing device, the current value of the attribute of the target resource may be added to the subscription response, where the subscription response is equivalent to the notification message, and since the current target resource is not updated, for the attached information, the attached information in the subscription response may be set to a null value or a default value, so as to ensure the integrity of the notification message.
Fig. 7 is an interaction flowchart of a method for subscribing to a resource according to an embodiment, where the embodiment relates to a specific implementation process of adding an attached information identifier oic.r.naiinfo to resource information of a target resource to indicate that the target resource supports attached information carried in a notification message. As shown in fig. 7, the method comprises the steps of:
s701, the subscription device sends a query request to the subscription target device.
And the query request carries a resource identifier of the target resource.
S702, the subscribing target device sends a query response to the subscribing device.
And the query response comprises the resource information of the target resource corresponding to the target resource identifier.
S703, the subscribing device judges whether the target resource supports carrying the auxiliary information in the notification message.
In this embodiment, if the subscribing device determines that the target resource supports carrying the auxiliary information in the notification message, a subscription request for requesting subscription to the target resource supporting carrying the auxiliary information in the notification message may be sent to the subscribing target device. The judgment method is that the bm attribute value in the p attribute of the target resource is a bitmask type, and when the second bit of the bm attribute value is 1, subscription support is indicated; in addition, if the rt attribute of the target resource contains oic.r.naiinfo, the notification message indicating the resource may carry the attached information.
S704, the subscribing device sends a subscription request to the subscribing target device.
S705, the subscribing device receives the subscription response sent by the subscribing target device.
The subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
S706, the target resource is updated.
S707, the subscribing target device collects the updated auxiliary information of the target resource.
S708, the subscribing target device sends a notification message to the subscribing device.
The notification message comprises a first notification message comprising update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource.
The resource subscription method provided by the embodiment of the application can add an auxiliary information identifier in the resource information of the target resource to indicate that the target resource supports carrying of the auxiliary information in the notification message, is simple, feasible, flexible and convenient, can ensure that the auxiliary information is sent to the subscription equipment along with the update information of the target resource, is beneficial to a subscriber to complete richer scenes, and meets the user requirements.
Fig. 8 is an interaction flowchart of a method for subscribing to a resource according to an embodiment, where the embodiment relates to a specific implementation process in which an attribute nainfoflag (borolean type) is added to resource information, and a subscribing device may control whether it is necessary to carry attached information in a notification message of a target resource by modifying the nainflag attribute. As shown in fig. 8, the method comprises the steps of:
s801, the subscribing device sends a query request to the subscribing target device.
And the query request carries a resource identifier of the target resource.
S802, the subscribing target device sends a query response to the subscribing device.
And the query response comprises the resource information of the target resource corresponding to the target resource identifier.
S803, the subscribing device judges whether the target resource supports carrying the auxiliary information in the notification message.
In this embodiment, if the subscribing device determines that the target resource supports carrying the auxiliary information in the notification message, a subscription request for requesting subscription to the target resource supporting carrying the auxiliary information in the notification message may be sent to the subscribing target device. The judgment method is that the bm attribute value in the p attribute of the target resource is a bitmask type, and when the second bit of the bm attribute value is 1, subscription support is indicated; in addition, if the rt attribute of the target resource contains oic.r.naiinfo, the notification message indicating the resource may carry the attached information.
S804, the subscribing device sends a subscribing request to the subscribing target device.
S805, the subscribing device receives the subscription response sent by the subscribing target device.
The subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
And S806, the subscribing device sends a function starting instruction to the target subscribing device.
The function starting instruction is used for indicating the function of starting the auxiliary information carried by the notification message of the target resource, the function starting instruction comprises an auxiliary parameter identifier, and if the value of the auxiliary parameter identifier is a first value, the function of starting the auxiliary information carried by the notification message of the target resource is indicated.
In this embodiment, if the subscribing device finds that the value of the nainflag is false, it needs to start the function of the notification message of the target resource, which carries the attached information; and sending a function starting instruction carrying the Nainfoflag with the value of true to the subscribing target device, and indicating to start the function carrying the auxiliary information of the notification message of the target resource.
S807, the subscribing target device sends a second notification message to the subscribing device.
And the second notification message is sent after the subscription target device starts the function carrying the auxiliary information of the notification message of the target resource according to the function starting instruction, and the second notification message comprises the information of the auxiliary information of the target resource.
And S808, updating the target resource.
S809, the subscribing target device collects the updated attached information of the target resource.
And S810, the subscribing target device sends a notification message to the subscribing device.
The notification message comprises a first notification message comprising update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource.
According to the resource subscription method provided by the embodiment of the application, after the target resource is determined to support the auxiliary information carried in the notification message, the subscription device can flexibly control whether the auxiliary information carried in the notification message of the target resource is started or not by setting the value of the auxiliary parameter identifier, so that the resource subscription method is suitable for various scenes.
Fig. 9 is an interaction flowchart of a method for subscribing to a resource according to an embodiment, where the embodiment relates to a specific implementation process in which a subscribing device selects whether to need to carry attached information in a notification message in a subscription process, and may also control whether to need to carry attached information in the notification message by setting a value of a subscription identifier in a subscription request. As shown in fig. 9, the method includes the steps of:
s901, the subscribing device sends a query request to the subscribing target device.
And the query request carries a resource identifier of the target resource.
S902, the subscribing target device sends a query response to the subscribing device.
And the query response comprises the resource information of the target resource corresponding to the target resource identifier.
S903, the subscribing device judges whether the target resource supports carrying the auxiliary information in the notification message.
In this embodiment, if the subscribing device determines that the target resource supports carrying the auxiliary information in the notification message, a subscription request for requesting subscription to the target resource supporting carrying the auxiliary information in the notification message may be sent to the subscribing target device. The judgment method is that the bm attribute value in the p attribute of the target resource is a bitmask type, and when the second bit of the bm attribute value is 1, subscription support is indicated; in addition, if the rt attribute of the target resource contains oic.r.naiinfo, the notification message indicating the resource may carry the attached information.
S904, the subscribing device sends a subscription request carrying a value of the subscription identifier to the subscribing target device.
For example, if the value of the carried subscription identifier (obs) in the subscription request is 1, it indicates that the subscription request is a subscription message without attached information in the notification message; the obs value of 2 indicates that the notification message needs to carry the subscription message of the auxiliary information; and if the value of the subscription identifier (obs) carried in the subscription request is 1 and the accessory information identifier oic.r.naiinfo is carried in the resource information of the target resource, determining that the target resource supports carrying the accessory information in the notification message.
S905, the subscribing device receives the subscription response sent by the subscribing target device.
The subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
S906, the target resource is updated.
S907, the subscribing target device collects the updated auxiliary information of the target resource.
S908, the subscribing target device sends a notification message to the subscribing device.
The notification message comprises a first notification message comprising update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource.
According to the resource subscription method provided by the embodiment of the application, when the subscription device determines that the resource information of the target resource carries the accessory information identifier oic.r.naifo and needs to start the accessory information carrying function of the notification message of the target resource, the subscription identifier can be assigned in the subscription request to indicate the accessory information carrying function of the notification message of the target resource.
It should be understood that although the various steps in the flow charts of fig. 2-9 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-9 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 10, there is provided a resource subscribing apparatus, including:
the generation module 11 is configured to, after receiving a subscription request sent by a subscription device, generate a first notification message if it is monitored that a target resource is updated; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for target resources carrying the auxiliary information in the notification message;
a sending module 12, configured to send the first notification message to the subscribing device.
In one embodiment, the apparatus further comprises, as shown in fig. 11:
a determining module 13, configured to determine whether the target resource supports carrying of the attached information in the notification message; if the target resource supports that the notification message carries the attached information, triggering the generation module 11 to execute the step of generating the first notification message.
In an embodiment, the determining module 13 is configured to determine that the target resource supports carrying the attached information in the notification message if the resource information of the target resource carries the attached information identifier.
In an embodiment, 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 auxiliary information identifier and the function of carrying the auxiliary information in the notification message of the target resource is turned on.
In one embodiment, as shown in fig. 11, the apparatus further comprises:
a receiving module 14, configured to receive a function starting instruction sent by the subscription device; the function starting instruction is used for indicating that the notification message for starting the target resource carries the attached information function.
In an embodiment, the function starting instruction includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, the notification message indicating to start the target resource carries an attached information function.
In one embodiment, the sending module 12 is further configured to send a second notification message to the subscribing device; the second notification message includes affiliation information for the target resource.
In an embodiment, the determining module 13 is configured to determine that the target resource supports carrying of the auxiliary information in the notification message if the value of the subscription identifier of the target resource indicates that the notification message carries the auxiliary information, and the resource information of the target resource carries the auxiliary information identifier.
In one embodiment, the subscription request includes a value of the subscription identity; and the value of the subscription identifier is used for indicating whether the notification message carries the attached information or cancels the subscription.
In one embodiment, if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information; if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information; and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
In one embodiment, as shown in fig. 11, the apparatus further comprises:
a receiving module 14, configured to receive a query request sent by the subscribing device; the query request carries a target resource identifier;
the sending module 12 is further configured to send a query response to the subscribing device; the query response comprises resource information of the target resource corresponding to the target resource identifier.
In one embodiment, 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 equipment of the target resource belongs;
updating the user identification ID of the user to which the equipment of the target resource belongs;
an update time of the target resource;
an update type of the target resource.
In one embodiment, the update type includes a local update, a remote update, a manual update, or a scene update.
In one embodiment, as shown in fig. 11, the apparatus further comprises:
a determining module 13, configured to determine whether the target resource supports subscription, and whether the target resource supports carrying of the attached information in the notification message; if the target resource supports subscription and the target resource supports that the notification message carries the attached information, triggering the generation module 11 to execute the step of generating the first notification message.
In one embodiment, the sending module 12 is further configured to send a subscription response to the subscribing device after receiving the subscription request sent by the subscribing device; the subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
In one embodiment, as shown in fig. 12, there is provided a resource subscribing apparatus, including: a processing module 21 and a receiving module 22;
the processing module 21 is configured to receive, through the receiving module 22, a first notification message sent by a target subscribing device after sending a subscription request to the subscribing target device, where the first notification message includes update information and attachment information, and the update information includes updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
In one embodiment, as shown in fig. 13, the apparatus further comprises:
a determining module 23, configured to determine whether the target resource supports carrying the attached information in the notification message.
In an embodiment, the determining module 23 is configured to determine that the target resource supports carrying the attached information in the notification message if the resource information of the target resource carries the attached information identifier.
In one embodiment, as shown in fig. 13, the apparatus further comprises:
a sending module 24, configured to send a function starting instruction to the target subscription device; and the function starting instruction is used for indicating the function of starting the notification message of the target resource and carrying the auxiliary information.
In an embodiment, the function starting instruction includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, it indicates to start an attached information carrying function of the notification message of the target resource.
In one embodiment, the receiving module 22 is further configured to receive a second notification message sent by the subscription target device; and the second notification message is sent after the subscription target device starts an auxiliary information carrying function of the notification message of the target resource according to the function starting instruction, and the second notification message comprises the auxiliary information of the target resource.
In one embodiment, the subscription request includes a value of a subscription identity; and the value of the subscription identifier is used for indicating whether the notification message carries the attached information or cancels the subscription.
In one embodiment, if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information;
if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information;
and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
In one embodiment, as shown in fig. 13, the apparatus further comprises:
a sending module 24, 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 comprises resource information of the target resource corresponding to the target resource identifier.
In one embodiment, 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 equipment of the target resource belongs;
updating the user ID of the user to which the equipment of the target resource belongs;
an update time of the target resource;
an update type of the target resource.
In one embodiment, the update type includes a local update, a remote update, a manual update, or a scene update.
In one embodiment, as shown in fig. 13, the apparatus further comprises:
a determining module 23, configured to determine whether the target resource supports subscription, and whether the target resource supports carrying of the attached information in the notification message; and if the target resource supports subscription and the target resource supports that the notification message carries the attached information, sending the subscription request to the subscription target device of the trigger sending module 24.
In one embodiment, the receiving module 22 is further configured to receive a subscription response sent by the subscription target device after sending the subscription request to the subscription target device; the subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
The implementation principle and technical effect of the resource subscription device provided by the above embodiment are similar to those of the above method embodiment, and are not described herein again.
For specific limitations of the resource subscription device, reference may be made to the above limitations of the resource subscription method, which is not described herein again. The modules in the resource subscribing device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a subscription target device, and its internal structure diagram may be as shown in fig. 14. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is for storing resource subscription data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource subscription method.
In one embodiment, a computer device is provided, which may be a subscribing device, the internal structure of which may be as shown in fig. 15. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource subscription method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 14 and 15 are block diagrams of only some of the configurations relevant to the present application, and do not constitute a limitation on the computing devices to which the present application may be applied, and a particular computing device may include more or less components than those shown, or some of the components may be combined, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
after a subscription request sent by subscription equipment is received, if the update of target resources is monitored, generating a first notification message; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message;
sending the first notification message to the subscribing device.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
after a subscription request is sent to a subscribing target device, receiving a first notification message sent by the target subscribing device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
The implementation principle and technical effect of the computer device provided by the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
after a subscription request sent by subscription equipment is received, if the update of target resources is monitored, generating a first notification message; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message;
sending the first notification message to the subscribing device.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
after a subscription request is sent to a subscribing target device, receiving a first notification message sent by the target subscribing device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
The implementation principle and technical effect of the computer-readable storage medium provided by the above embodiments are similar to those of the above method embodiments, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features. The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (34)
- A resource subscription method, characterized in that the method comprises:after a subscription request sent by subscription equipment is received, if the update of target resources is monitored, generating a first notification message; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message;sending the first notification message to the subscribing device.
- The method of claim 1, further comprising:determining whether the target resource supports carrying of the auxiliary information in the notification message;and if the target resource supports that the notification message carries the auxiliary information, executing the step of generating the first notification message.
- The method of claim 2, wherein the determining whether the target resource supports carrying of attachment information in a notification message comprises:and if the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
- The method of claim 2, wherein the determining whether the target resource supports carrying of attachment information in a notification message comprises:and if the resource information of the target resource carries the attached information identifier and the function of carrying the attached information in the notification message of the target resource is started, determining that the target resource supports carrying the attached information in the notification message.
- The method of claim 4, further comprising:receiving a function starting instruction sent by the subscription equipment; the function starting instruction is used for indicating that the notification message for starting the target resource carries the attached information function.
- The method according to claim 5, wherein the function opening command includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, the notification message indicating to open the target resource carries an attached information function.
- The method according to claim 5, wherein after receiving the function opening instruction sent by the subscribing device, the method further comprises:sending a second notification message to the subscribing device; the second notification message includes affiliation information for the target resource.
- The method of claim 2, wherein the determining whether the target resource supports carrying of attachment information in a notification message comprises:and if the value of the subscription identifier of the target resource indicates that the notification message carries the attached information and the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
- The method of claim 8, wherein the subscription request includes a value of the subscription identity; and the value of the subscription identifier is used for indicating whether the notification message carries the attached information or cancels the subscription.
- The method of claim 9,if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information;if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information;and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
- The method according to any one of claims 3-10, further comprising:receiving a query request sent by the subscription equipment; the query request carries a target resource identifier;sending a query response to the subscribing device; the query response comprises resource information of the target resource corresponding to the target resource identifier.
- The method according to any of claims 1-10, wherein the collateral information comprises at least one of: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 equipment of the target resource belongs;updating the user identification ID of the user to which the equipment of the target resource belongs;an update time of the target resource;an update type of the target resource.
- The method of claim 11, wherein the update type comprises a local update, a remote update, a manual update, or a scene update.
- The method of claim 1, further comprising:determining whether the target resource supports subscription and whether the target resource supports carrying of the attached information in the notification message;and if the target resource supports subscription and the target resource supports carrying the attached information in the notification message, executing the step of generating the first notification message.
- The method according to any one of claims 1-10, further comprising:after receiving the subscription request sent by the subscribing device, sending a subscription response to the subscribing device; the subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
- A resource subscription method, characterized in that the method comprises:after a subscription request is sent to a subscribing target device, receiving a first notification message sent by the target subscribing device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
- The method of claim 16, further comprising:and determining whether the target resource supports carrying the auxiliary information in the notification message.
- The method of claim 17, wherein the determining whether the target resource supports carrying of attachment information in a notification message comprises:and if the resource information of the target resource carries the attached information identifier, determining that the target resource supports carrying the attached information in the notification message.
- The method of claim 18, further comprising:sending a function starting instruction to the target subscription equipment; and the function starting instruction is used for indicating the function of starting the notification message of the target resource and carrying the auxiliary information.
- The method according to claim 19, wherein the function opening command includes an attached parameter identifier, and if the value of the attached parameter identifier is a first value, indicates to open an attached information carrying function of the notification message of the target resource.
- The method of claim 19, further comprising:receiving a second notification message sent by the subscription target device; and the second notification message is sent after the subscription target device starts an auxiliary information carrying function of the notification message of the target resource according to the function starting instruction, and the second notification message comprises the auxiliary information of the target resource.
- The method of claim 18, wherein the subscription request includes a value of a subscription identity; and the value of the subscription identifier is used for indicating whether the notification message carries the attached information or cancels the subscription.
- The method of claim 22,if the value of the subscription identifier is a second value, indicating that the notification message carries the attached information;if the value of the subscription identifier is a third value, indicating that the notification message does not carry the auxiliary information;and if the value of the subscription identifier is a fourth value, indicating to cancel the subscription.
- The method according to any one of claims 18-23, further comprising:sending a query request to the subscription target device; the query request carries a target resource identifier;receiving a query response sent by the subscription target device; the query response comprises resource information of the target resource corresponding to the target resource identifier.
- The method according to any of claims 16-23, wherein the collateral information comprises 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 equipment of the target resource belongs;updating the user ID of the user to which the equipment of the target resource belongs;an update time of the target resource;an update type of the target resource.
- The method of claim 25, wherein the update type comprises a local update, a remote update, a manual update, or a scene update.
- The method of claim 16, further comprising:determining whether the target resource supports subscription and whether the target resource supports carrying of the attached information in the notification message;and if the target resource supports subscription and the target resource supports the auxiliary information carried in the notification message, sending the subscription request to the subscription target equipment.
- The method according to any one of claims 16-23, further comprising:after the subscription request is sent to the subscription target device, receiving a subscription response sent by the subscription target device; the subscription response comprises a current value of the attribute of the target resource and preset auxiliary information, wherein the preset auxiliary information is a null value or a preset default value.
- An apparatus for subscribing to a resource, the apparatus comprising:the generation module is used for generating a first notification message if the update of the target resource is monitored after a subscription request sent by the subscription equipment is received; the first notification message comprises update information and auxiliary information, wherein the update information comprises updated content of the target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message;a sending module, configured to send the first notification message to the subscribing device.
- An apparatus for subscribing to a resource, the apparatus comprising: the device comprises a processing module and a receiving module;the processing module is used for receiving a first notification message sent by a target subscription device through the receiving module after sending a subscription request to a subscription target device, wherein the first notification message comprises update information and auxiliary information, and the update information comprises updated content of a target resource or updated content of the target resource; the subscription request is used for requesting subscription support for a target resource carrying the attached information in the notification message.
- A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 15 when executing the computer program.
- A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any one of claims 16 to 28.
- A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 15.
- A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 16 to 28.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/120995 WO2021102691A1 (en) | 2019-11-26 | 2019-11-26 | Resource subscription method and apparatus, computer device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113940037A true CN113940037A (en) | 2022-01-14 |
CN113940037B CN113940037B (en) | 2023-09-05 |
Family
ID=76129117
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201980097312.XA Active CN113940037B (en) | 2019-11-26 | 2019-11-26 | Resource subscription method, device, computer equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113940037B (en) |
WO (1) | WO2021102691A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114884987A (en) * | 2022-04-24 | 2022-08-09 | 青岛海信医疗设备股份有限公司 | Method, device and storage medium for acquiring equipment state information |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114172957B (en) * | 2021-12-02 | 2024-05-14 | Oppo广东移动通信有限公司 | Subscription system, method, electronic device, server, storage medium and product |
CN118140497A (en) * | 2021-12-17 | 2024-06-04 | Oppo广东移动通信有限公司 | Subscription authority information processing method and device, computer equipment and storage medium |
CN114598567A (en) * | 2022-03-03 | 2022-06-07 | 深圳市元征科技股份有限公司 | Communication method, apparatus and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020087586A1 (en) * | 2000-01-31 | 2002-07-04 | Yasuaki Yamagishi | Transmitting apparatus, receiving apparatus, transmitting - receiving system, transmitting method, and receiving method |
CN101127773A (en) * | 2007-09-21 | 2008-02-20 | 腾讯科技(深圳)有限公司 | A mail subscription method and server |
CN102118479A (en) * | 2011-01-26 | 2011-07-06 | 宇龙计算机通信科技(深圳)有限公司 | Communication book updating method, server and system |
CN102904960A (en) * | 2012-10-19 | 2013-01-30 | 北京奇虎科技有限公司 | Information synchronizing system and method based on really simple syndication (RSS) |
CN103618800A (en) * | 2013-12-05 | 2014-03-05 | 华为技术有限公司 | Method and device for achieving subscription informing |
CN105228111A (en) * | 2014-06-13 | 2016-01-06 | 中兴通讯股份有限公司 | resource subscription processing method and device |
CN106330953A (en) * | 2016-09-20 | 2017-01-11 | 北京搜狐新动力信息技术有限公司 | Intelligent router device, server device and data processing method thereof |
CN108366096A (en) * | 2018-01-17 | 2018-08-03 | 深圳市金立通信设备有限公司 | A kind of information subscribing method, terminal and computer readable storage medium |
WO2019192326A1 (en) * | 2018-04-04 | 2019-10-10 | 华为技术有限公司 | Event subscription method, apparatus and system |
WO2019205557A1 (en) * | 2018-04-24 | 2019-10-31 | 海信集团有限公司 | Resource subscription for internet of things device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1783849A (en) * | 2004-12-03 | 2006-06-07 | 腾讯科技(深圳)有限公司 | News subscribing method and system based on immediate communication platform |
US8825962B1 (en) * | 2010-04-20 | 2014-09-02 | Facebook, Inc. | Push-based cache invalidation notification |
CN102479228B (en) * | 2010-11-30 | 2013-09-18 | 英业达股份有限公司 | Pushing method for updates of online dictionary |
CN102572112B (en) * | 2012-02-14 | 2014-02-19 | 中国民航信息网络股份有限公司 | Mobile flight dynamic notifying system based on iPhone mobile platform and method thereof |
CN103647803A (en) * | 2013-11-22 | 2014-03-19 | 北京奇虎科技有限公司 | A method for a mobile terminal to subscribe content and an apparatus |
CN110311959B (en) * | 2019-06-19 | 2022-04-26 | 广州方硅信息技术有限公司 | Method and device for message pushing and page updating and data processing system |
-
2019
- 2019-11-26 CN CN201980097312.XA patent/CN113940037B/en active Active
- 2019-11-26 WO PCT/CN2019/120995 patent/WO2021102691A1/en active Application Filing
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020087586A1 (en) * | 2000-01-31 | 2002-07-04 | Yasuaki Yamagishi | Transmitting apparatus, receiving apparatus, transmitting - receiving system, transmitting method, and receiving method |
CN101127773A (en) * | 2007-09-21 | 2008-02-20 | 腾讯科技(深圳)有限公司 | A mail subscription method and server |
CN102118479A (en) * | 2011-01-26 | 2011-07-06 | 宇龙计算机通信科技(深圳)有限公司 | Communication book updating method, server and system |
CN102904960A (en) * | 2012-10-19 | 2013-01-30 | 北京奇虎科技有限公司 | Information synchronizing system and method based on really simple syndication (RSS) |
CN103618800A (en) * | 2013-12-05 | 2014-03-05 | 华为技术有限公司 | Method and device for achieving subscription informing |
CN105228111A (en) * | 2014-06-13 | 2016-01-06 | 中兴通讯股份有限公司 | resource subscription processing method and device |
CN106330953A (en) * | 2016-09-20 | 2017-01-11 | 北京搜狐新动力信息技术有限公司 | Intelligent router device, server device and data processing method thereof |
CN108366096A (en) * | 2018-01-17 | 2018-08-03 | 深圳市金立通信设备有限公司 | A kind of information subscribing method, terminal and computer readable storage medium |
WO2019192326A1 (en) * | 2018-04-04 | 2019-10-10 | 华为技术有限公司 | Event subscription method, apparatus and system |
WO2019205557A1 (en) * | 2018-04-24 | 2019-10-31 | 海信集团有限公司 | Resource subscription for internet of things device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114884987A (en) * | 2022-04-24 | 2022-08-09 | 青岛海信医疗设备股份有限公司 | Method, device and storage medium for acquiring equipment state information |
CN114884987B (en) * | 2022-04-24 | 2024-03-29 | 青岛海信医疗设备股份有限公司 | Method, device and storage medium for acquiring equipment state information |
Also Published As
Publication number | Publication date |
---|---|
WO2021102691A1 (en) | 2021-06-03 |
CN113940037B (en) | 2023-09-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113940037B (en) | Resource subscription method, device, computer equipment and storage medium | |
CN110389815A (en) | Task processing method, apparatus and system | |
RU2637466C2 (en) | Method, device and system for obtaining access to network | |
CN110837424A (en) | Service instance determining method and device, storage medium and electronic equipment | |
CN108595919B (en) | Software activation method, device, system and storage medium | |
US8849870B2 (en) | Method, apparatus and computer program product for providing context triggered distribution of context models | |
CN108600529B (en) | Information interaction method and device and computer readable storage medium | |
CN111757305A (en) | Switching method, device and system of service execution terminal and storage medium | |
CN113892279A (en) | Resource subscription method, device, server and computer storage medium | |
CN112910748B (en) | Network distribution method, device, computer equipment and storage medium | |
JP2022513769A (en) | How to process subscription messages, devices, computer devices and storage media | |
CN109275042A (en) | A kind of distribution method, device, terminal and the storage medium of barrage message | |
CN111338710A (en) | Application program control method and device, electronic equipment and storage medium | |
JP2013065207A (en) | Portable communication system, portable communication terminal and server | |
CN102413189A (en) | Configuration method and device for thin client | |
CN115037970B (en) | Control validity detection method and display device | |
CN108494843A (en) | Dropbox space sharing method, device and equipment | |
CN102970207A (en) | Instant communication method, client device and instant communication system | |
CN111935698A (en) | Network access method, device, terminal and storage medium | |
CN111541757A (en) | Vehicle-mounted interaction method, device, equipment and storage medium | |
CN112291749A (en) | Method and device for awakening T-Box, T-Box and server | |
CN109639629B (en) | Data access processing method and device, computer equipment and storage medium | |
CN110995767B (en) | Request processing method and device | |
CN106992882B (en) | Router file migration method and device | |
CN114390485A (en) | Data transmission method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |