Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a bandwidth allocation device of a hardware operating environment according to an embodiment of the present invention.
The bandwidth allocation device of the embodiment of the present invention may be a PC, or may be a mobile terminal device having a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4) player, a portable computer, or the like.
As shown in fig. 1, the bandwidth allocation apparatus may include: aprocessor 1001, such as a CPU, anetwork interface 1004, auser interface 1003, amemory 1005, acommunication bus 1002. Wherein acommunication bus 1002 is used to enable connective communication between these components. Theuser interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and theoptional user interface 1003 may also include a standard wired interface, a wireless interface. Thenetwork interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). Thememory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). Thememory 1005 may alternatively be a storage device separate from theprocessor 1001.
Optionally, the bandwidth allocation device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like.
Those skilled in the art will appreciate that the bandwidth allocation apparatus configuration shown in fig. 1 does not constitute a limitation of the bandwidth allocation apparatus and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, amemory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a bandwidth allocation program.
In the bandwidth allocation apparatus shown in fig. 1, thenetwork interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; theuser interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and theprocessor 1001 may be used to invoke a bandwidth allocation program stored in thememory 1005.
In this embodiment, the bandwidth allocation apparatus includes: amemory 1005, aprocessor 1001, and a bandwidth allocation program stored on thememory 1005 and executable on theprocessor 1001, wherein theprocessor 1001, when calling the bandwidth allocation program stored in thememory 1005, performs the following operations:
acquiring the device type of each network device, and determining a to-be-connected routing signal corresponding to each network device according to the device type of each network device, wherein the device types are distinguished according to the flow consumed by the network devices, and the to-be-connected routing signal is a signal generated by a routing system in different working frequency bands;
determining the network bandwidth to be connected corresponding to each network device according to the routing signal to be connected and the device type;
acquiring bandwidth resources of a preset network area, and respectively allocating the bandwidth resources to each network device according to the network bandwidth to be connected, wherein each network device corresponds to each network node of the preset network area.
Further, theprocessor 1001 may call a bandwidth allocation program stored in thememory 1005, and also perform the following operations:
when the change of the service type of the occupied bandwidth is detected, determining the spare bandwidth corresponding to the preset network area;
and if the spare bandwidth is zero, performing bandwidth reallocation on each network device according to the changed service type.
Further, theprocessor 1001 may call a bandwidth allocation program stored in thememory 1005, and also perform the following operations:
and when detecting that new network equipment is accessed to a preset network area, judging that the service type occupying the bandwidth is changed.
Further, theprocessor 1001 may call a bandwidth allocation program stored in thememory 1005, and also perform the following operations:
acquiring the bandwidth proportion of each network device according to the changed service type;
calculating the actual allocable bandwidth of each network device according to the bandwidth proportion and bandwidth resources allocated to each network device;
and performing bandwidth allocation on each network device according to the actually allocable bandwidth of each network device.
Further, theprocessor 1001 may call a bandwidth allocation program stored in thememory 1005, and also perform the following operations:
and calculating the downlink bandwidth and the uplink bandwidth which can be actually distributed by each network device according to the bandwidth proportion distributed by each network device, the pre-stored upper and lower bandwidth distribution proportion corresponding to each network device and the bandwidth resources.
Further, theprocessor 1001 may call a bandwidth allocation program stored in thememory 1005, and also perform the following operations:
when detecting that target network equipment executes a video downloading task, acquiring the current used bandwidth of each network equipment, wherein the target network equipment is any one of the network equipment;
determining the spare bandwidth corresponding to the preset network area according to the current used bandwidth and bandwidth resources;
if the spare bandwidth is not zero, calculating a target bandwidth corresponding to the minimum user experience quality value according to the spare bandwidth;
and if the target bandwidth is less than or equal to the sum of the current used bandwidth and the spare bandwidth of the target equipment, distributing the target bandwidth to the target network equipment so that the target network equipment executes the video downloading task based on the target bandwidth.
Further, theprocessor 1001 may call a bandwidth allocation program stored in thememory 1005, and also perform the following operations:
and respectively distributing the routing signals to each network device according to the network bandwidth to be connected, and respectively distributing the channel bandwidth to each network device.
The present invention further provides a bandwidth allocation method, referring to fig. 2, fig. 2 is a flowchart illustrating a bandwidth allocation method according to a first embodiment of the present invention.
Step S10, the routing system obtains the device type of each network device, and determines the route signal to be connected corresponding to each network device according to the device type of each network device, the device type is distinguished according to the flow consumed by the network device, the route signal to be connected is the signal in different working frequency band generated by the routing system;
the bandwidth allocation method provided by the invention is applied to a routing system, each network device is networked through the routing system, the routing system can be composed of one or more routers, each network device and the routing system respectively correspond to each network node of a preset network area, wherein the preset network area can be a local area network or a wide area network, the network area where the network device and the routing system are located is the preset network area, and the preset network area is generally a home local area network. Each network device is connected with the home local area network through a routing system, and the network device can be an internet of things terminal device, and also can be a terminal device with a networking function, such as a PC, a smart phone, a tablet computer, an electronic book reader, an MP3 player, an MP4 player, a portable computer and the like. Further, the system architecture of the routing system may be a mesh structure, i.e. the network structure formed by the routers is a mesh type structure.
And acquiring the device type of each network device in the process of distributing the bandwidth to each network device by the routing system. The routing system stores the device type of each network device in advance, and the device type of each network device is stored in the device list by the device type identifier, that is, the routing system obtains the device type of each network device based on the device type identifier in the network device list. The device types of each network device include a high-flow device and a low-flow device, the high-flow device is an electronic device in a preset network area, the network traffic used in the preset network area is greater than a preset traffic threshold, generally speaking, the high-flow device includes a smart phone, a personal computer or a smart television, and the low-flow device is an electronic device in the preset network area, the network traffic used in the preset network area is less than the preset traffic threshold.
The device type of each network device includes a high-flow device and a low-flow device, and after the device type of each network device is obtained, the to-be-connected routing signal corresponding to each network device is determined according to the device type of each network device, specifically, according to a preset mapping relationship between the device type and the routing signal, the to-be-connected routing signal of the network device of the high-flow device is determined to be a 5g routing signal, and the to-be-connected routing signal of the low-flow device is determined to be a 2.4g routing signal. The 5g routing signal is a signal which is generated by a routing system connected with the network device and works in a 5g frequency band, and the 2.4g routing signal is a signal which is generated by the routing system and works in the 5g frequency band.
Step S20, the routing system determines the network bandwidth to be connected corresponding to each network device according to the routing signal to be connected and the device type;
after the routing signal to be connected of each network device is determined, the network bandwidth to be connected corresponding to each network device is determined according to the routing signal to be connected of the network device and the device type of the network device. It can be understood that, on the basis of determining the to-be-connected routing signal, the network devices of different device types need to allocate different network bandwidths corresponding to the to-be-connected routing signal, and therefore, according to the device type, the to-be-connected network bandwidth corresponding to each network device is determined in the network bandwidth corresponding to the to-be-connected routing signal. For example, the network bandwidths corresponding to the routing signals to be connected are allocated according to the proportions by the different types of network devices, or the network bandwidths to be connected corresponding to the routing signals to be connected are allocated to the different types of network devices according to the current bandwidth usage condition of the preset area.
Step S30, the routing system obtains bandwidth resources of the preset network region, and allocates the bandwidth resources to each network device according to the network bandwidth to be connected, where each network device corresponds to each network node of the preset network region.
After the network bandwidth to be connected corresponding to each network device is determined, the bandwidth resources of the preset network area are obtained, and the bandwidth resources are distributed to each network device according to the determined network bandwidth to be connected corresponding to each network device. The preset network area may be a local area network or a wide area network, and the network nodes respectively corresponding to the network device and the routing system form the preset network area, and the preset network area is generally a home local area network.
In the bandwidth allocation method provided in this embodiment, the device type of each network device is obtained, and the to-be-connected routing signal corresponding to each network device is determined according to the device type of each network device, where the device types are distinguished according to the amount of traffic consumed by the network devices, and the to-be-connected routing signal is a signal generated by a routing system in different working frequency bands; determining the network bandwidth to be connected corresponding to each network device according to the routing signal to be connected and the device type; acquiring bandwidth resources of a preset network area, and respectively allocating the bandwidth resources to each network device according to the network bandwidth to be connected, wherein each network device corresponds to each network node of the preset network area. In this embodiment, different network devices are screened out according to different device types, and a to-be-connected routing signal of the network device is determined according to different device types; and then different network bandwidths to be connected are allocated to different equipment types, so that bandwidth resources are allocated to the network equipment according to the network bandwidths to be connected of the network equipment, bandwidth resources are allocated according to the different equipment types, excessive bandwidth resources occupied by some network equipment are avoided, the technical problem that the network speed of a routing system is easily reduced when the number of the network equipment is large is solved, the utilization rate of the bandwidth resources is improved, and the network speed of the network equipment is improved.
Based on the first embodiment, a second embodiment of the bandwidth allocation method of the present invention is proposed, and referring to fig. 3, in this embodiment, after step S30, the method further includes:
step S40, when detecting that the service type of the occupied bandwidth changes, the routing system determines the spare bandwidth corresponding to the preset network area;
step S50, if the spare bandwidth is zero, the routing system re-allocates bandwidth to each network device according to the changed service type.
If the routing system receives a new service type occupying bandwidth at present, the spare bandwidth in the total bandwidth resource is calculated through the total bandwidth resource corresponding to the preset network area and the allocated bandwidth resource. The service type of the occupied bandwidth may be a service type provided by a new network device, or a service type added to an original network device, so that the original network device needs more bandwidth resources. If the calculated spare bandwidth does not meet the new service type or the spare bandwidth does not exist currently, the bandwidth is redistributed to each network device according to the changed service type, wherein the changed service type comprises the original service type and the new service type, namely the bandwidth is redistributed according to the original service type and the new service type. If the spare bandwidth exists in the preset network area at present, calculating the minimum bandwidth corresponding to the minimum user experience quality value according to the spare bandwidth, and distributing the minimum bandwidth to the network equipment corresponding to the new service type.
Further, according to the changed service type, reallocating the bandwidth to each network device, including: acquiring network equipment corresponding to a new service type and an original service type as network equipment, acquiring the equipment type of each network equipment, and determining a to-be-connected routing signal corresponding to each network equipment according to the equipment type of each network equipment; determining the network bandwidth to be connected corresponding to each network device according to the routing signal to be connected and the device type; and acquiring bandwidth resources of a preset network area, and respectively allocating the bandwidth resources to each network device according to the network bandwidth to be connected.
Further, when detecting that a new network device is accessed, determining that the service type occupying the bandwidth is changed.
Further, according to the changed service type, performing bandwidth reallocation on each network device, including:
step S51, the routing system obtains the bandwidth proportion of each network device according to the changed service type;
step S52, the routing system calculates the actual allocable bandwidth of each network device according to the bandwidth proportion and bandwidth resource allocated by each network device;
step S53, the routing system allocates bandwidth to each network device according to the bandwidth actually allocable by each network device.
If the spare bandwidth is not enough to meet the new service type or does not exist currently, that is, the spare bandwidth meeting the requirement does not exist currently in the preset network area, the bandwidth proportion of each network device is obtained according to the changed service type, wherein the routing signal corresponds to the bandwidth proportion, that is, the network device (low-traffic device) corresponding to the 2.4g routing signal corresponds to the first bandwidth proportion, and the network device (high-traffic device) corresponding to the 5g routing signal corresponds to the second bandwidth proportion, that is, one of the routing signals determines one bandwidth proportion.
And then, calculating the actual allocable bandwidth of the low-flow device according to the first bandwidth proportion and the bandwidth resource corresponding to the low-flow device, and calculating the actual allocable bandwidth of the high-flow device according to the second bandwidth proportion and the bandwidth resource corresponding to the high-flow device, so that the actual allocable bandwidth of each network device can be calculated according to the bandwidth proportion allocated by each network device. And finally, according to the calculated bandwidth which can be actually distributed by each network device, distributing the bandwidth resources of the preset network area to each network device, wherein the changed service types comprise the original service type and the new service type, namely, the bandwidth is redistributed according to the original service type and the new service type.
Further, calculating the bandwidth actually allocable by each network device according to the bandwidth proportion and the bandwidth resource allocated by each network device, including:
step S521, the routing system calculates downlink bandwidths and uplink bandwidths that can be actually allocated to each network device according to the bandwidth proportions allocated to each network device, the pre-stored upper and lower bandwidth allocation proportions corresponding to each network device, and the bandwidth resources.
The bandwidth ratio determines the size of the bandwidth allocated to each network device, so that it is necessary to allocate the upper and lower bandwidths to different network devices more reasonably. Specifically, after the bandwidth of each network device is allocated to each network device according to the bandwidth proportion allocated to each network device, the upper and lower bandwidths are allocated to each network device based on the upper and lower bandwidth allocation proportions corresponding to each network device, so that the downlink bandwidth and the uplink bandwidth which can be actually allocated to each network device are obtained. It should be noted that the upper and lower bandwidth allocation proportion corresponding to each network device corresponds to the device type of the network device, that is, the upper and lower bandwidth allocation proportion of each network device is determined according to the device type of each network device, for example, the downlink bandwidth allocated by the smart television needs to be more, and the proportion of the downlink bandwidth of the smart television is high.
Further, after acquiring bandwidth resources of a preset network area and respectively allocating the bandwidth resources to each network device according to the network bandwidth to be connected, the method further includes:
step S60, when detecting that the target network device executes the video downloading task, the routing system obtains the current use bandwidth of each network device, wherein the target network device is any one of the network devices;
step S70, the routing system determines the spare bandwidth corresponding to the preset network area according to the current used bandwidth and bandwidth resources;
step S80, if the spare bandwidth is zero, the routing system calculates the target bandwidth corresponding to the minimum user experience quality value according to the spare bandwidth;
and step S90, if the target bandwidth is less than or equal to the sum of the current used bandwidth and the spare bandwidth of the target device, allocating the target bandwidth to the target network device so that the target network device executes the video downloading task based on the target bandwidth.
After the network bandwidth of each network device is allocated, the routing system detects whether the device is downloading the video in real time, and if a video downloading task is detected when the network device downloads the video, the current used bandwidth of each network device is obtained. And then, calculating the currently usable bandwidth based on the currently used bandwidth and the bandwidth resource corresponding to the preset network area, and calculating the spare bandwidth. If the spare bandwidth is zero, the calculated spare bandwidth meets the requirement, the spare bandwidth currently exists in a preset network area, and the target bandwidth corresponding to the minimum user experience quality value is calculated according to the spare bandwidth; and if the target bandwidth is less than or equal to the sum of the current used bandwidth and the spare bandwidth of the target device, the target bandwidth is allocated to the target network device so that the target network device can execute the video downloading task based on the target bandwidth, so that the network device executing the video downloading task can temporarily acquire the spare bandwidth resource to execute the video downloading task, the video downloading time is reduced, the bandwidth resource is dynamically allocated, and the data processing efficiency of the network device is improved.
Further, the bandwidth resource includes a routing signal corresponding to the routing system and a channel bandwidth corresponding to the routing signal, the routing signal is generated by the routing system connected to the network device, and the routing signal of the routing system includes a 2.4g routing signal and a 5g routing signal; acquiring bandwidth resources of a preset network area, and respectively allocating the bandwidth resources to each network device according to a network bandwidth to be connected, wherein the method comprises the following steps:
step S31, the routing system allocates the routing signals to each network device respectively according to the network bandwidth to be connected, and allocates the channel bandwidth to each network device.
After determining the network bandwidth to be connected corresponding to each network device, acquiring a routing signal of a routing system and a channel bandwidth corresponding to the routing signal, respectively allocating the routing signal to each network device, and allocating the channel bandwidth to each network device. The preset network area can be a local area network or a wide area network, the network device and the network nodes respectively corresponding to the routing system form the preset network area, the preset network area is generally a home local area network, the routing signals are generated by the routing system connected with the network device, and the routing signals of the routing system comprise 2.4g routing signals and 5g routing signals.
In the bandwidth allocation method provided by this embodiment, when it is detected that the service type occupying the bandwidth changes, the spare bandwidth corresponding to the preset network area is determined; and if the spare bandwidth is zero, performing bandwidth reallocation on each network device according to the changed service type. In this embodiment, when it is detected that a service type occupying a bandwidth in a preset network area changes, a current spare bandwidth of the preset network area is obtained, and when the spare bandwidth does not exist, the bandwidth is reallocated to the changed service type, so that the bandwidth can be allocated to an accessed new service type in real time, a problem that the service type processes service data slowly due to a small bandwidth allocation when the new service type accesses a routing system is avoided, and a function of allocating bandwidth resources in real time according to different requirements is realized.
Further, referring to fig. 4, an embodiment of the present invention provides a bandwidth distribution apparatus, including:
the device type is distinguished according to the flow consumed by the network equipment, and the routing signal to be connected is a signal generated by a routing system in different working frequency bands;
the determining module is used for determining the network bandwidth to be connected corresponding to each network device according to the routing signal to be connected and the device type;
and the distribution module is used for acquiring bandwidth resources of a preset network area and distributing the bandwidth resources to each network device according to the network bandwidth to be connected, wherein each network device corresponds to each network node of the preset network area.
Further, the allocation module is further configured to:
when the change of the service type of the occupied bandwidth is detected, determining the spare bandwidth corresponding to the preset network area;
and if the spare bandwidth is zero, performing bandwidth reallocation on each network device according to the changed service type.
Further, the allocation module is further configured to:
and when detecting that new network equipment is accessed to a preset network area, judging that the service type occupying the bandwidth is changed.
Further, the allocation module is further configured to:
acquiring the bandwidth proportion of each network device according to the changed service type;
calculating the actual allocable bandwidth of each network device according to the bandwidth proportion and bandwidth resources allocated to each network device;
and performing bandwidth allocation on each network device according to the actually allocable bandwidth of each network device.
Further, the allocation module is further configured to:
and calculating the downlink bandwidth and the uplink bandwidth which can be actually distributed by each network device according to the bandwidth proportion distributed by each network device, the pre-stored upper and lower bandwidth distribution proportion corresponding to each network device and the bandwidth resources.
Further, the allocation module is further configured to:
when detecting that target network equipment executes a video downloading task, acquiring the current used bandwidth of each network equipment, wherein the target network equipment is any one of the network equipment;
determining the spare bandwidth corresponding to the preset network area according to the current used bandwidth and bandwidth resources;
if the spare bandwidth is not zero, calculating a target bandwidth corresponding to the minimum user experience quality value according to the spare bandwidth;
and if the target bandwidth is less than or equal to the sum of the current used bandwidth and the spare bandwidth of the target equipment, distributing the target bandwidth to the target network equipment so that the target network equipment executes the video downloading task based on the target bandwidth.
Further, the allocation module is further configured to:
and respectively distributing the routing signals to each network device according to the network bandwidth to be connected, and respectively distributing the channel bandwidth to each network device.
Furthermore, an embodiment of the present invention provides a computer-readable storage medium, on which a bandwidth allocation program is stored, which when executed by a processor implements the steps of the bandwidth allocation method as in any one of the above.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the bandwidth allocation method, and is not described in detail herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.