CN105072144A - Method and device for transmitting server-side notification message - Google Patents
Method and device for transmitting server-side notification message Download PDFInfo
- Publication number
- CN105072144A CN105072144A CN201510386307.4A CN201510386307A CN105072144A CN 105072144 A CN105072144 A CN 105072144A CN 201510386307 A CN201510386307 A CN 201510386307A CN 105072144 A CN105072144 A CN 105072144A
- Authority
- CN
- China
- Prior art keywords
- property value
- notification message
- transmission condition
- client
- variation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a method and device for transmitting a server-side notification message, and the method comprises the steps: collecting an attribute value of an interface, and monitoring whether the collected attribute value meets a transmission condition or not; and transmitting the notification message containing the attribute value meeting the transmission condition to a client when the collected attribute value meets the transmission condition. Through the control of the generation of the notification message and transmission frequency, the method effectively solves problems, caused by that a transmission side transmits a large number of notification messages, of system overloading, network bandwidth loss and receiving side device overloading.
Description
Technical field
The present invention relates to technology of Internet of things field, particularly relate to a kind of sending method and device of service end notification message.
Background technology
Alljoyn is point-to-point communication framework between a kind of equipment based on C/S framework, and Alljoyn is made up of bus (BusDaemon) and terminal node.Bus is the medium that AllJoyn application is undertaken by API (ApplicationProgrammingInterface, application programming interface) communicating.Issue API Alljoyn application be service end, consumption be client.For example, support that the mobile phone of Alljoyn controls to support the refrigerator of Alljoyn, refrigerator provides the service such as control temperature, pattern, and mobile phone calls these services as client, therefore Alljoyn application refrigerator run is called as service (Service), and the Alljoyn application operated on mobile phone is called as client (Client).
AllJoyn application (service or client application) realizes externally exposing API by " total line object ", can understand like this, and an Alljoyn application can represent with a total line object.Total line object is the specific implementation form of an Alljoyn application.In most cases, total an application only has a line object, and a total line object comprises one or more interface, and in fact interface is exactly the concrete function logic realization of an application.For example, refrigerator has functions such as regulating temperature, the setting of various pattern, switching on and shutting down; The wherein Alljoyn application of refrigerator, represented, and this total line object comprises three interfaces by a total line object: adjustment temperature interface, pattern arrange interface and switching on and shutting down interface.Three members can be comprised again: method (Method), signal (Signal) and attribute (Property) in interface.Wherein Property represents the external visible state of entity.
In prior art, when the state (attribute) of service end interface changes, Alljoyn can send the information of change according to the mark value of attribute, particularly when this attribute is analog quantity, as temperature, humidity, power etc., and when needing when changing to produce notification message, Alljoyn can produce the notification message of magnanimity, not only seriously consume the device resource of service end, and the magnanimity notification message owing to producing, also can severe attrition client application place device resource, cause the overload of equipment.
Summary of the invention
In view of the defect of prior art, the object of the invention is the sending method and the device that provide a kind of service end notification message, produces the problem of network bandwidth consumption that too much notification message causes and service terminal device and client terminal device system overload in order to solve existing service terminal device.
On the one hand, the invention provides a kind of sending method of service end notification message, comprising:
The property value of acquisition interface, and whether the property value that monitoring gathers meets transmission condition; When the property value gathered meets transmission condition, the notification message of property value when carrying satisfied transmission condition is sent to client.
Further, described method also comprises:
When the property value gathered does not meet transmission condition, obtain apart from the previous duration sent a notification message to client; When the duration obtained is greater than default duration, the notification message of the property value carried when being greater than preset duration is sent to client.
Further, whether the property value that described monitoring gathers meets the step of transmission condition, specifically comprises:
Whether the property value that monitoring gathers exceedes default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message; When exceeding, be judged to be satisfied transmission condition; When not exceeding, be judged to not meet transmission condition.
Further, described amplitude of variation is specially attribute change step-length or is attribute change percentage.
Further, the property value that described monitoring gathers also comprises before whether exceeding the step of default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message:
Preset buffer memory threshold value, whether the property value that monitoring gathers reaches described cache threshold relative to the amplitude of variation of the property value carried in previous notification message and the ratio of default amplitude of variation, when reached, obtains property value when arriving cache threshold.
Further, described method also comprises:
When by the notification message of property value when carrying satisfied transmission condition or when the notification message of the property value carried when being greater than preset duration being sent to client failure, property value when arriving cache threshold is carried and sends to client in an announcement message.
On the other hand, the present invention also provides a kind of service terminal device, comprising:
Monitoring unit, for the property value of acquisition interface, and whether the property value that monitoring gathers meets transmission condition, when the property value gathered meets transmission condition, the notification message of property value when carrying satisfied transmission condition is sent to client by trigger message transmitting element;
Message sending unit, for sending to client according to the triggering of described monitoring unit by notification message.
Further, described monitoring unit, time also for not meeting transmission condition when the property value gathered, obtains apart from the previous duration sent a notification message to client; When the duration obtained is greater than default duration, the notification message of the property value carried when being greater than preset duration is sent to client by trigger message transmitting element.
Further, whether the property value that described monitoring gathers meets transmission condition specifically comprises:
Whether the property value that monitoring gathers exceedes default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message; When exceeding, be judged to be satisfied transmission condition; When not exceeding, be judged to not meet transmission condition.
Further, described amplitude of variation is specially attribute change step-length or is attribute change percentage.
Further, described monitoring unit, also for preset buffer memory threshold value; Whether the property value that monitoring gathers reaches described cache threshold relative to the amplitude of variation of the property value carried in previous notification message and the ratio of default amplitude of variation, when reached, obtains property value when arriving cache threshold.
Further, described message sending unit, also for when by the notification message of property value when carrying satisfied transmission condition or when the notification message of the property value carried when being greater than preset duration being sent to client failure, property value when arriving cache threshold is carried and sends to client in an announcement message.Beneficial effect of the present invention is as follows: the frequency that the present invention produces by controlling notification message and sends, and efficiently solves the problem that transmit leg sends system overload, network bandwidth consumption and the recipient's device overload that magnanimity notification message causes.
Accompanying drawing explanation
Fig. 1 is the main flow chart of the sending method of a kind of service end notification message in the embodiment of the present invention;
Fig. 2 is the detail flowchart of the sending method of a kind of service end notification message in the embodiment of the present invention;
Fig. 3 is the structural representation of a kind of service terminal device in the embodiment of the present invention.
Embodiment
The problem of network bandwidth consumption that too much notification message causes and service terminal device and client terminal device system overload is produced in order to solve existing service terminal device, the invention provides a kind of sending method and device of service end notification message, below in conjunction with accompanying drawing and embodiment, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, do not limit the present invention.
Embodiment one
The embodiment of the present invention provides a kind of sending method of service end notification message, comprising:
S101, the property value of acquisition interface, and whether the property value that monitoring gathers meets transmission condition.Wherein, whether the property value that monitoring gathers meets transmission condition, specifically comprises:
Whether the property value that monitoring gathers exceedes default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message;
When exceeding, be judged to be satisfied transmission condition;
When not exceeding, be judged to not meet transmission condition.Amplitude of variation is specially attribute change step-length or is attribute change percentage.
S102, when the property value gathered meets transmission condition, sends to client by the notification message of property value when carrying satisfied transmission condition.
S103, when the property value gathered does not meet transmission condition, does not send a notification message, or obtains apart from the previous duration sent a notification message to client; When the duration obtained is greater than default duration, the notification message of the property value carried when being greater than preset duration is sent to client.
Due to the Rapid Variable Design when some property value, changing value accurately cannot be monitored, or the monitoring thread of total line object is owing to blocking or not causing the notification message of property value when carrying satisfied transmission condition to send to client failure according to reasons such as set flow performing, or the notification message of the property value carried when being greater than preset duration is sent to client failure, property value when now the embodiment of the present invention will reach cache threshold from the reading scheduling queue sends.
That is, the property value that monitoring gathers also comprises before whether exceeding the step of default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message:
Preset buffer memory threshold value, whether the property value that monitoring gathers reaches described cache threshold relative to the amplitude of variation of the property value carried in previous notification message and the ratio of default amplitude of variation, when reached, obtains property value when arriving cache threshold.
Now, the method of the embodiment of the present invention also comprises: when by the notification message of property value when carrying satisfied transmission condition or when the notification message of the property value carried when being greater than preset duration being sent to client failure, carried by property value when arriving cache threshold and send to client in an announcement message.
In the embodiment of the present invention, service end is can carry out the smart machine of data interaction and process, such as intelligent refrigerator, intelligent air condition, intelligent television etc. with client.
Below for air-conditioning, Alljoyn technology is adopted to be described in detail embodiment of the present invention method.
The temperature sensor of air-conditioning can monitor the change of indoor temperature, and after temperature changes, Alljoyn application (service) of air-conditioning can apply (client) to the Alljoyn of mobile phone and send a notification message.But because temperature is analog quantity, there is continually varying possibility, the notification message of magnanimity will be produced like this.Therefore notification message is set in the present embodiment and sends condition, send a notification message according to transmission condition.The method performs step as shown in Figure 2.
Step 1, the configurable type that the temperature property increase arranged in interface in the temperature of service end sends a notification message, namely the mark value (annotationvalue) of org.freedesktop.DBus.Property.EmitsChangedSignal is extended, as shown in table 1, add Configurable value:
Table 1
When the mark value of org.freedesktop.DBus.Property.EmitsChangedSignal is set to Configurable, can refer to configuration shown in table 2:
Table 2
Step 2, the mark value selecting notification message is Configurable, and arrange notification message according to table 2 and send condition, the concrete numerical value of the optimum configurations in table 2 is as shown in table 3;
Table 3
Condition | Value | Describe |
Change step | 1 | When variations in temperature is 1 degree, produce notification message |
Duration | 1000ms | Produce a notification message each second |
Cache threshold | 0.8 | When variations in temperature is 0.8 degree, this temperature value is put into scheduling queue |
Step 3, client and service end are set up session (session) and are connected.Only have after setting up Session connection, client could intercom mutually with service end;
Step 4: start monitoring thread and scheduling thread.The property value of monitoring thread acquisition interface, is stored in schedule sequences by the property value of the interface of collection; Read the transmission condition being set to the attribute of Configurable simultaneously, after property value change meets the transmission condition arranged, then trigger scheduling thread send a notification message, proceed circulatory monitoring afterwards; Scheduling thread is used for the property value read according to the triggering of monitoring thread in scheduling queue, sends a notification message;
Step 5: first monitoring thread judges the cache threshold 0.8 degree whether variations in temperature reaches default; When reaching, perform step 6; When not reaching, perform step 7;
Step 6, puts into scheduling queue by property value when reaching cache threshold;
Step 7: monitoring thread judges whether variations in temperature reaches 1 degree, if reach 1 degree, performs step 9, otherwise performs step 8;
Step 8: monitoring thread judges that whether send the interval upgraded reaches 10 seconds, if reached, performs step by step rapid 9, otherwise execution step 5;
Step 9: monitoring thread dispatching notification message sends, and sends a notification message, concrete, reads property value when exceeding default change condition from scheduling queue, and is carried at notification message and sends to client;
Step 10: monitoring thread empties scheduling queue, performs step 5.
Method in the embodiment of the present invention, by controlling the frequency that notification message produces and sends, efficiently solves the problem that transmit leg sends system overload, network bandwidth consumption and the recipient's device overload that magnanimity notification message causes.
Embodiment two
The embodiment of the present invention provides a kind of service terminal device, comprising:
Monitoring unit 31, for the property value of acquisition interface, and whether the property value that monitoring gathers meets transmission condition, when the property value gathered meets transmission condition, the notification message of property value when carrying satisfied transmission condition is sent to client by trigger message transmitting element 32.
Message sending unit 32, for notification message being sent to client according to the triggering of described monitoring unit 31, property value when now notification message carries satisfied transmission condition.
Described monitoring unit 31, time also for not meeting transmission condition when the property value gathered, obtains apart from the previous duration sent a notification message to client; When the duration obtained is greater than default duration, the notification message of the property value carried when being greater than preset duration is sent to client by trigger message transmitting element 32.Now, message sending unit 32, specifically for notification message being sent to client according to the triggering of described monitoring unit 31, now notification message carries property value when being greater than preset duration.
Whether the property value that described monitoring gathers meets transmission condition specifically comprises:
Whether the property value that monitoring gathers exceedes default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message;
When exceeding, be judged to be satisfied transmission condition;
When not exceeding, be judged to not meet transmission condition.
Described amplitude of variation is specially attribute change step-length or is attribute change percentage.
Wherein, described monitoring unit 31, also for preset buffer memory threshold value; Whether the property value that monitoring gathers reaches described cache threshold relative to the amplitude of variation of the property value carried in previous notification message and the ratio of default amplitude of variation, when reached, obtains property value when arriving cache threshold.
Now, described message sending unit 32, also for when by the notification message of property value when carrying satisfied transmission condition or when the notification message of the property value carried when being greater than preset duration being sent to client failure, property value when arriving cache threshold is carried and sends to client in an announcement message.
In the embodiment of the present invention, device is the device embodiment that in embodiment one, method is corresponding, specifically arrange and can not repeat them here by See Examples one, the frequency that embodiment of the present invention device produces by controlling notification message and sends, efficiently solves the problem that sending method, device sends system overload, network bandwidth consumption and the recipient's device overload that magnanimity notification message causes.
Although be example object, disclose the preferred embodiments of the present invention above, it is also possible for those skilled in the art will recognize various improvement, increase and replacement, and therefore, scope of the present invention should be not limited to above-described embodiment.
Claims (12)
1. a sending method for service end notification message, is characterized in that, comprising:
The property value of acquisition interface;
Whether the property value that monitoring gathers meets transmission condition;
When the property value gathered meets transmission condition, the notification message of property value when carrying satisfied transmission condition is sent to client.
2. the method for claim 1, is characterized in that, described method also comprises:
When the property value gathered does not meet transmission condition, obtain apart from the previous duration sent a notification message to client;
When the duration obtained is greater than default duration, the notification message of the property value carried when being greater than preset duration is sent to client.
3. method as claimed in claim 1 or 2, is characterized in that, whether the property value that described monitoring gathers meets the step of transmission condition, specifically comprises:
Whether the property value that monitoring gathers exceedes default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message; When exceeding, be judged to be satisfied transmission condition; When not exceeding, be judged to not meet transmission condition.
4. method as claimed in claim 3, is characterized in that, described amplitude of variation is specially attribute change step-length or is attribute change percentage.
5. the method as described in claim 3 or 4, is characterized in that, the property value that described monitoring gathers also comprises before whether exceeding the step of default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message:
Preset buffer memory threshold value, whether the property value that monitoring gathers reaches described cache threshold relative to the amplitude of variation of the property value carried in previous notification message and the ratio of default amplitude of variation, when reached, obtains property value when arriving cache threshold.
6. method as claimed in claim 5, it is characterized in that, described method also comprises:
When by the notification message of property value when carrying satisfied transmission condition or when the notification message of the property value carried when being greater than preset duration being sent to client failure, property value when arriving cache threshold is carried and sends to client in an announcement message.
7. a service terminal device, is characterized in that, comprising:
Monitoring unit, for the property value of acquisition interface, and whether the property value that monitoring gathers meets transmission condition, when the property value gathered meets transmission condition, the notification message of property value when carrying satisfied transmission condition is sent to client by trigger message transmitting element;
Message sending unit, for sending to client according to the triggering of described monitoring unit by notification message.
8. device as claimed in claim 7, is characterized in that, described monitoring unit, time also for not meeting transmission condition when the property value gathered, obtains apart from the previous duration sent a notification message to client; When the duration obtained is greater than default duration, the notification message of the property value carried when being greater than preset duration is sent to client by trigger message transmitting element.
9. device as claimed in claim 7 or 8, is characterized in that, whether the property value that described monitoring gathers meets transmission condition specifically comprises:
Whether the property value that monitoring gathers exceedes default amplitude of variation relative to the amplitude of variation of the property value carried in previous notification message; When exceeding, be judged to be satisfied transmission condition; When not exceeding, be judged to not meet transmission condition.
10. device as claimed in claim 9, is characterized in that, described amplitude of variation is specially attribute change step-length or is attribute change percentage.
11. devices as described in claim 9 or 10, is characterized in that, described monitoring unit, also for preset buffer memory threshold value; Whether the property value that monitoring gathers reaches described cache threshold relative to the amplitude of variation of the property value carried in previous notification message and the ratio of default amplitude of variation, when reached, obtains property value when arriving cache threshold.
12. devices as claimed in claim 11, it is characterized in that, described message sending unit, also for when by the notification message of property value when carrying satisfied transmission condition or when the notification message of the property value carried when being greater than preset duration being sent to client failure, property value when arriving cache threshold is carried and sends to client in an announcement message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510386307.4A CN105072144A (en) | 2015-06-30 | 2015-06-30 | Method and device for transmitting server-side notification message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510386307.4A CN105072144A (en) | 2015-06-30 | 2015-06-30 | Method and device for transmitting server-side notification message |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105072144A true CN105072144A (en) | 2015-11-18 |
Family
ID=54501423
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510386307.4A Pending CN105072144A (en) | 2015-06-30 | 2015-06-30 | Method and device for transmitting server-side notification message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105072144A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021212293A1 (en) * | 2020-04-20 | 2021-10-28 | Oppo广东移动通信有限公司 | Method and apparatus for transmitting messages in internet of things, server, device and cloud platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1448860A (en) * | 2002-03-29 | 2003-10-15 | 欧姆龙株式会社 | Information processing device and method |
CN103106784A (en) * | 2013-01-31 | 2013-05-15 | 蓝标 | Water conservancy multi-parameter acquiring and transmitting device and method |
US20140073245A1 (en) * | 2012-09-07 | 2014-03-13 | Qualcomm Innovation Center, Inc. | Peer-to-peer communication initiated by shared physical experience |
CN104202353A (en) * | 2014-07-09 | 2014-12-10 | 武汉领傲科技有限公司 | Cloud event processing method and device for internet of things interconnected cooperative system |
CN104683193A (en) * | 2015-02-02 | 2015-06-03 | 惠州Tcl移动通信有限公司 | Application method for communication terminal and intelligent family system |
-
2015
- 2015-06-30 CN CN201510386307.4A patent/CN105072144A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1448860A (en) * | 2002-03-29 | 2003-10-15 | 欧姆龙株式会社 | Information processing device and method |
US20140073245A1 (en) * | 2012-09-07 | 2014-03-13 | Qualcomm Innovation Center, Inc. | Peer-to-peer communication initiated by shared physical experience |
CN103106784A (en) * | 2013-01-31 | 2013-05-15 | 蓝标 | Water conservancy multi-parameter acquiring and transmitting device and method |
CN104202353A (en) * | 2014-07-09 | 2014-12-10 | 武汉领傲科技有限公司 | Cloud event processing method and device for internet of things interconnected cooperative system |
CN104683193A (en) * | 2015-02-02 | 2015-06-03 | 惠州Tcl移动通信有限公司 | Application method for communication terminal and intelligent family system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021212293A1 (en) * | 2020-04-20 | 2021-10-28 | Oppo广东移动通信有限公司 | Method and apparatus for transmitting messages in internet of things, server, device and cloud platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11071013B2 (en) | Method and system for group communication, group server, and group member device | |
US8565080B2 (en) | Method and apparatus for managing communications in a wireless communication system | |
CN105376845B (en) | Router transmitting power adjusting method and system and router | |
CN106453648B (en) | Equipment state determination method and device for intelligent household equipment | |
CN101772061B (en) | Sleeping timer control method and device and communication system | |
CN102083109B (en) | Offline detection method, device and system | |
CN104811961A (en) | LTE wireless network obstruction perceiving and alleviating method and system | |
CN102143563A (en) | Control method, equipment and systems of short message center cluster | |
CN106357469B (en) | A kind of dynamic adjusting method and device of monitoring resource mode | |
CN104879887A (en) | Air conditioner and method and system for controlling operation of same | |
CN108488900A (en) | It is a kind of can more communication modes intelligence control valve device and its valve control method | |
CN114040483A (en) | Terminal wake-up signal monitoring method and device, storage medium and electronic equipment | |
CN105072144A (en) | Method and device for transmitting server-side notification message | |
CN102769830B (en) | Multicast message sending method and device, the network equipment | |
CN102497306B (en) | A kind of distribution substation realizes the method and system of transfer of data | |
CN108605054A (en) | Realize the method, apparatus and Cloud Server of value-added service | |
CN102573021B (en) | The method that wireless sensor network message is processed and gateway | |
CN103973510B (en) | The method that many MODEM share SIM card is realized based on virtual SIM card technology | |
CN102474434B (en) | Traffic control apparatus and data communication system including same | |
US20180309322A1 (en) | Information Transmission System, Method, and Device | |
CN109120486A (en) | WiFi module data transmission method, WiFi module data transmission system and intelligent household appliance data transmission system | |
CN108667918B (en) | Equipment state monitoring method and device | |
CN103813294B (en) | State information searching method and system, Interworking gateway | |
CN112416618A (en) | Application layer data transmission method and device, storage medium and electronic device | |
JP7350285B2 (en) | Wireless network multiple route communication operation system and wireless network multiple route communication operation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151118 |
|
RJ01 | Rejection of invention patent application after publication |