Disclosure of Invention
The invention mainly aims to provide an ONU (optical network Unit) on-line management method, an ONU on-line management system and a readable storage medium, and aims to solve the problem that an OLT cannot quickly acquire ONU License transmitted by a network manager when the number of on-line ONU is large.
In a first aspect, the present invention provides an ONU line management method, where the ONU line management method includes:
When an ONU needs to be on line, a main OLT corresponding to the ONU needs to be on line compares whether the number of the ONU needs to be on line is smaller than or equal to the ONU License residual number of the partition where the ONU needs to be on line, wherein the main OLT is any OLT in one partition after the network manager partitions all the OLTs;
If the number of the ONUs needing to be online is smaller than or equal to the remaining number of the ONUs License of the partition where the ONUs needing to be online are located, the main OLT distributes the ONU License of the number required by the ONUs needing to be online to the OLT to which the ONUs needing to be online belong.
Optionally, after the step of comparing, by the main OLT corresponding to the ONU requiring the line to determine whether the number of ONUs requiring the line is less than or equal to the remaining number of ONU License in the partition where the ONU requiring the line is located, the method includes:
If the number of the ONU needing to be on line is larger than the ONU License remaining number of the partition where the ONU needing to be on line is located, the main OLT subtracts the ONU License remaining number of the partition where the ONU needing to be on line from the number of the ONU needing to be on line to obtain a first difference value, and sends the first difference value to a network manager;
the network manager compares the first difference value with the remaining quantity of the total ONU License;
If the first difference value is smaller than or equal to the remaining quantity of the total ONU License, the network manager distributes the ONU License with the same quantity as the first difference value to the main OLT in the subarea where the ONU needing to be on line is located.
Optionally, after the step of comparing the first difference value with the remaining number of total ONU License by the network management device, the method includes:
if the first difference value is larger than the total ONU License residual quantity, the network manager subtracts the total ONU License residual quantity by using the first difference value to obtain a second difference value;
Comparing the second difference value with the sum of the residual numbers of ONU License of other partitions;
If the second difference value is smaller than or equal to the sum of the residual numbers of ONU License in other partitions, invoking ONU License with the same number as the difference value from other partitions to be distributed to a main OLT in the partition where the ONU needing to be on line is located;
And if the second difference value is larger than the sum of the ONU License residual numbers of other partitions, distributing the ONU License residual numbers of the other partitions to the main OLT in the partition where the ONU needing to be on line is located, and generating an alarm prompt.
Optionally, the ONU cable management method includes:
Step S110, the network manager detects whether partition entries exist in the database;
Step S111, if the detection result is that partition entries exist in the database, the network manager acquires all the partition entries in the database and sends an IP list of the partition member OLT and the number of the initial partition ONU License included in each partition entry to the corresponding main OLT, wherein each partition entry comprises the main OLT, the number of the initial partition ONU License and the IP list of the partition member OLT;
Step S112, the main OLT sends the initial partition ONU License number to the first partition member OLT according to the IP list of the partition member OLT;
Step S113, the first partition member OLT subtracts the self-allocated number from the initial partition ONU License number to obtain the residual number of the partition ONU License;
Step S114, detecting whether the remaining number of the partitioned ONU License is greater than or equal to zero, if so, executing step S118, and if so, executing step S115;
Step S115, detecting whether the number of the initial partition ONU License is greater than zero, if so, executing step S116, and if so, executing step S117;
Step S116, determining the number of ONUs needing to be offline under the first partition member OLT based on the remaining number of the partition ONU License, and downloading the ONUs based on the number of the ONUs needing to be offline, and updating the allocated number of the first partition member OLT to the initial partition ONU License number;
step S117, all ONUs under the first partition member OLT are disconnected, and the allocated quantity of the first partition member OLT is updated to be zero;
And step S118, deleting the IP of the first partition member OLT from the IP list of the partition member OLT to obtain a new IP list of the partition member OLT, taking the new IP list of the partition member OLT as the IP list of the partition member OLT, taking the residual quantity of the partition ONU License as the initial partition ONU License quantity, and executing the step of sending the initial partition ONU License quantity to the first partition member OLT by the main OLT according to the IP list of the partition member OLT until the IP list of the partition member OLT is empty to obtain the final residual quantity of the partition ONU License and the self-allocated quantity of each partition member, wherein the final residual quantity of the partition ONU License is the residual quantity of the partition ONU License.
Optionally, after the step of detecting whether the partition entry exists in the database by the network manager, the method includes:
if the detection result is that the partition entry does not exist in the database, the network manager acquires lists of all the OLTs from the database;
the network manager partitions all the OLTs based on the lists of all the OLTs, wherein the OLTs of the same network segment are in the same partition.
Optionally, after the step of obtaining the remaining number of the final partition ONU License and the self-allocated number of each partition member until the IP list of the partition member OLT is empty, the method includes:
the main OLT detects whether the residual quantity of the final partitioned ONU License is a negative number;
if the number is negative, the main OLT sends an application for distributing ONU License number which is the same as the absolute value of the negative number to the network manager;
After receiving an application sent by a main OLT, a network manager detects whether the residual quantity of the total ONU License meets the application;
if so, the network manager distributes ONU License with the same number as the negative absolute value to the main OLT.
Optionally, the ONU cable management method further includes:
the network manager detects whether an OLT which is offline or online exists;
when the OLT is on line, the newly-on-line OLT sends a request for applying to join the partition to all the main OLTs;
The main OLT which receives the request sends the IP of the newly-online OLT to a network manager, and the network manager and the main OLT add the IP of the newly-online OLT to an IP list of the partition member OLT;
The OLT which is newly connected with the network sends a request for distributing ONU License to the main OLT of the partition according to the number of the ONU which is required to be connected with the network;
after receiving the request, the main OLT executes the step of comparing whether the number of the ONU needing to be on-line is smaller than or equal to the ONU License residual number of the partition where the ONU needing to be on-line is located by the main OLT corresponding to the ONU needing to be on-line;
when the OLT is offline, the main OLT and the network manager delete the offline OLT from the IP list of the partition member OLT.
In a second aspect, the present invention further provides an ONU cable management system, where the ONU cable management system includes a main OLT configured to:
When the ONU is required to be on line in the partition where the main OLT is located, comparing whether the number of the ONU required to be on line is smaller than or equal to the remaining number of ONU License in the partition where the ONU required to be on line is located, wherein the main OLT is any OLT in one partition after the network manager partitions all the OLTs;
if the number of the ONU needing to be online is smaller than or equal to the remaining number of the ONU License of the partition where the ONU needing to be online is located, the ONU License of the number required by the ONU needing to be online is distributed to the OLT to which the ONU needing to be online belongs.
Optionally, the main OLT is further configured to:
If the number of the ONU needing to be on line is larger than the ONU License remaining number of the partition where the ONU needing to be on line is located, subtracting the ONU License remaining number of the partition where the ONU needing to be on line from the number of the ONU needing to be on line to obtain a first difference value, and sending the first difference value to a network manager;
ONU management system that manages still includes the network management, is used for:
Receiving the first difference value sent by the main OLT, and comparing the first difference value with the residual quantity of the total ONU License;
and if the first difference value is smaller than or equal to the remaining quantity of the total ONU License, distributing the ONU License with the same quantity as the first difference value to a main OLT in a partition where the ONU needing to be on line is located.
In a third aspect, the present invention further provides a readable storage medium, where an ONU on-line management program is stored, where the ONU on-line management program, when executed by a processor, implements the steps of the ONU on-line management method described above.
In the invention, when the ONU needs to be on line, a main OLT corresponding to the ONU needs to be on line compares whether the number of the ONU needs to be on line is smaller than or equal to the ONU License remaining number of the subarea where the ONU needs to be on line, wherein the main OLT is any OLT in one subarea after all the OLTs are subareas by a network manager, and if the number of the ONU needs to be on line is smaller than or equal to the ONU License remaining number of the subarea where the ONU needs to be on line, the main OLT distributes the ONU License of the number required by the ONU needs to be on line to the OLT to which the ONU needs to be on line belongs. By the method, when the ONU needs to be on line, the ONU License is directly distributed to the OLT to which the ONU needs to be on line by the main OLT corresponding to the ONU needs to be on line, and the network management does not need to distribute the ONU License to the OLT, so that even if the number of the ONU needs to be on line is more, the ONU License is distributed to the OLT to which the ONU needs to be on line by the main OLT corresponding to each ONU needs to be on line, the number of ONU License applications sent by the OLT to the network management is reduced, a large number of applications are prevented from waiting for network management processing in a network management queue, and the problem that the ONU License sent by the OLT cannot be quickly acquired when the number of the ONU needs to be on line is solved.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In a first aspect, an embodiment of the present invention provides an ONU network management method.
In an embodiment, referring to fig. 1, fig. 1 is a flowchart illustrating a first embodiment of an ONU management method according to the present invention. As shown in fig. 1, the ONU network management method includes:
Step S10, when an ONU needs to be on line, comparing whether the number of the ONU which needs to be on line is smaller than or equal to the ONU License remaining number of the partition where the ONU which needs to be on line is located by a main OLT corresponding to the ONU which needs to be on line, wherein the main OLT is any OLT in one partition after the network manager partitions all the OLTs;
In this embodiment, when an ONU needs to be on-line, the OLT to which the ONU belongs is determined first, and then the main OLT of the partition where the ONU needs to be on-line is determined according to the OLT to which the ONU belongs. After determining the main OLT of the partition where the ONU needing to be online is located, comparing whether the number of the ONU needing to be online is smaller than or equal to the ONU License remaining number of the partition where the ONU needing to be online is located by the main OLT corresponding to the ONU needing to be online. The main OLT is any OLT in a partition after the network manager partitions all the OLTs. It should be noted that a plurality of ONUs may be suspended by an optical splitter under one OLT.
In step S20, if the number of ONUs needing to be online is less than or equal to the remaining number of ONU License in the partition where the ONUs needing to be online are located, the main OLT allocates the number of ONU License needed by the ONUs needing to be online to the OLT to which the ONUs needing to be online belong.
In this embodiment, if the number of ONUs needing to be online is smaller than or equal to the remaining number of ONU License in the partition where the ONUs needing to be online are located, the main OLT of the partition where the ONUs needing to be online directly distributes the number of ONU License needed by the ONUs needing to be online to the OLT to which the ONUs needing to be online belong. Specifically, if 5 ONUs need to be on line and the OLT to which the 5 ONUs belong is the first member OLT in the first partition, and the remaining number of ONU License in the partition where the ONU needs to be on line is 10, the main OLT in the first partition directly allocates 5 ONU License to the first member OLT.
In this embodiment, when an ONU needs to be on line, a main OLT corresponding to the ONU that needs to be on line compares whether the number of ONUs that need to be on line is smaller than or equal to the remaining number of ONUs License in the partition where the ONU that needs to be on line is located, where the main OLT is any OLT in a partition after partitioning all the OLTs by the network manager, and if the number of ONUs that need to be on line is smaller than or equal to the remaining number of ONUs License in the partition where the ONU that needs to be on line is located, the main OLT allocates the OLT that belongs to the ONU that needs to be on line with the ONU License that needs to be on line. Through the embodiment, when the ONU needs to be on line, the ONU License is directly distributed to the OLT to which the ONU needs to be on line by the main OLT corresponding to the ONU needs to be on line, and the network management does not need to distribute the ONU License to the OLT, so that even if the number of the ONU needs to be on line is more, the ONU License is distributed to the OLT to which the ONU needs to be on line by the main OLT corresponding to each ONU needs to be on line, the number of ONU License applications sent by the OLT to the network management is reduced, a large number of applications are prevented from waiting for the network management to be processed in a network management queue, and the problem that the ONU License sent by the network management cannot be quickly acquired by the OLT when the number of the ONU needs to be on line is more is solved.
Further, in an embodiment, referring to fig. 2, fig. 2 is a flowchart of a second embodiment of the ONU network management method according to the present invention. As shown in fig. 2, after step S10, it includes:
Step S30, if the number of the ONU needing to be on line is larger than the ONU License remaining number of the partition where the ONU needing to be on line is located, the main OLT subtracts the ONU License remaining number of the partition where the ONU needing to be on line is located from the number of the ONU needing to be on line to obtain a first difference value, and sends the first difference value to the network manager;
step S40, the network manager compares the first difference value with the residual quantity of the total ONU License;
And step S50, if the first difference value is smaller than or equal to the residual quantity of the total ONU License, the network manager distributes the ONU License with the same quantity as the first difference value to the main OLT in the partition where the ONU needing to be on line is located.
In this embodiment, if the number of ONUs needing to be online is greater than the remaining number of ONUs in the partition where the ONUs needing to be online are located, the remaining number of ONUs in the partition where the ONUs needing to be online are located is indicated to be insufficient, and then the main OLT corresponding to the ONUs needing to be online subtracts the remaining number of ONUs in the partition where the ONUs needing to be online from the number of ONUs needing to be online, where the obtained difference is recorded as a first difference, and the first difference is the number of ONUs in the partition where the ONUs needing to be online are still absent. And the main OLT corresponding to the ONU which needs to be on line sends the first difference value to the network manager, and applies for supplement to the network manager.
After receiving a first difference value sent by a main OLT corresponding to an ONU which needs to be on line, the network manager compares the first difference value with the remaining quantity of the total ONU License and judges whether the remaining quantity of the total ONU License at the network manager is sufficient.
If the first difference value is smaller than or equal to the remaining amount of the total ONU License, the remaining amount of the total ONU License at the network manager is sufficient, and the network manager distributes the ONU License with the same amount as the first difference value to the main OLT in the zone where the ONU needing to be on line is located.
Specifically, if the number of ONUs needing to be on line is 5, and the OLT to which 2 ONUs needing to be on line belong is a second member OLT in the first partition, the OLT to which the other 3 ONUs needing to be on line belong is a member OLT in the second partition, the remaining number of ONU License in the first partition is 0, the remaining number of ONU License in the second partition is 2, the first difference value calculated by the first partition is 2, the first difference value calculated by the second partition is 1, 2 ONU License are applied for network management by the main OLT in the first partition, and 1 ONU License is applied for network management by the main OLT in the second partition. If the total ONU License remaining number at the network manager is 4, the network manager allocates 2 ONU licenses to the main OLT in the first partition and allocates 1 ONU License to the main OLT in the second partition. It is easy to think that after the network manager allocates the same number of ONU License as the first difference to the main OLT in the zone where the ONU requiring the line is located, the number of ONUs requiring the line is equal to the remaining number of ONU License in the zone where the ONU requiring the line is located.
Further, in an embodiment, referring to fig. 3, fig. 3 is a flowchart illustrating a third embodiment of an ONU connection management method according to the present invention. As shown in fig. 3, after step S40, it includes:
Step S60, if the first difference value is larger than the total ONU License residual quantity, the network manager subtracts the total ONU License residual quantity by using the first difference value to obtain a second difference value;
step S70, comparing the second difference value with the sum of the residual numbers of ONU License of other partitions;
Step S80, if the second difference value is smaller than or equal to the sum of the residual numbers of ONU License in other partitions, invoking the ONU License with the same number as the difference value from the other partitions to be distributed to the main OLT in the partition where the ONU needing to be on line is located;
And step S90, if the second difference value is larger than the sum of the ONU License residual numbers of other partitions, distributing the ONU License residual numbers of the other partitions to the main OLT in the partition where the ONU needing to be on line is located, and generating an alarm prompt.
In this embodiment, if the first difference value calculated by the first partition is 10 and the total ONU License remaining number at the network manager is 3, the total ONU License remaining number at the network manager is insufficient, and the difference value obtained by subtracting the total ONU License remaining number from the first difference value calculated by the network manager by using the first partition is recorded as the second difference value. And the second difference value is the number of ONU License distributed to the main OLT of the first partition by the network manager when the total ONU License remaining number at the network manager is 0.
When the total ONU License remaining quantity at the network manager is insufficient, the network manager compares the second difference value with the ONU License remaining quantity sum of other partitions. If the sum of the remaining amounts of the ONU License of the other partitions is 9, the second difference 7 is smaller than the sum of the remaining amounts of the ONU License of the other partitions, and the network manager calls 7 ONU License from the other partitions to be distributed to the main OLT of the first partition. It is easy to think that after the network manager calls 7 ONU License from other partitions to allocate to the main OLT of the first partition, the remaining number of ONU License of the first partition is equal to the number of ONUs that need to be on line.
If the sum 6 of the remaining numbers of the ONU License in the other partition is larger than the sum 6 of the remaining numbers of the ONU License in the other partition, the network manager distributes the 6 ONU License in the other partition to the main OLT in the first partition and generates an alarm prompt, so that the user is reminded that the total number of the ONU License in the network manager is insufficient.
Further, in an embodiment, referring to fig. 4, fig. 4 is a flowchart of a fourth embodiment of the ONU network management method according to the present invention. As shown in fig. 4, the ONU network management method includes:
Step S110, the network manager detects whether partition entries exist in the database;
Step S111, if the detection result is that partition entries exist in the database, the network manager acquires all the partition entries in the database and sends an IP list of the partition member OLT and the number of the initial partition ONU License included in each partition entry to the corresponding main OLT, wherein each partition entry comprises the main OLT, the number of the initial partition ONU License and the IP list of the partition member OLT;
Step S112, the main OLT sends the initial partition ONU License number to the first partition member OLT according to the IP list of the partition member OLT;
Step S113, the first partition member OLT subtracts the self-allocated number from the initial partition ONU License number to obtain the residual number of the partition ONU License;
Step S114, detecting whether the remaining number of the partitioned ONU License is greater than or equal to zero, if so, executing step S118, and if so, executing step S115;
Step S115, detecting whether the number of the initial partition ONU License is greater than zero, if so, executing step S116, and if so, executing step S117;
Step S116, determining the number of ONUs needing to be offline under the first partition member OLT based on the remaining number of the partition ONU License, and downloading the ONUs based on the number of the ONUs needing to be offline, and updating the allocated number of the first partition member OLT to the initial partition ONU License number;
step S117, all ONUs under the first partition member OLT are disconnected, and the allocated quantity of the first partition member OLT is updated to be zero;
And step S118, deleting the IP of the first partition member OLT from the IP list of the partition member OLT to obtain a new IP list of the partition member OLT, taking the new IP list of the partition member OLT as the IP list of the partition member OLT, taking the residual quantity of the partition ONU License as the initial partition ONU License quantity, and executing the step of sending the initial partition ONU License quantity to the first partition member OLT by the main OLT according to the IP list of the partition member OLT until the IP list of the partition member OLT is empty to obtain the final residual quantity of the partition ONU License and the self-allocated quantity of each partition member, wherein the final residual quantity of the partition ONU License is the residual quantity of the partition ONU License.
In this embodiment, the network manager detects whether partition entries exist in the database, if the detection result is that partition entries exist in the database, all OLTs have been partitioned, and then the network manager obtains all partition entries in the database and sends an IP list of partition member OLTs and the number of initial partition ONU License included in each partition entry to the corresponding main OLT, where each partition entry includes the main OLT, the number of initial partition ONU License, and the IP list of partition member OLTs. Specifically, if the network manager obtains 3 partition entries from the database, the network manager sends the IP list of the partition member OLT and the initial partition ONU License number included in the first partition entry to the main OLT included in the first partition entry, sends the IP list of the partition member OLT and the initial partition ONU License number included in the second partition entry to the main OLT included in the second partition entry, and sends the IP list of the partition member OLT and the initial partition ONU License number included in the third partition entry to the main OLT included in the third partition entry.
After all the partitioned main OLTs receive the IP lists of the partition member OLTs and the initial partition ONU License numbers sent by the network manager, each main OLT sends the initial partition ONU License numbers to the first partition member OLT according to the respective IP lists of the partition member OLTs. If the number of the initial ONU License of the first partition obtained from the database by the network manager is 15, the number of the initial ONU License of the first partition is 15.
Taking the first partition as an example for illustration, the main OLT in the first partition sends the initial partition ONU License number of the first partition to the first partition member OLT in the first partition according to the IP list of the partition member OLT in the first partition. After receiving the number of the initial partition ONU License of the first partition, the first partition member OLT_1 in the first partition subtracts the allocated number by using the number of the initial partition ONU License to obtain the remaining number of the partition ONU License. Specifically, if the number of the initial ONU License of the first partition is 15 and the number of the ONU License allocated to the first partition member olt_1 is 5, subtracting the number of the ONU License allocated to the first partition member olt_1 from the number of the ONU License of the first partition member olt_1 by using the number of the ONU License of the initial partition onu_1, where the obtained difference 10 is the remaining number of the ONU License of the first partition, that is, the remaining number of the ONU License of the first partition is 10, where the number of the ONU License allocated to the first partition member is the number of the ONU License allocated to the first partition member, and the number of the ONU License allocated to the first partition member is in one-to-one correspondence with the number of the ONU on-line under the first partition member.
Since the remaining number of the partition ONUs License of the first partition is 10 and greater than 0, step S118 is performed, i.e. the IP of the first partition member olt_1 is deleted from the IP list of the partition member OLT of the first partition, so as to obtain a new IP list of the partition member OLT, and it is easy to think that after deleting the IP of the first partition member olt_1, the second partition member olt_2 becomes the first partition member. Then, the step of sending the initial number of the partition ONU License to the first partition member OLT according to the IP list of the partition member OLT is executed by taking the new IP list of the partition member OLT as the IP list of the partition member OLT and taking the remaining number 10 of the partition ONU License as the initial number of the partition ONU License, that is, the step S112 is executed in return. That is, the main OLT in the first partition sends the initial partition ONU License number 10 of the first partition to the first partition member olt_2 in the first partition according to the IP list of the partition member OLTs.
After receiving the number of the initial partition ONU License of the first partition, the first partition member OLT_2 subtracts the allocated number by using the number of the initial partition ONU License to obtain the remaining number of the partition ONU License. Specifically, if the number of allocated ONU License of the first partition member olt_2 is 6, subtracting the allocated number 6 from the initial partition ONU License number 10, where the obtained difference is the remaining number of partition ONU License of the first partition, where the remaining number of partition ONU License of the first partition is 4.
Since the remaining number of the partition ONU License of the first partition is 4 and greater than 0, step S118 is performed, in which the IP of the first partition member olt_2 is deleted from the IP list of the partition member OLT of the first partition, and a new IP list of the partition member OLT is obtained, and it is easy to think that after deleting the IP of the first partition member olt_2, the third partition member olt_3 becomes the first partition member. And then taking the IP list of the new partition member OLT as the IP list of the partition member OLT, taking the residual quantity 4 of the partition ONU License as the quantity of the initial partition ONU License, executing the step that the main OLT sends the quantity of the initial partition ONU License to the first partition member OLT according to the IP list of the partition member OLT, namely returning to executing the step S112. That is, the main OLT in the first partition sends the initial partition ONU License number 4 of the first partition to the first partition member olt_3 in the first partition according to the IP list of the partition member OLTs.
After receiving the number of the initial partition ONU License of the first partition, the first partition member OLT_3 subtracts the allocated number by using the number of the initial partition ONU License to obtain the remaining number of the partition ONU License. Specifically, if the number of allocated ONU License of the first partition member olt_3 is 5, subtracting the number of allocated ONU License of the first partition member olt_3 from the number of original ONU License of the first partition 4 by the number of allocated ONU License of the first partition member olt_3 5 to obtain the remaining number of ONU License-1.
At this time, the remaining number of the ONU License in the partition is less than 0, so step S115 is performed to detect whether the number of the ONU License in the initial partition is greater than zero, and because the number of the ONU License in the initial partition is greater than zero, step S116 is performed to determine that 1 ONU is required to be down in the first partition member olt_3 based on the remaining number of the ONU License in the partition 1, then the ONU that has been down in the first partition member olt_3 is down one, and the self-assigned number of the first partition member olt_3 is updated to 4. Further, after the first partition member olt_3 is disconnected from the disconnected ONU, if the disconnected ONU needs to be disconnected again, the step S10 is executed again.
After updating the allocated number of the first partition member olt_3 to 4, the IP of the first partition member olt_3 is deleted from the IP list of the partition member OLT of the first partition, so as to obtain a new IP list of the partition member OLT, and it is easy to think that after deleting the IP of the first partition member olt_3, the fourth partition member olt_4 becomes the first partition member. And then taking the IP list of the new partition member OLT as the IP list of the partition member OLT, taking the residual quantity-1 of the partition ONU License as the quantity of the initial partition ONU License, executing the step that the main OLT sends the quantity of the initial partition ONU License to the first partition member OLT according to the IP list of the partition member OLT, namely returning to executing the step S112. That is, the main OLT in the first partition sends the initial partition ONU License number-1 of the first partition to the first partition member olt_4 in the first partition according to the IP list of the partition member OLT.
After receiving the number of the initial partition ONU License of the first partition, the first partition member OLT_4 subtracts the allocated number by using the number of the initial partition ONU License to obtain the remaining number of the partition ONU License. Specifically, if the allocated number of ONU License of the first partition member olt_4 is 2, subtracting the allocated number 2 of the first partition member olt_4 from the initial number-1 of ONU License of the first partition to obtain the remaining number-3 of ONU License of the partition.
At this time, the remaining number of the ONU License partitions-3 is smaller than 0, so step S115 is performed to detect whether the number of the ONU License partitions initially is larger than zero. Because the number of the initially partitioned ONUs License-1 is smaller than zero, step S117 is executed to completely down-line the ONUs that have been down-line from the first partition member olt_4, and update the allocated number of the first partition member olt_4 to 0.
After updating the self-allocated number of the first partition member olt_4 to 0, the IP of the first partition member olt_4 is deleted from the IP list of the partition member OLT of the first partition.
After deleting the IP of the first partition member olt_4 from the IP list of the partition member OLT of the first partition, if the IP list of the partition member OLT is empty, the final remaining number-3 of the partition ONU License and the self-assigned number of each partition member are obtained, where the final remaining number-3 of the partition ONU License is the remaining number of the ONU License of the first partition, the self-assigned number of the first partition member olt_1 in the first partition is 5, the self-assigned number of the second partition member olt_2 is 6, the self-assigned number of the third partition member olt_3 is 4, and the self-assigned number of the fourth partition member olt_4 is 0.
After deleting the IP of the first partition member olt_4 from the IP list of the partition member OLT of the first partition, if the IP list of the partition member OLT is not null, continuing to use the new IP list of the partition member OLT as the IP list of the partition member OLT, using the remaining number of partition ONUs as the number of initial partition ONUs, and executing the step of the main OLT transmitting the number of initial partition ONUs to the first partition member OLT according to the IP list of the partition member OLT, i.e. returning to execute step S112 until the IP list of the partition member OLT is null. Preferably, the main OLT is used as the last member OLT, so that whether the initial partition ONU License number is subtracted by the self-allocated number of the first partition member OLT to obtain the partition ONU License remaining number, or the self-allocated number of the first partition member OLT is subtracted by the initial partition ONU License number to obtain the partition ONU License remaining number, because the last partition member OLT is the main OLT, the main OLT can directly know the partition ONU License remaining number of the partition without transmitting the other member OLT, and the main OLT can directly allocate itself after acquiring the ONU License from the network manager, so that interaction between OLT devices is reduced, and efficiency is improved.
Further, after the partition member olt_1, the partition member olt_2, the partition member olt_3, and the partition member olt_4 receive the number of the initial partition ONU License of the first partition, the partition member OLT stores the IP of the main OLT, so that the request for allocating the ONU License is sent to the main OLT.
Further, after the main OLT sends the initial number of the partitioned ONU License to the first partition member, if the first partition member OLT is online, the first partition member OLT subtracts the allocated number from the initial number of the partitioned ONU License to obtain the remaining number of the partitioned ONU License, and returns the remaining number of the partitioned ONU License to the main OLT. If the main OLT does not receive the residual quantity of the partition ONU License replied by the first partition member OLT, determining that the first partition member OLT is down, and after the final residual quantity of the partition ONU License is obtained, updating an ONU License state table by the main OLT based on the self-allocated quantity of each partition member and the IP of the online partition member OLT, wherein the ONU License state table comprises the IP list of the partition member OLT and the self-allocated quantity of the partition member OLT. That is, the IP of the downstream partition member OLT is deleted from the IP list of the partition member OLT included in the ONU License state table. And the main OLT transmits the remaining number of the partition ONU License and the IP of the online partition member OLT to the network manager so as to update the partition entry. It should be noted that, if the network manager does not allocate the ONU License to the first partition, the number of ONU License in the initial partition of the first partition is unchanged.
Further, in an embodiment, after the step of detecting whether the partition entry exists in the database by the network manager, the method includes:
if the detection result is that the partition entry does not exist in the database, the network manager acquires lists of all the OLTs from the database;
the network manager partitions all the OLTs based on the lists of all the OLTs, wherein the OLTs of the same network segment are in the same partition.
In this embodiment, if the detection result of the network manager detecting whether the partition entry exists in the database is that the partition entry does not exist in the database, the network manager acquires the lists of all OLTs from the database. And then sending a partition request to any online OLT, sending a broadcast packet to the network segment by the OLT, collecting an IP list of the OLT in the network segment, reporting the IP list to a network manager, and generating a partition entry by the network manager according to the IP list of the OLT in the same network segment sent by the OLT, wherein the content of the partition entry comprises the main OLT, the number of the initial partition ONU License and the IP list of the partition member OLT, the initial value of the number of the initial partition ONU License is 0, namely the network manager does not allocate the ONU License to the partition, so that the initial value of the number of the initial partition ONU License is 0. And then, the network manager filters the OLTs corresponding to the IP lists of the OLTs transmitted by the OLTs from all the OLT lists, and then continuously transmits a partition request to an online OLT, and the like, and finally partitions all the OLTs.
Further, in an embodiment, after the step of obtaining the remaining number of the final partition ONU License and the self-allocated number of each partition member until the IP list of the partition member OLT is empty, the method includes:
the main OLT detects whether the residual quantity of the final partitioned ONU License is a negative number;
if the number is negative, the main OLT sends an application for distributing ONU License number which is the same as the absolute value of the negative number to the network manager;
After receiving an application sent by a main OLT, a network manager detects whether the residual quantity of the total ONU License meets the application;
if so, the network manager distributes ONU License with the same number as the negative absolute value to the main OLT.
In this embodiment, after the final remaining number of the ONU License of the partition and the self-allocated number of each partition member are obtained, the main OLT detects whether the final remaining number of the ONU License of the partition obtained is a positive number, and if the final remaining number is a positive number, the remaining number indicates that the ONU License of the partition is sufficient, and does not perform processing. If negative, the number of ONU License in the partition is insufficient.
Taking the final partition ONU License remaining number as-5 as an example, the main OLT sends a request for distributing 5 ONU licenses to the network manager, after receiving the request sent by the main OLT, the network manager detects whether the total ONU License remaining number is greater than or equal to 5, if the total ONU License remaining number is greater than or equal to 5, the total ONU License remaining number meets the request sent by the main OLT, the network manager distributes 5 ONU licenses to the main OLT, if the total ONU License remaining number is less than 5, all ONU licenses are distributed to the main OLT, specifically, if the total ONU License remaining number is 3, 3 ONU licenses are distributed to the main OLT, and other processing is not performed.
Further, in an embodiment, referring to fig. 5, fig. 5 is a flowchart of a fifth embodiment of an ONU connection management method according to the present invention. As shown in fig. 5, the ONU network management method further includes:
step S210, the network manager detects whether there is an OLT which is offline or online;
step S211, when the OLT is on line, the newly-on-line OLT sends a request for applying to join the partition to all the main OLTs;
step S212, the main OLT which receives the request sends the IP of the newly-uploaded OLT to a network manager, and the network manager and the main OLT add the IP of the newly-uploaded OLT to an IP list of the partition member OLT;
Step S213, the newly-online OLT sends a request for distributing ONU License to the main OLT of the partition according to the number of ONU needing to be online;
step S214, after the main OLT receives the request, the main OLT corresponding to the ONU needing to be on line compares whether the number of the ONU needing to be on line is smaller than or equal to the ONU License residual number of the partition where the ONU needing to be on line is located;
in step S215, when the OLT is offline, the main OLT and the network manager delete the offline OLT from the IP list of the partition member OLT.
In this embodiment, the network manager detects whether there is an OLT that is offline or online, and if the network manager detects that there is an OLT that is online, the network manager sends the IPs of all the main OLTs to the OLT that is newly online. The OLT newly on line sends a request for requesting to join the partition to all the main OLTs by unicast, or the OLT newly on line sends a request for requesting to join the partition to all the main OLTs by multicast (multicast).
The main OLT which is in a different network section with the newly-uploaded OLT cannot receive a request sent by the new OLT, so that the main OLT which receives the request and the newly-uploaded OLT are in the same network section, and the OLT in the same network section belongs to the same partition, so that the IP of the newly-uploaded OLT is added to an IP list of the partition member OLTs by the main OLT which receives the request, and an ONU License state table is updated, wherein the ONU License state table comprises the IP list of the partition member OLTs and the self-allocated number of the partition member OLTs, the main OLT which receives the request also sends the IP of the newly-uploaded OLT to a network manager, and the network manager also needs to add the IP of the newly-uploaded OLT to the IP list of the partition member OLT, and update partition entries, and the partition entries comprise the main OLT, the initial partition ONU License number and the IP list of the partition member OLT.
After the main OLT and the network manager which receive the request add the IP of the new online OLT to the IP list of the partition member OLT, the new online OLT sends a request for distributing ONU License to the main OLT of the partition according to the number of the ONU which needs to be online, and after the main OLT receives the request sent by the new OLT, the main OLT corresponding to the ONU which needs to be online compares whether the number of the ONU which needs to be online is smaller than or equal to the remaining number of the ONU License of the partition in which the ONU which needs to be online is located, so that the ONU which needs to be online can be online.
When the OLT is offline, the main OLT deletes the offline OLT from the IP list of the partition member OLT and updates the ONU License state table, and the network manager deletes the offline OLT from the IP list of the partition member OLT and updates the partition entry so that the ONU License allocated to the OLT is in an idle state so as to be called, thereby improving the utilization rate of the ONU License.
In a second aspect, the embodiment of the invention further provides an ONU network management system.
In an embodiment, referring to fig. 6, fig. 6 is a schematic diagram of an ONU network management system according to an embodiment of the present invention. As shown in fig. 6, the ONU network management system includes a main OLT configured to:
The system comprises a main OLT and a network management server, wherein the main OLT is used for comparing whether the number of the ONU needing to be on-line is smaller than or equal to the ONU License remaining number of the partition where the ONU needing to be on-line is located when the partition where the main OLT is located has the ONU needing to be on-line, and the main OLT is any OLT in one partition after the network management server partitions all the OLTs;
And the main OLT is also used for distributing ONU License of the number required by the ONU needing to be on line to the OLT to which the ONU needing to be on line belongs if the number of the ONU needing to be on line is smaller than or equal to the remaining number of the ONU License of the partition where the ONU needing to be on line is located.
Further, in an embodiment, the main OLT is further configured to:
If the number of the ONU needing to be on line is larger than the ONU License remaining number of the partition where the ONU needing to be on line is located, subtracting the ONU License remaining number of the partition where the ONU needing to be on line from the number of the ONU needing to be on line to obtain a first difference value, and sending the first difference value to a network manager;
ONU management system that manages still includes the network management, is used for:
Receiving the first difference value sent by the main OLT, and comparing the first difference value with the residual quantity of the total ONU License;
and if the first difference value is smaller than or equal to the remaining quantity of the total ONU License, distributing the ONU License with the same quantity as the first difference value to a main OLT in a partition where the ONU needing to be on line is located.
Further, in an embodiment, the network manager is configured to:
if the first difference value is larger than the total ONU License residual quantity, subtracting the total ONU License residual quantity from the first difference value to obtain a second difference value;
Comparing the second difference value with the sum of the residual numbers of ONU License of other partitions;
If the second difference value is smaller than or equal to the sum of the residual numbers of ONU License in other partitions, invoking ONU License with the same number as the difference value from other partitions to be distributed to a main OLT in the partition where the ONU needing to be on line is located;
And if the second difference value is larger than the sum of the ONU License residual numbers of other partitions, distributing the ONU License residual numbers of the other partitions to the main OLT in the partition where the ONU needing to be on line is located, and generating an alarm prompt.
Further, in an embodiment, the network manager is configured to:
detecting whether partition entries exist in a database;
If the detection result is that partition items exist in the database, acquiring all the partition items in the database, and sending an IP list of a partition member OLT and the number of initial partition ONU License included in each partition item to a corresponding main OLT, wherein each partition item comprises the main OLT, the number of initial partition ONU License and the IP list of the partition member OLT;
The main OLT is further configured to:
according to the IP list of the partition member OLT, the initial partition ONU License number is sent to the first partition member OLT;
the ONU management system further comprises a first partition member OLT, which is used for:
receiving the number of the initial partition ONU License sent by the main OLT;
subtracting the self-allocated number from the initial ONU License number to obtain the residual number of the ONU License;
detecting whether the residual number of the partitioned ONU License is larger than or equal to zero;
If the remaining number of the partitioned ONU License is greater than or equal to zero, deleting the IP of the partitioned ONU License from the IP list of the partitioned member OLT to obtain a new IP list of the partitioned member OLT, taking the new IP list of the partitioned member OLT as the IP list of the partitioned member OLT, taking the remaining number of the partitioned ONU License as the initial number of the partitioned ONU License, and executing the step of receiving the initial number of the partitioned ONU License sent by the main OLT until the IP list of the partitioned member OLT is empty to obtain a final remaining number of the partitioned ONU License and the self-allocated number of each partitioned member, wherein the final remaining number of the partitioned ONU License is the remaining number of the partitioned ONU License;
If the remaining number of the ONU License in the partition is smaller than zero, detecting whether the number of the ONU License in the initial partition is larger than zero or not;
If the number of the initial partition ONU License is larger than zero, determining the number of the ONU needing to be offline based on the remaining number of the partition ONU License, and downloading the ONU based on the number of the ONU needing to be offline, and updating the allocated number to the number of the initial partition ONU License;
If the number of the initially partitioned ONU License is smaller than or equal to zero, all the online ONUs are disconnected, and the allocated number of the online ONUs is updated to zero;
Deleting own IP from the IP list of the partition member OLT to obtain a new IP list of the partition member OLT, taking the new IP list of the partition member OLT as the IP list of the partition member OLT, taking the residual quantity of the partition ONU License as the quantity of the initial partition ONU License, and executing the step of receiving the quantity of the initial partition ONU License sent by the main OLT until the IP list of the partition member OLT is empty to obtain the final residual quantity of the partition ONU License and the self-allocated quantity of each partition member, wherein the final residual quantity of the partition ONU License is the residual quantity of the partition ONU License.
Further, in an embodiment, the network manager is configured to:
If the detection result is that the partition entry does not exist in the database, acquiring lists of all the OLTs from the database;
And partitioning all the OLTs based on the lists of all the OLTs, wherein the OLTs of the same network segment are in the same partition.
Further, in an embodiment, the main OLT is configured to:
Detecting whether the residual quantity of the final partitioned ONU License is negative;
If the number is negative, an application for distributing ONU License number which is the same as the absolute value of the negative number is sent to a network manager;
The network manager is used for detecting whether the residual quantity of the total ONU License meets the application after receiving the application sent by the main OLT;
if so, the ONU License with the same number as the negative absolute value is allocated to the main OLT.
Further, in an embodiment, the network manager is configured to:
detecting whether an OLT which is offline or online exists;
the ONU online management system further comprises an OLT for new online, and the OLT is used for:
when a newly-online OLT exists, a request for applying to join in a partition is sent to all the main OLTs;
The main OLT is used for sending the IP of the newly-online OLT to the network manager after receiving the request;
The network manager and the main OLT are used for adding the IP of the newly-online OLT to an IP list of the partition member OLT;
The OLT which is newly connected with the network is used for sending a request for distributing ONU License to the main OLT of the partition according to the number of the ONU which is required to be connected with the network;
After receiving the request, the main OLT is configured to perform a step of comparing whether the number of ONUs needing to be on-line is less than or equal to the remaining number of ONUs License in the partition where the ONUs needing to be on-line are located when the partition where the main OLT is located has ONUs needing to be on-line;
The network manager and the main OLT are also used for deleting the offline OLT from the IP list of the partition member OLT when the OLT is offline.
The function implementation of each module in the ONU network management system corresponds to each step in the ONU network management method embodiment, and the function and implementation process of the ONU network management system are not described here in detail.
In a third aspect, embodiments of the present invention also provide a readable storage medium.
The invention stores the ONU on-line management program on the readable storage medium, wherein the ONU on-line management program realizes the steps of the ONU on-line management method when being executed by a processor.
The method implemented when the ONU network management procedure is executed may refer to each embodiment of the ONU network management method according to the present invention, which is not described 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 one does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising several instructions for causing a terminal device to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.