Summary of the invention
The object of the embodiment of the present application is to provide method for synchronizing time and a kind of time synchronism apparatus, needs to carry out at each member port the device resource that PTP functional configuration causes consume excessive problem to solve in 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 device is the enable PTP function of aggregation port, from the physical member port of described aggregation port, choose activation port, and is described activation port arrangement PTP function;
It is mutual that local device and PTP opposite equip. carry out Role Information, utilizes the Role Information determined to configure described activation port;
Local device carries out time synchronized by the activation port of described activation port and described opposite equip..
Preferably, local device comprises after being the enable PTP function of described aggregation port further:
Described local device judges the physical member port quantity of described aggregation port;
When described physical member port is two or more, after the physical member port of described aggregation port chooses activation port, backup port is chosen further from other physical member port beyond described activation port, for described backup port configuration PTP function, and with opposite equip. determination Role Information after, configure described backup port according to the Role Information determined;
When described physical member port is zero, do not do any process.
Preferably, when the aggregation port of enable PTP function adds physical member port, described method comprises:
Current physical member port quantity on the aggregation port that described local device judges this enable PTP function;
When described present physical member port quantity is two or more, do not do any process;
When described present physical member port quantity is one, the physical member port choosing interpolation is backup port, is its configuration PTP function and Role Information;
When described present physical member port quantity is zero, choose the physical member port of this interpolation for activating port, for its configuration PTP function, to carry out Role Information mutual with opposite equip., utilize the Role Information determined to configure 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 of enable PTP function exits, described method comprises:
The port status of the physical member port exited described in described local device obtains;
When the described physical member port exited is common physical member port, do not do any process;
When the described physical member port exited is backup port, the PTP function of the physical member port exited described in removal and Role Information, if when also having common physical member port in the aggregation port of described enable PTP function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port exited is for activating port, the PTP function of the physical member port exited described in removal and Role Information, backup port is set to activate port, if when also having common physical member port in the aggregation port of described enable PTP 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 of enable PTP function breaks down, described method comprises:
The port status of the physical member port broken down described in described local device obtains;
When the described physical member port broken down is common physical member port, do not do any process;
When the described physical member port broken down is backup port, the PTP function of the physical member port broken down described in removal and Role Information, if when also having common physical member port in the aggregation port of described enable PTP function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port broken down is for activating port, the PTP function of the physical member port broken down described in removal and Role Information, backup port is set to activate port, if when also having common physical member port in the aggregation port of described enable PTP function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information.
Preferably,
Utilize the aggregation port of Role Information determination local device for Master port or Slave port;
When the aggregation port of local device is Master port, it is Master port that local device configures described activation port, described local device is by the activation port transmission PTP mutual message of described activation port to opposite equip., obtain the timestamp information in described PTP mutual message by described opposite equip., utilize described timestamp information to carry out time synchronized;
When the aggregation port of local device is Slave port, it is Slave port that local device configures described activation port, the PTP mutual message that described local device is sent by corresponding activation port by described activation port accepts opposite equip., obtain the timestamp information carried in 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:
Configuration process module, for being the enable PTP function of aggregation port, chooses activation port from the physical member port of described aggregation port, and is described activation port arrangement PTP function;
Interaction process module, for carrying out Role Information alternately with PTP opposite equip., utilizes the Role Information determined to configure described activation port;
Synchronous processing module, for carrying out time synchronized by the activation port of described activation port and described opposite equip..
Preferably, also comprise:
Judge module, for judging the physical member port quantity of described aggregation port;
Described configuration process module, specifically for when described physical member port is two or more, after the physical member port of described aggregation port chooses activation port, backup port is chosen further from other physical member port beyond described activation port, for described backup port configuration PTP function, and after described interaction process module and opposite equip. determination Role Information, configure described backup port according to the Role Information determined; When described physical member port is zero, be only the enable PTP function of aggregation port.
Preferably, when the aggregation port of enable PTP function adds physical member port,
Described judge module, also current physical member port quantity on the aggregation port judging this enable PTP function;
Described configuration process module, for when described present physical member port quantity is two or more, does not do any process;
When described present physical member port quantity is one, the physical member port choosing interpolation is backup port, is its configuration PTP function and Role Information;
When described present physical member port quantity is zero, choose the physical member port of this interpolation for activating port, for its configuration PTP function, to carry out Role Information mutual with opposite equip., utilize the Role Information determined to configure 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 of enable PTP function exits,
Described judge module, the port status of physical member port also for exiting described in obtaining;
Described configuration process module, for when described in the physical member port that exits be common physical member port time, do not do any process;
When the described physical member port exited is backup port, the PTP function of the physical member port exited described in removal and Role Information, if when also having common physical member port in the aggregation port of described enable PTP function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port exited is for activating port, the PTP function of the physical member port exited described in removal and Role Information, backup port is set to activate port, if when also having common physical member port in the aggregation port of described enable PTP 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 of enable PTP function breaks down,
Described judge module, the port status of physical member port also for breaking down described in obtaining;
Described configuration process module, for when described in the physical member port that breaks down be common member port time, do not do any process;
When the described physical member port broken down is backup port, the PTP function of the physical member port broken down described in removal and Role Information, if when also having common physical member port in the aggregation port of described enable PTP function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information;
When the described physical member port broken down is for activating port, the PTP function of the physical member port broken down described in removal and Role Information, backup port is set to activate port, if when also having common physical member port in the aggregation port of described enable PTP function, therefrom choose new backup port, and be described new backup port configuration PTP function and Role Information.
Preferably,
Described interaction process module, specifically for utilizing the aggregation port of Role Information determination local device for Master port or Slave port, when described aggregation port is Master port, configuring described activation port is Master port, when described aggregation port is Slave port, configuring described activation port is Slave port;
Described synchronous processing module, specifically for when described aggregation port is Master port, by the activation port transmission PTP mutual message of described activation port to opposite equip., obtain the timestamp information in described PTP mutual message by described opposite equip., utilize described timestamp information to carry out time synchronized;
When described aggregation port is Slave port, the PTP mutual message sent by corresponding activation port by described activation port accepts opposite equip., is obtained the timestamp information carried in described PTP message, utilizes described timestamp information to carry out time synchronized.
Compared with prior art, the technical scheme that the embodiment of the present application proposes has the following advantages:
By the proposition of the application's scheme, achieve the time synchronized based on aggregation port, reach the time synchronized with opposite equip., and pass through directly enable PTP function on aggregation port, simplify user's configuration, reduce the consumption of device resource, improve equipment performance, enhance the stability of network topology.
Embodiment
Below in conjunction with accompanying drawing, be clearly and completely described the technical scheme in the application, obviously, described embodiment is only section Example, instead of whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not making other embodiments all obtained under creative work prerequisite, all belong to the scope of the application's protection.
See Fig. 2, be the schematic flow sheet of the time synchronized that the embodiment of the present application provides, this flow process can comprise:
Step 201, local device is to the enable PTP function of the aggregation port on equipment of itself.
In this step, local device, by enable PTP function on self-polymerization mouth, supports time synchronized to enable the aggregation port of equipment of itself.
Step 202, local device chooses activation (Active) port from the physical member port of aggregation port.
In concrete enforcement, after local device is the enable PTP function of aggregation port, also comprise:
Local device judges the physical member port quantity of aggregation port;
When physical member port quantity is two or more, local device chooses activation port first wherein, according to link principle of optimality, can choose the port that link idle rate is high in the physical member port of self-polymerization mouth, as activation port; After choosing activation port, from other physical member port activated outside port, choose backup (Backup) port, the link idle rate of backup port is only second to activation port;
When physical member port quantity is one, this physical member port is chosen for activation port by local device;
When physical member port quantity is zero, local device does not do any process.
Carry out choosing of port for above-mentioned according to link idle rate, the preferred implementation just in the embodiment of the present application, certainly, also can adopt other port to choose mode, as the bandwidth according to link, link load etc. are chosen.
For activation port, all replace illustrating with Active port below, backup port all carries out replacement explanation with Backup port.
Step 203, local device is the Active port arrangement PTP function chosen.
Concrete, when there being Backup port, for Backup port configures PTP function equally.
Step 204, it is mutual that local device and PTP opposite equip. carry out Role Information, and determining the role of the aggregation port of local device, can be Master port or Slave port.
For PTP opposite equip. wherein, refer to that this opposite equip. is applied in PTP network;
It is mutual that local device and PTP opposite equip. carry out Role Information, specifically comprises:
Local device chooses arbitrarily a physical member port (wherein in the physical member port of self-polymerization mouth, this physical member port chosen can also be Active port), opposite equip. chooses arbitrarily a physical member port in the physical member port of self-polymerization mouth, it is mutual that local device carries out Role Information by the physical member port that the physical member port chosen and opposite equip. are chosen, obtaining the Role Information of the other side respectively, is Master port or Slave port according to the aggregation port of this Role Information determination equipment of itself; When the aggregation port of local device is Master port, forward step 205 to, when the aggregation port of local device is Slave port, forward step 207 to.
Step 205, configuration Active port is Master port.
Step 206, local device, by the Active port transmission PTP mutual message of Active port to opposite equip., utilizes the timestamp information in this PTP mutual message to carry out time synchronized by the activation port of opposite equip..
Particularly, local device is by the Active port transmission PTP mutual message of Active port to opposite equip., timestamp information is carried in this PTP mutual message, opposite equip. is after receiving this PTP mutual message, it is resolved, obtain timestamp information wherein, utilize this timestamp information poor for computing time, by the time difference calculated, time synchronized is carried out to equipment of itself;
Wherein, for the calculating of time difference, with the method that computing time in prior art is poor, therefore no longer do concrete elaboration at this.
Step 207, configuration Active port is Slave port.
Step 208, the local zone time that local device is sent by corresponding Active port by Active port accepts opposite equip., utilizes this local zone time to carry out time synchronized.
Particularly, the PTP mutual message that local device is sent by the Active port of Active port accepts opposite equip., timestamp information is carried in this PTP mutual message, this PTP mutual message is resolved, obtain timestamp information wherein, utilize this timestamp information poor for computing time, by the time difference calculated, time synchronized is carried out to equipment of itself.
In the present embodiment, local device is to the enable PTP function of the aggregation port on equipment of itself, Active port is chosen from the physical member port of aggregation port, and the Active port arrangement PTP function for choosing, to carry out Role Information mutual with opposite equip., determines that the aggregation port of local device is Master(master) port or Slave(from) port, when the aggregation port of local device is Master port, configuration Active port is Master port, by the Active port transmission local zone time of Active port to opposite equip., this local zone time is utilized to carry out time synchronized by opposite equip., when the aggregation port of local device is Slave port, configuration Active port is Slave port, by the local zone time that Active port accepts opposite equip. is sent by corresponding Active port, this local zone time is utilized to carry out time synchronized, achieve the time synchronized based on aggregation port, reach the time synchronized with opposite equip., and pass through directly enable PTP function on aggregation port, simplify user's configuration, reduce the consumption of device resource, improve equipment performance, enhance the stability of network topology.
Above-mentioned the application is set forth further below with several specific embodiment; for Role Information reciprocal process and the follow-up time synchronizing of the following local device that relates to and opposite equip.; all identical with the process in the flow process of above-mentioned Fig. 2; therefore no longer do concrete elaboration in following embodiment; certainly; the application is also not only confined to proposed several embodiments; to those skilled in the art; do not paying under performing creative labour; according to the embodiment of the present application other processing scheme thinkable, all within the protection range of the application.
Embodiment one,
See Fig. 3, on the aggregation port of enable PTP function, add schematic flow sheet during new physical member port, this flow process can comprise:
Step 301, local device judges physical member port quantity current on the aggregation port of enable PTP function.
Particularly, local device is by judging physical member port quantity current on the aggregation port of enable PTP function, carry out the process for new physical member port of adding: when present physical member port quantity is two or more, forward step 306 to, when present physical member port quantity is one, forward step 302 to, when present physical member port quantity is zero, forward step 303 to.
Step 302, the physical member port that local device chooses this interpolation is Backup port, is its configuration PTP function and Role Information, forwards step 305 to afterwards.
Step 303, the physical member port that local device chooses this interpolation is Active port, is its configuration PTP function.
In this step, when finding that own physical member port quantity is zero, initiated polymerization mouth, the physical member port choosing this interpolation is Active port, is its configuration PTP function.
Step 304, it is mutual that local device and opposite equip. carry out Role Information, utilizes the Role Information configuration Active port determined.
Step 305, local device carries out time synchronized by the Active port of Active port and opposite equip..
Step 306, local device does not do any process.
In the present embodiment, when adding new physical member port on the aggregation port of enable PTP function, by judging physical member port quantity current on the aggregation port of equipment of itself, achieve new different disposal flow process of adding physical member port, and pass through directly enable PTP function on aggregation port, simplify user's configuration, reduce the consumption of device resource, improve equipment performance, enhance the stability of network topology.
Embodiment two,
See Fig. 4, the schematic flow sheet when physical member port on the aggregation port of enable PTP function exits, this flow process can comprise:
Step 401, local device obtains the state of the physical member port exited, and processes accordingly according to its state information.
Particularly, local device, by obtaining the physical member port state information exited, has carried out the respective handling for the physical member port exited:
When the physical member port exited is common physical member port, forward step 410 to, when the physical member port exited is Backup port, forward step 402 to, when the physical member port exited is Active port, forward step 405 to.
Step 402, local device removes PTP function and the Role Information of the physical member port that this exits.
Step 403, local device judges whether also have other common physical member port in the aggregation port of enable PTP function.
In this step, whether in addition local device, by other common physical member port in the aggregation port that judges enable PTP function, when sometimes, forwards step 404 to, otherwise, forward step 409 to.
Step 404, local device selects new Backup port from common physical member port, is its configuration PTP function and Role Information, forwards step 409 to.
Backup port is wherein chosen, link principle of optimality can be adopted.
Step 405, local device removes PTP function and the Role Information of the physical member port that this exits.
Step 406, Backup port is set to Active port by local device.
Step 407, local device judges whether also have other common physical member port in the aggregation port of enable PTP function.
In this step, local device judges whether also have other common physical member port in the aggregation port of enable PTP function, when sometimes, forwards step 408 to, otherwise, forward step 409 to.
Step 408, local device selects new Backup port from common physical member port, is its configuration PTP function and Role Information, forwards step 409 to afterwards.
Step 409, process ends.
Step 410, local device does not do any process.
In the present embodiment, when physical member port on the aggregation port of enable PTP function exits, by judging the state of the physical member port exited, achieve the different disposal flow process to the physical member port exited, and pass through directly enable PTP function on aggregation port, simplify user's configuration, reduce the consumption of device resource, improve equipment performance, enhance the stability of network topology.
Embodiment three,
See Fig. 5, the schematic flow sheet when physical member port on the aggregation port of enable PTP function breaks down, this flow process can comprise:
Step 501, local device obtains the state of the member port broken down, and processes accordingly according to its state information.
Particularly, local device, by obtaining the port status information of the member port broken down, has carried out the respective handling for the physical member port broken down:
When the physical member port broken down is common physical member port, forward step 510 to, when the physical member port broken down is Backup port, forward step 502 to, when the physical member port broken down is Active port, forward step 505 to.
Step 502, local device removes PTP function and the Role Information of the physical member port that this breaks down.
Step 503, local device judges whether also have other common physical member port in the aggregation port of enable PTP function.
In this step, local device judges whether also have other common physical member port in the aggregation port of enable PTP function, when sometimes, forwards step 504 to, otherwise, forward step 509 to.
Step 504, local device selects new Backup port from common physical member port, is its configuration PTP function and Role Information.
After the Backup port arrangement PTP function new for this and Role Information, forward step 509 to.
Step 505, local device removes PTP function and the Role Information of the physical member port that this breaks down.
Step 506, Backup port is set to Active port by local device.
Step 507, local device judges whether also have other common physical member port in the aggregation port of enable PTP function.
In this step, local device judges whether also have other common physical member port in the aggregation port of enable PTP function, when sometimes, forwards step 508 to, otherwise, forward step 509 to.
Step 508, local device selects new Backup port from this common physical member port, and is its configuration PTP function and Role Information, forwards step 509 to afterwards.
Step 509, process ends.
Step 510, local device does not do any process.
In the present embodiment, when physical member port on the aggregation port of enable PTP function breaks down, by judging the state of the physical member port broken down, achieve different disposal flow process when network members port is broken down, and pass through directly enable PTP function on aggregation port, simplify user's configuration, reduce the consumption of device resource, improve equipment performance, enhance the stability of network topology.
Based on the design identical with said method, the embodiment of the present application additionally provides a kind of time synchronism apparatus, and as shown in Figure 6, this device comprises:
Configuration process module 61, for being the enable PTP function of aggregation port, chooses activation port from the physical member port of aggregation port, and for activating port arrangement PTP function;
Interaction process module 63, for carrying out Role Information alternately with opposite equip., utilizes the Role Information allocation activation port determined;
Synchronous processing module 64, carries out time synchronized for the activation port by activating port and opposite equip..
This device also comprises: judge module 62, for judging the physical member port quantity of aggregation port;
Configuration process module 61, specifically for when physical member port is two or more, after the physical member port of aggregation port chooses activation port, backup port is chosen further from other physical member port activated beyond port, for backup port configuration PTP function, and after interaction process module and opposite equip. determination Role Information, according to the Role Information configuration backup port determined; When physical member port is zero, be only the enable PTP function of aggregation port.Judge module 62, also for when the aggregation port of enable PTP function adds physical member port, current physical member port quantity on the aggregation port judging this enable PTP function;
Configuration process module 61, for when present physical member port quantity is two or more, does not do any process; When present physical member port quantity is one, the physical member port choosing interpolation is backup port, is its configuration PTP function and Role Information; When present physical member port quantity is zero, choose the physical member port of this interpolation for activating port, for its configuration PTP function, to carry out Role Information mutual with opposite equip., utilize the Role Information allocation activation port determined, and carry out time synchronized by the activation port activating port and opposite equip..
Judge module 62, when also exiting for the physical member port of the aggregation port when enable PTP function, obtains the port status of the physical member port exited;
Configuration process module 61, for when the physical member port exited is common physical member port, does not do any process; When the physical member port exited is backup port, remove PTP function and the Role Information of the physical member port exited, if when also having common physical member port in the aggregation port of enable PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information; When the physical member port exited is for activating port, remove PTP function and the Role Information of the physical member port exited, backup port is set to activate port, if when also having common physical member port in the aggregation port of enable PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information.
Judge module 62, when also breaking down for the physical member port of the aggregation port when enable PTP function, obtains the port status of the physical member port broken down;
Configuration process module 61, for when the physical member port broken down is common member port, does not do any process; When the physical member port broken down is backup port, remove PTP function and the Role Information of the physical member port broken down, if when also having common physical member port in the aggregation port of enable PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information; When the physical member port broken down is for activating port, remove PTP function and the Role Information of the physical member port broken down, backup port is set to activate port, if when also having common physical member port in the aggregation port of enable PTP function, therefrom choose new backup port, and be new backup port configuration PTP function and Role Information.
Interaction process module 63, specifically for utilizing the aggregation port of Role Information determination local device for Master port or Slave port, when described aggregation port is Master port, configuring described activation port is Master port, when described aggregation port is Slave port, configuring described activation port is Slave port;
Synchronous processing module 64, specifically for when aggregation port is Master port, by activating the activation port transmission PTP mutual message of port to opposite equip., obtaining the timestamp information in PTP mutual message by opposite equip., utilizing timestamp information to carry out time synchronized;
When aggregation port is Slave port, by activating the PTP mutual message that port accepts opposite equip. is sent by corresponding activation port, obtains the timestamp information carried in PTP message, utilizing timestamp information to carry out time synchronized.
In the present embodiment, local device is to the enable PTP function of the aggregation port on equipment of itself, Active port is chosen from the physical member port of aggregation port, and the Active port arrangement PTP function for choosing, to carry out Role Information mutual with opposite equip., determines that the aggregation port of local device is Master(master) port or Slave(from) port, when the aggregation port of local device is Master port, configuration Active port is Master port, by the Active port transmission local zone time of Active port to opposite equip., this local zone time is utilized to carry out time synchronized by opposite equip., when the aggregation port of local device is Slave port, configuration Active port is Slave port, by the local zone time that Active port accepts opposite equip. is sent by corresponding Active port, this local zone time is utilized to carry out time synchronized, achieve the time synchronized based on aggregation port, reach the time synchronized with opposite equip., and pass through directly enable PTP function on aggregation port, simplify user's configuration, reduce the consumption of device resource, improve equipment performance, enhance the stability of network topology.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the application can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, the technical scheme of the application can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform 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 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 in embodiment can carry out being distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
Above-mentioned the embodiment of the present application sequence number, just to describing, does not represent the quality of embodiment.
Be only several specific embodiments of the application above, but the application is not limited thereto, the changes that any person skilled in the art can think of all should fall into the protection range of the application.