Message processing method and device, equipment and storage medium
Patent Information
- Application Number
- CN202380100651.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2026-03-03
AI Technical Summary
In the Internet of Things, client devices may receive a large number of notification messages in a short period of time, resulting in waste of communication resources and reduced reception and resolution efficiency.
By including batch indication information in the subscription request, the server device aggregates multiple notification messages into one message and sends it to the client device, avoiding independent notifications for each notification message.
This solution saves IoT communication resources and improves the efficiency of client devices to receive and parse notification messages.
Smart Images

Figure CN121605658A_ABST
Abstract
Description
Message processing method, device, equipment and storage medium Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a message processing method, apparatus, device and storage medium. Background Art
[0002] With the continuous development of Internet of Things (IoT) technology, more and more IoT devices have brought great convenience to users' production and life in many fields such as smart homes and industrial production.
[0003] In the Internet of Things, a client device can subscribe to one or more resources from a server device. Accordingly, when the resource changes, the server device can send a notification message about the resource to the client device.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a message processing method, apparatus, device, and storage medium. The technical solution is as follows:
[0006] In one aspect, an embodiment of the present application provides a message processing method, which is executed by a server device and includes:
[0007] receiving a subscription request for subscribing to a target resource in the server device;
[0008] The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
[0009] In one aspect, an embodiment of the present application provides a message processing method, which is executed by a client device and includes:
[0010] Sending a subscription request to a server device, wherein the subscription request is used to subscribe to a target resource in the server device;
[0011] The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
[0012] In one aspect, an embodiment of the present application provides a message processing device, the device comprising:
[0013] A receiving module, configured to receive a subscription request for subscribing to a target resource in the server device;
[0014] The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
[0015] In one aspect, an embodiment of the present application provides a message processing device, the device comprising:
[0016] A sending module, configured to send a subscription request to a server device, wherein the subscription request is used to subscribe to a target resource in the server device;
[0017] The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
[0018] On the other hand, an embodiment of the present application provides a client device, the client device including a processor, a memory, and a transceiver;
[0019] The memory stores a computer program, and the processor executes the computer program to enable the client device to implement the above-mentioned message processing method.
[0020] On the other hand, an embodiment of the present application provides a server device, the server device including a processor, a memory, and a transceiver;
[0021] The memory stores a computer program, and the processor executes the computer program to enable the network device to implement the above-mentioned message processing method.
[0022] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned message processing method.
[0023] On the other hand, the present application also provides a chip, which includes a logic circuit and a firmware program written into the logic circuit; the chip is used to run in a communication device so that the communication device executes the above-mentioned message processing method.
[0024] In another aspect, the present application provides a computer program product, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a communication device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the communication device to perform the above-mentioned message processing method.
[0025] On the other hand, the present application provides a computer program, which is executed by a processor of a communication device to implement the above-mentioned message processing method.
[0026] An embodiment of the present application provides an event processing scheme, in which a server device can receive a subscription request sent by a client device, wherein the subscription request can include batch indication information for instructing to aggregate notifications of notification messages of a target resource corresponding to the subscription request. When a notification message corresponding to the target resource is subsequently generated in the server device, multiple such notification messages are aggregated and notified to the client device, without the need to notify each notification message separately. This provides a scheme for triggering the server device to aggregate multiple notification messages of the client-subscribed resource and notify the client device. When the client device subscribes to a resource that may generate multiple notification messages in a short period of time, and / or the client device subscribes to multiple notification messages that need to be used in combination, through the above scheme, the server device can aggregate multiple notification messages generated within a period of time and send them to the client device through one notification message. Accordingly, the client device only needs to receive and parse the aggregated notification message, that is, it can obtain multiple notification messages, without the need to receive and parse the multiple notification messages separately. In the scenario of sending and receiving notification messages of subscribed resources, communication resources of the Internet of Things are saved and the efficiency of the client device in receiving and parsing notification messages is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] FIG1 is a schematic diagram of the architecture of a communication system provided by an embodiment of the present application;
[0028] FIG2 is a diagram of a Matter device model involved in this application;
[0029] FIG3 is a flow chart of a message processing method provided by one embodiment of the present application;
[0030] FIG4 is a flowchart of a message processing method provided by an embodiment of the present application;
[0031] FIG5 is a schematic diagram of subscription and notification of an event involved in this application;
[0032] FIG6 is a flowchart of a message processing method provided by an embodiment of the present application;
[0033] FIG7 is a flowchart of an event subscription and aggregate notification involved in this application;
[0034] FIG8 is a flowchart of another event subscription and aggregate notification involved in this application;
[0035] FIG9 is a flowchart of another event subscription and aggregate notification involved in this application;
[0036] FIG10 is a block diagram of a message processing device provided by one embodiment of the present application;
[0037] FIG11 is a block diagram of a message processing device provided by one embodiment of the present application;
[0038] FIG12 is a schematic structural diagram of a communication device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application are further described in detail below with reference to the accompanying drawings.
[0040] The network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0041] Please refer to Figure 1, which shows a schematic diagram of the network architecture of the Internet of Things provided by one embodiment of the present application. The network architecture of the Internet of Things may include: a server device 110 and a client device 120;
[0042] The server device 110 may be a device in the Internet of Things that provides server functions corresponding to the Internet of Things protocol. The server device may provide subscribable resources to the outside world.
[0043] For example, the server device 110 can be a smart home device, such as smart lamps, smart TVs, smart air conditioners, smart refrigerators, smart microwave ovens, smart rice cookers, sweeping robots, smart speakers, smart switches, etc.
[0044] Alternatively, the server device 110 may be an industrial production equipment, such as a lathe, an industrial robot, a solar panel, a wind turbine, and the like.
[0045] Alternatively, the service-end device 110 may be a commercial service device, such as an unmanned vending machine, etc.
[0046] Alternatively, the server device 110 may be an intelligent monitoring device, such as a monitoring camera, an infrared sensor, a sound sensor, a temperature sensor, and the like.
[0047] In one possible implementation, the server device 110 may also be a user-side terminal device. For example, the server device 110 may be a smart controller, a smart remote control, a smart phone, a tablet computer, a smart watch, a smart TV, a gateway, etc. Alternatively, the server device 110 may be a personal computer, such as a desktop computer, a portable computer, a personal workstation, etc.
[0048] The client device 120 may also be a device that provides client functions corresponding to the Internet of Things protocol.
[0049] The client device 120 may be a terminal device on the user side. For example, the client device 120 may be an intelligent controller, an intelligent remote controller, a smart phone, a tablet computer, a smart watch, a smart TV, etc.
[0050] In another possible implementation, the client device 120 may also be a client entity (which may be a virtual entity) running based on a terminal device. For example, the client device 120 may be an APP running in a smartphone for controlling or managing the server device 110.
[0051] Alternatively, the client device 120 may also be a smart home device, such as a smart lamp, a smart TV, a smart air conditioner, a smart refrigerator, a smart microwave oven, a smart rice cooker, a sweeping robot, a smart speaker, a smart switch, and the like.
[0052] Alternatively, the client device 120 may also be industrial production equipment, such as a lathe, an industrial robot, a solar panel, a wind turbine, and the like.
[0053] Alternatively, the client device 120 may also be a commercial service device, such as an unmanned vending machine, etc.
[0054] Alternatively, the client device 120 may also be an intelligent monitoring device, such as a monitoring camera, an infrared sensor, a sound sensor, a temperature sensor, and the like.
[0055] In an embodiment of the present application, the above-mentioned server device 110 and client device 120 can be electronic devices that meet the same or different Internet of Things protocols. For example, they can be electronic devices that meet the Matter protocol (or the Connected Home over IP Working Group (CHIP) project) under the Connectivity Standards Alliance (CSA) (or Zigbee Alliance).
[0056] Matter is an IP-based IoT connectivity standard that addresses compatibility, security, and connectivity issues currently facing the smart home market. The Matter protocol includes the following concepts:
[0057] 1) Device Data Model
[0058] Please refer to Figure 2, which shows the Matter device model involved in this application. As shown in Figure 2, the model hierarchy from high to low is node (Node), endpoint (Endpoint), functional unit (Cluster), and attribute (Attribute) / command (Command) / event (Event).
[0059] ①Node
[0060] A node encapsulates an addressable, unique network resource and has a set of functions that allow users to clearly view it as a functional entity. For example, a desk lamp that supports the Matter protocol, after pairing with a user terminal, has an IP address (an addressable, unique network resource) and two functions: turning the light on and off. Users can view the lamp node as a single entity and control it.
[0061] A node is the highest or outermost first-order element in a physical model and the only addressable element in the outermost layer of the physical model.
[0062] A node can have multiple node IDs, each of which belongs to a specific Fabric.
[0063] The communication protocol stack that supports this data model should support the interaction between nodes on the node logical interconnection network.
[0064] ②Endpoint
[0065] Endpoint is an endpoint. A node consists of one or more endpoints. An endpoint is an instance, which can be a service type or a virtual device.
[0066] Each endpoint has one or more functional units, namely the functional units supported on the endpoint (Cluster). Cluster is an object class instantiated on the endpoint.
[0067] For example, a desk lamp can be regarded as a node. The desk lamp can have two independently controlled light bulbs. Each light bulb can be regarded as an endpoint. The turning on function of each light bulb corresponds to one cluster, while the brightness adjustment function can correspond to another cluster.
[0068] ③Cluster
[0069] A cluster, also known as a functional unit or cluster, is the most fundamental functional building block in the object model. It defines the rules for interaction between the server and client. A cluster can be considered an interface, service, or object class, representing the lowest-level, independent functional element in the data model. Each cluster has its own specification, which includes attributes, events, commands, and behaviors. The mandatory or optional nature of a cluster's attributes, events, commands, and behaviors depends on the cluster's definition.
[0070] A cluster specification should contain one or more cluster identifiers. A cluster identifier should reference a cluster specification and guarantee compliance with that specification. A cluster instance should be represented and discoverable by a cluster identifier on an endpoint. The cluster identifier also represents the function and purpose of the cluster instance.
[0071] The server-side Cluster supports attributes, events, and command data, and the client-side Cluster is responsible for initiating interactions, including calling Cluster commands.
[0072] ④Attribute
[0073] Attributes reflect the queryable / settable status, configuration, and capabilities of a device.
[0074] ⑤Command
[0075] Command is a control over the specific functions of a functional unit and is transmitted between the client and server of the cluster.
[0076] ⑥Event
[0077] An event is a record of past events. An event can be thought of as a log entry, and an event stream can be thought of as a time view of the state evolution on a node.
[0078] An event is readable because its event identifier is discoverable by a Cluster instance.
[0079] An event record is created by a node when an event occurs. This record should contain metadata: an event ID, a timestamp, and a priority level. This metadata should be stored in the event record header.
[0080] Event number:
[0081] A 64-bit node-wide identifier. This identifier should increase monotonically over the lifetime of the node and remain monotonic across device reboots. This monotonicity is reset after a factory reset.
[0082] Each event record should have an event number that is exactly the number of the last event record created on that node plus one.
[0083] When a node restarts, the event number may be incremented by a step size greater than 1.
[0084] After a client device subscribes to a resource (e.g., one or more functional units, or properties or events within one or more functional units) from a server device, the server device needs to notify the client device of a notification message generated for that resource (e.g., a change in a property within a subscribed functional unit, or an event within a subscribed functional unit, or a change in a subscribed property, or an event within a subscribed functional unit). Some notification messages may occur multiple times within a short period of time.
[0085] For example, a server device is a multimedia device, such as a TV or smart speaker. The server device includes a media playback function unit (MediaPlayback cluster), which includes the following:
[0086] CurrentState property: indicates whether the TV is currently in pause, cache, play, stop, etc. Fast forward or rewind are both considered play;
[0087] StartTime: the start time of multimedia playback;
[0088] Duration: The duration of multimedia playback;
[0089] PlaybackSpeed: playback speed, fast forward, fast rewind, etc.
[0090] These properties change rapidly when users fast-forward or rewind content. These properties are highly interrelated, and in some ways, only their combination makes sense. For example, when a user needs to understand the fast-forward / rewind status of a TV, they need to obtain both the fast-forward / rewind property (PlaybackSpeed) and the playback time (Duration) after the fast-forward / rewind. This allows them to determine the playback time after each fast-forward / rewind. Accordingly, the user's client device needs to subscribe to the PlaybackSpeed and Duration properties and the events corresponding to these two properties. Furthermore, when using the fast-forward / rewind function on a TV, users typically perform multiple fast-forward / rewind operations in succession, which means that multiple changes to the PlaybackSpeed and Duration properties, or multiple events corresponding to PlaybackSpeed and Duration, may occur within a short period of time.
[0091] If the user subscribes to these properties / events, or subscribes to the above-mentioned MediaPlayback cluster, then in the above-mentioned scenario, a large number of notification messages may be received at specific times and in specific scenarios, requiring the client device to undertake a large number of parsing tasks in a short period of time. At the same time, a large number of notification messages will also occupy too many network resources.
[0092] To address the above issues, subsequent embodiments of the present application provide a message processing method that can aggregate notification messages occurring within a period of time and send them to a client device, eliminating the need to independently notify each notification message.
[0093] Please refer to FIG3 , which shows a flow chart of a message processing method provided by an embodiment of the present application. The method may be executed by a server device, which may be the server device 110 in the network architecture shown in FIG1 . The method may include the following steps:
[0094] Step 301: Receive a subscription request, which is used to subscribe to a target resource in a server device. The subscription request includes batch indication information, which is used to instruct the server device to aggregate multiple notification messages corresponding to the target resource and send them to the client device.
[0095] In some embodiments, when a client device needs to continuously obtain notification messages corresponding to one or more resources in a server device, the client device may send a subscription request to the server device to subscribe to the corresponding target resource.
[0096] Among them, the above-mentioned subscription request can be a request to subscribe to events in the server device. For example, the above-mentioned subscription request can be a request to subscribe to one or more events (Event) in a functional unit (Cluster) in the server device; for example, taking the server device as a TV as an example, the above-mentioned subscription request can be a request to subscribe to the fast-forward event / fast-rewind event / playback time change event in the MediaPlayback cluster of the TV.
[0097] Alternatively, the subscription request may be a request to subscribe to an attribute in the server device; for example, taking the server device as a television, the subscription request may be a request to subscribe to the PlaybackSpeed attribute or the Duration attribute in the MediaPlayback cluster of the television.
[0098] Alternatively, the subscription request may be a request to subscribe to a functional unit in the server device; for example, taking the server device as a television, the subscription request may be a request to subscribe to the MediaPlayback cluster where the fast-forward event / fast-rewind event / playback time change event in the television is located, or the subscription request may be a request to subscribe to the MediaPlayback cluster where the PlaybackSpeed attribute or Duration attribute in the television is located.
[0099] The above subscription request may include information for indicating the above target resource (that is, information of the subscription target), such as the identifier of the above event (for example, the event name), or the identifier of the attribute corresponding to the above event (for example, the attribute name), or the identifier of the functional unit (for example, the name of the functional unit).
[0100] In addition to the information indicating the target resource, the subscription request may also include information indicating that the server device should aggregate and notify the notification messages corresponding to the target resource, that is, the batch indication information.
[0101] Among them, the notification message corresponding to the above-mentioned subscription request may include a single notification message, for example, it may include a notification message that may occur multiple times in a short period of time, such as a notification message of volume changes that may occur multiple times in a short period of time; or, the notification message corresponding to the above-mentioned subscription request may also include multiple notification messages, for example, it may include multiple events that need to be used in combination, such as the fast-forward and / or fast-rewind attributes in the above-mentioned TV, and a notification message of changes in the playback time attributes.
[0102] In summary, the solution shown in the embodiment of the present application is that the server device can receive a subscription request sent by the client device, wherein the subscription request can include batch indication information for instructing to aggregate and notify notification messages of the target resource corresponding to the subscription request. When a notification message corresponding to the target resource is subsequently generated in the server device, multiple of the above notification messages are aggregated and notified to the client device, and there is no need to notify each notification message separately, thereby providing a solution for triggering the server device to aggregate multiple notification messages of the resource subscribed by the client and notify the client device. When the client device subscribes to a resource that may generate multiple notification messages in a short period of time, and / or the client device subscribes to multiple notification messages that need to be used in combination, through the above solution, the server device can aggregate multiple notification messages generated within a period of time and send them to the client device through one notification message. Accordingly, the client device only needs to receive and parse the aggregated notification message, that is, it can obtain multiple notification messages, and there is no need to receive and parse multiple notification messages separately. In the scenario of sending and receiving notification messages of subscribed resources, the communication resources of the Internet of Things are saved and the efficiency of the client device in receiving and parsing notification messages is improved.
[0103] Please refer to FIG4 , which shows a flowchart of a message processing method provided by an embodiment of the present application. The method may be executed by a client device, which may be the client device 120 in the network architecture shown in FIG1 . The method may include the following steps:
[0104] Step 401: Send a subscription request to the server device. The subscription request is used to subscribe to the target resource in the server device. The subscription request includes batch indication information. The batch indication information is used to instruct the server device to aggregate multiple notification messages corresponding to the target resource and send them to the client device.
[0105] In summary, in the solution shown in the embodiment of the present application, the client device can send a subscription request to the server device, wherein the subscription request can include batch indication information for instructing to aggregate and notify notification messages of the target resource corresponding to the subscription request. When a notification message corresponding to the target resource is subsequently generated in the server device, multiple of the above notification messages are aggregated and notified to the client device, and there is no need to notify each notification message separately, thereby providing a solution for triggering the server device to aggregate multiple notification messages of the resource subscribed by the client and notify the client device. When the client device subscribes to a resource that may generate multiple notification messages in a short period of time, and / or the client device subscribes to multiple notification messages that need to be used in combination, through the above solution, the server device can aggregate multiple notification messages generated within a period of time and send them to the client device through one notification message. Accordingly, the client device only needs to receive and parse the aggregated notification message, that is, it can obtain multiple notification messages, and there is no need to receive and parse multiple notification messages separately. In the scenario of sending and receiving notification messages of subscribed resources, the communication resources of the Internet of Things are saved and the efficiency of the client device in receiving and parsing notification messages is improved.
[0106] Based on the embodiments shown in Figures 3 and 4 above, please refer to Figure 5, which shows a schematic diagram of subscription and notification of a resource involved in the present application. As shown in Figure 5, taking the scenario of subscribing to the PlaybackSpeed attribute and Duration attribute of a TV as an example, the client device 510 can send a subscription request to the server device 520 (step S1). The subscription request includes a subscription target (for example, the name of the PlaybackSpeed attribute and the Duration attribute) and batch indication information. When the PlaybackSpeed attribute and the Duration attribute subsequently change in the server device 520, the server device 520 will not immediately send a notification message of the corresponding PlaybackSpeed attribute and Duration attribute change event, but will wait for a period of time and aggregate one or more notification messages of the PlaybackSpeed attribute and the Duration attribute changes during the waiting period into a single notification message (step S2), and send the single notification message to the client device 510 (step S3). The client device 510 parses the single notification message to obtain one or more notification messages of the above-mentioned changes in the PlaybackSpeed attribute and the Duration attribute.
[0107] Please refer to FIG6 , which shows a flowchart of a message processing method provided by an embodiment of the present application. The method can be interactively executed by a client device and a server device, wherein the client device can be the client device 120 in the network architecture shown in FIG1 , and the server device can be the server device 110 in the network architecture shown in FIG1 . The method can include the following steps:
[0108] In step 601, the client device sends a subscription request to the server device, where the subscription request is used to subscribe to a target resource in the server device. The subscription request includes batch indication information, which is used to instruct the server device to aggregate multiple notification messages corresponding to the target resource and send them to the client device. The server device receives the subscription request.
[0109] In some embodiments, the subscription request may further include one or both of a maximum interval duration (Maxinterval) and a minimum interval duration (Mininterval).
[0110] Among them, the above-mentioned maximum interval duration (Maxinterval) can be used to indicate the maximum interval for the server device to send the notification message corresponding to the above-mentioned target resource to the client device. That is to say, within the duration of the above-mentioned maximum interval duration, the server device needs to send the notification message corresponding to the above-mentioned target resource to the client device at least once. For example, after the server device sends the notification message corresponding to the above-mentioned target resource to the client device once, a timer can be started. The timing duration of the timer is the above-mentioned maximum interval duration. If the notification message corresponding to the above-mentioned target resource is not generated in the server device when the timer reaches the above-mentioned maximum interval duration, the server device can send an empty notification message corresponding to the above-mentioned target resource to the client device, which is used to indicate that the client device's subscription to the above-mentioned target resource in the server device is normal.
[0111] Optionally, after receiving a notification message corresponding to the above-mentioned target resource sent by the server device, the client device may also start a timer, where the timing duration of the timer is the above-mentioned maximum interval duration. If the client device does not receive the notification message corresponding to the above-mentioned target resource during the period when the timer reaches the above-mentioned maximum interval duration, the client device may determine that an abnormality has occurred in the client device's subscription to the above-mentioned target resource in the server device. At this time, the client device may re-initiate the subscription to the target resource, or issue a reminder to the user.
[0112] The above-mentioned minimum interval duration (Mininterval) can be used to indicate the minimum interval between two consecutive notification messages notified by the server device to the client device; that is, if the above-mentioned notification messages occur two or more times consecutively in the server device within the above-mentioned minimum interval duration, the server device can notify the client device of one of the above-mentioned two or more notification messages, and the other notification messages can be discarded. For example, the server device can send a notification message with the latest generation time among the above-mentioned two or more notification messages to the client device.
[0113] Optionally, after a notification message corresponding to the target resource is generated in the server device (for example, determined to be notification message 1), a timer can be started, and during the timing period of the timer, detection can continue to be made as to whether the same notification message is generated. When the timing duration of the timer reaches the minimum interval duration, if the same notification message (for example, notification message 2, notification message 3, etc.) is detected to be generated during the timing period of the timer, then the notification message with the latest occurrence time among the same notification messages such as notification message 1, notification message 2, and notification message 3 can be determined as the notification message to be notified to the client device, and the other notification messages among the same notification messages such as notification message 1, notification message 2, and notification message 3 can be discarded by the server device. Correspondingly, if no notification message identical to notification message 1 is detected during the timing period of the timer, the server device can determine notification message 1 as the notification message to be notified to the client device.
[0114] In one possible implementation, the batch indication information includes at least one of the following information:
[0115] 1) A first indication is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device; or in other words, the first indication is used to instruct the server device to enable the function of aggregating and sending multiple notification messages to the client device.
[0116] In some embodiments, when there is a first indication in the above-mentioned batch indication information, the batch indication information is used to indicate that the server device is allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used for the server device to enable the function of aggregating and sending multiple notification messages to the client device for the client device; correspondingly, when there is no first indication in the above-mentioned batch indication information, the batch indication information is used to indicate that the server device is not allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used for the server device to not enable the function of aggregating and sending multiple notification messages to the client device for the client device.
[0117] In another embodiment, when the parameter of the above-mentioned first indication is the first parameter, the batch indication information is used to indicate that the server device is allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used for the server device to enable the function of aggregating and sending multiple notification messages to the client device; correspondingly, when the parameter of the above-mentioned first indication is the second parameter, the batch indication information is used to indicate that the server device is not allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used for the server device to not enable the function of aggregating and sending multiple notification messages to the client device.
[0118] For example, when the parameter of the first indication is 1, the batch indication information is used to indicate that the server device is allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used to indicate that the server device enables the function of aggregating and sending multiple notification messages to the client device for the client device; correspondingly, when the parameter of the above-mentioned first indication is 0, the batch indication information is used to indicate that the server device is not allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used to indicate that the server device does not enable the function of aggregating and sending multiple notification messages to the client device for the client device.
[0119] For another example, when the parameter of the first indication is 0, the batch indication information is used to indicate that the server device is allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used to indicate that the server device enables the function of aggregating and sending multiple notification messages to the client device for the client device; correspondingly, when the parameter of the above-mentioned first indication is 1, the batch indication information is used to indicate that the server device is not allowed to aggregate and send multiple notification messages to the client device, or the batch indication information is used to indicate that the server device does not enable the function of aggregating and sending multiple notification messages to the client device for the client device.
[0120] In another embodiment, when the above-mentioned subscription request includes the above-mentioned batch indication information, the subscription request indicates that the server device is allowed to aggregate and send multiple notification messages to the client device, or the subscription request indicates that the server device enables the function of aggregating and sending multiple notification messages to the client device for the client device; correspondingly, when the above-mentioned subscription request does not include the above-mentioned batch indication information, the subscription request is used to indicate that the server device is not allowed to aggregate and send multiple notification messages to the client device, or the subscription request is used to indicate that the server device does not enable the function of aggregating and sending multiple notification messages to the client device for the client device.
[0121] 2) Buffering duration, used to indicate the duration of the aggregated notification message.
[0122] Optionally, the above buffering period can be used to indicate the upper limit of the time span between the occurrence times of multiple events to which notification messages are aggregated and sent; or, the above buffering period is used to indicate the maximum time for delaying the sending of notification messages of events.
[0123] In some embodiments, the above-mentioned batch indication information is used to instruct the server device to aggregate and send multiple notification messages to the client device, which means that the above-mentioned batch indication information is used to instruct the server device to aggregate and send multiple notification messages generated within the buffering period to the client device, that is, each notification message corresponding to the target resource generated within a time period corresponding to the above-mentioned buffering period will be aggregated and notified to the client device, or, after an above-mentioned notification message that is not notified to the client device is generated in the server device, the notification message will be delayed and notified to the client device, and the maximum delay time shall not exceed the above-mentioned buffering period, and when the notification message is notified to the client device, the same notification message generated within the above-mentioned delayed time period will also be notified to the client device in an aggregated manner together with the notification message.
[0124] According to the solution shown in the above embodiment of the present application, the client device can indicate to the server device through a subscription request whether to aggregate the notification messages corresponding to the subscribed target resources, and indicate the upper limit of the time span between the times when the notification messages of the aggregated notifications are generated / the maximum duration of the delayed sending of the notification messages, thereby ensuring the flexibility and controllability of the aggregated notifications of the notification messages of the subscribed target resources.
[0125] In some embodiments, the method further includes: the server device may send a subscription response corresponding to the subscription request to the client device, the subscription response being used to indicate whether the subscription is successful. Correspondingly, the client device receives the subscription response corresponding to the subscription request.
[0126] In the above embodiment, after receiving the above subscription request, the server device may determine whether to accept the subscription and return a subscription response to the client device based on the determination result, so that the client device can timely understand the subscription status of the target resource.
[0127] In some embodiments, the subscription response includes a second indication;
[0128] When the value of the second indication is the first value, the subscription response is used to indicate that the subscription is successful;
[0129] When the value of the second indication is the second numerical value, the subscription response is used to indicate that the subscription fails.
[0130] For example, when the value of the second indication is 1, the subscription response may indicate that the client device has successfully subscribed to the target resource in the server device; when the value of the second indication is 0, the subscription response may indicate that the client device has failed to subscribe to the target resource in the server device.
[0131] For another example, when the value of the second indication is 0, the subscription response may indicate that the client device has successfully subscribed to the target resource in the server device; when the value of the second indication is 1, the subscription response may indicate that the client device has failed to subscribe to the target resource in the server device.
[0132] For another example, when the value of the second indication is TRUE, the subscription response may indicate that the client device has successfully subscribed to the target resource in the server device; when the value of the second indication is FALSE, the subscription response may indicate that the client device has failed to subscribe to the target resource in the server device.
[0133] In some embodiments, when the batch indication information includes a buffering duration, the method further includes:
[0134] When the server device determines that the subscription is successful and does not accept the buffering time included in the batch indication information, it corrects the buffering time to obtain the corrected buffering time. In this case, the server device sends a subscription response to the client device, including:
[0135] A subscription response is sent to the client device, indicating that the subscription is successful. The subscription response also includes the corrected buffering duration.
[0136] Accordingly, for the client device, if the buffering time is included in the batch indication information and the server device determines that the subscription is successful and does not accept the buffering time included in the batch indication information, the subscription response also includes the revised buffering time.
[0137] In an embodiment of the present application, after the server device receives the above-mentioned subscription request, if it is determined to accept the client device's subscription to the above-mentioned target resource, it can further detect whether the above-mentioned buffer period is accepted. If it is determined not to accept the above-mentioned buffer period, the server device can further determine a new buffer period as the above-mentioned revised buffer period, and notify the client device in the subscription response.
[0138] For example, after the server device receives the above-mentioned subscription request, if it detects that the client device has the authority to subscribe to the above-mentioned target resource, it determines to accept the client device's subscription to the target resource, and further detects whether the capabilities of the server device support the above-mentioned buffer period carried in the subscription request. If it is determined that the capabilities of the server device do not support the above-mentioned buffer period carried in the subscription request, it can be determined that the above-mentioned buffer period is not accepted, and further determines the one closest to the buffer period carried in the above-mentioned subscription request among the buffer periods supported by the server device as the corrected buffer period, and notifies the client device in the subscription response.
[0139] Alternatively, after receiving the above subscription request, if the server device detects that the client device has the authority to subscribe to the above target resource, it determines to accept the client device's subscription to the target resource, and if other devices have previously subscribed to the target resource, and the subscription request of the other devices to the target resource also carries a buffering period, the server device can further detect whether the above buffering period carried in the subscription request is the same as the buffering period carried in the subscription request of the other devices to the target resource. If they are different, it can be determined not to accept the above buffering period in the subscription request sent by the client device, and the buffering period is corrected to the buffering period carried in the subscription request of the other devices to the target resource, and notified to the client device in the subscription response. Through the above scheme, the buffering periods corresponding to the subscription requests of multiple devices to the same target resource can be unified, so that when the notification message of the same target resource is subsequently aggregated and sent to multiple devices, the aggregation and sending process of the notification message can be unified, which simplifies the complexity of sending aggregated notification messages to multiple devices and improves the efficiency of aggregated notifications.
[0140] In addition, when multiple devices subscribe to the same target resource, the server device can also maintain corresponding buffer durations for multiple devices respectively. That is, the duration of the aggregate notifications sent by the server device to multiple devices can be different, thereby achieving personalized processing of aggregate notifications for multiple devices.
[0141] According to the solution shown in the embodiment of the present application, the server device can correct the above-mentioned buffering period and notify the client device, thereby establishing a negotiation mechanism for the buffering period between the server device and the client device, further improving the flexibility of the server device in aggregating notifications of notification messages corresponding to the target resources subscribed by the client device.
[0142] Step 602: The server device sends an aggregated notification message to the client device; the aggregated notification message is used to indicate the notification messages corresponding to all the target resources in the server device that have not been notified to the client device.
[0143] In some embodiments, the client device includes a plurality of devices subscribing to the target resource;
[0144] When the first timer expires, an aggregated notification message is sent to the client device, including:
[0145] When the first timer expires, obtaining identification information of multiple devices subscribed to the target resource;
[0146] According to the identification information of the multiple devices, an aggregated notification message is sent to the multiple devices respectively.
[0147] That is to say, in the above scheme, when multiple devices subscribe to the same target resource, the same buffering period can be used. This can unify the timing and message content of the server device sending the aggregated notification message corresponding to the target resource to multiple devices respectively, simplifying the implementation method of the aggregated notification and improving the notification efficiency.
[0148] In some embodiments, when the first timer expires, an aggregated notification message is sent to the client device; the aggregated notification message is a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device;
[0149] The maximum timing duration of the first timer is the buffer duration, and the starting method of the first timer includes at least one of the following:
[0150] When a first notification message corresponding to the target resource and not yet notified to the client device is generated, starting a first timer;
[0151] Cyclic start of the first timer; that is, when the first timer ends, a new first timer can be started;
[0152] Also, when the second timer is started, the first timer is started; the second timer is a timer corresponding to the maximum interval duration, and the maximum interval duration is the upper limit of the time span between two consecutive notification messages corresponding to the target resource being sent to the client device.
[0153] In some embodiments, when the first notification message corresponding to the target resource and not notified to the client device occurs, the server device starts a first timer; the timing duration of the first timer is the buffer duration; when the first timer expires, the server device sends an aggregated notification message to the client device; the aggregated notification message is used to indicate all notification messages corresponding to the target resource that have not been notified to the client device.
[0154] In the scheme shown in the embodiment of the present application, when there is no notification message in the server device that has not been notified to the client device, if the first of the above-mentioned notification messages occurs (assuming it is notification message 1), the server device can start a timer, set the timing duration of the timer to the above-mentioned buffer duration, and at the same time detect whether the same notification message occurs in the server device. When the first timer ends, the above-mentioned event 1 and the same notification message that occurred during the running time period of the timer are aggregated and notified to the client device. For example, the server device generates an aggregated notification message, which includes information about the above-mentioned notification message 1 and the same notification message that occurred during the running time period of the timer; wherein the information of the above-mentioned notification message may include the occurrence time of the notification message, the type / name of the notification message, the value of the attribute corresponding to the notification message (such as the value before and after the change of the attribute corresponding to the time), etc.
[0155] Among them, the above-mentioned same notification message may refer to a notification message filtered by the above-mentioned Mininterval, that is, during the running time of the above-mentioned first timer, if the client device detects two of the above-mentioned notification messages, and the interval between the two notification messages is not greater than Mininterval, then one of the two notification messages is recorded and the other notification message can be discarded.
[0156] Through the above scheme, the server device can start timing from the first occurrence of the above notification message that has not been notified to the client device, and aggregate the same notification messages during the period when the timing reaches the buffer time and notify the client device. If the above notification message does not occur, the timing will not be started, avoiding unnecessary timing operations and saving the processing resources of the server device. In addition, this scheme can maximize the use of the above buffer time, that is, aggregating as many notification messages as possible, further saving the communication resources of the Internet of Things, and improving the efficiency of the client device in parsing notification messages.
[0157] In some embodiments, the above method further comprises:
[0158] The server device starts a first timer; the timing duration of the first timer is the buffering duration; when the first timer expires, the server device sends an aggregated notification message to the client device.
[0159] In the solution shown in the embodiment of the present application, the server device can cyclically start the above-mentioned first timer, that is, when the first timer is not started, the server device will start the above-mentioned first timer regardless of whether the notification message corresponding to the target resource subscribed by the above-mentioned client device has occurred, and detect whether the above-mentioned notification message has occurred during the running time period of the first timer. If the above-mentioned notification message has occurred multiple times during the running time period of the first timer, the multiple notification messages occurring within the first timer will be aggregated and notified to the client device; optionally, if the above-mentioned notification message has occurred only once during the running time period of the first timer, the server device will also notify the client device of the notification message. Optionally, after the first timer reaches the above-mentioned buffering time, the server device can restart the first timer, or in other words, the server device can reset the timing progress of the first timer to 0, that is, let the first timer start timing again from 0.
[0160] Through the above solution, the server device can count the buffering time in a loop, aggregate the notification messages of the target resources subscribed by the client device that occur within each buffering time and notify the client device, and start the timing even if the above notification message does not occur. In this way, when the notification messages are aggregated, the timeliness of the notification messages can be guaranteed as much as possible, thereby improving the notification efficiency of the notification messages.
[0161] In some embodiments, the above method also includes: when the second timer reaches the timing duration and the first timer has not reached the timing duration, the server device determines that the first timer has ended; the timing duration of the second timer is the above maximum interval duration Maxinterval.
[0162] In an embodiment of the present application, the above-mentioned buffering period can also be used in conjunction with Maxinterval, that is, when the server device uses the buffering period to count to determine the notification messages that need to be aggregated for notification, it can also run a second timer, and the timing period of the second timer is Maxinterval. When the timing period of the second timer reaches Maxinterval, it means that the server device has not sent a notification message to the client device within the duration of Maxinterval. At this time, the server device needs to send a notification message to the client device. In this case, the server device can also end the operation of the first timer. If the above-mentioned notification message that has occurred and delayed notification exists in the server device at this time, the server device can notify the client device of the above-mentioned notification message that has been cached and not notified, thereby avoiding the situation where the server device sends an empty notification message to the client device due to delayed notification when there is a notification message that needs to be notified, thereby further saving communication resources between the server device and the client device. Optionally, when the timing duration of the second timer reaches Maxinterval and the server device ends the operation of the first timer, if the server device does not have the above-mentioned notification message that has occurred and delayed notification, the server device can send an empty notification message to the client device to indicate that the subscription relationship is normal.
[0163] The buffering time is not greater than the maximum time interval.
[0164] In some embodiments, the buffering time is greater than the minimum interval (ie, the Mininterval), where the minimum interval is the lower limit of the time span between two adjacent notification messages corresponding to the target resource.
[0165] In some embodiments, the above method further includes: when the first timer reaches the timing duration, the server device determines that the first timer has expired.
[0166] In an embodiment of the present application, if the first timer reaches the above-mentioned buffering time, the server device can determine that the first timer has ended. If at this time there are one or more of the above-mentioned notification messages that have occurred and delayed notification in the server device, the server device can send an aggregated notification message to the client device, and the aggregated notification message includes information about one or more of the above-mentioned notification messages that have occurred and delayed notification.
[0167] For example, if the first timer reaches the above-mentioned buffering time length and the second timer does not reach the timing time length, the server device can determine that the first timer has expired. If there are one or more of the above-mentioned notification messages that have occurred and delayed notification, the above-mentioned one or more notification messages will be aggregated and notified to the client device; if there are no above-mentioned notification messages that have occurred and delayed notification, no notification message will be sent.
[0168] In some embodiments, the above method also includes: when the first timer reaches the timing duration, the second timer has not reached the timing duration, and the server device has the above event that has not been notified to the client device, the server device determines that the second timer has ended.
[0169] In an embodiment of the present application, if the first timer reaches the above-mentioned buffering time and the second timer has not reached the timing time, the server device can determine that the first timer has ended. At this time, if there are one or more of the above-mentioned notification messages that have occurred and delayed notification, the server device needs to send an aggregated notification message, which means that the above-mentioned notification message has occurred within the time range of Maxinterval. At this time, it is necessary to end the second timer at the same time to ensure the compatibility of the buffering time and Maxinterval.
[0170] In some embodiments, the above method further comprises:
[0171] Simultaneously starting a first timer and a second timer, wherein the timing duration of the first timer is the buffer duration; the timing duration of the second timer is the maximum interval duration; when the first timer reaches the timing duration, sending an aggregated notification message to the client device; the aggregated notification message is used to indicate notification messages that occurred during the running time of the first timer;
[0172] Restart the first timer and the second timer.
[0173] In an embodiment of the present application, the first timer and the second timer can be started at the same time. Specifically, when the second timer is started, the server device can start the first timer at the same time. When the first timer is started and the buffering time is reached, if the server device has the above-mentioned notification message that has not been notified to the client device, the server device will aggregate the notification message to the client device. At this time, the above-mentioned notification message is sent, and the first timer and the second timer need to be restarted at the same time. If the first timer is started and the buffering time is reached, there is no above-mentioned event that has not been notified to the client device in the server device, and the second timer has not reached Maxinterval, the server device can restart the first timer alone. Through the above solution, the compatibility of the buffering time and Maxinterval can be guaranteed.
[0174] In some embodiments, when the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N ≥ 2, the aggregated notification message may indicate the time of the N notification messages in the following two ways:
[0175] 1) The aggregated notification message includes the first occurrence time of the first notification message among the N notification messages, and the intervals between the occurrence times of the other N-1 notification messages among the N notification messages and the first occurrence time.
[0176] For example, assuming that the number N is 3, and the times at which the three notification messages occur are time 1, time 2, and time 3, respectively, then the aggregated notification message can include time 1. In addition, it can also include the time interval between time 2 and time 1, and the time interval between time 3 and time 1.
[0177] 2) The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the intervals between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
[0178] For example, assuming that the number N is 3, and the times at which the three notification messages occur are time 1, time 2, and time 3, respectively, then the aggregated notification message can include time 1. In addition, it can also include the time interval between time 2 and time 1, and the time interval between time 3 and time 2.
[0179] Through the above scheme, when the server device aggregates and notifies multiple notification messages, it represents the occurrence time of multiple notification messages in the form of a complete time and one or more time intervals. Since the time interval occupies less data than the representation of the complete time, it is possible to compress the time information in the aggregated notification of the notification message, thereby further saving communication resources between the server device and the client device.
[0180] Optionally, the complete time in the above-mentioned aggregated notification message may be, in addition to the occurrence time of the first event, the occurrence time of other events. For example, the above-mentioned aggregated notification message may include the second occurrence time of the last notification message among N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the second occurrence time; or, the above-mentioned aggregated notification message may include the second occurrence time of the last notification message among N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the next adjacent notification message.
[0181] In some embodiments, the aggregated notification message may include an aggregation status (BatchStatues) and the number of the notification messages.
[0182] The aggregation state indicates whether the current notification message is a notification message sent after aggregating multiple notification messages. The number of notification messages indicates the number of notification messages indicated by the aggregated notification message.
[0183] For example, when the value of the above-mentioned aggregation state is 1, it indicates that the current notification message is a notification message sent after aggregating multiple notification messages, and the number of the above-mentioned notification messages is an integer greater than or equal to 2; conversely, when the value of the above-mentioned aggregation state is 0, it indicates that the current notification message is not a notification message sent after aggregating multiple notification messages, and the number of the above-mentioned notification messages is 1 or 0; among them, the number of the above-mentioned notification messages is 1, indicating that the above-mentioned notification message occurs only once within a buffer period; the number of the above-mentioned notification messages is 0, indicating that the above-mentioned notification message does not occur within a Maxinterval.
[0184] For another example, when the value of the above-mentioned aggregation state is 0, it indicates that the current notification message is a notification message sent after aggregating multiple notification messages, and the number of the above-mentioned notification messages is an integer greater than or equal to 2; conversely, when the value of the above-mentioned aggregation state is 1, it indicates that the current notification message is not a notification message sent after aggregating multiple notification messages, and the number of the above-mentioned notification messages is 1 or 0.
[0185] For another example, when the value of the above-mentioned aggregation state is 0, it indicates that the current notification message is a notification message sent after aggregating multiple notification messages, and the number of the above-mentioned notification messages is an integer greater than or equal to 2; when the value of the above-mentioned aggregation state is 1, it indicates that the current notification message is a notification message triggered by only one of the above-mentioned notification messages occurring within the buffering period, and the number of the above-mentioned notification messages is 1 at this time; when the value of the above-mentioned aggregation state is 2, it indicates that the current notification message is a notification message triggered by no occurrence of the above-mentioned notification message within the Maxinterval, and the number of the above-mentioned notification messages is 0 at this time.
[0186] The above-mentioned aggregation state values are merely exemplary representations, and other numerical values may also be used as aggregation state values, which is not limited in the embodiments of the present application.
[0187] In some embodiments, the target resource is a media playback function unit Mediaplayback Cluster.
[0188] In some embodiments, the notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes;
[0189] The attributes include at least one of the following: current playback status, playback progress, and current playback time.
[0190] Based on the solutions shown in FIG. 3 , FIG. 4 , or FIG. 6 , please refer to FIG. 7 , which shows a flowchart of event subscription and aggregate notification involved in the present application. As shown in FIG. 7 , taking the example of subscribing to events / functional units containing events / attributes corresponding to events in a television (TV) through an APP in a mobile phone, the solution may include the following steps:
[0191] S1, the app subscribes to the playback status on the TV, and the subscription carries the subscription target (such as MediaPlayback cluster), Maxinterval, Mininterval, batchEnable, and BufferTime.
[0192] Among them, Maxinterval: the maximum time interval between two notification messages. However, when this time limit is reached, if no subscribed event occurs, an empty message needs to be sent. This empty message plays the role of Keepalive.
[0193] Mininterval: The minimum interval between two notification messages. If more than two events occur within the minimum interval, all event messages except the first one will be lost.
[0194] Buffernable: Whether to allow aggregated sending of notification messages.
[0195] BufferTime: The time for aggregating event notification messages. TV will aggregate events within this time period and send them to the app.
[0196] S2, TV responds with a successful subscription response message.
[0197] S3, after the subscription is successful, starts the Buffer Timer and aggregates the messages within the Buffer Time before transmitting them.
[0198] This timer is preferably started when the first message is generated, but can also be started immediately after a successful subscription. It can also be started together with the MaxInterval timer. When the MaxInterval timer expires, the Buffer Time and MaxInterval timers are cleared simultaneously, and the next cycle timer is started. Generally, the Buffer Time should be less than or equal to the MaxInterval value.
[0199] S4, when BufferTime expires, the N events (notification messages) generated within this period are aggregated. The aggregated message should include the number of events (optional), the content of the event, and the events that occurred are aggregated into a notification message and sent to the APP.
[0200] When events are aggregated, the time of occurrence of the events can be compressed. The entire event uses the time of occurrence of the first message as the full format time (year, month, day, hour, minute, second, millisecond...), and the time of occurrence of the second event uses the incremental method of XX milliseconds, etc.
[0201] Based on the scheme shown in Figures 3, 4 or 6 above, please refer to Figure 8, which shows a flowchart of another event subscription and aggregation notification involved in this application. Taking the subscription to events / functional units containing events / attributes corresponding to events in a television (TV) through an APP in a mobile phone as an example, as shown in Figure 8, compared with the scheme shown in Figure 7, the difference between the scheme shown in Figure 8 is that: in the subscription response message, the parameter BatchEnable indicating whether the TV supports the sending of aggregate messages, as well as the new BufferTime can be carried.
[0202] If BatchEnable=TRUE, the message processing process is the same as the solution shown in FIG7 .
[0203] If BatchEnable = FALSE, the subscription message can be processed as normal, that is, a notification message is sent for each event; or, it can be determined that the subscription has failed and the APP is notified to re-initiate a normal subscription.
[0204] Based on the scheme shown in Figures 3, 4 or 6 above, please refer to Figure 9, which shows a flowchart of another event subscription and aggregation notification involved in this application. Taking the subscription to events / functional units containing events / attributes corresponding to events in a television (TV) through an APP in a mobile phone as an example, as shown in Figure 9, compared with the scheme shown in Figures 7 or 8, the difference of the scheme shown in Figure 9 is that the relationship between BufferTime and MaxInterval is further defined.
[0205] As shown in Figure 9, after the timers corresponding to BufferTime and MaxInterval have been started, if BufferTime has not yet expired but MaxInterval has, the TV will immediately end both timers and send a notification message, which may carry zero or more events. After sending the notification message, the MaxInterval timer is restarted and, depending on the scenario shown in Figure 7, the BufferTime timer is started as appropriate.
[0206] The solutions shown in the above embodiments of the present application include the following features:
[0207] 1) The subscription message carries the BufferTime and / or BatchEnable parameters, indicating that the app subscribes to the target resource and aggregates and sends the events corresponding to the target resource;
[0208] 2) TV determines when to send the aggregation notification message based on the Timer relationship between Buffertime and MaxInterval;
[0209] 3) The aggregate notification message includes multiple events, the events that occurred, whether to aggregate and send tags, etc.
[0210] Through the scheme shown in the above embodiments of the present application, events on the TV can be aggregated and sent to the APP within the agreed time, saving resources for transmitting messages on the TV and APP. In particular, for the APP and users, it can reduce their frequent interruptions by notification messages.
[0211] Please refer to Figure 10, which shows a block diagram of a message processing device provided by an embodiment of the present application. The message processing device has the functions of implementing the method shown in Figure 3, Figure 4 or Figure 6 above, which is performed by the server device. As shown in Figure 10, the device may include:
[0212] The receiving module 1001 is configured to receive a subscription request for subscribing to a target resource in the server device;
[0213] The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
[0214] In some embodiments, the batch instruction information includes at least one of the following information:
[0215] A first instruction is used to instruct the server device to aggregate multiple notification messages corresponding to the target resource and send them to the client device;
[0216] Buffering duration, used to indicate the duration of aggregated notification messages.
[0217] In some embodiments, when the batch indication information includes a buffering duration, the apparatus further includes:
[0218] a correction module, configured to, when determining that the subscription is successful and the buffering time included in the batch indication information is not accepted, correct the buffering time to obtain the corrected buffering time;
[0219] The response sending module is used to send the subscription response indicating that the subscription is successful to the client device, and the subscription response also includes the corrected buffering time.
[0220] In some embodiments, the apparatus further comprises:
[0221] a notification module configured to send an aggregated notification message to the client device when the first timer expires; the aggregated notification message being a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device;
[0222] The maximum timing duration of the first timer is the buffer duration, and the starting method of the first timer includes at least one of the following:
[0223] When a first notification message corresponding to the target resource and not yet notified to the client device is generated, starting the first timer;
[0224] cyclically starting the first timer;
[0225] And, at the same time as starting the second timer, start the first timer; the second timer is a timer corresponding to the maximum interval duration, and the maximum interval duration is the upper limit of the time span between two consecutive sending notification messages corresponding to the target resource to the client device.
[0226] In some embodiments, the apparatus further comprises:
[0227] The first determining module is configured to determine that the first timer has expired when the second timer has reached a timing duration and the first timer has not reached a timing duration.
[0228] In some embodiments, the apparatus further comprises:
[0229] The second determining module is used to determine that the second timer has expired when the first timer has reached the timing duration and the second timer has not reached the timing duration, and the notification message that has not been notified to the client device exists in the server device.
[0230] In some embodiments, the buffering duration is no greater than the maximum interval duration.
[0231] In some embodiments, the buffering duration is greater than a minimum interval duration, where the minimum interval duration is a lower limit of a time span between two adjacent notification messages corresponding to the target resource.
[0232] In some embodiments, when the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N≥2,
[0233] The aggregated notification message includes a first occurrence time of a first notification message among the N notification messages, and an interval between the occurrence time of the other N-1 notification messages among the N notification messages and the first occurrence time;
[0234] or,
[0235] The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
[0236] In some embodiments, the target resource is a media playback function unit Mediaplayback Cluster.
[0237] In some embodiments, the notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes;
[0238] The attributes include at least one of the following:
[0239] Current playback status, playback progress, and current playback time.
[0240] In some embodiments, the client device includes a plurality of devices subscribed to the target resource;
[0241] The notification module is configured to obtain identification information of the multiple devices subscribed to the target resource when the first timer expires; and send the aggregated notification message to the multiple devices respectively according to the identification information of the multiple devices.
[0242] Please refer to Figure 11, which shows a block diagram of a message processing device provided by an embodiment of the present application. The message processing device has the functions of implementing the methods shown in Figures 3, 4, or 6 above, which are performed by the client device. As shown in Figure 11, the device may include:
[0243] The sending module 1101 is configured to send a subscription request to a server device, wherein the subscription request is used to subscribe to a target resource in the server device;
[0244] The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
[0245] In some embodiments, the batch instruction information includes at least one of the following information:
[0246] A first instruction is used to instruct the server device to aggregate multiple notification messages corresponding to the target resource and send them to the client device;
[0247] Buffering duration, used to indicate the duration of aggregated notification messages.
[0248] In some embodiments, when the batch indication information includes a buffering time, and the server device determines that the subscription is successful and does not accept the buffering time included in the batch indication information, the subscription response also includes a revised buffering time.
[0249] In some embodiments, the buffering duration is no greater than the maximum interval duration.
[0250] In some embodiments, the buffering duration is greater than a minimum interval duration, where the minimum interval duration is a lower limit of a time span between two adjacent notification messages corresponding to the target resource.
[0251] In some embodiments, the apparatus further comprises:
[0252] An aggregated notification message is received; the aggregated notification message is a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device.
[0253] In some embodiments, when the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N≥2,
[0254] The aggregated notification message includes a first occurrence time of a first notification message among the N notification messages, and an interval between the occurrence time of the other N-1 notification messages among the N notification messages and the first occurrence time;
[0255] or,
[0256] The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
[0257] In some embodiments, the target resource is a media playback function unit Mediaplayback Cluster.
[0258] In some embodiments, the notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes;
[0259] The attributes include at least one of the following:
[0260] Current playback status, playback progress, and current playback time.
[0261] It should be noted that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0262] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0263] Please refer to FIG12 , which shows a schematic diagram of the structure of a communication device 1200 provided in one embodiment of the present application. The communication device 1200 may include: a processor 1201 , a receiver 1202 , a transmitter 1203 , a memory 1204 , and a bus 1205 .
[0264] The processor 1201 includes one or more processing cores. The processor 1201 executes various functional applications and information processing by running software programs and modules.
[0265] Receiver 1202 and transmitter 1203 can be implemented as a communication component, which can be a communication chip. This communication chip can also be called a transceiver. Memory 1204 is connected to processor 1201 via bus 1205. Memory 1204 can be used to store computer programs, and processor 1201 is used to execute the computer programs to implement the various steps in the above method embodiments.
[0266] In addition, the memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, including but not limited to: magnetic disk or optical disk, electrically erasable programmable read-only memory, erasable programmable read-only memory, static random access memory, read-only memory, magnetic memory, flash memory, and programmable read-only memory.
[0267] In an exemplary embodiment, when the communication device 1200 is implemented as the above-mentioned server device, the receiver 1202, the transmitter 1203 and the processor 1201 execute the computer program so that the communication device implements the various steps performed by the server device in any of the methods shown in Figures 3, 4 or 6.
[0268] In an exemplary embodiment, when the communication device 1200 is implemented as the above-mentioned client device, the receiver 1202, the transmitter 1203 and the processor 1201 execute the computer program so that the communication device implements the various steps performed by the client device in any of the methods shown in Figures 3, 4 or 6.
[0269] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by a processor to implement all or part of the steps performed by the client device or the server device in the method shown in any of Figures 3, 4 or 6 above.
[0270] The present application also provides a chip, which may include a logic circuit and a firmware program written into the logic circuit. The chip is used to run in a communication device so that the communication device executes all or part of the steps performed by the client device or the server device in any of the methods shown in Figures 3, 4 or 6 above.
[0271] The present application also provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor of a communication device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the communication device to perform all or part of the steps performed by the client device or the server device in any of the methods shown in FIG. 3 , FIG. 4 , or FIG. 6 .
[0272] The present application also provides a computer program, which is executed by a processor of a communication device to implement all or part of the steps performed by a client device or a server device in the method shown in any of Figures 3, 4 or 6 above.
[0273] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0274] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A message processing method, characterized in that: The method is executed by a server device, and the method includes: Receiving a subscription request, wherein the subscription request is used to subscribe to a target resource in the server device; The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
2. The method according to claim 1, characterized in that The batch instruction information includes at least one of the following information: A first instruction, used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device; Buffering duration, used to indicate the duration of aggregated notification messages.
3. The method according to claim 2, characterized in that In a case where the batch indication information includes a buffering duration, the method further includes: If it is determined that the subscription is successful and the buffering time contained in the batch indication information is not accepted, the buffering time is corrected to obtain the corrected buffering time; The sending a subscription response to the client device includes: The subscription response indicating successful subscription is sent to the client device, wherein the subscription response also includes the corrected buffering duration.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: When the first timer expires, an aggregated notification message is sent to the client device; the aggregated notification message is a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device; The maximum timing duration of the first timer is the buffer duration, and the starting method of the first timer includes at least one of the following: When a first notification message corresponding to the target resource and not notified to the client device is generated, starting the first timer; cyclically starting the first timer; And, while starting the second timer, the first timer is started; the second timer is a timer corresponding to a maximum interval duration, and the maximum interval duration is an upper limit of a time span between two consecutive times of sending notification messages corresponding to the target resource to the client device.
5. The method according to claim 4, characterized in that The method further comprises: When the second timer reaches the timing duration and the first timer does not reach the timing duration, it is determined that the first timer ends.
6. The method according to claim 4 or 5, characterized in that: The method further comprises: When the first timer reaches the timing duration, the second timer does not reach the timing duration, and the notification message that has not been notified to the client device exists in the server device, it is determined that the second timer has ended.
7. The method according to any one of claims 4 to 6, characterized in that: The buffering duration is not greater than the maximum interval duration.
8. The method according to any one of claims 2 to 7, characterized in that: The buffering time is greater than a minimum interval time, and the minimum interval time is a lower limit of a time span between two adjacent notification messages corresponding to the target resource.
9. The method according to any one of claims 4 to 7, characterized in that: In the case where the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N ≥ 2, The aggregated notification message includes a first occurrence time of a first notification message among the N notification messages, and an interval between the occurrence time of other N-1 notification messages among the N notification messages and the first occurrence time; or, The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
10. The method according to any one of claims 1 to 9, characterized in that: The target resource is a media playback function unit Mediaplayback Cluster.
11. The method according to claim 10, characterized in that The notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes; The attributes include at least one of the following: Current playback status, playback progress, and current playback time.
12. The method according to any one of claims 4 to 7 and 9, characterized in that: The client device includes a plurality of devices subscribing to the target resource; When the first timer expires, sending the aggregated notification message to the client device includes: When the first timer expires, obtaining identification information of the plurality of devices subscribing to the target resource; The aggregated notification message is sent to each of the multiple devices according to the identification information of the multiple devices.
13. A message processing method, characterized in that: The method is performed by a client device, and the method includes: Sending a subscription request to a server device, wherein the subscription request is used to subscribe to a target resource in the server device; The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
14. The method according to claim 13, characterized in that The batch instruction information includes at least one of the following information: A first instruction, used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device; Buffering duration, used to indicate the duration of aggregated notification messages.
15. The method according to claim 14, characterized in that When the batch indication information includes a buffering time, and the server device determines that the subscription is successful and does not accept the buffering time included in the batch indication information, the subscription response also includes a revised buffering time.
16. The method according to claim 14 or 15, characterized in that The buffering duration is not greater than the maximum interval duration.
17. The method according to any one of claims 14 to 16, characterized in that: The buffering time is greater than a minimum interval time, and the minimum interval time is a lower limit of a time span between two adjacent notification messages corresponding to the target resource.
18. The method according to any one of claims 13 to 17, characterized in that: The method further comprises: An aggregated notification message is received; the aggregated notification message is a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device.
19. The method according to claim 18, characterized in that In the case where the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N ≥ 2, The aggregated notification message includes a first occurrence time of a first notification message among the N notification messages, and an interval between the occurrence time of other N-1 notification messages among the N notification messages and the first occurrence time; or, The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
20. The method according to any one of claims 13 to 19, characterized in that: The target resource is a media playback function unit Mediaplayback Cluster.
21. The method according to claim 20, characterized in that The notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes; The attributes include at least one of the following: Current playback status, playback progress, and current playback time.
22. A message processing device, characterized in that: The device comprises: A receiving module, used to receive a subscription request, wherein the subscription request is used to subscribe to a target resource in the server device; The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
23. The device according to claim 22, characterized in that The batch instruction information includes at least one of the following information: A first instruction, used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device; Buffering duration, used to indicate the duration of aggregated notification messages.
24. The device according to claim 23, characterized in that In a case where the batch indication information includes a buffering duration, the device further includes: A correction module, configured to correct the buffering time when determining that the subscription is successful and not accepting the buffering time contained in the batch indication information, so as to obtain the corrected buffering time; The response sending module is used to send the subscription response indicating successful subscription to the client device, and the subscription response also includes the corrected buffering time.
25. The device according to claim 23 or 24, characterized in that The device also includes: A notification module, configured to send an aggregated notification message to the client device when the first timer expires; the aggregated notification message is a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device; The maximum timing duration of the first timer is the buffer duration, and the starting method of the first timer includes at least one of the following: When a first notification message corresponding to the target resource and not notified to the client device is generated, starting the first timer; cyclically starting the first timer; And, while starting the second timer, the first timer is started; the second timer is a timer corresponding to a maximum interval duration, and the maximum interval duration is an upper limit of a time span between two consecutive times of sending notification messages corresponding to the target resource to the client device.
26. The device according to claim 25, characterized in that The device also includes: The first determining module is used to determine that the first timer ends when the second timer reaches the timing duration and the first timer does not reach the timing duration.
27. The device according to claim 25 or 26, characterized in that The device also includes: The second determination module is used to determine that the second timer has ended when the first timer has reached the timing duration and the second timer has not reached the timing duration, and there is the notification message in the server device that has not been notified to the client device.
28. The device according to any one of claims 25 to 27, characterized in that The buffering duration is not greater than the maximum interval duration.
29. The device according to any one of claims 23 to 28, characterized in that The buffering time is greater than a minimum interval time, and the minimum interval time is a lower limit of a time span between two adjacent notification messages corresponding to the target resource.
30. The device according to any one of claims 25 to 28, characterized in that In the case where the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N ≥ 2, The aggregated notification message includes a first occurrence time of a first notification message among the N notification messages, and an interval between the occurrence time of other N-1 notification messages among the N notification messages and the first occurrence time; or, The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
31. The device according to any one of claims 22 to 30, characterized in that The target resource is a media playback function unit Mediaplayback Cluster.
32. The device according to claim 31, characterized in that The notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes; The attributes include at least one of the following: Current playback status, playback progress, and current playback time.
33. The device according to any one of claims 25 to 28 and 30, characterized in that The client device includes a plurality of devices subscribing to the target resource; The notification module is used to obtain the identification information of the multiple devices subscribed to the target resource when the first timer expires; and send the aggregated notification message to the multiple devices respectively according to the identification information of the multiple devices.
34. A message processing device, characterized in that: The device comprises: A sending module, used to send a subscription request to a server device, wherein the subscription request is used to subscribe to a target resource in the server device; The subscription request includes batch indication information, and the batch indication information is used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device.
35. The device according to claim 34, characterized in that The batch instruction information includes at least one of the following information: A first instruction, used to instruct the server device to aggregate and send multiple notification messages corresponding to the target resource to the client device; Buffering duration, used to indicate the duration of aggregated notification messages.
36. The device according to claim 35, characterized in that When the batch indication information includes a buffering time, and the server device determines that the subscription is successful and does not accept the buffering time included in the batch indication information, the subscription response also includes a revised buffering time.
37. The device according to claim 35 or 36, characterized in that The buffering duration is not greater than the maximum interval duration.
38. The device according to any one of claims 35 to 37, characterized in that The buffering time is greater than a minimum interval time, and the minimum interval time is a lower limit of a time span between two adjacent notification messages corresponding to the target resource.
39. The device according to any one of claims 34 to 38, characterized in that The device also includes: An aggregated notification message is received; the aggregated notification message is a single notification message obtained by aggregating multiple notification messages corresponding to the target resource and not notified to the client device.
40. The device according to claim 39, characterized in that In the case where the aggregated notification message is used to indicate N notification messages corresponding to the target resource, and N ≥ 2, The aggregated notification message includes a first occurrence time of a first notification message among the N notification messages, and an interval between the occurrence time of other N-1 notification messages among the N notification messages and the first occurrence time; or, The aggregated notification message includes the occurrence time of the first notification message among the N notification messages, and the interval between the occurrence time of the other N-1 notification messages among the N notification messages and the occurrence time of the previous notification message.
41. The device according to any one of claims 34 to 40, characterized in that The target resource is a media playback function unit Mediaplayback Cluster.
42. The device according to claim 41, characterized in that The notification message corresponding to the target resource is a notification message generated when an attribute in the target resource changes; The attributes include at least one of the following: Current playback status, playback progress, and current playback time.
43. A network device, characterized in that: The network device includes a processor, a memory and a transceiver; The memory stores a computer program, and the processor executes the computer program so that the network device implements the message processing method as described in any one of claims 1 to 21 above.
44. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to be executed by a processor of a communication device so that the communication device implements the message processing method as described in any one of claims 1 to 21.
45. A chip, characterized in that: The chip includes a logic circuit and a firmware program written into the logic circuit, and the chip is used to run in a communication device so that the communication device executes the message processing method as described in any one of claims 1 to 21.
46. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the processor of the communication device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, so that the communication device executes the message processing method as described in any one of claims 1 to 21.
47. A computer program, characterized in that The computer program is executed by a processor of a communication device, so that the communication device implements the message processing method according to any one of claims 1 to 21.