Summary of the invention
The purpose of the embodiment of the present application is to provide method for synchronizing time and a kind of time synchronism apparatus, need carry out the excessive problem of device resource consumption that the PTP functional configuration is caused at each member port to solve in the prior art.
In order to achieve the above object, the embodiment of the present application provides a kind of method for synchronizing time, comprising:
Local terminal equipment is that aggregation port enables the PTP function, chooses the activation port from the physical member port of described aggregation port, and is described activation port arrangement PTP function;
It is mutual that local terminal equipment and PTP opposite equip. carry out Role Information, utilizes the Role Information of determining to dispose described activation port;
Local terminal equipment carries out time synchronized by the activation port of described activation port and described opposite equip..
Preferably, local terminal equipment is that described aggregation port enables further to comprise after the PTP function:
Described local terminal equipment is judged the physical member port quantity of described aggregation port;
When described physical member port is two when above, after the physical member port of described aggregation port is chosen the activation port, further choose backup port other physical member port beyond described activation port, be described backup port configuration PTP function, and after determining Role Information with opposite equip., dispose described backup port according to the Role Information of determining;
When described physical member port is zero, do not do any processing.
Preferably, when the aggregation port that enables the PTP function added physical member port, described method comprised:
Described local terminal equipment is judged current physical member port quantity on this aggregation port that enables the PTP function;
When described current physical member port quantity is two when above, do not do any processing;
When described current physical member port quantity was one, the physical member port of choosing interpolation was backup port, was its configuration PTP function and Role Information;
When described current physical member port quantity is zero, choose the physical member port of this interpolation for activating port, be its configuration PTP function, to carry out Role Information mutual with opposite equip., utilize the Role Information of determining to dispose described activation port, and carry out time synchronized by the activation port of described activation port and opposite equip..
Preferably, when the physical member port of the aggregation port that enables the PTP function withdrawed from, described method comprised:
Described local terminal equipment obtains the port status of the described physical member port that withdraws from;
When the described physical member port that withdraws from is common physical member port, do not do any processing;
When the described physical member port that withdraws from is backup port, remove PTP function and the Role Information of the described physical member port that withdraws from, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port that withdraws from is when activating port, remove PTP function and the Role Information of the described physical member port that withdraws from, backup port is set to activate port, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information.
Preferably, when the physical member port of the aggregation port that enables the PTP function broke down, described method comprised:
Described local terminal equipment obtains the port status of the described physical member port that breaks down;
When the described physical member port that breaks down is common physical member port, do not do any processing;
When the described physical member port that breaks down is backup port, remove PTP function and the Role Information of the described physical member port that breaks down, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port that breaks down is when activating port, remove PTP function and the Role Information of the described physical member port that breaks down, backup port is set to activate port, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information.
Preferably,
Utilize Role Information to determine that the aggregation port of local terminal equipment is Master port or Slave port;
When the aggregation port of local terminal equipment is the Master port, it is the Master port that local terminal equipment disposes described activation port, described local terminal equipment is by the activation port transmission PTP mutual message of described activation port to opposite equip., obtain timestamp information in the mutual message of described PTP by described opposite equip., utilize described timestamp information to carry out time synchronized;
When the aggregation port of local terminal equipment is the Slave port, it is the Slave port that local terminal equipment disposes described activation port, described local terminal equipment receives the mutual message of PTP that opposite equip. sends by corresponding activation port by described activation port, obtain the timestamp information that carries in the described PTP message, utilize described timestamp information to carry out time synchronized.
The embodiment of the present application provides a kind of time synchronism apparatus, comprising:
The configuration process module is used to aggregation port to enable the PTP function, chooses the activation port from the physical member port of described aggregation port, and is described activation port arrangement PTP function;
The interaction process module is used for that to carry out Role Information mutual with the PTP opposite equip., utilizes the Role Information of determining to dispose described activation port;
Synchronous processing module is used for carrying out time synchronized by the activation port of described activation port and described opposite equip..
Preferably, also comprise:
Judge module is for the physical member port quantity of judging described aggregation port;
Described configuration process module module, concrete be used for when described physical member port be two when above, after the physical member port of described aggregation port is chosen the activation port, further choose backup port other physical member port beyond described activation port, be described backup port configuration PTP function, and after described interaction process module and opposite equip. are determined Role Information, dispose described backup port according to the Role Information of determining; When described physical member port is zero, only enable the PTP function for aggregation port.
Preferably, when the aggregation port that enables the PTP function adds physical member port,
Described judge module also is used for judging current physical member port quantity on this aggregation port that enables the PTP function;
Described configuration process module, be used for when described current physical member port quantity be two when above, do not do any processing;
When described current physical member port quantity was one, the physical member port of choosing interpolation was backup port, was its configuration PTP function and Role Information;
When described current physical member port quantity is zero, choose the physical member port of this interpolation for activating port, be its configuration PTP function, to carry out Role Information mutual with opposite equip., utilize the Role Information of determining to dispose described activation port, and carry out time synchronized by the activation port of described activation port and opposite equip..
Preferably, when the physical member port of the aggregation port that enables the PTP function withdraws from,
Described judge module is also for the port status that obtains the described physical member port that withdraws from;
Described configuration process module is used for not doing any processing when the described physical member port that withdraws from is common physical member port;
When the described physical member port that withdraws from is backup port, remove PTP function and the Role Information of the described physical member port that withdraws from, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port that withdraws from is when activating port, remove PTP function and the Role Information of the described physical member port that withdraws from, backup port is set to activate port, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information.
Preferably, when the physical member port of the aggregation port that enables the PTP function breaks down,
Described judge module is also for the port status that obtains the described physical member port that breaks down;
Described configuration process module is used for not doing any processing when the described physical member port that breaks down is common member port;
When the described physical member port that breaks down is backup port, remove PTP function and the Role Information of the described physical member port that breaks down, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port that breaks down is when activating port, remove PTP function and the Role Information of the described physical member port that breaks down, backup port is set to activate port, if when also having common physical member port in the aggregation port of the described PTP of enabling function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information.
Preferably,
Described interaction process module, concrete being used for utilizes Role Information to determine that the aggregation port of local terminal equipment is Master port or Slave port, when described aggregation port is the Master port, disposing described activation port is the Master port, when described aggregation port was the Slave port, disposing described activation port was the Slave port;
Described synchronous processing module, concrete being used for when described aggregation port is the Master port, by the activation port transmission PTP mutual message of described activation port to opposite equip., obtain timestamp information in the mutual message of described PTP by described opposite equip., utilize described timestamp information to carry out time synchronized;
When described aggregation port is the Slave port, receive opposite equip. by the mutual message of PTP that corresponding activation port sends by described activation port, obtain the timestamp information that carries in the described PTP message, utilize described timestamp information to carry out time synchronized.
Compared with prior art, the technical scheme that proposes of the embodiment of the present application has the following advantages:
Proposition by the application's scheme, realized the time synchronized based on aggregation port, reached the time synchronized with opposite equip., and by directly enabling the PTP function at aggregation port, simplified user's configuration, reduce the consumption of device resource, improved equipment performance, strengthened the stability of network topology.
Embodiment
Below in conjunction with accompanying drawing, the technical scheme among the application is clearly and completely described, obviously, described embodiment only is part embodiment, rather than whole embodiment.Based on the embodiment among the application, those of ordinary skills are not making all other embodiment that obtain under the creative work prerequisite, all belong to the scope of the application's protection.
Referring to Fig. 2, the schematic flow sheet of the time synchronized that provides for the embodiment of the present application, this flow process can comprise:
Step 201, local terminal equipment enables the PTP function to the aggregation port on the equipment of itself.
In this step, local terminal equipment is by enabling the PTP function at the self-polymerization mouth, so that the aggregation port of equipment of itself can be supported time synchronized.
Step 202, local terminal equipment are chosen activation (Active) port from the physical member port of aggregation port.
In concrete enforcement, be after aggregation port enables the PTP function, also to comprise at local terminal equipment:
Local terminal equipment is judged the physical member port quantity of aggregation port;
Local terminal equipment is chosen the activation port at first therein, can choose the high port of link idle rate in the physical member port of self-polymerization mouth according to the link principle of optimality when above when physical member port quantity is two, as activating port; After choosing the activation port, choose backup (Backup) port other physical member port outside activating port, the link idle rate of backup port is only second to the activation port;
When physical member port quantity was one, local terminal equipment was chosen for the activation port with this physical member port;
When physical member port quantity was zero, local terminal equipment was not done any processing.
Carry out choosing of port for above-mentioned according to the link idle rate, just the preferred implementation in the embodiment of the present application certainly, also can adopt other port to choose mode, as choosing according to the bandwidth of link, link load etc.
For activating port, below all replace explanation with the Active port, backup port all replaces explanation with the Backup port.
Step 203, local terminal equipment are the Active port arrangement PTP function of choosing.
Concrete, when the Backup port, for the Backup port disposes the PTP function equally.
Step 204, it is mutual that local terminal equipment and PTP opposite equip. carry out Role Information, determines the role of the aggregation port of local terminal equipment, can be Master port or Slave port.
For PTP opposite equip. wherein, refer to that this opposite equip. is applied in the PTP network;
It is mutual that local terminal equipment and PTP opposite equip. carry out Role Information, specifically comprises:
Local terminal equipment is chosen a physical member port arbitrarily (wherein in the physical member port of self-polymerization mouth, this physical member port of choosing can also be the Active port), opposite equip. is chosen a physical member port arbitrarily in the physical member port of self-polymerization mouth, it is mutual that the physical member port that local terminal equipment is chosen by the physical member port chosen and opposite equip. is carried out Role Information, obtain the other side's Role Information respectively, determine that according to this Role Information the aggregation port of equipment of itself is Master port or Slave port; When the aggregation port of local terminal equipment is the Master port, forward step 205 to, when the aggregation port of local terminal equipment is the Slave port, forward step 207 to.
Step 205, configuration Active port is the Master port.
Step 206, local terminal equipment sends the mutual message of PTP by the Active port to the Active port of opposite equip., utilizes the timestamp information in the mutual message of this PTP to carry out time synchronized by the activation port of opposite equip..
Particularly, local terminal equipment is by the Active port transmission PTP mutual message of Active port to opposite equip., carry timestamp information in the mutual message of this PTP, opposite equip. is after receiving the mutual message of this PTP, it is resolved, obtain timestamp information wherein, utilize this timestamp information poor computing time, equipment of itself is carried out time synchronized by the time difference that calculates;
Wherein, for the calculating of time difference, with poor method computing time in the prior art, so no longer do concrete elaboration at this.
Step 207, configuration Active port is the Slave port.
Step 208, local terminal equipment receives opposite equip. by the local zone time that corresponding Active port sends by the Active port, utilizes this local zone time to carry out time synchronized.
Particularly, local terminal equipment receives the mutual message of PTP of the Active port transmission of opposite equip. by the Active port, carry timestamp information in the mutual message of this PTP, the mutual message of this PTP is resolved, obtain timestamp information wherein, utilize this timestamp information poor computing time, equipment of itself is carried out time synchronized by the time difference that calculates.
In the present embodiment, local terminal equipment enables the PTP function to the aggregation port on the equipment of itself, from the physical member port of aggregation port, choose the Active port, and the Active port arrangement PTP function for choosing, to carry out Role Information mutual with opposite equip., and the aggregation port of determining local terminal equipment is Master(master) port or Slave(from) port; When the aggregation port of local terminal equipment is the Master port, configuration Active port is the Master port, by the Active port transmission local zone time of Active port to opposite equip., utilize this local zone time to carry out time synchronized by opposite equip., when the aggregation port of local terminal equipment is the Slave port, configuration Active port is the Slave port, receive the local zone time that opposite equip. sends by corresponding Active port by the Active port, utilize this local zone time to carry out time synchronized, realized the time synchronized based on aggregation port, reached the time synchronized with opposite equip., and by directly enabling the PTP function at aggregation port, simplified user's configuration, reduced the consumption of device resource, improve equipment performance, strengthened the stability of network topology.
Further set forth above-mentioned the application with several specific embodiments below; for the following local terminal equipment that relates to and the Role Information reciprocal process of opposite equip. and follow-up time synchronizing; all identical with the processing in the flow process of above-mentioned Fig. 2; so no longer do concrete elaboration among the following embodiment; certainly; several embodiment that the application and not only being confined to proposes; to those skilled in the art; do not paying under the performing creative labour; according to thinkable other processing scheme of the embodiment of the present application, all within the application's protection range.
Embodiment one,
Referring to Fig. 3, the schematic flow sheet when adding new physical member port on the aggregation port that enables the PTP function, this flow process can comprise:
Step 301, the judgement of local terminal equipment has enabled physical member port quantity current on the aggregation port of PTP function.
Particularly, local terminal equipment has enabled physical member port quantity current on the aggregation port of PTP function by judging, finish the processing for the physical member port of new interpolation: when current physical member port quantity is two when above, forward step 306 to, when current physical member port quantity is one, forward step 302 to, when current physical member port quantity is zero, forward step 303 to.
The physical member port that step 302, local terminal equipment are chosen this interpolation is the Backup port, for its configuration PTP function and Role Information, forwards step 305 afterwards to.
The physical member port that step 303, local terminal equipment are chosen this interpolation is the Active port, is its configuration PTP function.
In this step, when discovery self physical member port quantity is zero, the initialization aggregation port, the physical member port of choosing this interpolation is the Active port, is its configuration PTP function.
Step 304, it is mutual that local terminal equipment and opposite equip. carry out Role Information, utilizes the Role Information configuration Active port of determining.
Step 305, local terminal equipment carries out time synchronized by the Active port of Active port and opposite equip..
Step 306, local terminal equipment is not done any processing.
In the present embodiment, when adding new physical member port on the aggregation port that enables the PTP function, by current physical member port quantity on the aggregation port of judging equipment of itself, realized the different disposal flow process of new interpolation physical member port, and by directly enabling the PTP function at aggregation port, simplified user's configuration, reduced the consumption of device resource, improve equipment performance, strengthened the stability of network topology.
Embodiment two,
Referring to Fig. 4, the schematic flow sheet when the physical member port on the aggregation port that enables the PTP function withdraws from, this flow process can comprise:
Step 401, local terminal equipment obtains the state of the physical member port that withdraws from, and handles accordingly according to its state information.
Particularly, local terminal equipment is finished the respective handling for the physical member port that withdraws from by obtaining the physical member port state information that withdraws from:
When the physical member port that withdraws from is common physical member port, forward step 410 to, when the physical member port that withdraws from is the Backup port, forward step 402 to, when the physical member port that withdraws from is the Active port, forward step 405 to.
Step 402, local terminal equipment are removed PTP function and the Role Information of this physical member port that withdraws from.
Step 403, local terminal equipment judge whether also have other common physical member port in the aggregation port that enables the PTP function.
In this step, local terminal equipment enables whether also have other common physical member port in the aggregation port of PTP function by judgement, when sometimes, forward step 404 to, otherwise, forward step 409 to.
Step 404, local terminal equipment are selected new Backup port from common physical member port, for its configuration PTP function and Role Information, forward step 409 to.
Choose for Backup port wherein, can adopt the link principle of optimality.
Step 405, local terminal equipment are removed PTP function and the Role Information of this physical member port that withdraws from.
Step 406, local terminal equipment Backup port is set to the Active port.
Step 407, local terminal equipment judge whether also have other common physical member port in the aggregation port that enables the PTP function.
In this step, local terminal equipment judges in the aggregation port that enables the PTP function whether also have other common physical member port, when sometimes, forwards step 408 to, otherwise, forward step 409 to.
Step 408, local terminal equipment are selected new Backup port from common physical member port, for its configuration PTP function and Role Information, forward step 409 afterwards to.
Step 409, process ends.
Step 410, local terminal equipment is not done any processing.
In the present embodiment, when the physical member port on the aggregation port that enables the PTP function withdraws from, the state of the physical member port that withdraws from by judgement, realized the different disposal flow process to the physical member port that withdraws from, and by directly enabling the PTP function at aggregation port, simplified user's configuration, reduced the consumption of device resource, improve equipment performance, strengthened the stability of network topology.
Embodiment three,
Referring to Fig. 5, the schematic flow sheet when the physical member port on the aggregation port that enables the PTP function breaks down, this flow process can comprise:
Step 501, local terminal equipment obtains the state of the member port that breaks down, and handles accordingly according to its state information.
Particularly, local terminal equipment is finished the respective handling for the physical member port that breaks down by obtaining the port status information of the member port that breaks down:
When the physical member port that breaks down is common physical member port, forward step 510 to, when the physical member port that breaks down is the Backup port, forward step 502 to, when the physical member port that breaks down is the Active port, forward step 505 to.
Step 502, local terminal equipment are removed PTP function and the Role Information of this physical member port that breaks down.
Step 503, local terminal equipment judge whether also have other common physical member port in the aggregation port that enables the PTP function.
In this step, local terminal equipment judges in the aggregation port that enables the PTP function whether also have other common physical member port, when sometimes, forwards step 504 to, otherwise, forward step 509 to.
Step 504, local terminal equipment are selected new Backup port from common physical member port, be its configuration PTP function and Role Information.
After being this new Backup port arrangement PTP function and Role Information, forward step 509 to.
Step 505, local terminal equipment are removed PTP function and the Role Information of this physical member port that breaks down.
Step 506, local terminal equipment Backup port is set to the Active port.
Step 507, local terminal equipment judge whether also have other common physical member port in the aggregation port that enables the PTP function.
In this step, local terminal equipment judges in the aggregation port that enables the PTP function whether also have other common physical member port, when sometimes, forwards step 508 to, otherwise, forward step 509 to.
Step 508, local terminal equipment are selected new Backup port from this common physical member port, and for its configuration PTP function and Role Information, forward step 509 afterwards to.
Step 509, process ends.
Step 510, local terminal equipment is not done any processing.
In the present embodiment, when the physical member port on the aggregation port that enables the PTP function breaks down, the state of the physical member port that breaks down by judgement, realized the different disposal flow process when the network members port broken down, and by directly enabling the PTP function at aggregation port, simplified user's configuration, reduced the consumption of device resource, improve equipment performance, strengthened the stability of network topology.
Based on the design identical with said method, the embodiment of the present application also provides a kind of time synchronism apparatus, and as shown in Figure 6, this device comprises:
Configuration process module 61 is used to aggregation port to enable the PTP function, chooses the activation port from the physical member port of aggregation port, and for activating port arrangement PTP function;
Interaction process module 63 is used for that to carry out Role Information mutual with opposite equip., utilizes the Role Information allocation activation port of determining;
Synchronous processing module 64 is used for carrying out time synchronized by the activation port that activates port and opposite equip..
This device also comprises: judge module 62, for the physical member port quantity of judging aggregation port;
Configuration process module 61, concrete be used for when physical member port be two when above, after the physical member port of aggregation port is chosen the activation port, further choose backup port other physical member port beyond activating port, be backup port configuration PTP function, and after interaction process module and opposite equip. are determined Role Information, according to the Role Information configuration backup port of determining; When physical member port is zero, only enable the PTP function for aggregation port.Judge module 62 also is used for judging current physical member port quantity on this aggregation port that enables the PTP function when the aggregation port that enables the PTP function adds physical member port;
Configuration process module 61, be used for when current physical member port quantity be two when above, do not do any processing; When current physical member port quantity was one, the physical member port of choosing interpolation was backup port, was its configuration PTP function and Role Information; When current physical member port quantity is zero, choose the physical member port of this interpolation for activating port, be its configuration PTP function, to carry out Role Information mutual with opposite equip., utilize the Role Information allocation activation port of determining, and carry out time synchronized by the activation port that activates port and opposite equip..
Judge module 62 also is used for obtaining the port status of the physical member port that withdraws from when the physical member port of the aggregation port that enables the PTP function withdraws from;
Configuration process module 61 is used for not doing any processing when the physical member port that withdraws from is common physical member port; When the physical member port that withdraws from is backup port, PTP function and the Role Information of the physical member port that removal is withdrawed from, if when enabling to also have common physical member port in the aggregation port of PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information; When the physical member port that withdraws from is when activating port, PTP function and the Role Information of the physical member port that removal is withdrawed from, backup port is set to activate port, if when enabling to also have common physical member port in the aggregation port of PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information.
Judge module 62 also is used for obtaining the port status of the physical member port that breaks down when the physical member port of the aggregation port that enables the PTP function breaks down;
Configuration process module 61 is used for not doing any processing when the physical member port that breaks down is common member port; When the physical member port that breaks down is backup port, PTP function and the Role Information of the physical member port that removal is broken down, if when enabling to also have common physical member port in the aggregation port of PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information; When the physical member port that breaks down is when activating port, PTP function and the Role Information of the physical member port that removal is broken down, backup port is set to activate port, if when enabling to also have common physical member port in the aggregation port of PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information.
Interaction process module 63, concrete being used for utilizes Role Information to determine that the aggregation port of local terminal equipment is Master port or Slave port, when described aggregation port is the Master port, disposing described activation port is the Master port, when described aggregation port was the Slave port, disposing described activation port was the Slave port;
Synchronous processing module 64, concrete being used for when aggregation port is the Master port, send the mutual message of PTP by activating port to the activation port of opposite equip., obtain timestamp information in the mutual message of PTP by opposite equip., utilize timestamp information to carry out time synchronized;
When aggregation port is the Slave port, receive opposite equip. by the mutual message of PTP that corresponding activation port sends by activating port, obtain the timestamp information that carries in the PTP message, utilize timestamp information to carry out time synchronized.
In the present embodiment, local terminal equipment enables the PTP function to the aggregation port on the equipment of itself, from the physical member port of aggregation port, choose the Active port, and the Active port arrangement PTP function for choosing, to carry out Role Information mutual with opposite equip., and the aggregation port of determining local terminal equipment is Master(master) port or Slave(from) port; When the aggregation port of local terminal equipment is the Master port, configuration Active port is the Master port, by the Active port transmission local zone time of Active port to opposite equip., utilize this local zone time to carry out time synchronized by opposite equip., when the aggregation port of local terminal equipment is the Slave port, configuration Active port is the Slave port, receive the local zone time that opposite equip. sends by corresponding Active port by the Active port, utilize this local zone time to carry out time synchronized, realized the time synchronized based on aggregation port, reached the time synchronized with opposite equip., and by directly enabling the PTP function at aggregation port, simplified user's configuration, reduced the consumption of device resource, improve equipment performance, strengthened the stability of network topology.
Through the above description of the embodiments, those skilled in the art can be well understood to the application and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better execution mode under a lot of situation.Based on such understanding, the part that the application's technical scheme contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the method for each embodiment of the application.
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module in the accompanying drawing or flow process might not be that enforcement the application is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of above-described embodiment can be merged into a module, also can further split into a plurality of submodules.
Above-mentioned the embodiment of the present application sequence number does not represent the quality of embodiment just to description.
More than disclosed only be several specific embodiments of the application, still, the application is not limited thereto, any those skilled in the art can think variation all should fall into the application's protection range.