Bandwidth allocation method, system and electronic equipment
By obtaining the alarm event sending queue and total target bandwidth value in the Internet of Things devices, selecting data conversion methods, calculating data conversion efficiency, and allocating bandwidth values, the gateway bandwidth occupation problem is solved, and priority uploading of important emergency alarm data and overall upload efficiency is improved.
Patent Information
- Application Number
- CN202211445484.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-11-18
AI Technical Summary
During the process of uploading alarm data to the IoT platform by IoT devices, the fixed bandwidth of the gateway is occupied by an alarm event, resulting in the inability to upload important and urgent alarm data in time, affecting the upload efficiency.
By obtaining the alarm event sending queue and total target bandwidth values, selecting the data conversion method, calculating the data conversion efficiency, assigning different bandwidth values to priority uploading important and urgent alarm data, and improving data upload efficiency.
Ensure priority upload of important and urgent alarm data, and improve the overall upload efficiency of alarm data, avoiding data loss due to bandwidth occupation.
Smart Images

Figure CN115865685B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a bandwidth allocation method, system and electronic equipment. Background Art
[0002] With the development of IoT technology, IoT devices are widely used in daily life. For example, fire and smoke detectors can monitor the environment in real time and record current environmental data. If the current environmental data value exceeds a set threshold, the IoT device can send an alarm event and the corresponding alarm data to the IoT platform. The IoT platform then handles the alarm event based on the alarm data, thereby reducing potential property losses.
[0003] Currently, in the process of uploading various types of alarm data to the IoT platform, the alarm data collected by each IoT device must first be sent to the gateway. The gateway then allocates sufficient bandwidth for the currently processed alarm event according to the order of the received alarm data, and finally uploads the alarm data corresponding to the alarm event to the IoT platform.
[0004] However, in the process of uploading the above-mentioned types of alarm data to the IoT platform, the bandwidth that the gateway can provide is fixed. If the bandwidth required for the currently processed alarm event exceeds the fixed bandwidth of the gateway, the bandwidth will still be allocated to the current alarm event according to the order of the received alarm data. The bandwidth will continue to be occupied by the currently processed alarm event, resulting in limited bandwidth allocated to the alarm data uploaded later or even no bandwidth being allocated, which in turn affects the uploading of important and urgent alarm data. Summary of the Invention
[0005] This invention provides a bandwidth allocation method for prioritizing the upload of important and urgent target alarm data and improving the efficiency of alarm data upload. The specific technical solution is as follows:
[0006] In a first aspect, the present application provides a bandwidth allocation method, comprising:
[0007] Acquire an alarm event sending queue and a total target bandwidth value corresponding to the queue, wherein the alarm event sending queue includes various types of original alarm data;
[0008] Selecting data conversion methods corresponding to the various types of original alarm data from a preset data conversion method set, wherein the data conversion method set represents converting the various types of original alarm data into the corresponding target alarm data;
[0009] Calculate the data conversion efficiency of converting the various types of original alarm data into the corresponding target alarm data based on the data conversion method within a set time;
[0010] Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the types of original alarm data are determined.
[0011] Based on the above method, different bandwidth values can be allocated according to the efficiency of converting various types of original alarm data into corresponding target alarm data. On the premise of ensuring that important emergency alarm data is uploaded to the IoT platform first, the efficiency of uploading various types of original alarm data to the IoT platform is improved.
[0012] In a possible design, before obtaining the alarm event sending queue and the total target bandwidth value corresponding to the queue, the method further includes:
[0013] Obtaining a total bandwidth value and various types of original alarm data uploaded by each IoT device, wherein the original alarm data at least includes an alarm category and audio and video data corresponding to the alarm category;
[0014] Classifying the various types of original alarm data according to the importance levels of the alarm events to obtain a first audio and video data queue corresponding to a first importance level and a second audio and video data queue corresponding to a second importance level, wherein the first importance level is greater than the second importance level;
[0015] Determining whether the total bandwidth value is greater than a first total required bandwidth value of the first audio and video data queue;
[0016] If the total bandwidth value is greater than the first total required bandwidth value, the first audio and video data queue is converted according to the first total required bandwidth value, and the remaining bandwidth value is allocated to the second audio and video data queue;
[0017] If the total bandwidth value is less than or equal to the first total required bandwidth value, the total bandwidth value is allocated to the first audio and video data queue.
[0018] Through the above method, alarm events can be divided according to their importance, and corresponding bandwidth values can be allocated according to the importance levels of alarm events, so as to avoid bandwidth being occupied by one alarm event and causing possible property losses.
[0019] In one possible design, if the total bandwidth value is less than or equal to the first total required bandwidth value, after allocating the total bandwidth value to the first audio and video data queue, the method further includes:
[0020] Dividing the first audio and video data queue according to data volume levels to obtain a third audio and video data queue corresponding to the first data volume level and a fourth audio and video data queue corresponding to the second data volume level, wherein the first data volume level is greater than the second data volume level;
[0021] Determining whether the total bandwidth value is greater than a second total required bandwidth value of the third audio and video data queue;
[0022] If the total bandwidth value is greater than the second total required bandwidth value, the third audio and video data queue is converted according to the second total required bandwidth value, and the remaining bandwidth value is allocated to the fourth audio and video data queue;
[0023] If the total bandwidth value is less than or equal to the second total required bandwidth value, the total bandwidth value is allocated to the third audio and video data queue.
[0024] Through the above method, various types of audio and video data under a specific importance level can be divided again according to the data volume level, thereby improving the efficiency of uploading various types of audio and video data to the Internet of Things platform.
[0025] In one possible design, if the total bandwidth value is greater than the first total required bandwidth value, then after the first audio and video data queue is converted according to the first total required bandwidth, the method further includes:
[0026] gradually allocating the first total required bandwidth value to the second audio and video data queue;
[0027] After completing the first data conversion, repeatedly querying the first audio and video data queue to see whether various types of original alarm data exist;
[0028] If the first audio and video data queue contains the various types of original alarm data, reallocating the first total bandwidth value allocated to the second audio and video data queue to the first audio and video data queue;
[0029] After the first audio and video data queue completes corresponding data conversion, the first total bandwidth value is successively allocated to the second audio and video data queue.
[0030] By polling, it is checked whether there are various types of original alarm data to be converted in the audio and video data queue with a higher importance level than the current one, ensuring that important and urgent alarm audio and video data are uploaded first.
[0031] In one possible design, based on the data conversion efficiency and the total target bandwidth value, determining the target bandwidth value corresponding to each type of original alarm data includes:
[0032] When performing data conversion on various types of original alarm data according to respective data conversion methods, obtaining the key frame interval and frame rate corresponding to each type of original alarm data, wherein the key frame interval represents the number of frames between two key frames;
[0033] Based on the key frame interval and the frame rate, obtaining the alarm time interval corresponding to each type of original alarm data;
[0034] Based on the alarm time interval, determining the total alarm time of the various types of original alarm data;
[0035] Within the total alarm time, the system resource consumption time corresponding to the conversion of various types of original alarm data into corresponding data volumes is counted;
[0036] Obtaining data conversion efficiencies corresponding to the various types of original alarm data based on the system resource consumption time corresponding to the corresponding data amounts of the various types of original alarm data and the total system resource consumption time;
[0037] Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the various types of original alarm data are determined.
[0038] Through the above method, different bandwidth values can be allocated according to the conversion efficiency of each type of original alarm data, thereby improving the efficiency of converting various types of original alarm data into target alarm data, and thus improving the efficiency of uploading various types of original alarm data to the Internet of Things platform.
[0039] In a second aspect, the present application provides a bandwidth allocation system, comprising:
[0040] A data acquisition module is used to acquire an alarm event sending queue and a total target bandwidth value corresponding to the queue, wherein the alarm event sending queue includes various types of original alarm data;
[0041] a data mapping module, configured to select a data conversion method corresponding to each of the various types of original alarm data from a preset data conversion method set, wherein the data conversion method set represents a method for converting the various types of original alarm data into the corresponding target alarm data;
[0042] A bandwidth allocation module is used to calculate the data conversion efficiency of converting the various types of original alarm data into the corresponding target alarm data based on the data conversion method within a set time;
[0043] Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the types of original alarm data are determined.
[0044] In one possible design, the data acquisition module is further configured to:
[0045] Obtaining a total bandwidth value and various types of original alarm data uploaded by each IoT device, wherein the original alarm data at least includes an alarm category and audio and video data corresponding to the alarm category;
[0046] Classifying the various types of original alarm data according to the importance levels of the alarm events to obtain a first audio and video data queue corresponding to a first importance level and a second audio and video data queue corresponding to a second importance level, wherein the first importance level is greater than the second importance level;
[0047] Determining whether the total bandwidth value is greater than a first total required bandwidth value of the first audio and video data queue;
[0048] If the total bandwidth value is greater than the first total required bandwidth value, the first audio and video data queue is converted according to the first total required bandwidth value, and the remaining bandwidth value is allocated to the second audio and video data queue;
[0049] If the total bandwidth value is less than or equal to the first total required bandwidth value, the total bandwidth value is allocated to the first audio and video data queue.
[0050] In one possible design, the bandwidth allocation module is specifically configured to:
[0051] When performing data conversion on various types of original alarm data according to respective data conversion methods, obtaining the key frame interval and frame rate corresponding to each type of original alarm data, wherein the key frame interval represents the number of frames between two key frames;
[0052] Based on the key frame interval and the frame rate, obtaining the alarm time interval corresponding to each type of original alarm data;
[0053] Based on the alarm time interval, determining the total alarm time of the various types of original alarm data;
[0054] Within the total alarm time, the system resource consumption time corresponding to the conversion of various types of original alarm data into corresponding data volumes is counted;
[0055] Obtaining data conversion efficiencies corresponding to the various types of original alarm data based on the system resource consumption time corresponding to the corresponding data amounts of the various types of original alarm data and the total system resource consumption time;
[0056] Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the various types of original alarm data are determined.
[0057] In a third aspect, the present application provides an electronic device, comprising:
[0058] Memory for storing computer programs;
[0059] The processor is configured to implement the steps of the above-mentioned bandwidth allocation method when executing the computer program stored in the memory.
[0060] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned bandwidth allocation method steps are implemented.
[0061] For each of the above-mentioned aspects from the second to the fourth aspects and the technical effects that may be achieved by each of the aspects, please refer to the above-mentioned description of the technical effects that can be achieved by the first aspect or various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A flow chart of a bandwidth allocation method provided in this application;
[0063] Figure 2 A schematic diagram of the bandwidth allocation system architecture provided in this application;
[0064] Figure 3 A schematic diagram of the bandwidth allocation system structure provided by this application;
[0065] Figure 4 This is a schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail with reference to the accompanying drawings. The specific operating methods in the method embodiments can also be applied to device embodiments or system embodiments. It should be noted that in the description of the present application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent the following two situations: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0067] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0068] With the development of IoT technology, IoT devices are widely used in daily life. For example, fire and smoke detectors are examples. IoT devices can monitor the environment in real time and record current environmental data, allowing the IoT platform to make corresponding adjustments based on this data. For example, if the current environmental data exceeds a set safety threshold, the IoT device can promptly send a corresponding alarm event and corresponding alarm data to the IoT platform. The IoT platform then takes appropriate action based on the alarm event and the corresponding alarm data, mitigating potential property losses.
[0069] Currently, IoT devices are generally equipped with cameras that can record various types of audio and video data, and the amount of data is much larger than before. Audio and video data can intuitively reflect the status of the device and facilitate judgment of the current environmental status. In the process of uploading various types of alarm data to the IoT platform, the alarm data collected by each IoT device must first be sent to the gateway. The gateway then converts the received alarm data according to the order in which the alarm data was received, allocates sufficient bandwidth for the alarm event being processed, and finally uploads the alarm data corresponding to the alarm event to the IoT platform.
[0070] However, in the process of uploading the above-mentioned types of alarm data to the IoT platform, the bandwidth that the gateway can provide is fixed. If the bandwidth required for the currently processed alarm event exceeds the fixed bandwidth of the gateway, the bandwidth will still be allocated to the current alarm event according to the order of the received alarm data. The bandwidth will continue to be occupied by the currently processed alarm event, resulting in limited bandwidth allocated to the alarm data uploaded later or even no bandwidth being allocated, which in turn affects the uploading of important and urgent alarm data.
[0071] In view of this, in order to avoid the problem that the bandwidth is occupied by a processed alarm event, resulting in limited bandwidth or even no bandwidth being allocated to more important and urgent alarm data uploaded later, the present application provides a bandwidth allocation method, which specifically includes: first obtaining the alarm event sending queue and the total target bandwidth value corresponding to the queue, then selecting a data conversion method corresponding to each type of original alarm data from a preset data conversion method set, and then calculating the data conversion efficiency of converting each type of original alarm data into its corresponding target alarm data based on the data conversion method within a set time, and finally determining the target bandwidth value corresponding to each type of original alarm data based on the data conversion efficiency and the total target bandwidth value.
[0072] It is not difficult to see that through the above method, data conversion can be performed according to the data conversion method corresponding to each type of original alarm data, and different bandwidth values can be allocated to each type of original alarm data according to the data conversion efficiency of each type of original alarm data into the corresponding target alarm data. Finally, various types of original alarm data are uploaded to the Internet of Things platform according to the alarm event sending queue. In this way, not only can important and urgent target alarm data be uploaded first, but also the efficiency of alarm data uploading can be improved.
[0073] Reference Figure 1 As shown, it is a flow chart of a bandwidth allocation method provided in an embodiment of the present application, the method comprising:
[0074] S1, obtain the alarm event sending queue and the total target bandwidth value corresponding to the queue.
[0075] First of all, the method provided in this application can be applied to Figure 2 In the system architecture shown, the system architecture includes various types of Internet of Things devices ( 201a , 201b , 201c , 201d ), a gateway 202 and an Internet of Things platform 203 .
[0076] The present application embodiment does not impose any restrictions on the number of the above devices. Figure 2 As shown in the figure, only various IoT devices, gateways and IoT platforms are used as examples for description. The following is a brief introduction to the above devices and their respective functions.
[0077] Various types of IoT devices are used to collect various types of original alarm data; the gateway is used to receive the original alarm data collected by various IoT devices, separate the audio and video data from the original alarm data, and then convert the audio and video data into a data format that the IoT platform can recognize and allocate the corresponding bandwidth value, and finally upload the obtained target alarm data to the IoT platform; the IoT platform is used to receive the target alarm data from the gateway and process the corresponding alarm events according to the target alarm data.
[0078] In actual application, before obtaining the alarm event sending queue and the total target bandwidth value corresponding to the queue, the gateway needs to classify the importance of the original alarm data collected by various IoT devices to ensure that important and urgent alarm events are given priority in allocating corresponding bandwidth to reduce possible property losses.
[0079] Specifically, the gateway first obtains the total bandwidth value and various types of raw alarm data uploaded by each IoT device. Then, the gateway separates the alarm categories corresponding to each type of raw alarm data and the audio and video data corresponding to the alarm categories from the raw alarm data. For example, the importance level of each type of raw alarm data can be classified according to the following method:
[0080] The gateway classifies the audio and video data corresponding to fire alarms, gas leaks, and water level alarms into the first importance level, and uses the audio and video data corresponding to fire alarms, gas leaks, and water level alarms as the first audio and video data queue; classifies the audio and video data corresponding to smoke and electric leakage alarms into the second importance level, and uses the audio and video data corresponding to smoke and electric leakage alarms as the second audio and video data queue; classifies the audio and video data corresponding to motion detection and occlusion into the third importance level; and classifies the audio and video data corresponding to temperature and humidity into the fourth importance level. That is, when the gateway simultaneously receives audio and video data corresponding to fire alarms, smoke alarms, occlusion alarms, and temperature alarms, it first allocates the corresponding bandwidth to the fire alarm, then to the smoke alarm, then to the occlusion alarm, and finally to the temperature alarm. This embodiment of the application does not impose any restrictions on the number of importance levels of alarm events, and will not be elaborated here.
[0081] The obtained first audio and video data queue corresponding to the first importance level and the obtained second audio and video data queue corresponding to the second importance level may be shown in the following Table 1:
[0082]
[0083] Table 1
[0084] Furthermore, after the gateway classifies the importance levels of various types of original alarm data and obtains the first audio and video data queue corresponding to the first importance level and the second audio and video data queue corresponding to the second importance level, it first determines whether the total bandwidth value fixed by the gateway is greater than the total required bandwidth value of each audio and video data queue. If the total bandwidth value fixed by the gateway is greater than or equal to the total required bandwidth value of each audio and video data queue, the corresponding required bandwidth is allocated to each audio and video data queue.
[0085] If the total bandwidth value fixed by the gateway is less than the total required bandwidth value of each audio and video data queue, determine whether the total bandwidth value is greater than the first total required bandwidth value of the first audio and video data queue;
[0086] If the total bandwidth value is greater than the first total required bandwidth value, the first audio and video data queue performs data conversion according to the first total required bandwidth value, and allocates the remaining bandwidth value to the second audio and video data queue;
[0087] Further, after the first audio and video data queue is converted according to the first total required bandwidth value, the gateway successively allocates the first total required bandwidth value to the second audio and video data queue;
[0088] After completing the first data conversion, the gateway will repeatedly query the first audio and video data queue to see whether there are various types of original alarm data from the second data conversion. If the first audio and video data queue again contains various types of original alarm data from the second data conversion, the gateway will reallocate the first total bandwidth value currently used to process the second audio and video data queue to the first audio and video data queue; after the first audio and video data queue completes the second data conversion, the gateway will gradually reallocate the first total bandwidth value to the second audio and video data again.
[0089] Therefore, the gateway uses polling to check whether there are any other types of original alarm data to be converted in the audio and video data queue with a higher importance level than the current one, ensuring that important and urgent alarm audio and video data are uploaded first.
[0090] Next, if the total bandwidth value is less than or equal to the first total required bandwidth value, the gateway allocates the entire total bandwidth value to the first audio and video data queue. When the corresponding audio and video data in the first audio and video data queue is converted, the first conversion bandwidth value corresponding to the converted audio and video data is allocated to the second audio and video data until the first conversion bandwidth value is equal to the total required bandwidth value.
[0091] Through the above method, corresponding bandwidth values can be allocated to the audio and video data queues corresponding to each importance level, ensuring that important and urgent alarm events can be uploaded to the Internet of Things platform in priority.
[0092] After allocating bandwidth to the audio and video data queues corresponding to each importance level, the gateway further subdivides the audio and video data queues at the same importance level in order to improve the efficiency of converting various types of original audio and video data into target data.
[0093] In an embodiment of the present application, specifically, after the gateway allocates all the total bandwidth value to the first audio and video data queue, it divides the first audio and video data queue according to the data volume level corresponding to each type of audio and video data. For example, the data volume of 0-1M is divided into the first data volume level; the data volume of 1-5M is divided into the second data volume level; and the data volume of 5-50M is divided into the third data volume level. Finally, the third audio and video data queue corresponding to the first data volume level and the fourth audio and video data queue corresponding to the second data volume level can be obtained. Referring to Table 1, assuming that the data volume corresponding to the fire alarm audio and video data is 0.5M, the data volume corresponding to the gas leak alarm audio and video data is 0.9M, and the data volume corresponding to the water level alarm audio and video data is 2M, then the audio and video data corresponding to the fire alarm and the gas leak alarm are divided into the first data volume level to obtain the third audio and video data queue, and the audio and video data corresponding to the water level alarm are divided into the second data volume level to obtain the fourth audio and video data queue. The obtained third audio and video data queue corresponding to the first data volume level and the fourth audio and video data queue corresponding to the second data volume level can be shown in Table 2 below:
[0094]
[0095] Table 2
[0096] Then, the gateway determines whether the total bandwidth value is greater than the second total required bandwidth value of the third audio and video data queue;
[0097] If the total bandwidth value is greater than the second total required bandwidth value, the third audio and video data queue is converted according to the second total required bandwidth value, and the remaining bandwidth value is allocated to the fourth audio and video data queue;
[0098] If the total bandwidth value is less than or equal to the second total required bandwidth value, the total bandwidth value will be fully allocated to the third audio and video data queue. When the corresponding audio and video data in the third audio and video data queue is converted, the second conversion bandwidth value corresponding to the converted audio and video data will be allocated to the fourth audio and video data queue until the second conversion bandwidth value is equal to the total required bandwidth value.
[0099] Finally, the alarm event sending queues divided according to the importance level and the data volume level and the total target bandwidth values corresponding to the queues are obtained.
[0100] Through the above method, audio and video data of the same importance level can be divided according to the data volume level, and the alarm event sending queue and the total target bandwidth value corresponding to the queue can be obtained; thereby improving the efficiency of uploading audio and video data at the same importance level.
[0101] S2, selecting a data conversion method corresponding to each type of original alarm data from a preset data conversion method set.
[0102] In an embodiment of the present application, since various types of original alarm data are uploaded to the gateway through different protocols, in order to convert various types of original alarm data into target alarm data that can be recognized by the Internet of Things platform, the gateway needs to select corresponding data conversion methods for each type of original alarm data. The data conversion method can be a specific encoding rule, which will not be repeated here.
[0103] By selecting the data conversion method corresponding to each type of original alarm data, each type of original alarm data can be converted into target alarm data that can be recognized by the Internet of Things platform.
[0104] S3, calculating the data conversion efficiency of converting various types of original alarm data into their corresponding target alarm data based on the data conversion method within a set time.
[0105] After the gateway selects the corresponding data conversion method for each type of raw alarm data, since the data conversion rate of converting each type of raw alarm data into target alarm data that can be recognized by the IoT platform will also be different, in order to further improve the rate of uploading various types of raw alarm data to the IoT platform, the gateway needs to allocate different bandwidth values for each type of raw alarm data with the same data volume level.
[0106] In the embodiment of the present application, before performing data conversion on each type of original alarm data according to its respective data conversion method, the gateway equally divides the total target bandwidth among each type of original alarm data.
[0107] Next, when converting each type of raw alarm data according to its own data conversion method, the corresponding keyframe interval (Group of Pictures, GOP) and frame rate are first obtained for each type of raw alarm data in a queue with the same data volume level. A GOP is a group of consecutive pictures within a video or video stream encoded in a specific format. The video sequence begins with an I-frame and ends with the next I-frame. Based on the keyframe interval and frame rate, the alarm time interval corresponding to each type of raw alarm data can be calculated.
[0108] For example, assume that the GOP value for a fire alarm is 15, and this GOP value includes a complete fire alarm event, and the frame rate is 5; the GOP value for a gas leak alarm is 10, and this GOP value includes a complete gas leak alarm event, and the frame rate is 2. Then, the alarm time interval T0 corresponding to each type of raw alarm data at the same data volume level can be obtained by the following calculation formula:
[0109]
[0110] Therefore, the time interval corresponding to converting the original fire alarm audio and video data into the target fire alarm data through the gateway is 3S, and the time interval corresponding to converting the gas leak alarm audio and video data into the target gas leak alarm data is 5S.
[0111] In order to ensure the integrity of the conversion of various types of original alarm audio and video data, the total alarm time of various types of original alarm data can be determined based on the alarm time interval T0 corresponding to each type of original alarm data. For example, the least common multiple of the alarm time intervals corresponding to each type of original alarm audio and video data can be calculated, and the time interval corresponding to the least common multiple can be used as the total alarm time. For example, the time intervals corresponding to the fire alarm and gas leak alarm are 3S and 5S respectively, so 15S is used as the total alarm time.
[0112] Furthermore, within the total alarm time, the gateway can count the system resource consumption time corresponding to the conversion of various types of original alarm data into corresponding data volumes.
[0113] For example, first assume that the total alarm time is 15S. If the gateway converts the original audio and video data corresponding to the fire alarm and the original audio and video data corresponding to the gas leak alarm into their respective corresponding target alarm data under sufficient bandwidth conditions, then 5 fire alarm events and 3 gas leak alarm events can be converted respectively; according to the gateway statistics, the system resource consumption time corresponding to converting 5 fire alarm events is 5S, and the system resource consumption time corresponding to converting 3 gas leak alarm events is 4S.
[0114] Then, based on the system resource consumption time corresponding to the corresponding data volume of each type of raw data conversion and the total system resource consumption time, the data conversion efficiency corresponding to each type of raw alarm data can be obtained. In the same example as above, assuming that the total system resource consumption time is 9s, the data conversion efficiency corresponding to the fire alarm event is 5 / 9; the data conversion efficiency corresponding to the gas leak alarm event is 4 / 9.
[0115] Through the above method, the data conversion efficiency corresponding to each type of original alarm data can be calculated.
[0116] S4, based on the data conversion efficiency and the total target bandwidth value, determining the target bandwidth value corresponding to each type of original alarm data.
[0117] In an embodiment of the present application, after obtaining the data conversion efficiency and total target bandwidth value corresponding to each type of original alarm data, the gateway can determine the target bandwidth value corresponding to each type of original alarm data based on the data conversion efficiency and total target bandwidth value corresponding to each type of original alarm data.
[0118] Exemplarily, the gateway can allocate corresponding target bandwidth values in proportion. For example, a corresponding bandwidth value can be allocated to each type of original alarm data according to the product of the data conversion efficiency (ratio) and the total target bandwidth value. Similarly, a corresponding bandwidth value can be allocated to each type of original alarm data according to the number of original alarm data converted by the same alarm event at the same time. For example, the system resource consumption time corresponding to converting 5 fire alarm events is 5S, and the system resource consumption time corresponding to converting 3 gas leak alarm events is 4S. Then, the bandwidth allocated to the fire alarm event is 3 / (5+3)*total target bandwidth; the bandwidth allocated to the gas leak alarm event is 5 / (5+3)*total target bandwidth, that is, audio and video data with high data conversion efficiency are allocated a smaller bandwidth value that meets the conversion requirements, thereby improving the efficiency of uploading various audio and video data to the Internet of Things platform.
[0119] To sum up, the bandwidth allocation method provided in this application can allocate different bandwidths to various types of original alarm data according to the importance level and data volume level of the alarm event, which not only ensures that the audio and video data corresponding to important and urgent alarm events are uploaded first, but also improves the efficiency of uploading various types of audio and video data to the Internet of Things platform.
[0120] Based on the method provided in the above embodiment, the embodiment of the present application also provides a bandwidth allocation system, such as Figure 3 FIG2 is a schematic diagram of a bandwidth allocation system according to an embodiment of the present application, wherein the system includes:
[0121] The data acquisition module 301 is used to acquire an alarm event sending queue and a total target bandwidth value corresponding to the queue, wherein the alarm event sending queue includes various types of original alarm data;
[0122] The data mapping module 302 is configured to select a data conversion method corresponding to each of the various types of original alarm data from a preset data conversion method set, wherein the data conversion method set represents how to convert each type of original alarm data into the corresponding target alarm data;
[0123] The bandwidth allocation module 303 is configured to calculate the data conversion efficiency of converting the various types of original alarm data into the corresponding target alarm data based on the data conversion method within a set time;
[0124] Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the types of original alarm data are determined.
[0125] In one possible design, the data acquisition module 301 is further configured to:
[0126] Obtaining a total bandwidth value and various types of original alarm data uploaded by each IoT device, wherein the original alarm data at least includes an alarm category and audio and video data corresponding to the alarm category;
[0127] Classifying the various types of original alarm data according to the importance levels of the alarm events to obtain a first audio and video data queue corresponding to a first importance level and a second audio and video data queue corresponding to a second importance level, wherein the first importance level is greater than the second importance level;
[0128] Determining whether the total bandwidth value is greater than a first total required bandwidth value of the first audio and video data queue;
[0129] If the total bandwidth value is greater than the first total required bandwidth value, the first audio and video data queue is converted according to the first total required bandwidth value, and the remaining bandwidth value is allocated to the second audio and video data queue;
[0130] If the total bandwidth value is less than or equal to the first total required bandwidth value, the total bandwidth value is allocated to the first audio and video data queue.
[0131] In one possible design, the bandwidth allocation module 303 is specifically configured to:
[0132] When performing data conversion on various types of original alarm data according to respective data conversion methods, obtaining the key frame interval and frame rate corresponding to each type of original alarm data, wherein the key frame interval represents the number of frames between two key frames;
[0133] Based on the key frame interval and the frame rate, obtaining the alarm time interval corresponding to each type of original alarm data;
[0134] Based on the alarm time interval, determining the total alarm time of the various types of original alarm data;
[0135] Within the total alarm time, the system resource consumption time corresponding to the conversion of various types of original alarm data into corresponding data volumes is counted;
[0136] Obtaining data conversion efficiencies corresponding to the various types of original alarm data based on the system resource consumption time corresponding to the corresponding data amounts of the various types of original alarm data and the total system resource consumption time;
[0137] Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the various types of original alarm data are determined.
[0138] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application. The electronic device can realize the above-mentioned bandwidth allocation function. Figure 4, the electronic device includes:
[0139] At least one processor 401, and a memory 402 connected to the at least one processor 401. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 In the example, the processor 401 and the memory 402 are connected via a bus 400. Figure 4 The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The diagram is represented by only one thick line, but this does not mean that there is only one bus or one type of bus. Alternatively, the processor 401 may also be referred to as a controller, without limitation to the name.
[0140] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute the bandwidth allocation method discussed above by executing the instructions stored in the memory 402. The processor 401 can implement Figure 3 The functions of each module in the system are shown.
[0141] Among them, the processor 401 is the control center of the device, which can use various interfaces and lines to connect the various parts of the entire control device, and monitor the device as a whole by running or executing instructions stored in the memory 402 and calling data stored in the memory 402, the various functions of the device and processing data.
[0142] In one possible design, processor 401 may include one or more processing units. Processor 401 may integrate an application processor and a modem processor. The application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.
[0143] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the bandwidth allocation method disclosed in the embodiments of this application can be directly implemented as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0144] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0145] By designing and programming the processor 401, the code corresponding to the bandwidth allocation method described in the above embodiment can be fixed into the chip, so that the chip can execute the bandwidth allocation method when running. Figure 1 The steps of the bandwidth allocation method in the embodiment shown are as follows: How to design and program the processor 401 is a technique well known to those skilled in the art and will not be described in detail here.
[0146] Based on the same inventive concept, an embodiment of the present application further provides a storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer executes the bandwidth allocation method discussed above.
[0147] In some possible implementations, various aspects of the bandwidth allocation method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a device, the program code is used to enable the control device to execute the steps of the bandwidth allocation method according to various exemplary embodiments of the present application described above in this specification.
[0148] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0149] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0150] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0152] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A bandwidth allocation method, characterized in that: The method comprises: Acquire an alarm event sending queue and a total target bandwidth value corresponding to the queue, wherein the alarm event sending queue includes various types of original alarm data; Selecting data conversion methods corresponding to the various types of original alarm data from a preset data conversion method set, wherein the data conversion method set represents converting the various types of original alarm data into the corresponding target alarm data; Calculate the data conversion efficiency of converting the various types of original alarm data into the corresponding target alarm data based on the data conversion method within a set time; Determining target bandwidth values corresponding to each type of original alarm data based on the data conversion efficiency and the total target bandwidth value includes: When performing data conversion on various types of original alarm data according to respective data conversion methods, obtaining the key frame interval and frame rate corresponding to each type of original alarm data, wherein the key frame interval represents the number of frames between two key frames; Based on the key frame interval and the frame rate, obtaining the alarm time interval corresponding to each type of original alarm data; Based on the alarm time interval, determining the total alarm time of the various types of original alarm data; Within the total alarm time, the system resource consumption time corresponding to the conversion of various types of original alarm data into corresponding data volumes is counted; Obtaining data conversion efficiencies corresponding to the various types of original alarm data based on the system resource consumption time corresponding to the corresponding data amounts of the various types of original alarm data and the total system resource consumption time; Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the various types of original alarm data are determined.
2. The method according to claim 1, wherein Before obtaining the alarm event sending queue and the total target bandwidth value corresponding to the queue, the method further includes: Obtaining a total bandwidth value and various types of original alarm data uploaded by each IoT device, wherein the original alarm data at least includes an alarm category and audio and video data corresponding to the alarm category; Classifying the various types of original alarm data according to the importance levels of the alarm events to obtain a first audio and video data queue corresponding to a first importance level and a second audio and video data queue corresponding to a second importance level, wherein the first importance level is greater than the second importance level; Determining whether the total bandwidth value is greater than a first total required bandwidth value of the first audio and video data queue; If the total bandwidth value is greater than the first total required bandwidth value, the first audio and video data queue is converted according to the first total required bandwidth value, and the remaining bandwidth value is allocated to the second audio and video data queue; If the total bandwidth value is less than or equal to the first total required bandwidth value, the total bandwidth value is allocated to the first audio and video data queue.
3. The method according to claim 2, wherein If the total bandwidth value is less than or equal to the first total required bandwidth value, after allocating the total bandwidth value to the first audio and video data queue, the method further includes: Dividing the first audio and video data queue according to data volume levels to obtain a third audio and video data queue corresponding to the first data volume level and a fourth audio and video data queue corresponding to the second data volume level, wherein the first data volume level is greater than the second data volume level; Determining whether the total bandwidth value is greater than a second total required bandwidth value of the third audio and video data queue; If the total bandwidth value is greater than the second total required bandwidth value, the third audio and video data queue is converted according to the second total required bandwidth value, and the remaining bandwidth value is allocated to the fourth audio and video data queue; If the total bandwidth value is less than or equal to the second total required bandwidth value, the total bandwidth value is allocated to the third audio and video data queue.
4. The method according to claim 2, wherein If the total bandwidth value is greater than the first total required bandwidth value, after converting the first audio and video data queue according to the first total required bandwidth, the method further includes: gradually allocating the first total required bandwidth value to the second audio and video data queue; After completing the first data conversion, repeatedly querying the first audio and video data queue to see whether various types of original alarm data exist; If the first audio and video data queue contains the various types of original alarm data, reallocating the first total bandwidth value allocated to the second audio and video data queue to the first audio and video data queue; After the first audio and video data queue completes corresponding data conversion, the first total bandwidth value is successively allocated to the second audio and video data queue.
5. A bandwidth allocation system, characterized in that: include: A data acquisition module is used to acquire an alarm event sending queue and a total target bandwidth value corresponding to the queue, wherein the alarm event sending queue includes various types of original alarm data; a data mapping module, configured to select a data conversion method corresponding to each of the various types of original alarm data from a preset data conversion method set, wherein the data conversion method set represents a method for converting the various types of original alarm data into the corresponding target alarm data; A bandwidth allocation module is used to calculate the data conversion efficiency of converting the various types of original alarm data into the corresponding target alarm data based on the data conversion method within a set time; Determining target bandwidth values corresponding to each type of original alarm data based on the data conversion efficiency and the total target bandwidth value includes: When performing data conversion on various types of original alarm data according to respective data conversion methods, obtaining the key frame interval and frame rate corresponding to each type of original alarm data, wherein the key frame interval represents the number of frames between two key frames; Based on the key frame interval and the frame rate, obtaining the alarm time interval corresponding to each type of original alarm data; Based on the alarm time interval, determining the total alarm time of the various types of original alarm data; Within the total alarm time, the system resource consumption time corresponding to the conversion of various types of original alarm data into corresponding data volumes is counted; Obtaining data conversion efficiencies corresponding to the various types of original alarm data based on the system resource consumption time corresponding to the corresponding data amounts of the various types of original alarm data and the total system resource consumption time; Based on the data conversion efficiency and the total target bandwidth value, target bandwidth values corresponding to each of the various types of original alarm data are determined.
6. The system according to claim 5, wherein: The data acquisition module is also used for: Obtaining a total bandwidth value and various types of original alarm data uploaded by each IoT device, wherein the original alarm data at least includes an alarm category and audio and video data corresponding to the alarm category; Classifying the various types of original alarm data according to the importance levels of the alarm events to obtain a first audio and video data queue corresponding to a first importance level and a second audio and video data queue corresponding to a second importance level, wherein the first importance level is greater than the second importance level; Determining whether the total bandwidth value is greater than a first total required bandwidth value of the first audio and video data queue; If the total bandwidth value is greater than the first total required bandwidth value, the first audio and video data queue is converted according to the first total required bandwidth value, and the remaining bandwidth value is allocated to the second audio and video data queue; If the total bandwidth value is less than or equal to the first total required bandwidth value, the total bandwidth value is allocated to the first audio and video data queue.
7. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method steps of any one of claims 1 to 4 when executing the computer program stored in the memory.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Bandwidth management method and device, computer storage medium and chip
CN114391250A