A bandwidth allocation method, using an Hierarchical Token Bucket, HTB, algorithm, the method comprising: dividing an uplink total bandwidth of a router into an uplink parent-class bandwidth and an uplink reserved bandwidth according to a first preset allocation ratio, and dividing a downlink total bandwidth of a router into a downlink parent-class bandwidth and a downlink reserved bandwidth according to a second preset allocation ratio; monitoring bandwidth traffic of each device linked to the router, wherein each device corresponds to one child-class and classifying a device having bandwidth traffic exceeding a preset threshold as a first-class device, and a device having bandwidth traffic not exceeding the preset threshold as a second-class device, wherein the preset threshold is a minimum traffic value for sharing the parent-class bandwidth; and allocating the uplink and the downlink parent-class bandwidths and the uplink and downlink reserved bandwidths to first-class devices and second-class devices respectively according to the monitoring result obtained after the bandwidth traffic monitoring of each device; wherein allocating the uplink and downlink parent-class bandwidths and the uplink and downlink reserved bandwidths to the first-class devices and the second-class devices respectively according to the monitoring results comprises: allocating the uplink and downlink parent-class bandwidths to the first-class devices; and allocating a remaining bandwidth to the second-class devices, wherein the remaining bandwidth is equal to a sum of the uplink reserved bandwidth, respectively of the downlink reserved bandwidth, and a value obtained by subtracting a bandwidth used by the first-class devices from the uplink parent-class bandwidth, respectively from the downlink parent-class bandwidth; wherein the parent-class bandwidth is defined as the remaining bandwidth obtained by subtracting the reserved bandwidth from the total bandwidth, and the child classes having pre-empted all the remaining bandwidth in the total bandwidth are not allowed to borrow the reserved bandwidth. dividing an uplink total bandwidth of a router into an uplink parent-class bandwidth and an uplink reserved bandwidth according to a first preset allocation ratio, and dividing a downlink total bandwidth of a router into a downlink parent-class bandwidth and a downlink reserved bandwidth according to a second preset allocation ratio; monitoring bandwidth traffic of each device linked to the router, wherein each device corresponds to one child-class and classifying a device having bandwidth traffic exceeding a preset threshold as a first-class device, and a device having bandwidth traffic not exceeding the preset threshold as a second-class device, wherein the preset threshold is a minimum traffic value for sharing the parent-class bandwidth; and allocating the uplink and the downlink parent-class bandwidths and the uplink and downlink reserved bandwidths to first-class devices and second-class devices respectively according to the monitoring result obtained after the bandwidth traffic monitoring of each device; wherein allocating the uplink and downlink parent-class bandwidths and the uplink and downlink reserved bandwidths to the first-class devices and the second-class devices respectively according to the monitoring results comprises: allocating the uplink and downlink parent-class bandwidths to the first-class devices; and allocating a remaining bandwidth to the second-class devices, wherein the remaining bandwidth is equal to a sum of the uplink reserved bandwidth, respectively of the downlink reserved bandwidth, and a value obtained by subtracting a bandwidth used by the first-class devices from the uplink parent-class bandwidth, respectively from the downlink parent-class bandwidth; wherein the parent-class bandwidth is defined as the remaining bandwidth obtained by subtracting the reserved bandwidth from the total bandwidth, and the child classes having pre-empted all the remaining bandwidth in the total bandwidth are not allowed to borrow the reserved bandwidth.