Disclosure of Invention
The technical scheme provided by the invention is as follows:
the invention provides a method for distributing network flow, which comprises the following steps: s10, monitoring the total network flow of each terminal device connected to the same network; s20, judging whether the total network flow exceeds a preset flow threshold value; s30, when the total network flow exceeds a preset flow threshold, collecting and reporting network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10; and S40, distributing the network flow of each terminal device according to the received network reference data.
Further, the step S40 further includes: s41, analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; and S42, when the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, distributing the network traffic of each terminal device according to the traffic distribution parameters in the preset network traffic distribution table in the database.
Further, the step S40 further includes: s43, when the network connection time, the network flow fluctuation characteristic, the network resource source, the connection access frequency are inconsistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, searching whether a corresponding reference network flow distribution table exists in the database according to the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency; s44, when the reference network traffic distribution table exists in the database, judging whether the traffic distribution parameters in the reference network traffic distribution table meet the network traffic fluctuation characteristics; and S441, when the flow distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics, distributing the network flow of each terminal device according to the flow distribution parameters in the reference network flow distribution table.
Further, the step S40 further includes: s442, when the traffic distribution parameter in the reference network traffic distribution table does not satisfy the network traffic fluctuation characteristic, modifying the traffic distribution parameter in the reference network traffic distribution table according to the network traffic fluctuation characteristic and the broadband network information; s443, allocating the network traffic of each terminal device according to the traffic allocation parameters in the modified reference network traffic allocation table.
Further, the step S40 further includes: s45, when the reference network flow distribution table does not exist in the database, recording router MAC, terminal equipment MAC, network connection time, network flow fluctuation characteristics, network resource sources and connection access frequency in the network reference data; s451, generating a new preset network flow distribution table according to the router MAC, the terminal equipment MAC, the network connection time, the network flow fluctuation characteristics, the network resource source, the connection access frequency and the preset event priority; and S452, distributing the network flow of each terminal device according to the flow distribution parameters in the newly generated preset network flow distribution table.
Further, the step S40 further includes: s401, judging whether the number of the terminal devices exceeds the preset number of the terminal devices according to the obtained number of the terminal devices connected with the same network; s402, when the number of the terminal devices exceeds the preset number of the terminal devices, searching the same terminal device MAC which is the same as the preset terminal device MAC in the database according to the terminal device MAC in the network reference data, and then executing the step S41 to realize the distribution of the network flow of each same terminal device; otherwise, step S41 is directly performed.
Further, the database in step S43 includes each preset network traffic distribution table preset by several other router users, and a preset network traffic distribution table newly generated by each other router user in the traffic distribution process; the reference to the network traffic allocation table in step S43 is: and the preset network flow distribution table of other router users is in accordance with the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency.
The invention also provides a router for distributing network flow, comprising: the monitoring module is used for monitoring the total network flow of each terminal device connected to the same network; the judging module is used for judging whether the total network flow exceeds a preset flow threshold value; the collecting and reporting module is used for collecting and reporting the network reference data on the terminal equipment when the total network flow exceeds a preset flow threshold; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; and the flow distribution module is used for distributing the network flow of each terminal device according to the received network reference data.
Further, the method comprises the following steps: the analysis module is used for analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; and the flow distribution module is further configured to distribute the network flows of each terminal device according to flow distribution parameters in a preset network flow distribution table in the database when the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database.
Further, the method comprises the following steps: the searching module is used for searching whether a corresponding reference network flow distribution table exists in the database or not according to the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency when the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency are inconsistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database; a judging module, configured to, when the reference network traffic distribution table exists in the database, judge whether a traffic distribution parameter in the reference network traffic distribution table satisfies the network traffic fluctuation characteristic; and the flow distribution module is further configured to distribute the network flows of the terminal devices according to the flow distribution parameters in the reference network flow distribution table when the flow distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics.
Compared with the prior art, the network flow distribution method and the router provided by the invention have the following beneficial effects:
1) according to the invention, once the network flow used by the terminal equipment exceeds a preset network flow threshold value, network reference data are automatically encrypted and reported; identifying an application scene of network resources on the terminal equipment according to the network reference data; and distributing network flow to each terminal device according to the analyzed application scene so as to meet the application scene requirement on the terminal device which needs the network flow most by the user, thereby improving the user experience.
2) After the application scene on each terminal device is identified, whether the application scene is consistent with the preset application scene in the database or not is analyzed, and when the application scene is consistent with the preset application scene, the network flow of each terminal device is distributed according to a preset network flow distribution table, so that the user requirements are better met.
3) When the application scene is inconsistent with the preset application scene, a reference network flow distribution table consistent with the preset application scene of other router users is searched in a database, the reference network flow distribution tables of other router users are borrowed, and when the reference network flow distribution table meets the network flow fluctuation characteristic, the reference network flow distribution table is directly utilized to distribute the network flow of each terminal device; the number of the self-set preset network flow distribution tables is reduced, and the flexibility and the universality of the reference network flow distribution tables are enhanced, so that various users can be better served.
4) When the reference network flow distribution table does not meet the network flow fluctuation characteristic, the reference network flow distribution table is modified according to the network flow fluctuation characteristic and the broadband network information; therefore, the user can better meet the application scene requirements on the terminal equipment by combining the characteristics of the home broadband network.
5) When the reference network flow distribution table does not exist in the database, a new preset network flow distribution table is generated according to the collected network reference data and the preset event priority, so that the network flow is distributed to each terminal device at present or later.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
As shown in fig. 1, according to an embodiment of the present invention, a method for distributing network traffic includes the following steps: s10, monitoring the total network flow of each terminal device connected to the same network;
s20, judging whether the total network flow of the terminal equipment exceeds a preset flow threshold value;
s30, when the total network flow exceeds a preset flow threshold, collecting and reporting network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10;
and S40, identifying the application scene of the network resource on each terminal device according to the received network reference data, and distributing the network traffic of each terminal device.
Specifically, the total network flow used by each terminal device connected to the same network and at the same time is monitored according to a preset interval time, and when a plurality of terminal devices are networked to play games or watch videos and the like at the same time, the total network flow can suddenly use the flow increase condition, so that the network flow of each terminal device needs to be distributed, and the requirements of terminal device users are met; judging whether the total network flow exceeds a preset flow threshold value or not; when the total network flow exceeds a preset flow threshold, reporting network reference data after collecting the network reference data related to the terminal equipment, wherein the network reference data comprises router MAC for identifying different routers, terminal equipment MAC for identifying the type of the terminal equipment, network connection time for the terminal equipment to connect into a network, and reference data (network flow fluctuation characteristics, network resource sources and connection access frequency) for identifying application scenes (playing games and watching videos) of network resources on the terminal equipment; and distributing the network flow of each terminal device according to the application scene of the network resources on each terminal device.
According to another embodiment of the present invention, a method for distributing network traffic includes the following steps: s10, monitoring the total network flow of each terminal device connected to the same network;
s20, judging whether the total network flow of the terminal equipment exceeds a preset flow threshold value;
s30, when the total network flow exceeds a preset flow threshold, collecting and reporting (automatic encryption reporting) network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10;
s41, analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; identifying whether the application scene of the network resource on the terminal equipment is consistent with the preset application scene in the database;
and S42, when the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, distributing the network traffic of each terminal device according to the traffic distribution parameters in the preset network traffic distribution table in the database. The preset network traffic distribution table is used for setting the network traffic of events in different application scenarios according to the preset event priority of each application scenario at different times, for example: the network flow of the game is preferably met from eight to ten points at night, then the network flow of the video is met, and then the downloaded network flow is met; and the network flow of the video is preferentially met from six to eight points at night, the network flow of the game is met, and the downloaded network flow is met.
Specifically, application scenes (game scenes, video scenes and web browsing scenes) of the network resources on the terminal equipment are identified by analyzing the network traffic fluctuation characteristics, the network resource sources and the connection access frequency in the network reference data and the preset network traffic fluctuation characteristics, the preset network resource sources and the preset connection access frequency corresponding to the preset application scenes in the database; and further, according to the network connection time of the terminal equipment connected to the network, whether the network connection time is consistent with the preset network connection time in the database or not is judged, so that whether the preset application scene occurs in the preset network connection time or not of each terminal equipment is identified. Therefore, the network flow of each terminal device is distributed according to the application scene on each terminal device and the flow distribution parameters in the preset network flow distribution table, so that the requirement of the application scene on important terminal devices on the network flow is better met.
According to still another embodiment of the present invention, a method for allocating network traffic includes the steps of: s10, monitoring the total network flow of each terminal device connected to the same network;
s20, judging whether the total network flow of the terminal equipment exceeds a preset flow threshold value;
s30, when the total network flow exceeds a preset flow threshold, collecting and reporting network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10;
s41, analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; identifying whether the application scene of the network resource on the terminal equipment is consistent with the preset application scene in the database;
and S42, when the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, distributing the network traffic of each terminal device according to the traffic distribution parameters in the preset network traffic distribution table in the database. The preset network traffic distribution table is used for setting the network traffic of events in different application scenarios according to the preset event priority of each application scenario at different times, for example: the network flow of the game is preferably met from eight to ten points at night, then the network flow of the video is met, and then the downloaded network flow is met; and the network flow of the video is preferentially met from six to eight points at night, the network flow of the game is met, and the downloaded network flow is met.
S43, when the network connection time, the network flow fluctuation characteristic, the network resource source, the connection access frequency are inconsistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, searching whether a corresponding reference network flow distribution table exists in the database according to the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency;
the database in step S43 includes each preset network traffic distribution table preset by a plurality of other router users, and a preset network traffic distribution table newly generated by each other router user in the traffic distribution process;
the reference to the network traffic allocation table in step S43 is: and the preset network flow distribution table of other router users is in accordance with the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency.
S44, when the reference network traffic distribution table exists in the database, judging whether the traffic distribution parameters in the reference network traffic distribution table meet the network traffic fluctuation characteristics;
and S441, when the flow distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics, distributing the network flow of each terminal device according to the flow distribution parameters in the reference network flow distribution table.
Specifically, when the preset network traffic distribution table does not exist in the database, whether a reference network traffic distribution table exists is searched in the database, and the reference network traffic distribution table refers to a preset network traffic distribution table made for the same application scenario by other router users. When a reference network flow distribution table exists, judging whether distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics; and when the network flow fluctuation characteristic is met, the network flow of each terminal device is directly distributed according to the distribution parameters in the reference network flow distribution table.
According to another embodiment of the present invention, a method for distributing network traffic includes the following steps: s10, monitoring the total network flow of each terminal device connected to the same network;
s20, judging whether the total network flow of the terminal equipment exceeds a preset flow threshold value;
s30, when the total network flow exceeds a preset flow threshold, collecting and reporting network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10;
s41, analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; identifying whether the application scene of the network resource on the terminal equipment is consistent with the preset application scene in the database;
and S42, when the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, distributing the network traffic of each terminal device according to the traffic distribution parameters in the preset network traffic distribution table in the database. The preset network flow distribution table is used for setting the network flow of events under different application scenes according to the preset event priority of each application scene.
S43, when the network connection time, the network flow fluctuation characteristic, the network resource source, the connection access frequency are inconsistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, searching whether a corresponding reference network flow distribution table exists in the database according to the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency;
the database in step S43 includes each preset network traffic distribution table preset by a plurality of other router users, and a preset network traffic distribution table newly generated by each other router user in the traffic distribution process;
the reference to the network traffic allocation table in step S43 is: and the preset network flow distribution table of other router users is in accordance with the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency.
S44, when the reference network traffic distribution table exists in the database, judging whether the traffic distribution parameters in the reference network traffic distribution table meet the network traffic fluctuation characteristics;
and S441, when the flow distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics, distributing the network flow of each terminal device according to the flow distribution parameters in the reference network flow distribution table.
S442, when the traffic distribution parameter in the reference network traffic distribution table does not satisfy the network traffic fluctuation characteristic, modifying the traffic distribution parameter in the reference network traffic distribution table according to the network traffic fluctuation characteristic and the broadband network information;
s443, allocating the network traffic of each terminal device according to the traffic allocation parameters in the modified reference network traffic allocation table.
Specifically, the network connection time refers to the time when the terminal device connects to a certain network; the network flow fluctuation characteristic refers to a network flow fluctuation trend required by using the terminal equipment in the network connection process after the terminal equipment is connected to the network; the network resource sources are as follows: the terminal equipment opens a certain application program and then loads the coming path of the network resource; the connection access frequency means: the connection request frequency is sent by the terminal device when the network resource is loaded. When the flow distribution parameters in the reference network flow distribution table do not meet the network flow fluctuation characteristics, the flow distribution parameters in the reference network flow distribution table are modified according to the network flow fluctuation characteristics under the limitation of the broadband network, so that the requirements of the terminal equipment on the network flow are better met by combining the characteristics of the home broadband network.
According to still another embodiment of the present invention, a method for distributing network traffic includes the steps of: s10, monitoring the total network flow of each terminal device connected to the same network;
s20, judging whether the total network flow of the terminal equipment exceeds a preset flow threshold value;
s30, when the total network flow exceeds a preset flow threshold, collecting and reporting network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10;
s41, analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; identifying whether the application scene of the network resource on the terminal equipment is consistent with the preset application scene in the database;
and S42, when the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, distributing the network traffic of each terminal device according to the traffic distribution parameters in the preset network traffic distribution table in the database. The preset network flow distribution table is used for setting the network flow of events under different application scenes according to the preset event priority of each application scene.
S43, when the network connection time, the network flow fluctuation characteristic, the network resource source, the connection access frequency are inconsistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, searching whether a corresponding reference network flow distribution table exists in the database according to the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency;
the database in step S43 includes each preset network traffic distribution table preset by a plurality of other router users, and a preset network traffic distribution table newly generated by each other router user in the traffic distribution process;
the reference to the network traffic allocation table in step S43 is: and the preset network flow distribution table of other router users is in accordance with the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency.
S44, when the reference network traffic distribution table exists in the database, judging whether the traffic distribution parameters in the reference network traffic distribution table meet the network traffic fluctuation characteristics;
and S441, when the flow distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics, distributing the network flow of each terminal device according to the flow distribution parameters in the reference network flow distribution table.
S442, when the traffic distribution parameter in the reference network traffic distribution table does not satisfy the network traffic fluctuation characteristic, modifying the traffic distribution parameter in the reference network traffic distribution table according to the network traffic fluctuation characteristic and the broadband network information;
s443, allocating the network traffic of each terminal device according to the traffic allocation parameters in the modified reference network traffic allocation table.
S45, when the reference network flow distribution table does not exist in the database, recording the router MAC, the terminal equipment MAC, the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency;
s451, generating a new preset network flow distribution table according to the router MAC, the terminal equipment MAC, the network connection time, the network flow fluctuation characteristics, the network resource source, the connection access frequency and the preset event priority, and storing the newly generated preset network flow distribution table in a database;
and S452, distributing the network flow of each terminal device according to the flow distribution parameters in the newly generated preset network flow distribution table.
Specifically, when the preset network traffic distribution table and the reference network traffic distribution table do not exist in the database, the router MAC, the terminal device MAC, the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency in the currently acquired network reference data are recorded; and then, according to the network reference data and the preset event priority (for example, the game is played to preferentially distribute the network traffic meeting the network traffic fluctuation characteristic, and the network traffic meeting the network traffic fluctuation characteristic of watching the video is redistributed), the preset event priority is preset and stored in the database. And then, distributing the network traffic of each terminal device according to the traffic distribution parameters in the newly generated preset network traffic distribution table.
As shown in fig. 1 and fig. 2, according to still another embodiment of the present invention, a method for distributing network traffic includes the following steps: s10, monitoring the total network flow of each terminal device connected to the same network;
s20, judging whether the total network flow of the terminal equipment exceeds a preset flow threshold value;
s30, when the total network flow exceeds a preset flow threshold, collecting and reporting network reference data on the terminal equipment; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency; otherwise, go to step S10;
s401, judging whether the number of the terminal devices exceeds the preset number of the terminal devices according to the obtained number of the terminal devices connected with the same network;
s402, when the number of the terminal devices exceeds the preset number of the terminal devices, searching the same terminal device MAC which is the same as the preset terminal device MAC in the database according to the terminal device MAC in the network reference data, and then executing the step S41 to realize the distribution of the network flow of each same terminal device; otherwise, step S41 is directly performed.
S41, analyzing whether the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database respectively according to the received network reference data; identifying whether the application scene of the network resource on the terminal equipment is consistent with the preset application scene in the database;
and S42, when the network connection time, the network traffic fluctuation characteristic, the network resource source and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, distributing the network traffic of each terminal device according to the traffic distribution parameters in the preset network traffic distribution table in the database. The preset network flow distribution table is used for setting the network flow of events under different application scenes according to the preset event priority of each application scene.
S43, when the network connection time, the network flow fluctuation characteristic, the network resource source, the connection access frequency are inconsistent with the preset network connection time, the preset network flow fluctuation characteristic, the preset network resource source and the preset connection access frequency in the database, searching whether a corresponding reference network flow distribution table exists in the database according to the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency;
the database in step S43 includes each preset network traffic distribution table preset by a plurality of other router users, and a preset network traffic distribution table newly generated by each other router user in the traffic distribution process;
the reference to the network traffic allocation table in step S43 is: and the preset network flow distribution table of other router users is in accordance with the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency.
S44, when the reference network traffic distribution table exists in the database, judging whether the traffic distribution parameters in the reference network traffic distribution table meet the network traffic fluctuation characteristics;
and S441, when the flow distribution parameters in the reference network flow distribution table meet the network flow fluctuation characteristics, distributing the network flow of each terminal device according to the flow distribution parameters in the reference network flow distribution table.
S442, when the traffic distribution parameter in the reference network traffic distribution table does not satisfy the network traffic fluctuation characteristic, modifying the traffic distribution parameter in the reference network traffic distribution table according to the network traffic fluctuation characteristic and the broadband network information;
s443, allocating the network traffic of each terminal device according to the traffic allocation parameters in the modified reference network traffic allocation table.
S45, when the reference network flow distribution table does not exist in the database, recording the router MAC, the terminal equipment MAC, the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency;
s451, generating a new preset network flow distribution table according to the router MAC, the terminal equipment MAC, the network connection time, the network flow fluctuation characteristics, the network resource source, the connection access frequency and the preset event priority, and storing the newly generated preset network flow distribution table in a database;
and S452, distributing the network flow of each terminal device according to the flow distribution parameters in the newly generated preset network flow distribution table.
Specifically, after the total network flow is monitored to exceed a preset flow threshold, whether the number of terminal devices connected to the same network exceeds the preset number of terminal devices is judged; when the number of the terminal devices does not exceed the preset number of the terminal devices, according to the method, whether the terminal devices connected to the same network are the same as the preset terminal devices in the database or not is judged, and the network flow of each terminal device is distributed; when the number of the terminal devices exceeds the preset number of the terminal devices, the network flow of the same terminal device as the preset terminal device is distributed according to the method, and the network flow of the same terminal device is satisfied; and if the residual flow exists, the network flow of the terminal equipment different from the preset terminal equipment is supplied. In the using process, the user can change or add the preset terminal equipment.
As shown in fig. 3, according to an embodiment of the present invention, a router for distributing network traffic includes: a monitoring module 10, configured to monitor a total network traffic of each terminal device connected to the same network;
a judging module 20, configured to judge whether a total network traffic of the terminal device exceeds a preset traffic threshold;
a collecting and reporting module 30, configured to collect and report network reference data on the terminal device when the total network traffic exceeds a preset traffic threshold; the network reference data comprises a router MAC, a terminal device MAC, network connection time, network flow fluctuation characteristics, a network resource source and connection access frequency;
the judging module 20 is further configured to judge whether the number of the terminal devices exceeds a preset number of terminal devices according to the obtained number of the terminal devices connected to the same network;
the searching module 40 is configured to, when the number of the terminal devices exceeds a preset number of terminal devices, search, according to the terminal device MAC in the network reference data, for the same terminal device MAC as the preset terminal device MAC in the database, and then realize allocation of network traffic of each same terminal device;
the analysis module 50 is configured to analyze whether the network connection time, the network traffic fluctuation characteristic, the network resource source, and the connection access frequency in the network reference data are consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source, and the preset connection access frequency in the database, respectively, according to the received network reference data; identifying whether the application scene of the network resource on the terminal equipment is consistent with the preset application scene in the database;
and a traffic distribution module 60, configured to distribute the network traffic of each terminal device according to traffic distribution parameters in a preset network traffic distribution table in the database when the network connection time, the network traffic fluctuation characteristic, the network resource source, and the connection access frequency are respectively consistent with the preset network connection time, the preset network traffic fluctuation characteristic, the preset network resource source, and the preset connection access frequency in the database. The preset network flow distribution table is used for setting the network flow of events under different application scenes according to the preset event priority of each application scene.
The searching module 40 is configured to, when the network connection time, the network traffic fluctuation characteristic, the network resource source, the connection access frequency are inconsistent with a preset network connection time, a preset network traffic fluctuation characteristic, a preset network resource source, and a preset connection access frequency in a database, search whether a corresponding reference network traffic allocation table exists in the database according to the network connection time, the network traffic fluctuation characteristic, the network resource source, and the connection access frequency;
the database comprises each preset network traffic distribution table preset by a plurality of other router users and a preset network traffic distribution table newly generated by each other router user in the traffic distribution process;
the reference to the network traffic distribution table means: and the preset network flow distribution table of other router users is in accordance with the network connection time, the network flow fluctuation characteristic, the network resource source and the connection access frequency.
The determining module 20 is further configured to determine whether a traffic distribution parameter in the reference network traffic distribution table meets the network traffic fluctuation characteristic when the reference network traffic distribution table exists in the database;
the traffic distribution module 60 is configured to, when the traffic distribution parameter in the reference network traffic distribution table meets the network traffic fluctuation characteristic, distribute the network traffic of each terminal device according to the traffic distribution parameter in the reference network traffic distribution table.
A parameter modification module 70, configured to modify a traffic distribution parameter in the reference network traffic distribution table according to the network traffic fluctuation characteristic and broadband network information when the traffic distribution parameter in the reference network traffic distribution table does not meet the network traffic fluctuation characteristic;
the traffic distribution module 60 is further configured to distribute the network traffic of each terminal device according to the modified traffic distribution parameters in the reference network traffic distribution table.
A recording module 80, configured to record the router MAC, the terminal device MAC, the network connection time, the network traffic fluctuation characteristic, the network resource source, and the connection access frequency when the reference network traffic allocation table does not exist in the database;
a generating module 90, configured to generate a new preset network traffic distribution table according to the router MAC, the terminal device MAC, the network connection time, the network traffic fluctuation characteristic, the network resource source, the connection access frequency, and the preset event priority, and store the newly generated preset network traffic distribution table in a database;
the traffic distribution module 60 is configured to distribute the network traffic of each terminal device according to the traffic distribution parameters in the newly generated preset network traffic distribution table.
As shown in fig. 4, according to an embodiment of the present invention, a method for allocating network traffic includes the following steps: the router confirms that the user starts the intelligent regulation function;
the router sets basic parameters, such as thresholds, by the user and turns on traffic listeners for listening to traffic.
Judging whether the flow exceeds a threshold value; when the flow exceeds the threshold value, the router collects and encrypts the reported data, and the method comprises the following steps: environmental data (time period, network operator information); router data (existing setup parameters, traffic fluctuation segments), terminal data (terminal MAC, connection time, connection frequency). When the flow is normal (not exceeding the threshold), the listener is silent and the router maintains the original set parameters.
The router receives the parameters transmitted by the server and makes setting parameter modification; and keeps listening continuously. After the event is finished, the router returns to the original parameter setting.
And receiving and decoding the information reported by the router, and quickly searching the database by comparing the time period, the router and the terminal MAC number to determine whether similar scenes appear before. And if the parameter is set, directly calling the previous setting parameter and returning the previous setting parameter to the router.
If a similar scenario does not occur if the router and terminal pair is retrieved. The terminal MAC number is used to look up the terminal type (cell phone, computer or other). And comparing the parameters in respective preset scene databases according to the terminal types. For example, at 8 o' clock, the computer end keeps higher flow at night and has frequent interaction with the public network, the system judges that the user scene is an instant network game, the system improves the priority of the event, obtains the router parameter corresponding to the event, records the event and other basic information (time period, router and terminal MAC number) and makes new event reference. And returns the parameters to the router.
And while continuously judging the same scene and giving parameters, the server updates the parameters of the event router, so that the next quick retrieval effect is best.
The invention sets threshold value and monitor on the router; the server can make a judgment on the user scene through the reported information and set the priority of the terminal equipment to change the router setting. The user scene judgment on the server has a learning function, reasonable preset scenes and parameter values are set through big data processing, and the accuracy of scene judgment is improved through accurate positioning of a single router and a terminal.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.