CN110933168B - Message reporting method and device for multiple Internet of things devices and storage medium - Google Patents
Message reporting method and device for multiple Internet of things devices and storage medium Download PDFInfo
- Publication number
- CN110933168B CN110933168B CN201911190929.4A CN201911190929A CN110933168B CN 110933168 B CN110933168 B CN 110933168B CN 201911190929 A CN201911190929 A CN 201911190929A CN 110933168 B CN110933168 B CN 110933168B
- Authority
- CN
- China
- Prior art keywords
- internet
- things
- messages
- cached
- equipment
- 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
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- 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/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- 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/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
- H04L67/5651—Reducing the amount or size of exchanged application data
Abstract
The invention discloses a message reporting method, equipment and a storage medium for a plurality of Internet of things equipment, wherein the reporting method comprises the following steps: s1: each piece of Internet of things equipment caches the message to be reported and counts the quantity of the cached message of each piece of Internet of things equipment in real time; s2: selecting one Internet of things device with the largest number of cached messages at the current sampling time from the plurality of Internet of things devices; s3: judging whether the number of the cached messages of the internet of things equipment selected in the step S2 is still the largest at the next sampling moment, if so, submitting all the cached messages of the internet of things equipment to report, and clearing the cached messages; if not, the process returns to S1 again after waiting for a set time. The invention can select the equipment which is most urgently needed to submit the message, then the selected equipment submits the message of the equipment, and other equipment needs to wait, thereby effectively reducing the connection quantity of the equipment to the server and reducing the resource consumption of the local network and the remote network.
Description
Technical Field
The present invention relates to the field of network communications, and in particular, to a method, a device, and a storage medium for reporting messages of multiple internet of things devices.
Background
At present, in the same network environment, devices with the internet of things function often need to report data or messages to a cloud server to realize the data collection function.
However, if a large number of internet of things devices are in the same network environment, when a large number of internet of things devices report submitted data at the same time, pressure is applied to the local network, so that the local network may have abnormal phenomena such as breakdown, and the local network cannot be normally used; meanwhile, a large amount of data is uploaded to the cloud server, and the cloud server also needs to consume a large amount of thread resources to receive and process the uploaded data, so that remote network resources are consumed.
Disclosure of Invention
In order to overcome the defects of the prior art, one of the objectives of the present invention is to provide a message reporting method for multiple internet of things devices, which can effectively reduce network resource consumption.
The second purpose of the invention is to provide a terminal device.
It is a further object of the present invention to provide a storage medium.
One of the purposes of the invention is realized by adopting the following technical scheme:
a message reporting method for a plurality of Internet of things devices comprises the following steps:
step S1: each piece of Internet of things equipment caches the message to be reported and counts the quantity of the cached message of each piece of Internet of things equipment in real time;
step S2: selecting one Internet of things device with the largest number of cached messages at the current sampling time from the plurality of Internet of things devices;
step S3: judging whether the number of the cached messages of the internet of things equipment selected in the step S2 is still the maximum at the next sampling moment, if so, submitting all the cached messages of the internet of things equipment to report, and clearing the cached messages; if not, the process returns to step S1 again after waiting for the set time.
Further, after the internet of things device with the largest number of cached messages reports all the cached messages in step S3, the number of messages to be submitted is zero and is broadcasted to other internet of things devices.
Further, when it is determined in the step S3 that the number of the cached messages of the internet of things device selected in the step S2 is not the maximum, the number of the messages to be submitted by the broadcasting device to other internet of things devices is N, where N is not zero.
Further, when it is determined that the number of the cached messages of the internet of things device selected in the step S2 is not the maximum, the number of the messages cached by each internet of things device is counted again after waiting for the set time, one internet of things device with the maximum number of the cached messages is selected from the plurality of internet of things devices with the number of the cached messages greater than N, and then the step S3 is executed.
Further, in step S2, if the number of the internet of things devices with the largest number of cached messages is greater than one, the number of the messages cached by each internet of things device is counted again after waiting for the set time, and then the messages are picked again until the only internet of things device with the largest number of cached messages is picked out, and step S3 is executed.
Further, after the step S1, the method further includes: and sequencing each piece of Internet of things equipment in real time according to the number of the messages cached by each piece of Internet of things equipment.
Further, the set time is a fixed time set by a user or generated by a default of the system.
Further, the time difference between the next sampling time and the current sampling time is set by a user-defined setting or a fixed time generated by the system by default.
The second purpose of the invention is realized by adopting the following technical scheme:
a terminal device comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the message reporting method of a plurality of Internet of things devices.
The third purpose of the invention is realized by adopting the following technical scheme:
a storage medium having a computer program stored thereon, the computer program, when executed, implementing the message reporting method of multiple internet of things devices.
Compared with the prior art, the invention has the beneficial effects that:
all the Internet of things equipment in the same network environment selects the equipment which is most urgently required to submit the message through internal election, then the elected equipment submits the message of the equipment, and other equipment needs to wait, so that the connection quantity of the equipment to the server is effectively reduced, and the resource consumption of a local network and a remote network is reduced.
Drawings
Fig. 1 is a schematic flow chart of a message reporting method for multiple internet of things devices according to the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.
A message reporting method for multiple Internet of things devices selects a small number of devices to report submitted data, effectively reduces the number of the devices connected to a server, and reduces resource consumption of a local network and a remote network.
As shown in fig. 1, a message reporting method for an internet of things device includes:
step S1: each piece of Internet of things equipment caches the message to be reported and counts the number of the cached messages of each piece of Internet of things equipment in real time.
Each piece of Internet of things equipment is connected with the cloud server through the same network environment, so that the mutual signal communication between the pieces of Internet of things equipment and the cloud server is realized; the current state information of each piece of internet-of-things equipment needs to be reported to the cloud server during the working period, so that in order to avoid the cloud server from being crashed due to the fact that a large number of pieces of internet-of-things equipment report data at the same time, messages or data to be reported are cached before reporting, the cached message quantity of each piece of internet-of-things equipment is counted in real time, the cached message data of each piece of internet-of-things equipment gradually increases along with the increase of time, and therefore the cached message quantity of each piece of internet-of-things equipment needs to be updated in real time.
Step S2: and selecting the Internet of things equipment with the largest number of cached messages in the current sampling time from the plurality of Internet of things equipment.
The internet of things equipment with the largest number of cached messages is selected from all the internet of things equipment in the same network environment, the messages corresponding to the internet of things equipment are preferentially reported as the messages needing to be submitted most urgently, other internet of things equipment are in a waiting state and do not do reporting work, the connection number of the equipment to the cloud server can be effectively reduced, and therefore resource consumption of a local network and a remote network is reduced.
In order to quicken the selection of the internet of things equipment with the largest number of the currently cached messages from the numerous internet of things equipment, each piece of internet of things equipment is sequenced in real time before the selection according to the number of the cached messages of each piece of internet of things equipment, and the internet of things equipment with the largest number of the cached messages can be quickly searched after the sequencing, so that the searching time is saved.
If the number of the internet of things devices with the largest number of cached messages is more than one, the number of the messages cached by each internet of things device is counted again after waiting for the set time, and then the internet of things devices are selected again until the only internet of things device with the largest number of the cached messages is selected, and then the step S3 is executed.
Step S3: judging whether the number of the cached messages of the internet of things equipment selected in the step S2 is still the largest at the next sampling moment, if so, submitting all the cached messages of the internet of things equipment to report, broadcasting the number of the messages to be submitted to other internet of things equipment to be zero, and emptying the cached messages; if not, the process returns to step S1 again after waiting for the set time.
Since the number of the cached messages of each piece of internet-of-things equipment is gradually increased, the piece of internet-of-things equipment meeting the condition at the previous sampling time is selected in step S2, and the number of the cached messages of each piece of internet-of-things equipment may possibly change at the next sampling time, so as to ensure that the message which most urgently needs to be reported is preferentially reported, it is further required to confirm whether the number of the cached messages of the piece of internet-of-things equipment is still the maximum at the next sampling time before reporting, if the piece of internet-of-things equipment with the maximum number of the cached messages at the previous sampling time is no longer the maximum number of the cached messages of all pieces of internet-of-things equipment at the next sampling time, after waiting for a set time, the number of the cached messages of each piece of internet-of-things equipment is updated, and then one piece of internet-of-things equipment with the maximum number of the cached messages is selected from all pieces of internet-of equipment for re-of-things equipment for re-judgment, if the number of the cached messages of the reselected internet-of-things device is judged to be always the maximum, all messages of the internet-of-things device are reported, and if the number of the cached messages of the internet-of-things device is judged to be not the maximum again, the steps S1-S3 are repeated until the internet-of-things device with the maximum number of the cached messages is found for reporting, so that the network resource consumption is reduced, and the caching pressure can be reduced.
The time difference between the current sampling time and the next sampling time can be set by a user in a self-defined mode or fixed time generated by default of the system, similarly, the set time in the internet of things equipment with the largest number of cached messages is selected again after the set time is waited for can be set according to the requirements of the user, and if the user does not set the set time, the default fixed time of the system is automatically adopted as the set time.
When it is determined that the number of the cached messages of the internet of things device selected in the step S2 is not the maximum, broadcasting to other internet of things devices that the number of the messages to be submitted is N, where N is a non-zero natural number, and when the internet of things device with the maximum number of the cached messages is reselected next time, selecting the internet of things device with the cached number of more than N, so that the internet of things device with the cached number of less than N is in a waiting state, and the range of the reselected internet of things device can be reduced, so as to accelerate the rate of reselecting.
Example two
A terminal device includes a memory, a processor, and a program stored in the memory, where the program is configured to be executed by the processor, and the processor executes the program to implement the steps of the message reporting method of multiple internet of things devices in the first embodiment.
In addition, the present invention also provides a storage medium, where the storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps of the message reporting method for multiple pieces of internet of things equipment.
The invention is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The device and the storage medium in this embodiment are based on two aspects of the same inventive concept, and the method implementation process has been described in detail in the foregoing, so that those skilled in the art can clearly understand the structure and implementation process of the system in this embodiment according to the foregoing description, and for the sake of brevity of the description, details are not repeated here.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.
Claims (10)
1. A message reporting method for multiple Internet of things devices is characterized by comprising the following steps:
step S1: each piece of Internet of things equipment caches the message to be reported and counts the quantity of the cached message of each piece of Internet of things equipment in real time;
step S2: selecting one Internet of things device with the largest number of cached messages at the current sampling time from the plurality of Internet of things devices;
step S3: judging whether the number of the cached messages of the internet of things equipment selected in the step S2 is still the maximum at the next sampling moment, if so, submitting all the cached messages of the internet of things equipment to report, and clearing the cached messages; if not, the process returns to step S1 again after waiting for the set time.
2. The message reporting method of multiple pieces of internet of things equipment according to claim 1, wherein after all the cached messages of the piece of internet of things equipment with the largest number of cached messages are reported in the step S3, the message number to be submitted is zero.
3. The method for reporting messages of multiple internet of things devices according to claim 2, wherein when it is determined in step S3 that the number of the messages cached in the internet of things device selected in step S2 is not the maximum, the number of messages to be submitted by the message broadcasting device is N, where N is not zero.
4. The method for reporting messages of multiple internet of things devices according to claim 1, wherein when it is determined that the number of the messages cached in the internet of things device selected in step S2 is not the maximum, the number of the messages cached in each internet of things device is counted again after waiting for a set time, one internet of things device with the maximum number of the cached messages is selected from the multiple internet of things devices with the number of the cached messages greater than N, and step S3 is performed.
5. The method for reporting messages of multiple internet of things devices of claim 4, wherein in step S2, if the number of the internet of things devices with the largest number of cached messages is greater than one, the number of the messages cached by each internet of things device is counted again after waiting for a set time, and then the messages are reselected until the only internet of things device with the largest number of cached messages is selected, and step S3 is executed.
6. The method for reporting messages of multiple internet of things devices of claim 1, wherein the step S1 is followed by further comprising: and sequencing each piece of Internet of things equipment in real time according to the number of the messages cached by each piece of Internet of things equipment.
7. The method as claimed in claim 1, wherein the set time is a fixed time set by a user or generated by a default of a system.
8. The method as claimed in claim 1, wherein the time difference between the current sampling time and the next sampling time is a fixed time set by a user or generated by a system default.
9. A terminal device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the message reporting method of multiple internet of things devices according to any one of claims 1 to 8 when executing the computer program.
10. A storage medium having a computer program stored thereon, wherein the computer program is configured to implement the message reporting method of multiple internet of things devices according to any one of claims 1 to 8 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911190929.4A CN110933168B (en) | 2019-11-28 | 2019-11-28 | Message reporting method and device for multiple Internet of things devices and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911190929.4A CN110933168B (en) | 2019-11-28 | 2019-11-28 | Message reporting method and device for multiple Internet of things devices and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110933168A CN110933168A (en) | 2020-03-27 |
CN110933168B true CN110933168B (en) | 2022-03-11 |
Family
ID=69847476
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911190929.4A Active CN110933168B (en) | 2019-11-28 | 2019-11-28 | Message reporting method and device for multiple Internet of things devices and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110933168B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2216346A1 (en) * | 1996-10-18 | 1998-04-18 | At&T Corp. | Inter-cache protocol for improved web performance |
CN101026596A (en) * | 2007-03-02 | 2007-08-29 | 李沫南 | Clientend interface customized instant communication method and system |
CN101459619A (en) * | 2009-01-05 | 2009-06-17 | 杭州华三通信技术有限公司 | Method and apparatus for packet transmission processing in network |
CN102281591A (en) * | 2010-06-13 | 2011-12-14 | 中兴通讯股份有限公司 | Data buffer method and system thereof |
CN104519139A (en) * | 2014-12-31 | 2015-04-15 | 华为技术有限公司 | Caching method, cache edge server, cache core server and caching system |
CN105007303A (en) * | 2015-06-05 | 2015-10-28 | 冠研(上海)企业管理咨询有限公司 | Internet-of-Things connection method |
-
2019
- 2019-11-28 CN CN201911190929.4A patent/CN110933168B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2216346A1 (en) * | 1996-10-18 | 1998-04-18 | At&T Corp. | Inter-cache protocol for improved web performance |
CN101026596A (en) * | 2007-03-02 | 2007-08-29 | 李沫南 | Clientend interface customized instant communication method and system |
CN101459619A (en) * | 2009-01-05 | 2009-06-17 | 杭州华三通信技术有限公司 | Method and apparatus for packet transmission processing in network |
CN102281591A (en) * | 2010-06-13 | 2011-12-14 | 中兴通讯股份有限公司 | Data buffer method and system thereof |
CN104519139A (en) * | 2014-12-31 | 2015-04-15 | 华为技术有限公司 | Caching method, cache edge server, cache core server and caching system |
CN105007303A (en) * | 2015-06-05 | 2015-10-28 | 冠研(上海)企业管理咨询有限公司 | Internet-of-Things connection method |
Also Published As
Publication number | Publication date |
---|---|
CN110933168A (en) | 2020-03-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7631034B1 (en) | Optimizing node selection when handling client requests for a distributed file system (DFS) based on a dynamically determined performance index | |
CN111600952B (en) | Scene pushing method, scene pushing execution device, terminal, server and scene pushing system | |
EP3832452A1 (en) | Log printing method and system, server | |
CN113392041A (en) | Application cache cleaning method, device, equipment and storage medium | |
CN113656176A (en) | Cloud equipment distribution method, device, system, electronic equipment, medium and product | |
US10938773B2 (en) | Method and apparatus for synchronizing contact information and medium | |
CN114490160A (en) | Method, device, equipment and medium for automatically adjusting data tilt optimization factor | |
CN112506619B (en) | Job processing method, job processing device, electronic equipment and storage medium | |
CN110933168B (en) | Message reporting method and device for multiple Internet of things devices and storage medium | |
CN113747423B (en) | Cloud mobile phone state synchronization method, device, equipment, storage medium and program product | |
CN116185578A (en) | Scheduling method of computing task and executing method of computing task | |
CN104717286A (en) | Data processing method, terminal, server and system | |
CN112395337A (en) | Data export method and device | |
CN112994934B (en) | Data interaction method, device and system | |
CN112367384B (en) | Kafka cluster-based dynamic speed limiting method and device and computer equipment | |
CN113835905A (en) | Message queue load balancing method and device, electronic equipment and medium | |
CN114048228A (en) | State storage updating method, device, equipment and storage medium | |
CN112965844A (en) | CPU surge accident processing method and device | |
CN103152386A (en) | Business data distribution server and business data distribution method thereof | |
CN113835733B (en) | Cloud application updating method and device, electronic equipment and storage medium | |
CN116760891B (en) | Data processing method and device for downhole multi-equipment | |
CN114257598B (en) | Resource downloading method and device, storage medium and electronic equipment | |
CN116628306A (en) | Webpage resource acquisition method and device, electronic equipment and storage medium | |
CN114175748B (en) | Communication frequency adjusting method, device, electronic equipment and storage medium | |
CN117421331A (en) | Data query optimization method, device, equipment and storage medium |
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 | ||
CB02 | Change of applicant information |
Address after: 511434 No.1 and No.2, Shihua Road, Hualong Town, Panyu District, Guangzhou City, Guangdong Province Applicant after: Guangdong haomadame smart home Co.,Ltd. Address before: No.1, No.2 highway, No.2, Panyu, Guangzhou Applicant before: GUANGDONG KELAINI INTELLIGENT TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |