Iot data transmission method and device, electronic equipment and storage medium
By employing a hierarchical storage and transmission strategy based on device type and priority in the Internet of Things (IoT), the problem of emergency data being blocked during IoT data transmission is solved, thereby improving the stability and efficiency of data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TANGSHAN CAOFEIDIAN LIANCHENG TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-10
AI Technical Summary
In large-scale IoT networking scenarios, existing IoT data transmission methods fail to effectively distinguish between different types of data, resulting in urgent data being easily blocked by ordinary monitoring data, high transmission latency, link congestion, inability to meet the concurrent transmission needs of large-scale IoT devices, and poor data transmission stability.
By acquiring data packets from IoT devices in the perception layer, and based on the mapping relationship between device type and priority, the data is stored in a cache in a hierarchical manner, and then transmitted to the IoT data transmission platform according to a priority queue strategy. This ensures that urgent data is transmitted first and avoids being blocked by ordinary data, and adopts a hierarchical caching and hierarchical transmission queue design.
It enables priority transmission of urgent data, reduces transmission latency, minimizes data congestion, and improves the stability and efficiency of data transmission in large-scale IoT device networking scenarios.
Smart Images

Figure CN121509475B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of data transmission, and more particularly relates to an Internet of Things data transmission method and device, an electronic device and a storage medium. BACKGROUND
[0002] In a large-scale Internet of Things networking scenario, the types of sensing layer Internet of Things devices are various, and the importance and real-time demand of the generated data are significantly different. The existing Internet of Things data transmission method mostly adopts a non-discriminatory transmission mode, which causes emergency data such as alarm data to be easily blocked by ordinary monitoring data, resulting in problems such as high transmission delay and link congestion. Meanwhile, various types of data are mixedly stored and scheduled, which further aggravates the disorder of transmission order and reduces the data transmission efficiency, and cannot adapt to the concurrent transmission demand of large-scale Internet of Things devices, ultimately resulting in poor data transmission stability. SUMMARY
[0003] The application aims to provide an Internet of Things data transmission method and device, an electronic device and a storage medium, to improve the data transmission stability in a large-scale Internet of Things device networking scenario.
[0004] In a first aspect, an Internet of Things data transmission method is provided, which comprises the following steps:
[0005] obtaining a data packet of a sensing layer Internet of Things device, the data packet comprising Internet of Things data collected by the sensing layer Internet of Things device and a type of the sensing layer Internet of Things device, the type comprising an alarm device, a control device and a monitoring device;
[0006] determining a priority of the data packet based on the type and a first target mapping relationship, the first target mapping relationship being a mapping relationship between the device type and the data packet priority, different types corresponding to different data packet priorities, the data packet priority comprising a first-level priority, a second-level priority and a third-level priority;
[0007] storing the data packet in a corresponding cache area based on the priority of the data packet, the data packet priority and the cache area having a mapping relationship;
[0008] determining a data transmission queue based on the priority of the data packet, and transmitting the data packet to an Internet of Things data transmission platform based on a transmission strategy corresponding to the data transmission queue, the priority of the data transmission queue corresponding to the priority of the data packet in a one-to-one manner;
[0009] The transmission strategy corresponding to the data transmission queue comprises:
[0010] if the first-level priority queue contains a first-level priority data packet, the first-level priority data packet is transmitted;
[0011] If the first priority queue is empty and the second priority queue contains a second priority data packet, the second priority data packet is transmitted.
[0012] If the first priority queue is empty and the second priority queue is empty and the third priority queue contains a third priority data packet, the third priority data packet is transmitted.
[0013] In a second aspect, the embodiment of the present application provides an Internet of Things data transmission device, which comprises:
[0014] a data acquisition module, configured to acquire a data packet of a perception layer Internet of Things device, the data packet comprising Internet of Things data collected by the perception layer Internet of Things device and a type of the perception layer Internet of Things device, the type comprising an alarm type device, a control type device and a monitoring type device;
[0015] a priority determination module, configured to determine a priority of the data packet based on the type and a first target mapping relationship, the first target mapping relationship being a mapping relationship between the device type and the data packet priority, different types corresponding to different data packet priorities, the data packet priority comprising a first priority, a second priority and a third priority;
[0016] a data caching module, configured to store the data packet in a corresponding cache area based on the priority of the data packet, the data packet priority and the cache area having a mapping relationship;
[0017] a data transmission module, configured to determine a data transmission queue based on the priority of the data packet, and transmit the data packet to an Internet of Things data transmission platform based on a transmission strategy corresponding to the data transmission queue, the priority of the data transmission queue corresponding to the priority of the data packet in a one-to-one manner;
[0018] The transmission strategy corresponding to the data transmission queue comprises:
[0019] If the first priority queue contains a first priority data packet, the first priority data packet is transmitted.
[0020] If the first priority queue is empty and the second priority queue contains a second priority data packet, the second priority data packet is transmitted.
[0021] If the first priority queue is empty and the second priority queue is empty and the third priority queue contains a third priority data packet, the third priority data packet is transmitted.
[0022] In a third aspect, the embodiment of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the Internet of Things data transmission method when executing the computer program.
[0023] In a fourth aspect, the present application provides a computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned Internet of Things data transmission method.
[0024] The Internet of Things data transmission method and device, electronic device, and storage medium provided by the present application have the following advantages. The perception layer Internet of Things device collects data and generates a data packet containing the device type and the Internet of Things data, and sends the data packet to the edge node. The edge node receives the data packet, analyzes the device type identifier, determines the priority of the data packet by querying the first target mapping relationship, stores the data packet in the cache area corresponding to the priority, and synchronizes the data packet to the corresponding transmission queue. The transmission scheduling module schedules the data packet in the high-priority queue in priority according to the preset transmission strategy, transmits the data packet to the Internet of Things data transmission platform through the transmission network, and realizes the hierarchical transmission scheduling of data. The present application binds the device type and the priority to realize the hierarchical processing of data, ensures the priority transmission of emergency data such as alarms, avoids being blocked by ordinary monitoring data, reduces the transmission delay of emergency data, and guarantees the independence and security of the storage of data of different priorities by the partitioned cache of the edge node. The combination of the hierarchical transmission queue and the scheduling strategy reasonably allocates the transmission link resources, reduces the occurrence of data congestion, and improves the data transmission stability in the large-scale Internet of Things device networking scenario. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, 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 creative labor.
[0026] Figure 1 The flowchart of the Internet of Things data transmission method provided by an embodiment of the present application is shown in the figure.
[0027] Figure 2 The structure block diagram of the Internet of Things data transmission device provided by an embodiment of the present application is shown in the figure.
[0028] Figure 3 The schematic block diagram of the electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0029] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, technologies, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
[0030] It can be understood that, in the embodiments of the present application, the data related to user information and the like needs to be obtained with the permission or consent of the user, and the collection, use and processing of the related data need to comply with relevant laws, regulations and standards when the embodiments of the present application are applied to specific products or technologies.
[0031] It should be noted that the terms "first", "second", and the like in the description, claims, and drawings of the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0032] In order to make the purposes, technical solutions and advantages of the present application clearer, specific embodiments will be described below with reference to the accompanying drawings.
[0033] Reference should be made to Figure 1 , Figure 1 The flowchart of the Internet of Things data transmission method provided by an embodiment of the present application can be executed by an electronic device, and the method can include the following steps.
[0034] S101: Obtain a data packet of a perception layer Internet of Things device, the data packet including Internet of Things data collected by the perception layer Internet of Things device and a type of the perception layer Internet of Things device, the type including an alarm type device, a control type device and a monitoring type device.
[0035] In the embodiment, the perception layer Internet of Things device is a terminal device of a perception layer of an Internet of Things architecture, directly interacts with a physical environment, is responsible for collecting various physical quantities, state information or executing control instructions, and is a source of Internet of Things data.
[0036] The data packet is a standardized data transmission unit generated after the perception layer Internet of Things device collects data, internally encapsulates the Internet of Things data collected by the device and the type information of the device itself, and can be reliably transmitted and analyzed between Internet of Things nodes.
[0037] The Internet of Things data is original information of the physical world collected by the perception layer Internet of Things device, such as temperature, humidity, pressure, device running state and fault alarm signals.
[0038] Alarm device is a type of sensing layer IoT device, which is used to collect data related to emergency events or abnormal states, such as fire sensors, device fault monitors, gas leak alarms, etc. The data transmitted by the device is directly related to safety or system stability.
[0039] Control device is a type of sensing layer IoT device, which is used to transmit device control instructions or instruction execution feedback data, such as motor drivers, valve controllers, industrial computers, etc. The data transmitted by the device is related to the operation control logic of the device.
[0040] Monitoring device is a type of sensing layer IoT device, which is used to periodically collect regular environmental or device parameter data, such as temperature and humidity sensors, flow sensors, voltage sensors, etc. The data transmitted by the device is mainly for regular monitoring, and the real-time requirement is relatively low.
[0041] In this embodiment, the sensing layer IoT device is deployed on the field side of the Internet of Things sensing scene, such as in a smart factory scene. Alarm devices are specifically fire sensors and device fault monitors, which are used to collect fire alarm signals, device fault signals, and other emergency data. Control devices are specifically motor drivers and valve controllers, which are used to collect device operation state feedback data and receive execution control instructions. Monitoring devices are specifically temperature and humidity sensors, pressure sensors, and flow sensors, which are used to periodically collect regular parameter data of the environment or device. When generating a data packet, the sensing layer IoT device will embed a device type identification field in the packet header. This field uses 2-bit binary bits to identify, where 00 represents an alarm device, 01 represents a control device, 10 represents a monitoring device, and 11 is a reserved extension bit. IoT data is the original data collected by the device, such as environmental temperature data collected by a fire sensor, operating current data collected by a motor driver, and environmental humidity data collected by a temperature and humidity sensor.
[0042] S102: Determine the priority of the data packet based on the type and the first target mapping relationship. The first target mapping relationship is the mapping relationship between device type and data packet priority. Different types correspond to different data packet priorities. Data packet priority includes first priority, second priority, and third priority.
[0043] In this embodiment, the first target mapping relationship is a mapping table pre-configured and stored in the IoT data transmission platform. The mapping table clearly records the corresponding rules of device type and priority. Specifically, alarm devices correspond to first priority, control devices correspond to second priority, and monitoring devices correspond to third priority. The mapping table supports remote updates through the IoT data transmission platform to adapt to changes in business requirements in different application scenarios.
[0044] The data message priority is a level divided according to the importance and real-time requirement of data, including a first priority, a second priority and a third priority, and the priority determines the scheduling order of the data message in the transmission process.
[0045] In the embodiment, the Internet of Things data transmission method can be applied to the edge node layer, and the perception layer Internet of Things device sends the data message with the priority field to the corresponding edge node; the edge node pre-stores a first target mapping relationship. When the edge node receives the data message, the device type information in the message is first parsed, and then the first target mapping relationship is queried to bind different types of devices with corresponding message priorities. For example, the alarm type device for transmitting emergency information corresponds to the highest priority, the control type device for transmitting regular instructions corresponds to the medium priority, and the monitoring type device for transmitting ordinary monitoring data corresponds to the lowest priority, thereby establishing a judgment standard for subsequent differentiated transmission scheduling.
[0046] S103: storing the data message to the corresponding cache area based on the priority of the data message, and the data message priority and the cache area have a mapping relationship.
[0047] In the embodiment, the cache area is a storage area deployed in the edge node, corresponding to the data message priority, for temporarily storing the data message to be transmitted, realizing isolated storage of different priority data and avoiding data mixing and loss.
[0048] In the embodiment, the cache area is deployed in the edge node, and the edge node is a local computing node close to the perception layer Internet of Things device, which can specifically adopt an industrial edge gateway. After the priority of the data message is determined, the edge node will deliver the message to the cache area corresponding to the priority. The first priority data message enters the first cache area, the second priority data message enters the second cache area, and the third priority message enters the third cache area. The partitioned cache can avoid mixing and covering of data messages of different priorities in the storage stage, and at the same time provide stable data source for subsequent transmission queue scheduling, to ensure that high priority data will not be squeezed out of storage resources by low priority data.
[0049] S104: determining a data transmission queue based on the priority of the data message, and transmitting the data message to the Internet of Things data transmission platform based on the transmission strategy corresponding to the data transmission queue, the priority of the data transmission queue corresponding to the priority of the data message;
[0050] The transmission strategy corresponding to the data transmission queue includes:
[0051] If the first priority queue contains a first priority data message, the first priority data message is transmitted;
[0052] If the first priority queue is empty and the second priority queue contains a second priority data packet, the second priority data packet is transmitted.
[0053] If the first priority queue is empty and the second priority queue is empty and the third priority queue contains a third priority data packet, the third priority data packet is transmitted.
[0054] In the embodiment, the data transmission queue is a logical queue deployed in the edge node, corresponding to the buffer area and the data packet priority, and the data packet in the buffer area is synchronized to the corresponding queue for waiting for the scheduling of the transmission scheduling module.
[0055] The transmission strategy is a rule for scheduling the data transmission queue, and high priority is given to transmission, i.e., the first priority queue is scheduled first, and then the second and third priority queues are scheduled in sequence, to ensure the transmission timeliness of important data.
[0056] The IOT data transmission platform is a cloud or edge data management platform in the IOT architecture, responsible for receiving data packets transmitted by the edge node, data analysis, storage, analysis and application, and is a centralized processing center for IOT data.
[0057] In the embodiment, the data transmission queue is a logical queue in the transmission scheduling module in the edge node, and the first, second and third priority queues are also provided, corresponding to the three buffer areas, and the data packets in the buffer areas are synchronized to the corresponding transmission queues through the data migration module. The transmission strategy corresponding to the data transmission queue is realized through the scheduling algorithm of the transmission scheduling module, which monitors the state of each priority queue in real time, uses the hardware interrupt mechanism to ensure the priority scheduling of the first priority queue, triggers a high-priority interrupt signal when there is a data packet in the first priority queue, suspends the scheduling process of other queues, and preferentially occupies the transmission link resources to transmit the first priority data packet; only when the interrupt signal of the first priority queue is released (i.e., the queue is empty), the scheduling process of the second priority queue is triggered; when the first and second priority queues have no data packets, the scheduling process is switched to the third priority queue. Through the hierarchical scheduling strategy, the transmission timeliness of important data can be ensured, and urgent data can be prevented from being blocked by ordinary data.
[0058] From the above, the perception layer Internet of Things device of the embodiment collects data to generate a data message containing the device type and the Internet of Things data, and sends the data message to the edge node. After receiving the data message, the edge node parses the device type identifier, determines the priority of the data message by querying the first target mapping relationship, then stores the data message in the cache area corresponding to the priority, and synchronizes to the corresponding transmission queue. The transmission scheduling module schedules the data message in the high-priority queue in priority according to the preset transmission strategy, transmits it to the Internet of Things data transmission platform through the transmission network, and realizes the hierarchical transmission scheduling of data. Through the binding of the device type and the priority, the embodiment realizes the hierarchical processing of data, ensures the priority transmission of emergency data such as alarms, avoids being blocked by ordinary monitoring data, reduces the transmission delay of emergency data, and guarantees the independence and security of the storage of data of different priorities through the partitioned cache design of the edge node. The cooperation of the hierarchical transmission queue and the scheduling strategy reasonably allocates the transmission link resources, reduces the occurrence of data congestion, and improves the data transmission stability in the large-scale Internet of Things device networking scenario.
[0059] In an embodiment of the present application, the method further comprises:
[0060] If the priority of the data message is a third-level priority, a target data compression algorithm is determined based on the data type of the data message, and the data message is compressed based on the target data compression algorithm to obtain a compressed data message, the data type including structured data and unstructured data; the compressed data message carries a compression identifier;
[0061] The compression identifier is used to indicate the type of the target data compression algorithm; the type of the target data compression algorithm includes a difference value coding compression algorithm and a dictionary coding compression algorithm;
[0062] The storing of the data message into the corresponding cache area based on the priority of the data message comprises:
[0063] The compressed data message is stored into the corresponding cache area based on the priority of the compressed data message.
[0064] In the embodiment, the judgment of the data type can be realized by parsing the payload format of the data message. The structured data is numerical data with fixed format and field definition, such as temperature value and humidity value collected by a temperature and humidity sensor, pressure value collected by a pressure sensor, etc., which is stored in the message payload in the format of key-value pair. The unstructured data is text data without fixed format, such as device state description text and note information of monitoring data, etc., which is stored in the message payload in the format of string.
[0065] The selection of the target data compression algorithm can be realized by a compression algorithm selection module in the edge node, which has built-in data type identification logic and can automatically analyze the data message payload format and determine the data type, and then match the corresponding compression algorithm. The difference value coding compression algorithm specifically adopts an improved difference value coding, which calculates the difference value of two adjacent data points and stores the difference value, and only stores the complete data when the difference value exceeds a preset fluctuation threshold, thereby reducing the storage amount of repeated data. The dictionary coding compression algorithm specifically adopts the LZ77 algorithm, which replaces the repeated words in the message payload with the index value in the dictionary table by establishing a common word dictionary table, and the dictionary table is established in advance based on common monitoring data texts and contains high-frequency words such as "normal operation", "stable parameters", and "normal monitoring".
[0066] The compression identifier is a 1-bit field in the data message header, and 0 indicates that the difference value coding compression algorithm is adopted, and 1 indicates that the LZ77 dictionary coding compression algorithm is adopted; after the compression processing is completed, the compression module can recalculate the length of the data message and update the length field in the message header. The compressed three-level priority data message is still stored in the three-level cache area, and the storage mode is consistent with that of the uncompressed data, and they all correspond to the independent storage address space of the three-level cache area.
[0067] In the embodiment, when the edge node receives the three-level priority data message, the message payload format is first analyzed to determine the data type; the corresponding target data compression algorithm is matched according to the data type, and the message payload is compressed; after adding the compression identifier and updating the length field in the message header, the compressed data message is stored in the three-level cache area, and then synchronized to the three-level priority queue for transmission; after the Internet of Things data transmission platform receives the compressed data message, the corresponding decompression algorithm is selected according to the compression identifier, the payload data is decompressed, and the original data is restored.
[0068] From the above, it can be seen that the embodiment adopts differentiated compression algorithms for different data types of three-level priority data, improves the compression efficiency, effectively reduces the size of the data message, reduces the occupation of the transmission bandwidth, and relieves the congestion pressure of the transmission link; the setting of the compression identifier ensures that the Internet of Things data transmission platform can accurately match the decompression algorithm and ensure the normal analysis of the data; the compressed data is stored in the corresponding cache area, without changing the original priority storage logic, and ensuring the compatibility of the overall technical solution.
[0069] In an embodiment of the present application, the target data compression algorithm is determined based on the data type of the data message, comprising:
[0070] If the data type of the data message is structured data, the difference value coding compression algorithm is used as the target data compression algorithm;
[0071] If the data type of the data packet is unstructured data, the dictionary encoding compression algorithm is used as the target data compression algorithm.
[0072] In this embodiment, the implementation steps of the difference encoding compression algorithm for structured data are as follows:
[0073] First, extract the structured numerical value sequence in the data packet, for example, 5 groups of temperature data continuously collected by a temperature and humidity sensor: 25°C, 26°C, 25°C, 27°C, 26°C.
[0074] Second, calculate the difference between adjacent data, taking the first group of data as the reference value, and the differences of the subsequent data are 1°C, -1°C, 2°C, -1°C.
[0075] Third, set the fluctuation threshold to 3°C, and determine whether the difference exceeds the threshold. In this case, all differences do not exceed the threshold, so only the reference value 25°C and the subsequent difference sequence are stored.
[0076] Fourth, encapsulate the reference value and the difference sequence according to the preset format to form the compressed payload data.
[0077] In this embodiment, the implementation steps of the dictionary encoding compression algorithm for unstructured data are as follows:
[0078] First, load the pre-established dictionary table, which contains high-frequency words of 100 Internet of Things monitoring scenarios, and each word corresponds to a unique 4-digit decimal index, for example, "normal operation" corresponds to 0001, and "parameter stability" corresponds to 0002.
[0079] Second, parse the unstructured text data in the data packet, for example, "device normal operation, parameter stability".
[0080] Third, replace the high-frequency words in the text with the corresponding dictionary index, and the replaced data is "device 0001, 0002".
[0081] Fourth, encapsulate the replaced index sequence as the compressed payload data, and supplement the dictionary table version information in the compression identifier to ensure that the matching dictionary table is used during decompression.
[0082] The data type judgment logic is integrated in the compression algorithm selection module of the edge node, and is realized by analyzing the format identifier of the data packet payload. The data type identifier field in the header of the data packet is set to 1 bit, where 0 represents structured data and 1 represents unstructured data. This identifier field is embedded by the perception layer Internet of Things device according to the type of collected data when generating the data packet.
[0083] In the embodiment, after the compression algorithm selection module of the edge node receives the third-level priority data packet, first, the data type identification field in the packet header is parsed to determine the data type of the data packet; if it is structured data, the difference encoding compression algorithm module is called to compress the payload data; if it is unstructured data, the dictionary encoding compression algorithm module is called to compress the payload data; after compression, a data packet containing a compression identifier is generated and stored in the third-level cache area.
[0084] From the above, it can be concluded that the embodiment selects the appropriate compression algorithm according to the characteristics of structured data and unstructured data. Structured data has the characteristics of strong data correlation and high redundancy, and the difference encoding compression algorithm can effectively reduce redundant data. Unstructured data has the characteristic of high repetition of text vocabulary, and the dictionary encoding compression algorithm can quickly replace high-frequency vocabulary, with high compression efficiency and short compression time. By accurately matching the compression algorithm, the overall compression effect of the third-level priority data is improved, further reducing the bandwidth occupation and ensuring the data transmission efficiency.
[0085] In an embodiment of the present application, if the priority of the data packet is a third-level priority, and the data packet is not transmitted within a preset time, the method further comprises:
[0086] The current transmission link bandwidth is divided into shared bandwidth and exclusive bandwidth, and the data transmission capacity of the shared bandwidth is greater than that of the exclusive bandwidth.
[0087] The data packet is transmitted to the Internet of Things data transmission platform based on the exclusive bandwidth.
[0088] The shared bandwidth is used to transmit first-level priority data packets or second-level priority data packets.
[0089] In the embodiment, the preset time is a time threshold pre-configured in the edge node transmission scheduling module, and the timing is realized by a software timer. When the third-level priority data packet enters the third-level priority queue, the timer starts timing. If the transmission is not scheduled after the timing reaches the preset time, the exclusive bandwidth transmission mechanism is triggered.
[0090] The division of the transmission link bandwidth can be realized by the bandwidth management module of the edge node, and a software-level bandwidth allocation strategy is adopted without changing the physical characteristics of the transmission link. The division ratio of the shared bandwidth and the exclusive bandwidth can be dynamically determined according to the total bandwidth of the transmission link, and the principle is that the data transmission capacity of the shared bandwidth is greater than that of the exclusive bandwidth. For example, when the total bandwidth is 100 Mbps, the shared bandwidth is allocated 90 Mbps and the exclusive bandwidth is allocated 10 Mbps; when the total bandwidth is 1 Gbps, the shared bandwidth is allocated 900 Mbps and the exclusive bandwidth is allocated 100 Mbps.
[0091] The bandwidth management module monitors the bandwidth occupation state of the transmission link in real time. When the shared bandwidth is not fully occupied, the third-priority data message can temporarily occupy the idle shared bandwidth resource for transmission. Only when the shared bandwidth is fully occupied by the first-priority data message or the second-priority data message, and the third-priority data message is not transmitted for more than a preset time, the exclusive bandwidth is enabled for transmission. The exclusive bandwidth is a guaranteed transmission resource for the third-priority data message, and is not occupied by the first-priority data message and the second-priority data message.
[0092] In the embodiment, after the third-priority data message enters the third-priority queue, the transmission scheduling module waits for scheduling according to the transmission strategy. At the same time, the software timer starts timing. If the third-priority data message is not scheduled for transmission within a preset time, the bandwidth management module divides the bandwidth of the transmission link into a shared bandwidth and an exclusive bandwidth. The transmission scheduling module switches the transmission path, and transmits the third-priority data message to the IOT data transmission platform through the exclusive bandwidth. The shared bandwidth is specially used for transmitting the first-priority data message and the second-priority data message, to guarantee the transmission resource of high-priority data.
[0093] From the above, it can be seen that the embodiment provides guaranteed transmission resources for the third-priority data by dividing the exclusive bandwidth, avoids the accumulation or loss of the third-priority data due to long-term waiting for high-priority data transmission, and guarantees the final transmission integrity of ordinary monitoring data. The shared bandwidth guarantees the transmission of high-priority data first, and the exclusive bandwidth is guaranteed as a bottom line, so that the transmission resources are reasonably allocated among different priority data, and the real-time performance of high-priority data and the transmission guarantee of low-priority data are taken into account.
[0094] In an embodiment of the present application, after the data message is transmitted to the IOT data transmission platform based on the transmission strategy corresponding to the data transmission queue, the method further comprises:
[0095] If the confirmation receiving instruction returned by the IOT data transmission platform is not received within the target preset confirmation time, the data message is retransmitted to the IOT data transmission platform based on the transmission strategy corresponding to the data transmission queue;
[0096] The determination method of the target preset confirmation time comprises:
[0097] The current link bandwidth utilization rate is determined, and the current basic preset confirmation time is determined based on the interval in which the current link bandwidth utilization rate is located and the second target mapping relationship. The second target mapping relationship is a mapping relationship between the interval of the link bandwidth utilization rate and the basic preset confirmation time. Different intervals of the link bandwidth utilization rate include a first load interval, a second load interval, and a third load interval. The basic preset confirmation time of the first load interval is less than the basic preset confirmation time of the second load interval, and the basic preset confirmation time of the second load interval is less than the basic preset confirmation time of the third load interval.
[0098] The base preset confirmation time is weighted and adjusted according to the priority of the data message to obtain a target preset confirmation time.
[0099] In the embodiment, the link bandwidth utilization rate can be collected in real time by a bandwidth monitoring module of the edge node. The bandwidth monitoring module uses a flow statistics method to obtain the ratio of the actual transmission data amount of the transmission link in a unit time to the maximum transmission capacity of the link, and the collection period is 100 ms to ensure the real-time of the monitoring data.
[0100] The three intervals of the link bandwidth utilization rate are divided by preset thresholds. The first load interval is that the bandwidth utilization rate is less than 30%, indicating that the link load is low. The second load interval is that the bandwidth utilization rate is greater than or equal to 30% and less than or equal to 80%, indicating that the link load is moderate. The third load interval is that the bandwidth utilization rate is greater than 80%, indicating that the link load is high.
[0101] The second target mapping relationship is a preconfigured mapping table stored in a storage module of the edge node. The mapping relationship is that the first load interval corresponds to a base preset confirmation time of 100 ms, the second load interval corresponds to a base preset confirmation time of 200 ms, and the third load interval corresponds to a base preset confirmation time of 500 ms. The mapping table can be adjusted according to the characteristics of different transmission links.
[0102] The weight coefficient of the weighted adjustment is preconfigured. Specifically, the weight coefficient corresponding to the first priority data message is 0.2, the weight coefficient corresponding to the second priority data message is 0.3, and the weight coefficient corresponding to the third priority data message is 0.5. The calculation method of the weighted adjustment is target preset confirmation time = base preset confirmation time x weight coefficient. For example, if the current link bandwidth utilization rate is in the third load interval, the base preset confirmation time is 500 ms, if the data message is of the first priority, the target preset confirmation time = 500 ms x 0.2 = 100 ms, and if the data message is of the third priority, the target preset confirmation time = 500 ms x 0.5 = 250 ms.
[0103] The confirmation receiving instruction is a response message generated by the IOT data transmission platform after receiving the data message. The message contains the unique identifier of the data message, the receiving timestamp, and other information, and is returned to the edge node through the original transmission link. The edge node sets a receiving monitoring module of the confirmation receiving instruction to monitor in real time whether the corresponding data message confirmation receiving instruction is received within the target preset confirmation time.
[0104] In the embodiment, after the edge node transmits the data packet to the IOT data transmission platform, the edge node starts the confirmation receiving timing; meanwhile, the bandwidth monitoring module collects the current link bandwidth utilization, determines the load interval in which the link bandwidth utilization is located, and obtains the basic preset confirmation time through the second target mapping relationship; according to the priority of the data packet, a corresponding weight coefficient is selected to calculate the target preset confirmation time; if the receiving monitoring module does not receive the confirmation receiving instruction within the target preset confirmation time, it is determined that the data packet transmission fails, and the data packet is re-placed into the corresponding transmission queue for transmission according to the original transmission strategy; if the confirmation receiving instruction is received, it is determined that the transmission is successful, and the transmission process of the data packet is completed.
[0105] From the above, it can be concluded that the embodiment dynamically determines the target preset confirmation time in combination with the link bandwidth utilization and the priority of the data packet, prolongs the basic confirmation time in the high-load link scenario, avoids misjudgment of retransmission, shortens the confirmation time for high-priority data to ensure fast retransmission and guarantee real-time performance, and appropriately prolongs the confirmation time for low-priority data to reduce the occupation of link resources by retransmission. Through the differentiated confirmation and retransmission mechanism, the reliability of data transmission is improved, and the utilization efficiency of transmission resources is optimized.
[0106] In an embodiment of the present application, the method further comprises:
[0107] An initial capacity is configured for each buffer area corresponding to the priority of the data packet, and the initial capacity allocation ratio is positively correlated with the priority of the data packet corresponding to the buffer area;
[0108] The interval in which the current link bandwidth utilization is located and the number proportion of the data packets to be transmitted in each priority data transmission queue are monitored in real time; the number proportion is the proportion of the number of the data packets to be transmitted in each priority data transmission queue to the total number of the data packets to be transmitted in all priority data transmission queues;
[0109] If the link bandwidth utilization is in the third load interval and the number proportion of the data packets to be transmitted in the first priority data transmission queue is higher than the preset proportion threshold, the capacity of the first priority buffer area is expanded according to the preset adjustment ratio, and the capacity of the third priority buffer area is reduced, and the reduced capacity scale matches the expanded capacity scale;
[0110] If the link bandwidth utilization is in the first load interval and the number proportion of the data packets to be transmitted in the third priority data transmission queue is higher than the preset proportion threshold, the capacity of the third priority buffer area is expanded according to the preset adjustment ratio, and the capacity of the first priority buffer area is reduced, and the reduced capacity scale matches the expanded capacity scale;
[0111] If the link bandwidth utilization is in the second load interval, the initial capacity of each priority buffer area remains unchanged.
[0112] In the embodiment, the initial capacity allocation can be implemented by the cache management module of the edge node, and the initial capacity allocation ratio is first cache area: second cache area: third cache area = 5:3:2, the total cache capacity of the edge node is 16 GB, and the initial capacity of the first cache area is 8 GB, the second cache area is 4.8 GB, and the third cache area is 3.2 GB according to the calculation. The allocation ratio can be pre-configured and adjusted according to the business requirements of the application scenario.
[0113] The monitoring method of the link bandwidth utilization rate is consistent with the foregoing, and the division criteria of the first load interval, the second load interval and the third load interval are also the same as the foregoing. The number of data messages to be transmitted in each priority data transmission queue is counted in real time by the transmission queue management module, and the number ratio is calculated by dividing the number of data messages to be transmitted of a certain priority by the total number of data messages to be transmitted of the first priority, the second priority and the third priority, for example, the number of data messages to be transmitted of the first priority queue is 500, the number of data messages to be transmitted of the second priority is 300, and the number of data messages to be transmitted of the third priority is 200, and the total number is 1000, and the number ratio of the first priority is 50%.
[0114] The preset ratio threshold is a pre-configured ratio threshold, which can be 30% in particular. The threshold is stored in the configuration file of the cache management module and can be adjusted according to the actual business scenario. The preset adjustment ratio can be 20%, that is, when the adjustment condition is met, the capacity of the target cache area can be expanded by 20%, and the capacity of the corresponding other cache area can be reduced by the same scale, so that the total cache capacity of the edge node remains unchanged.
[0115] For example, the initial capacity of the first cache area is 8 GB, and the capacity is expanded to 9.6 GB according to the adjustment ratio of 20%, and the capacity of the third cache area is reduced by 1.6 GB, and the capacity of the third cache area is changed from 3.2 GB to 1.6 GB.
[0116] The cache capacity adjustment can be realized by the dynamic partition adjustment function of the cache management module. When the capacity of the target cache area needs to be expanded, the cache management module can send a capacity expansion instruction to the storage management unit of the edge node to expand the corresponding logical partition address space. When the cache area capacity needs to be reduced, the cache management module first scans the data messages in the cache area that have not entered the transmission queue, and deletes the data messages generated earliest in the order of generation timestamp in priority, until the required capacity scale is released, and then sends a capacity reduction instruction to complete the adjustment of the logical partition.
[0117] In the embodiment, the cache management module configures initial capacities for the priority cache areas, monitors the interval of the link bandwidth utilization in real time, and simultaneously counts the proportion of the number of the data messages to be transmitted in each priority transmission queue; if the link is in the third load interval and the proportion of the number of the first priority is higher than 30%, the capacity of the first priority cache area is expanded by 20% and the same scale capacity is reduced from the third priority cache area; if the link is in the first load interval and the proportion of the number of the third priority is higher than 30%, the capacity of the third priority cache area is expanded by 20% and the same scale capacity is reduced from the first priority cache area; if the link is in the second load interval and the data transmission pressure of each priority is moderate, the initial capacity is kept unchanged to ensure the reasonable allocation of the cache resources.
[0118] From the above, it can be concluded that the embodiment realizes the dynamic self-adaptive adjustment of the cache area capacity, in the case of high link load and high priority data surge, the high priority cache area is expanded to guarantee the non-loss of emergency data; in the case of low link load and more low priority data, the low priority cache area is expanded to relieve data backlog, and the capacity of the idle high priority cache area is reduced to improve the utilization rate of the storage resources; the ordered deletion of the untransmitted data is guaranteed in the capacity adjustment process to avoid the loss of effective data, and the adaptation ability of the edge node cache resources is improved.
[0119] In an embodiment of the present application, the Internet of Things data includes data corresponding to a plurality of Internet of Things parameters respectively, and the method further includes:
[0120] If the data of at least one Internet of Things parameter in the Internet of Things data exceeds the corresponding data anomaly threshold, the priority of the data message is adjusted based on the priority adjustment rule to obtain an adjusted data message; the data anomaly threshold corresponding to the Internet of Things data of different types of perception layer Internet of Things devices is different;
[0121] The data message is stored in the corresponding cache area based on the priority of the data message, including:
[0122] The data message is stored in the corresponding cache area based on the priority of the adjusted data message;
[0123] The priority adjustment rule includes:
[0124] The original third priority is promoted to the second priority, the original second priority is promoted to the first priority, and the priority of the original first priority remains unchanged.
[0125] In the embodiment, the data corresponding to the plurality of Internet of Things parameters respectively is multi-dimensional data collected by the perception layer Internet of Things device, for example, temperature parameter data and humidity parameter data collected by a temperature and humidity sensor, running current parameter data, running temperature parameter data and rotation speed parameter data collected by a motor driver.
[0126] The data anomaly threshold is a threshold range configured in advance for each Internet of Things parameter, and the anomaly threshold of different types of perception layer Internet of Things devices is different. The anomaly threshold is configured through the Internet of Things data transmission platform and delivered to the corresponding perception layer Internet of Things device and edge node. For example, the temperature anomaly threshold of the fire sensor of the alarm type device is greater than 60°C; the running current anomaly threshold of the motor driver of the control type device is greater than 10A; the temperature anomaly threshold of the temperature and humidity sensor of the monitoring type device is greater than 35°C or less than 0°C, and the humidity anomaly threshold is greater than 85% or less than 20%. The data anomaly threshold supports individualized configuration according to the environment and device characteristics of the application scenario.
[0127] The priority adjustment rule is stored in the priority adjustment module of the edge node. When the edge node receives the data packet, it first parses each parameter data in the Internet of Things data, compares each parameter data with the corresponding anomaly threshold, and if at least one parameter data exceeds the anomaly threshold, triggers the priority adjustment process, and adjusts the priority of the data packet according to the adjustment rule. If all parameter data is within the anomaly threshold range, the original priority remains unchanged. For example, the temperature data collected by the temperature and humidity sensor of the monitoring type device is 40°C, which exceeds the anomaly threshold of 35°C, and the original priority is three, which is adjusted to two; the running current collected by the motor driver of the control type device is 12A, which exceeds the anomaly threshold of 10A, and the original priority is two, which is adjusted to one; the temperature data collected by the fire sensor of the alarm type device is 70°C, which exceeds the anomaly threshold, and the original priority is one, which remains unchanged.
[0128] The adjusted data packet updates the priority identifier field in the packet header. The field uses 2-bit binary bits, 00 represents first priority, 01 represents second priority, and 10 represents third priority. Then the adjusted data packet is stored in the cache area corresponding to the new priority. If the data packet is temporarily stored in the original priority cache area, the corresponding data packet in the original cache area is deleted by the cache management module to avoid redundant data storage.
[0129] In this embodiment, the perception layer Internet of Things device generates a data packet after collecting data containing multiple Internet of Things parameters and sends it to the edge node. The edge node parses the Internet of Things parameter data in the data packet and compares it with the corresponding data anomaly threshold configured in advance. If there is parameter data exceeding the anomaly threshold, the priority of the data packet is adjusted based on the priority adjustment rule, and the priority identifier is updated. The adjusted data packet is stored in the cache area corresponding to the new priority, and subsequent scheduling transmission is performed according to the transmission queue and transmission strategy corresponding to the new priority. If all parameter data is normal, the original priority is maintained and stored in the corresponding cache area.
[0130] From the above, it can be concluded that the embodiment realizes dynamic priority adjustment based on data content abnormal state, breaks the limitation of static priority division based on device type only, enables abnormal normal monitoring data and control data to promote priority transmission, ensures timely reporting and disposal of abnormal data, and reduces the disposal delay of abnormal conditions; different types of devices are configured with different abnormal thresholds, which improves the accuracy and adaptability of priority adjustment; the adjusted data packet is stored in the corresponding cache area to ensure the orderliness of subsequent transmission scheduling.
[0131] In an embodiment of the present application, the method further comprises the step of dynamically selecting a transmission link based on the data packet priority and the transmission link state, specifically comprising:
[0132] A third target mapping relationship is pre-configured, the third target mapping relationship being a mapping relationship between the data packet priority and the transmission link type, the transmission link type including a low-delay high-reliability link and a low-cost wide-coverage link, wherein the first-priority data packet corresponds to the low-delay high-reliability link, and the second-priority and third-priority data packets correspond to the low-cost wide-coverage link;
[0133] The current state parameters of each transmission link are monitored in real time, the state parameters including a link packet loss rate, a link delay, and an interval in which a link bandwidth utilization rate is located;
[0134] If the low-delay high-reliability link corresponding to the first-priority data packet is in the third load interval and the link packet loss rate is higher than a preset packet loss threshold, the first-priority data packet is temporarily switched to a backup low-delay high-reliability link for transmission, and link abnormal information is reported to the Internet of Things data transmission platform;
[0135] If the low-cost wide-coverage link corresponding to the second-priority or third-priority data packet is in the third load interval and the proportion of the number of data packets to be transmitted is higher than a preset proportion threshold, part of the second-priority or third-priority data packets are shunted to the idle low-delay high-reliability link for transmission, and the proportion of the number of shunted packets is positively correlated with the idle bandwidth proportion of the low-delay high-reliability link;
[0136] After the data packet transmission is completed, if it is a temporary switching or shunting transmission, the default transmission link corresponding to the third target mapping relationship is restored; if it is a switching caused by link failure, the backup link is continuously used until the original link state recovers to within a preset normal threshold range.
[0137] In the embodiment, the third target mapping relationship is a mapping table pre-configured and stored in the edge node link management module, the mapping table records the corresponding rules of the priority and the transmission link type, wherein the low-delay high-reliability link is used to guarantee the real-time performance and reliability of the first priority data (such as alarm data); the low-cost wide-coverage link is used to transmit the second and third priority data (such as control instruction feedback and ordinary monitoring data), and is suitable for large-scale low-rate device access. In actual application, the modules / gateways of the two types of links can also select other models, and the embodiment of the application does not limit this.
[0138] The monitoring of the link state parameters is realized by the link monitoring module of the edge node: the link packet loss rate can be calculated by periodically sending a probe packet, that is, a probe packet with a fixed length is sent to the opposite end of the link every 50 ms, the difference between the total number of sent probe packets and the total number of received response packets within a preset time is calculated, and the ratio of the difference to the total number is the link packet loss rate; the link delay is obtained by recording the difference between the time stamp of the sent probe packet and the time stamp of the received response packet, and the average value of multiple measurements is taken as the current link delay; the monitoring method of the link bandwidth utilization is consistent with the foregoing. The preset packet loss threshold can be configured as 1%, and the preset proportion threshold can be configured as 30%, which are stored in the configuration file of the link management module and can be adjusted according to the actual link characteristics.
[0139] The standby low-delay high-reliability link and the main low-delay high-reliability link are the same type of industrial private network link, covered by different operators or different base stations, to ensure that the main and standby links are independent of each other and avoid simultaneous failure of the main and standby links due to the same fault point; the link abnormal information includes the abnormal link identifier, the abnormal type (high load / high packet loss), the abnormal timestamp, and the current link state parameters, and is reported to the Internet of Things data transmission platform in the form of structured data packets through the standby link, and the platform triggers a link abnormal alarm to notify the operation and maintenance personnel after receiving the information.
[0140] The specific implementation logic of the shunt transmission is as follows: the link management module calculates the idle bandwidth proportion of the low-delay high-reliability link in real time, the idle bandwidth proportion = (link maximum transmission bandwidth-current occupied bandwidth) / link maximum transmission bandwidth x 100%; the proportion of the number of shunted packets does not exceed the idle bandwidth proportion, for example, if the idle bandwidth proportion of the low-delay high-reliability link is 20%, then at most 20% of the second or third priority data to be transmitted is shunted to the link; the third priority data is preferentially selected for shunting, and if the number of third priority data is insufficient, the second priority data is supplemented for shunting, to ensure that the transmission resources of the first priority data are not affected.
[0141] The link recovery mechanism is realized by continuous monitoring of the link monitoring module: for temporary switching (high load / high packet loss of the primary link but not failure) or shunting transmission, when the original link state parameters recover to the preset normal threshold (out of the third load interval, packet loss rate ≤ preset packet loss threshold), the link management module triggers link switching to restore data packet transmission to the default link corresponding to the third target mapping relationship; for switching caused by link failure, the link monitoring module performs state detection on the original failure link every 100 ms until the original link state recovers to the normal threshold range, and then performs the recovery operation, and if the original link continuously fails for more than a preset time (such as 10 minutes), the standby link is switched to the primary link, and the default link configuration in the third target mapping relationship is updated.
[0142] In the embodiment, the link management module preloads the third target mapping relationship, and the data packets match the corresponding default transmission link according to their own priority; the link monitoring module collects state parameters such as packet loss rate, delay, and bandwidth utilization of each link in real time; if the default low-delay high-reliability link of the first priority data is in the third load interval and the packet loss rate exceeds the threshold, the first priority data packet is immediately switched to the standby link for transmission and an exception is reported; if the default low-cost wide-coverage link of the second and third priority data is in the third load interval and the proportion of the data to be transmitted exceeds the threshold, part of the second and third priority data is shunted to the idle low-delay high-reliability link according to the idle bandwidth proportion of the low-delay high-reliability link; after the data transmission is completed, it is determined whether to switch back to the default link according to the original link state recovery condition, to ensure the reasonable allocation of link resources.
[0143] From the above, it can be seen that the embodiment realizes differentiated link resource adaptation by binding priority and link type, which not only guarantees low-delay high-reliability transmission of first priority data, but also controls the transmission cost of second and third priority data through low-cost links; the dynamic switching and shunting mechanism based on link state avoids the influence of single link exception on data transmission, and improves the reliability of core data transmission; the shunting strategy fully utilizes the idle link resources, relieves the congestion pressure of low-cost links, and reduces the backlog of low-priority data; the primary and standby link switching and recovery mechanism ensures the redundant backup of link resources, and further improves the stability and fault tolerance of data transmission in large-scale Internet of Things networking scenarios.
[0144] Based on the same inventive concept, the embodiments of the present application also provide an Internet of Things data transmission device for implementing the above-mentioned Internet of Things data transmission method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more Internet of Things data transmission device embodiments provided below can be referred to the limitations of the Internet of Things data transmission method in the foregoing, which will not be repeated here.
[0145] The embodiment of the application provides a kind of Internet of Things data transmission device, as shown in Figure 2 The Internet of Things data transmission device 20 includes: data acquisition module 21, priority determination module 22, data cache module 23 and data transmission module 24;
[0146] Data acquisition module 21 is used to acquire the data message of the perception layer Internet of Things device, and the data message includes the Internet of Things data collected by the perception layer Internet of Things device and the type of the perception layer Internet of Things device, including alarm type device, control type device and monitoring type device;
[0147] Priority determination module 22 is used to determine the priority of the data message based on the type and the first target mapping relationship, and the first target mapping relationship is the mapping relationship between the device type and the data message priority, and the data message priority corresponding to different types is different, including first priority, second priority and third priority;
[0148] Data cache module 23 is used to store the data message to the corresponding cache area based on the priority of the data message, and the priority of the data message and the cache area have a mapping relationship;
[0149] Data transmission module 24 is used to determine the data transmission queue based on the priority of the data message, and transmit the data message to the Internet of Things data transmission platform based on the transmission strategy corresponding to the data transmission queue, and the priority of the data transmission queue corresponds to the priority of the data message one by one;
[0150] Among them, the transmission strategy corresponding to the data transmission queue includes:
[0151] If the first priority queue contains first priority data message, transmit the first priority data message;
[0152] If the first priority queue is empty, and the second priority queue contains second priority data message, transmit the second priority data message;
[0153] If the first priority queue is empty and the second priority queue is empty, and the third priority queue contains third priority data message, transmit the third priority data message.
[0154] In an embodiment of the application, the Internet of Things data transmission device 20 further includes a compression module, specifically used for:
[0155] If the priority of the data message is third priority, determine the target data compression algorithm based on the data type of the data message, and compress the data message based on the target data compression algorithm to obtain the compressed data message, and the data type includes structured data and unstructured data;The compressed data message carries a compression identifier;
[0156] The compression identifier is used to indicate the type of target data compression algorithm; the type of target data compression algorithm includes a difference value coding compression algorithm and a dictionary coding compression algorithm;
[0157] The data buffering module 23 is specifically configured to:
[0158] The compressed data packet is stored in a corresponding buffer area based on the priority of the compressed data packet.
[0159] In an embodiment of the present application, the compression module is specifically further configured to:
[0160] If the data type of the data packet is structured data, the difference value coding compression algorithm is used as the target data compression algorithm;
[0161] If the data type of the data packet is unstructured data, the dictionary coding compression algorithm is used as the target data compression algorithm.
[0162] In an embodiment of the present application, if the priority of the data packet is a three-level priority, the IoT data transmission device 20 further includes a bandwidth division module specifically configured to:
[0163] divide the current transmission link bandwidth into a shared bandwidth and an exclusive bandwidth, the data transmission capacity of the shared bandwidth being greater than that of the exclusive bandwidth;
[0164] transmit the data packet to the IoT data transmission platform based on the exclusive bandwidth;
[0165] The shared bandwidth is used to transmit a one-level priority data packet or a two-level priority data packet.
[0166] In an embodiment of the present application, after the data packet is transmitted to the IoT data transmission platform based on the transmission strategy corresponding to the data transmission queue, the IoT data transmission device 20 further includes a receiving confirmation module specifically configured to:
[0167] If the confirmation receiving instruction returned by the IoT data transmission platform is not received within a target preset confirmation time, the data packet is retransmitted to the IoT data transmission platform based on the transmission strategy corresponding to the data transmission queue;
[0168] The determination method of the target preset confirmation time includes:
[0169] determining a current link bandwidth utilization, determining a current basic preset acknowledgement time based on an interval in which the current link bandwidth utilization is located and a second target mapping relationship, the second target mapping relationship being a mapping relationship between intervals of link bandwidth utilizations and basic preset acknowledgement times; different intervals of link bandwidth utilizations include a first load interval, a second load interval and a third load interval; the basic preset acknowledgement time of the first load interval is less than the basic preset acknowledgement time of the second load interval, and the basic preset acknowledgement time of the second load interval is less than the basic preset acknowledgement time of the third load interval;
[0170] weighting and adjusting the basic preset acknowledgement time according to the priority of the data message to obtain a target preset acknowledgement time.
[0171] In an embodiment of the present application, the Internet of Things data transmission device 20 further comprises a buffer area configuration module, specifically configured to:
[0172] configuring an initial capacity for each buffer area corresponding to the priority of the data message, and the initial capacity allocation ratio is positively correlated with the priority of the data message corresponding to the buffer area;
[0173] monitoring the interval in which the current link bandwidth utilization is located and the number proportion of the data messages to be transmitted in each priority data transmission queue in real time; the number proportion is the proportion of the number of the data messages to be transmitted in each priority data transmission queue to the total number of the data messages to be transmitted in all priority data transmission queues;
[0174] if the link bandwidth utilization is in the third load interval and the number proportion of the data messages to be transmitted in the first priority data transmission queue is higher than a preset proportion threshold, then the capacity of the first priority buffer area is expanded by a preset adjustment ratio, and the capacity of the third priority buffer area is reduced, and the reduced capacity scale matches the expanded capacity scale;
[0175] if the link bandwidth utilization is in the first load interval and the number proportion of the data messages to be transmitted in the third priority data transmission queue is higher than a preset proportion threshold, then the capacity of the third priority buffer area is expanded by a preset adjustment ratio, and the capacity of the first priority buffer area is reduced, and the reduced capacity scale matches the expanded capacity scale;
[0176] if the link bandwidth utilization is in the second load interval, then the initial capacity of each priority buffer area is kept unchanged.
[0177] In an embodiment of the present application, the Internet of Things data includes data corresponding to a plurality of Internet of Things parameters respectively, and the Internet of Things data transmission device 20 further comprises a priority adjustment module, specifically configured to:
[0178] If at least one IoT parameter in the IoT data exceeds the corresponding data anomaly threshold, the priority of the data packet is adjusted based on the priority adjustment rule to obtain the adjusted data packet; the data anomaly thresholds for IoT data from different types of sensing layer IoT devices are different.
[0179] This includes storing data packets in corresponding buffers based on their priority, including:
[0180] The data packets are stored in the corresponding buffer based on their adjusted priority.
[0181] The priority adjustment rules include:
[0182] The original level 3 priority is promoted to level 2 priority, the original level 2 priority is promoted to level 1 priority, and the original level 1 priority remains unchanged.
[0183] See Figure 3 , Figure 3 This is a schematic block diagram of an electronic device provided according to an embodiment of this application. Figure 3 The electronic device 300 in this embodiment may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memories 304 store computer programs, including program instructions. The processors 301 execute the program instructions stored in the memories 304. Specifically, the processors 301 are configured to invoke the program instructions to perform the functions of the modules in the aforementioned device embodiments, for example... Figure 2 The functions of the data acquisition module 21, priority determination module 22, data caching module 23, and data transmission module 24 are shown.
[0184] It should be understood that, in the embodiments of this application, the processor 301 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0185] The input device 302 can include a touchpad, a fingerprint collection sensor (for collecting fingerprint information and direction information of a fingerprint of a user), a microphone, etc., and the output device 303 can include a display (LCD, etc.), a speaker, etc.
[0186] The memory 304 can include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A part of the memory 304 can also include a non-volatile random access memory. For example, the memory 304 can also store information such as a transmission strategy, a data packet, etc.
[0187] In a specific implementation, the processor 301, the input device 302, and the output device 303 described in the embodiments of the present application can execute the implementation manners described in the data transmission method of the Internet of Things provided by the embodiments of the present application, and can also execute the implementation manners of the electronic device described in the embodiments of the present application, which will not be described here.
[0188] In another embodiment of the present application, a computer readable storage medium is provided, which stores a computer program. The computer program includes program instructions, which are executed by a processor to implement all or part of the processes of the above-mentioned embodiment methods. The computer program can also be used to instruct related hardware to complete the implementation. The computer program can be stored in a computer readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0189] The computer readable storage medium can be an internal storage unit of the electronic device of any of the preceding embodiments, such as a hard disk or a memory of the electronic device. The computer readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, or the like. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of the electronic device. The computer readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer readable storage medium can also be used to temporarily store data that has been output or will be output.
[0190] Those skilled in the art can understand that the modules / units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the foregoing description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic device and the units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0192] In several embodiments provided in the present application, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules / units is only a logical function division, and actual implementation can have another division manner, for example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be indirect coupling or communication connection through some interfaces or modules / units, and can also be electrical, mechanical or other forms of connection.
[0193] The modules / units described as separate components can or can not be physically separated, and the components shown as modules / units can or can not be physical modules / units, i.e., can be located in one place or distributed on multiple network modules / units. Part or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0194] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each module can exist physically independently, or two or more modules can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0195] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An Internet of Things data transmission method, characterized by, The method comprises the following steps: obtaining a data packet of a sensing layer IOT device, wherein the data packet comprises IOT data collected by the sensing layer IOT device and a type of the sensing layer IOT device, and the type comprises an alarm type device, a control type device and a monitoring type device; determining a priority of the data packet based on the type and a first target mapping relationship, wherein the first target mapping relationship is a mapping relationship between a device type and a data packet priority, different types correspond to different data packet priorities, and the data packet priority comprises a first priority, a second priority and a third priority; storing the data packet in a corresponding cache area based on the priority of the data packet, wherein the data packet priority and the cache area have a mapping relationship; determining a data transmission queue based on the priority of the data packet, and transmitting the data packet to an IOT data transmission platform based on a transmission strategy corresponding to the data transmission queue, wherein the priority of the data transmission queue corresponds to the priority of the data packet in a one-to-one manner; wherein the transmission strategy corresponding to the data transmission queue comprises: if the first priority queue contains a first priority data packet, transmitting the first priority data packet; if the first priority queue is empty and the second priority queue contains a second priority data packet, transmitting the second priority data packet; if the first priority queue and the second priority queue are empty and the third priority queue contains a third priority data packet, transmitting the third priority data packet; after the data packet is transmitted to the IOT data transmission platform based on the transmission strategy corresponding to the data transmission queue, the method further comprises: if an acknowledgement instruction returned by the IOT data transmission platform is not received within a target preset acknowledgement time, retransmitting the data packet to the IOT data transmission platform based on the transmission strategy corresponding to the data transmission queue; wherein the target preset acknowledgement time is determined in the following manner: determining a current link bandwidth utilization rate, determining a current basic preset acknowledgement time based on an interval in which the current link bandwidth utilization rate is located and a second target mapping relationship, wherein the second target mapping relationship is a mapping relationship between an interval of a link bandwidth utilization rate and a basic preset acknowledgement time; the different intervals of the link bandwidth utilization rate comprise a first load interval, a second load interval and a third load interval; the basic preset acknowledgement time of the first load interval is less than the basic preset acknowledgement time of the second load interval, and the basic preset acknowledgement time of the second load interval is less than the basic preset acknowledgement time of the third load interval; weighting and adjusting the basic preset acknowledgement time according to the priority of the data packet to obtain the target preset acknowledgement time; the method further comprises: configuring an initial capacity for each cache area corresponding to the priority of the data packet, wherein the initial capacity allocation ratio is positively correlated with the data packet priority corresponding to the cache area. monitoring a current link bandwidth utilization interval and a quantity proportion of data packets to be transmitted in each priority data transmission queue, the quantity proportion being a proportion of the number of data packets to be transmitted in each priority data transmission queue to the total number of data packets to be transmitted in all priority data transmission queues; if the link bandwidth utilization is in the third load interval and the quantity proportion of data packets to be transmitted in the first priority data transmission queue is higher than a preset proportion threshold, expanding the capacity of the first priority cache area according to a preset adjustment proportion and reducing the capacity of the third priority cache area, the reduced capacity matching the expanded capacity; if the link bandwidth utilization is in the first load interval and the quantity proportion of data packets to be transmitted in the third priority data transmission queue is higher than a preset proportion threshold, expanding the capacity of the third priority cache area according to a preset adjustment proportion and reducing the capacity of the first priority cache area, the reduced capacity matching the expanded capacity; if the link bandwidth utilization is in the second load interval, keeping the initial capacity of each priority cache area unchanged.
2. The IoT data transmission method of claim 1, wherein, Further comprising: if the priority of the data packet is the third priority, determining a target data compression algorithm based on the data type of the data packet, and compressing the data packet based on the target data compression algorithm to obtain a compressed data packet, the data type including structured data and unstructured data; the compressed data packet carrying a compression identifier; the compression identifier is used to indicate the type of the target data compression algorithm; the type of the target data compression algorithm includes a difference value coding compression algorithm and a dictionary coding compression algorithm; wherein, storing the data packet to the corresponding cache area based on the priority of the data packet comprises: storing the compressed data packet to the corresponding cache area based on the priority of the compressed data packet.
3. The IoT data transmission method of claim 2, wherein, determining the target data compression algorithm based on the data type of the data packet comprises: if the data type of the data packet is structured data, the difference value coding compression algorithm is used as the target data compression algorithm; if the data type of the data packet is unstructured data, the dictionary coding compression algorithm is used as the target data compression algorithm.
4. The IoT data transmission method of claim 3, wherein, if the priority of the data packet is the third priority, the data packet is not transmitted within a preset time, the method further comprises: dividing the current transmission link bandwidth into shared bandwidth and exclusive bandwidth, the data transmission capacity of the shared bandwidth being greater than that of the exclusive bandwidth; transmitting the data packet to the IoT data transmission platform based on the exclusive bandwidth; the shared bandwidth is used to transmit the first priority data packet or the second priority data packet. 5.The Internet of Things data transmission method of claim 1, wherein, the IoT data includes data corresponding to a plurality of IoT parameters, and further comprises: if the data of at least one IoT parameter in the IoT data exceeds the corresponding data abnormal threshold, adjusting the priority of the data packet based on the priority adjustment rule to obtain an adjusted data packet; the data abnormal threshold corresponding to the IoT data of different types of sensing layer IoT devices is different; The storing the data message to the corresponding cache area based on the priority of the data message comprises: storing the data message to the corresponding cache area based on the priority of the adjusted data message; The priority adjustment rule comprises: the original third-level priority is promoted to the second-level priority, the original second-level priority is promoted to the first-level priority, and the priority of the original first-level priority remains unchanged.
6. An Internet of Things data transmission apparatus, characterized by, The method comprises: a data acquisition module configured to acquire a data message of a perception layer Internet of Things device, the data message comprising Internet of Things data collected by the perception layer Internet of Things device and a type of the perception layer Internet of Things device, the type comprising an alarm type device, a control type device, and a monitoring type device; a priority determination module configured to determine a priority of the data message based on the type and a first target mapping relationship, the first target mapping relationship being a mapping relationship between a device type and a data message priority, different types corresponding to different data message priorities, the data message priority comprising a first-level priority, a second-level priority, and a third-level priority; a data cache module configured to store the data message to a corresponding cache area based on the priority of the data message, the data message priority and the cache area having a mapping relationship; a data transmission module configured to determine a data transmission queue based on the priority of the data message, and transmit the data message to an Internet of Things data transmission platform based on a transmission strategy corresponding to the data transmission queue, the priority of the data transmission queue corresponding to the priority of the data message; The transmission strategy corresponding to the data transmission queue comprises: if the first-level priority queue contains a first-level priority data message, the first-level priority data message is transmitted; if the first-level priority queue is empty and the second-level priority queue contains a second-level priority data message, the second-level priority data message is transmitted; if the first-level priority queue is empty and the second-level priority queue is empty, and the third-level priority queue contains a third-level priority data message, the third-level priority data message is transmitted; After transmitting the data message to the Internet of Things data transmission platform based on the transmission strategy corresponding to the data transmission queue, the Internet of Things data transmission device further comprises a receiving confirmation module configured to: if no confirmation receiving instruction returned by the Internet of Things data transmission platform is received within a target preset confirmation time, retransmit the data message to the Internet of Things data transmission platform based on the transmission strategy corresponding to the data transmission queue; The determination of the target preset confirmation time comprises: determining a current link bandwidth utilization rate, determining a current basic preset confirmation time based on an interval in which the current link bandwidth utilization rate is located and a second target mapping relationship, the second target mapping relationship being a mapping relationship between the interval of the link bandwidth utilization rate and the basic preset confirmation time; different intervals of the link bandwidth utilization rate comprising a first load interval, a second load interval, and a third load interval; the basic preset confirmation time of the first load interval being less than the basic preset confirmation time of the second load interval, and the basic preset confirmation time of the second load interval being less than the basic preset confirmation time of the third load interval. The basic preset confirmation time is weighted and adjusted according to the priority of the data message to obtain a target preset confirmation time; The Internet of Things data transmission device further comprises a buffer area configuration module, specifically configured to: An initial capacity is configured for each buffer area corresponding to the priority of the data message, and the initial capacity allocation proportion is positively correlated with the priority of the data message corresponding to the buffer area; The current link bandwidth utilization rate interval and the number proportion of the data messages to be transmitted in each priority data transmission queue are monitored in real time, and the number proportion is the proportion of the number of the data messages to be transmitted in each priority data transmission queue to the total number of the data messages to be transmitted in all priority data transmission queues; If the link bandwidth utilization rate is in the third load interval and the number proportion of the data messages to be transmitted in the first priority data transmission queue is higher than the preset proportion threshold, the capacity of the first priority buffer area is expanded by a preset adjustment proportion, and the capacity of the third priority buffer area is reduced, and the reduced capacity scale matches the expanded capacity scale; If the link bandwidth utilization rate is in the first load interval and the number proportion of the data messages to be transmitted in the third priority data transmission queue is higher than the preset proportion threshold, the capacity of the third priority buffer area is expanded by a preset adjustment proportion, and the capacity of the first priority buffer area is reduced, and the reduced capacity scale matches the expanded capacity scale; If the link bandwidth utilization rate is in the second load interval, the initial capacity of each priority buffer area remains unchanged.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes the computer program to realize the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to realize the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Congestion processing method, network equipment and storage medium
CN113810309A
Real-time data processing system and method for Internet of Things
CN120567800A
Mass data cross-security domain transmission high-low priority queue hierarchical scheduling method based on Internet of Things equipment
CN120750876A
Cashier system data synchronization method and system, intelligent terminal and storage medium
CN121210566A
Circuits and methods for intelligent acknowledgement based flow control in a processing system network
US5815667A