CN113259262B - Message reporting method and related device - Google Patents
Message reporting method and related device Download PDFInfo
- Publication number
- CN113259262B CN113259262B CN202110344793.9A CN202110344793A CN113259262B CN 113259262 B CN113259262 B CN 113259262B CN 202110344793 A CN202110344793 A CN 202110344793A CN 113259262 B CN113259262 B CN 113259262B
- Authority
- CN
- China
- Prior art keywords
- message
- current
- reporting
- priority
- reporting method
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
- H04L47/2433—Allocation of priorities to traffic types
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16Y—INFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
- G16Y10/00—Economic sectors
- G16Y10/75—Information technology; Communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/32—Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
- H04L47/625—Queue scheduling characterised by scheduling criteria for service slots or service orders
- H04L47/6275—Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
Abstract
The application provides a message reporting method and a related device, wherein the message reporting method comprises the following steps: starting a message detection thread and receiving a message; judging whether a first message which has higher priority than the current message and is not reported to be finished exists on a current reporting link; if so, discarding the current message; if not, reporting the current message in response to that a second message with higher priority than the current message is not received in a mutex time period corresponding to the first message; returning to the step of receiving a message. Through the design mode, the technical problem of message redundancy possibly generated when a plurality of messages are triggered simultaneously can be solved.
Description
Technical Field
The application belongs to the technical field of the Internet of things, and particularly relates to a message reporting method and a related device.
Background
In the field of IPC of the Internet of things, intelligent messages are very important functions; the IPC intelligent detection system deeply embodies the IPC intelligent detection capability and is directly oriented to users. At present, the IPC field of the Internet of things has a plurality of categories, but simultaneously, various products contain similar messages, such as mobile detection information, human shape detection information, human face detection information, PIR detection information, sound detection information, intrusion detection information, line passing detection information and the like. When different manufacturers and different product schemes produce related products, various message combinations can be generated, and when the messages are triggered simultaneously, if push reporting is selected, message redundancy can be generated.
Disclosure of Invention
The application provides a message reporting method and a related device, which are used for solving the technical problem of message redundancy possibly generated when a plurality of messages are triggered simultaneously.
In order to solve the technical problem, the application adopts a technical scheme that: a message reporting method is provided, which comprises: starting a message detection thread and receiving a message; judging whether a first message which has higher priority than the current message and is not reported to be finished exists on a current reporting link; if so, discarding the current message; if not, reporting the current message in response to that a second message with higher priority than the current message is not received in a mutex time period corresponding to the first message; returning to the step of receiving messages.
Wherein, after the step of not existing, the method further comprises: and reporting the current message in response to the first message on the current reporting link and the current message having the same priority.
Wherein, after the step of not existing, the method further comprises: and in response to receiving a second message with higher priority than the current message in a mutex time period corresponding to the first message, discarding the current message, taking the second message as the current message, and returning to the step of judging whether the first message with higher priority than the current message exists on the current reporting link.
Wherein, after the step of not existing, the method further comprises: and reporting the current message and a second message with the same priority as the current message in response to receiving the second message with the same priority as the current message in a mutual exclusion time period corresponding to the first message.
The step of judging whether a first message which has higher priority than the current message and is not reported to be finished exists on the current reporting link includes: and judging whether the priority of the first message on the current reporting link is higher than that of the current message or not and whether the first message is triggered within the timeout time corresponding to the first message or not.
Wherein, before the step of starting the message detection thread and receiving the message, the method further comprises: receiving a message configuration table, wherein priorities, timeout times and mutual exclusion times corresponding to various messages are preset in the message configuration table, and at least one message is correspondingly set under the same priority.
The types of the various messages comprise at least one of video, pictures and sound, the messages belonging to the same type have different priorities, and the types of the corresponding messages under the same priority are different.
And the message reporting method adopts SDK encapsulation.
In order to solve the above technical problem, another technical solution adopted by the present application is: provided is a message reporting device, including: the message reporting method includes a processor and a memory, where the processor is coupled to the memory and is used to implement the message reporting method in any of the above embodiments.
In order to solve the technical problem, the other technical scheme adopted by the application is as follows: there is provided a device having a storage function, on which program data is stored, the program data being executable by a processor to implement the message reporting method in any of the embodiments described above.
Being different from the prior art situation, the beneficial effect of this application is: in the message reporting method provided by the application, for a received current message which does not start to be reported, whether a first message which has higher priority than the current message and is not reported to be ended exists on a current reporting link or not is judged; if so, discarding the current message; if the current message does not exist, reporting the current message under the condition that a second message with higher priority than the current message is not received in the exclusive time period. That is, in the message reporting mode provided by the present application, whether the current message is reported can be determined by using the priority of the message, the message with high priority can be reported preferentially, and the mutual exclusion time, timeout time, etc. of the message are introduced, so as to further reduce the unreasonable phenomena of message redundancy, short message interval, etc. which may occur when the message is reported.
In addition, the method and the device provide that various messages without logical relations are configured from two dimensions of message priority and parallel to form a message configuration table; the message reporting method adopts an SDK packaging form, supports a user to edit a message configuration table, and opens a unified interface to assist the user to complete development so as to reduce development difficulty and standardize the message service of the IPC of the Internet of things.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without inventive efforts, wherein:
fig. 1 is a schematic flow chart of an embodiment of a message reporting method of the present application;
fig. 2 is a schematic flow chart of another embodiment of a message reporting method according to the present application;
FIG. 3 is a schematic structural diagram of an embodiment of a message sending apparatus according to the present application;
FIG. 4 is a schematic structural diagram of an embodiment of the apparatus with storage function according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of a message reporting method according to the present application, where the message reporting method specifically includes:
s101: and starting a message detection thread and receiving the message.
Specifically, an execution main body of the message reporting method provided by the present application may be an intelligent gateway, which may establish a network connection with a plurality of network cameras IPC. The intelligent gateway can receive the messages transmitted by each IPC, and the message types can be various, for example, the message types can be a mobile detection message, a human shape detection message, a human face detection message, a PIR detection message, a sound detection message, an intrusion detection message, a line passing detection message and the like. Different messages can be generated according to different application scenarios of IPC.
In addition, before the step S101, the message reporting method provided by the present application further includes receiving a message configuration table, where priorities and timeout times corresponding to various messages are preset in the message configuration table, and at least one message is correspondingly set under the same priority. The method and the device for configuring the messages have the advantage that the messages without logical relations are configured from the priority and parallel dimensions to form a message configuration table. The message configuration table can be edited and set by a user according to actual requirements, and the flexibility and the applicability are wide. Of course, in other embodiments, the duration and debounce time corresponding to each message may also be preset in the message configuration table.
Wherein, the above timeout time can be understood as: and if the message A is not triggered when the corresponding timeout time is exceeded, the message A is considered to be reported to be finished.
The mutual exclusion time can be understood as follows: the triggering of the high priority message is only valid until after a period of time in which the low priority message is triggered. For example, the mutex time between low-priority message a and high-priority message B is 5 seconds, and assuming that a triggers at the 1 st second, then B triggers within 5 seconds are all considered invalid, and 5 seconds later triggers are considered valid new messages. The message mutex time can be understood as the waiting time when the low-priority message a satisfies the reporting condition.
The above-mentioned duration can be understood as: the total time of continuous triggering or discontinuous triggering of the same message is only reported in the period of time.
The debounce time can be understood as: and when the message is not triggered for a certain time, the message is considered to be ended. If a new message triggers after this, the message is considered as a new message, otherwise the message is considered as a current message and only one message is reported.
Optionally, the types of the messages include at least one of video, pictures and sound, and the messages belonging to the same type have different priorities, and the types of the messages corresponding to the same priority are different. That is, the present application can report messages of the same type separately, and the reporting of messages of different types can not be affected.
In an application scenario, taking the combination of a face detection message, a human shape detection message, a pet detection message, a movement detection message, and an abnormal sound detection message in practical application as an example, a standardized reporting scenario is specifically implemented, where the messages are configured as shown in table 1, the messages are represented in a longitudinal manner, the priority of the messages is decreased, and the messages are represented in a transverse manner. In table 1 below, the face detection message is a first priority, the human shape detection message and the pet detection message are a second priority, the motion detection message and the voice detection message are a third priority, and the first priority > the second priority > the third priority; the face detection message, the humanoid detection message and the movement detection message may all be of a video message type, and the pet detection message and the voice detection message may all be of a voice message type. In addition, although the mutual exclusion times of the various messages in table 1 are the same, it is understood that the mutual exclusion times of the various messages may be completely different or may not be completely the same, and may be specifically set according to actual situations. Likewise, the timeout times for the various messages may or may not be the same, may or may not be completely different.
Table 1 message configuration table
S102: and judging whether a first message which has higher priority than the current message and is not reported to be finished exists on the current reporting link.
Specifically, the specific implementation process of step S102 may be: after a first message which is reported on a current reporting link is obtained, a message configuration table is called to obtain the priority and the timeout time corresponding to the first message; and judging whether the priority of the first message on the current reporting link is higher than that of the current message or not and whether the first message is triggered within the timeout time corresponding to the first message or not. And when the first message is not triggered within the timeout time corresponding to the first message, the report of the first message is finished. The specific implementation process of the step S102 is simple, and the process of determining whether to end the report by using the timeout time is accurate, thereby reducing the situation of message redundancy.
S103: if so, discarding the current message and returning to the step of receiving the message.
Specifically, if the first message exists in the step S103, the first message exists on the current reporting link, and the priority of the first message is higher than that of the current message, and the reporting of the first message is not finished.
S104: and if the current message does not exist, reporting the current message in response to that a second message with higher priority than the current message is not received in the exclusive time period corresponding to the first message, and returning to the step of receiving the message.
Of course, the above-mentioned cases include a plurality of cases, and the step S104 is only one of them. Specifically, the step synchronized with step S104 includes:
the first condition is as follows: and reporting the current message in response to no message on the current reporting link.
Case two: and in response to the first message which has the same priority as the current message and is not reported to the end, the current message is reported directly without waiting for the first message to be reported to the end. I.e. for messages of the same priority, they may be reported simultaneously.
Case three: if there is a first message with a lower priority than the current message and without reporting completion on the current reporting link, the method can be subdivided into the following three cases:
case a: that is, in step S104, in response to that the second message with higher priority than the current message is not received in the mutex period corresponding to the first message, the current message is reported, and the step of receiving the message is returned.
Case B: and in response to receiving a second message with higher priority than the current message in a mutex time period corresponding to the first message, discarding the current message, taking the second message as the current message, and returning to the step of judging whether the first message with higher priority than the current message exists on the current reporting link. It should be noted that the first message after the return may be different from the first message of the previous cycle.
Case C: and reporting the current message and the second message in response to receiving the second message with the same priority as the current message in the mutual exclusion time period corresponding to the first message.
The cases a to C all relate to the mutex time corresponding to the first message, and the mutex time may be obtained by calling a message configuration table. In addition, when the priority and the timeout time corresponding to the first message are obtained in step S102, the mutual exclusion time may be obtained together. Of course, the mutex time may be obtained after the step S102 determines that the mutex time does not exist, and the present application is not limited thereto.
In addition, the message reporting method in any embodiment provided by the application can adopt an SDK packaging form, support a user to edit a message configuration table, and open a unified interface to assist the user in completing development, so as to reduce development difficulty and standardize the message service of the Internet of things IPC.
The above-mentioned message reporting method is further explained with a specific application scenario. Still taking table 1 as an example, please refer to fig. 2, and fig. 2 is a schematic flow chart of another embodiment of the message reporting method of the present application, where the message sending method specifically includes:
step 1, starting a message detection thread and circularly receiving different types of messages.
Step 2, when detecting the message A, firstly judging whether a high-priority message exists on the current uplink; for example, when the message a is a mobile detection message or a voice message, it is first determined whether a human detection message, a pet detection message, or a face detection message exists on the current uplink; for example, when the message a is a human face detection message or a pet detection message, it is first determined whether a human face detection message exists on the current upload link.
And 3, when the high-priority message B exists and is not ended, discarding the message A, and ending the circulation.
Step 4, when no high-priority message exists on the current uploading link, responding to the fact that the priority of the message B on the current uploading link is the same as the priority of the message A, and uploading the message A; in response to the priority of message B being less than the priority of message a on the current uplink, step 5 is entered.
And 5, when the message B is not triggered by the message with higher priority than the message A within the mutex time (namely 10 seconds) corresponding to the message B, reporting the current message A, and ending the cycle.
And 6, when a new high-priority message C is triggered within the mutual exclusion time (namely 10 seconds) corresponding to the message B, discarding the message A, and continuously judging whether a message with higher priority than the message C exists at present.
And 7, when the message D with higher priority exists, the message C does not carry out any processing, and the cycle is ended.
And 8, when no message with high priority exists, re-entering the step 4.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an embodiment of a message sending apparatus according to the present application. The message sending device comprises a processor 20 and a memory 22 coupled to each other for cooperating with each other to implement the object tracking method described in any of the above embodiments. In the present embodiment, the processor 20 may also be referred to as a CPU (Central Processing Unit). The processor 20 may be an integrated circuit chip having signal processing capabilities. The Processor 20 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In addition, the message sending device provided in the present application may further include other structures, such as a common display screen, a communication circuit, etc., which are not described in the present application too much.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an embodiment of a device with a storage function according to the present application. The storage-enabled device 30 has stored thereon program data 300, the program data 300 being executable by a processor to implement the message sending method described in any of the embodiments above. The program data 300 may be stored in the storage device in the form of a software product, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.
Claims (9)
1. A message reporting method is characterized by comprising the following steps:
starting a message detection thread and receiving a current message;
judging whether the priority of a first message which is being reported on a current reporting link is higher than the priority of the current message or not and whether the first message is triggered within a timeout time corresponding to the first message or not; determining that the reporting of the first message is finished in response to that the first message is not triggered within the timeout time corresponding to the first message;
if yes, discarding the current message; if a first message which is lower than the priority of the current message and is not reported to be finished exists on the current reporting link, responding to that a second message which is higher than the priority of the current message is not received in a mutual exclusion time period corresponding to the first message, and reporting the current message;
returning to the step of receiving the current message.
2. The message reporting method according to claim 1, wherein the method further comprises:
and reporting the current message in response to the first message on the current reporting link and the current message having the same priority.
3. The message reporting method according to claim 1, wherein the method further comprises:
and in response to receiving a second message with higher priority than the current message in a mutex time period corresponding to the first message, discarding the current message, taking the second message as the current message, and returning to the step of judging whether the first message with higher priority than the current message exists on the current reporting link.
4. The message reporting method of claim 1, wherein the method further comprises:
and reporting the current message and a second message with the same priority as the current message in response to receiving the second message with the same priority as the current message in a mutual exclusion time period corresponding to the first message.
5. The message reporting method of claim 1, wherein the step of starting the message detection thread and receiving the current message is preceded by:
receiving a message configuration table, wherein priorities, timeout times and mutual exclusion times corresponding to various messages are preset in the message configuration table, and at least one message is correspondingly set under the same priority.
6. The message reporting method of claim 5, wherein the message reporting method comprises the steps of,
the types of the various messages comprise at least one of video, pictures and sound, the messages belonging to the same type have different priorities, and the types of the corresponding messages under the same priority are different.
7. The message reporting method according to any of claims 1-6,
the message reporting method adopts SDK encapsulation.
8. A message reporting apparatus, comprising:
a processor and a memory, wherein the processor is coupled to the memory and configured to implement the message reporting method of any one of claims 1-7.
9. An apparatus having a storage function, wherein program data is stored thereon, the program data being executable by a processor to implement the message reporting method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110344793.9A CN113259262B (en) | 2021-03-29 | 2021-03-29 | Message reporting method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110344793.9A CN113259262B (en) | 2021-03-29 | 2021-03-29 | Message reporting method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113259262A CN113259262A (en) | 2021-08-13 |
CN113259262B true CN113259262B (en) | 2023-04-14 |
Family
ID=77181262
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110344793.9A Active CN113259262B (en) | 2021-03-29 | 2021-03-29 | Message reporting method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113259262B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101102281A (en) * | 2007-08-16 | 2008-01-09 | 中兴通讯股份有限公司 | Data processing method for reporting a large number of data in mobile communication system |
CN111263384A (en) * | 2019-01-18 | 2020-06-09 | 维沃软件技术有限公司 | Information reporting and receiving method, terminal equipment and network equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105530111A (en) * | 2014-10-21 | 2016-04-27 | 中兴通讯股份有限公司 | Alarm suppression method and system for the Internet of things |
US9515932B2 (en) * | 2015-02-06 | 2016-12-06 | Oracle International Corporation | Methods, systems, and computer readable media for conducting priority and compliance based message traffic shaping |
CN107395677B (en) * | 2017-06-21 | 2020-04-07 | 深圳市盛路物联通讯技术有限公司 | Data reporting control method and system based on terminal equipment priority |
CN110445824B (en) * | 2018-05-04 | 2022-03-11 | 中国移动通信有限公司研究院 | NB-IoT data reporting method, device, system and computer readable storage medium |
CN111600758A (en) * | 2020-05-19 | 2020-08-28 | 中移(杭州)信息技术有限公司 | Message reporting method and platform, intelligent gateway and storage medium |
-
2021
- 2021-03-29 CN CN202110344793.9A patent/CN113259262B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101102281A (en) * | 2007-08-16 | 2008-01-09 | 中兴通讯股份有限公司 | Data processing method for reporting a large number of data in mobile communication system |
CN111263384A (en) * | 2019-01-18 | 2020-06-09 | 维沃软件技术有限公司 | Information reporting and receiving method, terminal equipment and network equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113259262A (en) | 2021-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TW201835831A (en) | Method and device for sending trading information, and consensus verification method and device | |
CN107783803B (en) | System optimization method and device of intelligent terminal, storage medium and intelligent terminal | |
CN105874773B (en) | Task processing device, intelligent equipment, task processing method and baseband processor | |
CN112218272A (en) | Event subscription method, device and equipment | |
CN109981737B (en) | Network request processing method, device, terminal and storage medium | |
TW202002599A (en) | Information processing method, apparatus, device and system | |
CN103294553A (en) | Method and device for managing multimedia resources of mobile terminal | |
CN110933075B (en) | Service calling method and device, electronic equipment and storage medium | |
WO2022148254A1 (en) | User information analysis result feedback method and device thereof | |
WO2023029961A1 (en) | Task execution method and system, electronic device, and computer storage medium | |
CN113259262B (en) | Message reporting method and related device | |
CN113810890A (en) | Device loop-back method, device, electronic device and storage medium | |
CN114158018A (en) | Data transmission method and device, Bluetooth slave device and Bluetooth master device | |
CN111540458A (en) | Information processing method and device, electronic equipment and computer storage medium | |
US20080176590A1 (en) | Method and apparatus for receiving multimedia message service messages | |
CN111493861B (en) | Electrocardiogram measuring method and device, electronic equipment and computer storage medium | |
CN111475870B (en) | Reset method and device, electronic equipment and computer storage medium | |
CN111540457B (en) | Binding method and device, electronic equipment and computer storage medium | |
EP3876651B1 (en) | Contention random access method and device | |
CN111885264A (en) | Information reminding system, method and device | |
WO2022062849A1 (en) | Resource request method, resource configuration method, and related apparatus | |
CN115208936A (en) | Remote calling method, system, device, electronic equipment and storage medium | |
CN113747100B (en) | Audio and video call method and device, storage medium and electronic equipment | |
WO2021115437A1 (en) | Rejection short message sending method and apparatus, and computer device and storage medium | |
CN114979285B (en) | Service calling method, device, equipment, system, storage medium and product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |