CN110365538A - Port status control method, device, equipment and computer readable storage medium - Google Patents

Port status control method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110365538A
CN110365538A CN201910649909.2A CN201910649909A CN110365538A CN 110365538 A CN110365538 A CN 110365538A CN 201910649909 A CN201910649909 A CN 201910649909A CN 110365538 A CN110365538 A CN 110365538A
Authority
CN
China
Prior art keywords
port
state
relied
starting
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910649909.2A
Other languages
Chinese (zh)
Other versions
CN110365538B (en
Inventor
段琳
杨志逵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910649909.2A priority Critical patent/CN110365538B/en
Publication of CN110365538A publication Critical patent/CN110365538A/en
Application granted granted Critical
Publication of CN110365538B publication Critical patent/CN110365538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/12Arrangements for remote connection or disconnection of substations or of equipment thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting

Abstract

The present invention provides a kind of port status control method, device, equipment and computer readable storage medium.Method of the invention, by starting switch for setting port, starting switch port when being in an open state can just start;When starting port, pass through the starting situation for the software task that monitoring port is relied on;The setting that starts switch of port is in an open state after the equal start completion of software task relied on, control port carries out link negotiation, and the physical state of port is updated to physical link starting state;When the software task starting relied on does not complete, the starting for being in off state delay ports physical level is started switch by being arranged, realize effective control to port physical state, start port as soon as possible in the equal start completion of the software task that is relied on, so that port enters physical link starting state, so that the software task for relying on port normally starts, guarantee that electronic equipment normally starts, and shorten the starting time of electronic equipment.

Description

Port status control method, device, equipment and computer readable storage medium
Technical field
The present invention relates to field of computer technology more particularly to a kind of port status control method, device, equipment and calculating Machine readable storage medium storing program for executing.
Background technique
Existing electronic equipment (such as computer equipment, router, interchanger) during startup, complete by software task There is a deviation in the time that starting and hardware port complete starting, it is hardware-initiated some be not controlled by software task, it is hardware-initiated Earlier than or be later than software task starting, this time deviation is also uncontrolled.
But some software tasks and hardware port in equipment, there are dependence, some software tasks are needed at it Start after the hardware port of dependence, if the hardware port that it is relied on after the starting of these software tasks is also inactive, then can Software task is caused to be operating abnormally;Alternatively, the starting of certain hardware ports depends on certain software tasks, if certain software tasks Do not start earlier than these hardware ports, then will lead to the starting failure of these hardware ports, so as to cause appliance boot failure.
Existing port starting control method is usually to force port to be set as physical link closed state (link Down), after software task start completion, in the starting for carrying out hardware port.But certain start-up courses are relied on Just need the physical state of hardware port for physics chain in the software task of hardware port, that is, before software task starting Road starting state (link up) can directly result in software task starting failure under this mode, so as to cause unit exception.
Summary of the invention
The present invention provides a kind of port status control method, device, equipment and computer readable storage medium, to solve In the prior art by port force be set as physical link closed state (link down), until software task start completion it Afterwards, in the starting for carrying out hardware port, certain start-up courses is depended on the software task of hardware port, can be directly resulted in soft Part task start failure, the problem of so as to cause unit exception.
It is an aspect of the invention to provide a kind of port status control methods, comprising:
In response to the enabled instruction to port, the starting situation for the software task that the port is relied on is monitored;
After the equal start completion of software task that the port is relied on, starting switch for the port is set as opening State controls the port and carries out link negotiation;
The physical state of the port is updated to physical link starting state by physical link closed state.
Another aspect of the present invention is to provide a kind of port status control device, comprising:
Port monitoring control module, for monitoring the software that the port is relied in response to the enabled instruction to port The starting situation of task;After the equal start completion of software task that the port is relied on, starting switch for the port is set It is set to opening state;
Port starting module carries out link negotiation for controlling the port;By the physical state of the port by physics Linkdown state is updated to physical link starting state.
Another aspect of the present invention is to provide a kind of electronic equipment, comprising:
Processor, memory, and it is stored in the computer journey that can be run on the memory and on the processor Sequence;Wherein, port status control method described above is realized when the processor runs the computer program.
Another aspect of the present invention is to provide a kind of computer readable storage medium, the computer readable storage medium In be stored with computer program, the computer program realizes port status controlling party described above when being executed by processor Method.
Port status control method, device, equipment and computer readable storage medium provided by the invention, by response to Enabled instruction to port monitors the starting situation for the software task that the port is relied on;It is relied in the port soft After the equal start completion of part task, the setting that starts switch of the port is in an open state, the port is controlled and carries out link association Quotient;The physical state of the port is updated to physical link starting state by physical link closed state;By the way that port is arranged Start switch, start switch after being arranged to opening state, port can just carry out link negotiation, realize and to be relied in port In the case that software task starting does not complete, is started switch and be in off state by default setting, can be delayed port physical layer Effective control to port status is realized in the starting in face, in the case where the software task that port is relied on equal start completion, to the greatest extent Early start port, so that port enters physical link starting state, so that the software task for relying on port is normal Starting guarantees that electronic equipment normally starts, and can shorten the starting time of electronic equipment.
Detailed description of the invention
Fig. 1 is the port status control method flow chart that the embodiment of the present invention one provides;
Fig. 2 is port status control method flow chart provided by Embodiment 2 of the present invention;
Fig. 3 is the port status control method flow chart that the embodiment of the present invention three provides;
Fig. 4 is the structural schematic diagram for the port status control device that the embodiment of the present invention four provides;
Fig. 5 is the structural schematic diagram for the port status control device that the embodiment of the present invention five provides;
Fig. 6 is the structural schematic diagram for the electronic equipment that the embodiment of the present invention six provides.
Through the above attached drawings, it has been shown that the specific embodiment of the present invention will be hereinafter described in more detail.These attached drawings It is not intended to limit the scope of the inventive concept in any manner with verbal description, but is by referring to specific embodiments Those skilled in the art illustrate idea of the invention.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Term " first " according to the present invention, " second " etc. are used for description purposes only, and should not be understood as instruction or dark Show relative importance or implicitly indicates the quantity of indicated technical characteristic.In the description of following embodiment, " multiple " It is meant that two or more, unless otherwise specifically defined.
The specific application scenarios of the present invention are as follows: in electronic equipment start-up course, need to start multiple software tasks and There are a deviation in hardware port, the time that software task completes starting and hardware port completes starting, it is hardware-initiated some be not by soft Part task control, it is hardware-initiated earlier than or be later than software task starting, this time deviation is also uncontrolled.But It is that there are dependences, some software tasks to need to rely at it for some software tasks and hardware port in electronic equipment Start after hardware port, if the hardware port that it is relied on after the starting of these software tasks is also inactive, then will lead to soft Part task run is abnormal;Alternatively, the starting of certain hardware ports depends on certain software tasks, if certain software tasks are without early Start in these hardware ports, then will lead to the starting failure of these hardware ports, so as to cause appliance boot failure.
Port status control method provided by the invention, it is intended to solve the technical problem as above of the prior art.
How to be solved with technical solution of the specifically embodiment to technical solution of the present invention and the application below above-mentioned Technical problem is described in detail.These specific embodiments can be combined with each other below, for the same or similar concept Or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, the embodiment of the present invention is described.
Embodiment one
Fig. 1 is the port status control method flow chart that the embodiment of the present invention one provides.Method application in the present embodiment In electronic equipment, which can be computer equipment, router, interchanger etc., and in other embodiments, this method is also It can be applied to other equipment.
As shown in Figure 1, specific step is as follows for this method:
Step S101, in response to the enabled instruction to port, the starting situation for the software task that monitoring port is relied on.
Wherein, the software task that port is relied on refers to the software task relied on when the function of port operates normally.Example Such as, the system that the forwarding capability of the line card port of distributed more card routers not only relies on this card, also relies on master control borad Routing protocol stack and forwarding table issue task, and the only routing protocol stack on master control borad starts to work normally and issued available turn It delivers, that is, in the case that forwarding table is complete, line card port just can normally start operation.
In the embodiment of the present invention, it is arranged one for each group of port (including one or more port) started together It starts switch, port is started switch for whether control port can to carry out link negotiation, that is, whether control port may be used Starting.
Start switch including opening state and closed state, when port start switch be arranged to opening state when, should Port can carry out link negotiation (can also start);When port start switch be set to off closed state when, which can not It carries out link negotiation (namely can not start).
When electronic equipment is inactive, the default that starts switch of port is set to off closed state, and all of the port is set It sets in physical link closed state.It, just can be by port after determining the equal start completion of software task that port is relied on It starts switch setting to be in an open state, port can just carry out link negotiation at this time, and after completing link negotiation, update end Mouth is physical link starting state.
In the present embodiment, after receiving to the enabled instruction of port, before starting port, end to be launched is monitored The starting situation for the software task that mouth is relied on is relied on according to the starting situation for the software task that port is relied in port The equal start completion of software task after, just can star the port.
Step S102, after the equal start completion of software task that port is relied on, starting switch for port is set as beating Open state, control port carry out link negotiation.
According to the starting situation for the software task that port is relied on, in the equal start completion of software task that port is relied on Afterwards, the setting that starts switch of port is in an open state, and control port carries out link negotiation;That is, port institute according to After the equal start completion of bad software task, the setting that starts switch of port is in an open state, and start the port.
Step S103, the physical state of port is updated to physical link starting state by physical link closed state.
In the present embodiment, when electronic equipment is inactive, all of the port is set in physical link closed state.? After the starting of port, the physical state of port is updated to physical link starting state by physical link closed state.
The embodiment of the present invention is by response to the enabled instruction to port, the starting for the software task that monitoring port is relied on Situation;After the equal start completion of software task that port is relied on, the setting that starts switch of port is in an open state, control terminal Mouth carries out link negotiation;The physical state of port is updated to physical link starting state by physical link closed state;Pass through Starting switch for port is set, is started switch after being arranged to opening state, port can just carry out link negotiation, realize in port In the case that the software task starting relied on does not complete, is started switch and be in off state by default setting, can be delayed end The starting of mouth physical layer, realizes effective control to port status, in the equal start completion of software task that port is relied on In the case of, start port as soon as possible, so that port enters physical link starting state, so that relying on the software of port Task normally starts, and guarantees that electronic equipment normally starts, and can shorten the starting time of electronic equipment.
Embodiment two
Fig. 2 is port status control method flow chart provided by Embodiment 2 of the present invention.On the basis of above-described embodiment one On, in the present embodiment, in response to the enabled instruction to port, the starting situation for the software task that monitoring port is relied on, comprising: In response to the enabled instruction to port, the starting situation for the software task that port is relied on is obtained;If the software that port is relied on The inactive completion of at least one software task in task after being then spaced default first duration, obtains at least one software again and appoints The starting situation of business, until the equal start completion of software task that port is relied on.
As shown in Fig. 2, specific step is as follows for this method:
Step S201, in response to the enabled instruction to port, the starting situation for the software task that port is relied on is obtained.
Wherein, the software task that port is relied on refers to the software task relied on when the function of port operates normally.Example Such as, the system that the forwarding capability of the line card port of distributed more card routers not only relies on this card, also relies on master control borad Routing protocol stack and forwarding table issue task, and the only routing protocol stack on master control borad starts to work normally and issued available turn It delivers, that is, in the case that forwarding table is complete, line card port just can normally start operation.
In the embodiment of the present invention, it is arranged one for each group of port (including one or more port) started together It starts switch, port is started switch for whether control port can to carry out link negotiation, that is, whether control port may be used Starting.
Start switch including opening state and closed state, when port start switch be arranged to opening state when, should Port can carry out link negotiation (can also start);When port start switch be set to off closed state when, which can not It carries out link negotiation (namely can not start).
When electronic equipment is inactive, the default that starts switch of port is set to off closed state, and all of the port is set It sets in physical link closed state.It, just can be by port after determining the equal start completion of software task that port is relied on It starts switch setting to be in an open state, port can just carry out link negotiation at this time, and after completing link negotiation, update end Mouth is physical link starting state.
In the present embodiment, after receiving to the enabled instruction of port, before starting port, end to be launched is monitored The starting situation for the software task that mouth is relied on is relied on according to the starting situation for the software task that port is relied in port The equal start completion of software task after, just can star the port.
Step S202, judge the relied on whether equal start completion of software task.
If the inactive completion of at least one software task, thens follow the steps S203 in the software task that port is relied on, After default first duration, the starting situation that step S201 obtains the software task that port is relied on is executed again.
If the equal start completion of the software task that port is relied on, then executing step S204-S205, the starting of port is updated The state of switch starts port, and updates the physical state of port.
If step S203, the inactive completion of at least one software task in the software task that port is relied on, interval is pre- If the first duration, the starting situation for the software task that port is relied on is obtained.
In the present embodiment, if the inactive completion of at least one software task in the software task that port is relied on, is spaced After default first duration, the starting situation for the software task that port is relied on is obtained again, and is jumped and continued to execute step S202.
Wherein, presetting the first duration can be set by technical staff according to practical application scene and empirical value, this reality Example is applied to be not specifically limited herein.
Optionally, in the present embodiment, if the inactive completion of at least one software task in the software task that port is relied on, After being then spaced default first duration, the starting situation for monitoring at least one software task of inactive completion can be continued, not After the equal start completion of at least one software task of start completion, all software tasks that can determine that port is relied on are opened It is dynamic to complete.
Step S204, the setting that starts switch of port is in an open state, control port carries out link negotiation.
According to the starting situation for the software task that port is relied on, in the equal start completion of software task that port is relied on Afterwards, the setting that starts switch of port is in an open state, and control port carries out link negotiation;That is, port institute according to After the equal start completion of bad software task, the setting that starts switch of port is in an open state, and start the port.
Step S205, it is spaced default starting duration, the physical state of port is updated to object by physical link closed state Manage link-up status.
In the present embodiment, when electronic equipment is inactive, all of the port is set in physical link closed state.
Since the start-up course that port carries out link negotiation needs the regular hour, in the step, start to carry out in port After link negotiation, be spaced default starting duration, port waited to carry out link negotiation to start completion, by the physical state of port by Physical link closed state is updated to physical link starting state.
Wherein, default starting duration is spaced for waiting port to carry out link negotiation to start completion, is spaced default starting Duration should be greater than port and start duration needed for carrying out link negotiation to start completion.Default starting duration can be by technical staff It is set according to practical application scene and empirical value, the present embodiment is not specifically limited herein.For example, when starting is preset at interval Length can be 5 seconds etc..
The embodiment of the present invention is by response to the enabled instruction to port, the starting for the software task that monitoring port is relied on Situation;After the equal start completion of software task that port is relied on, the setting that starts switch of port is in an open state, control terminal Mouth carries out link negotiation;The physical state of port is updated to physical link starting state by physical link closed state;Pass through Starting switch for port is set, is started switch after being arranged to opening state, port can just carry out link negotiation, realize in port In the case that the software task starting relied on does not complete, is started switch and be in off state by default setting, can be delayed end The starting of mouth physical layer, realizes effective control to port status, in the equal start completion of software task that port is relied on In the case of, start port as soon as possible, so that port enters physical link starting state, so that relying on the software of port Task normally starts, and guarantees that electronic equipment normally starts, and can shorten the starting time of electronic equipment.
Embodiment three
Fig. 3 is the port status control method flow chart that the embodiment of the present invention three provides.In above-described embodiment one or in fact On the basis of applying example two, in the present embodiment, in equipment start-up course, starting and the port of software task can be concurrently carried out Starting.Port status control method provided in this embodiment further include: in response to the software task enabled instruction to goal task, Obtain the physical state for the port that goal task is relied on;Judge whether the port that goal task is relied on is in available shape State;If at least one port is in down state in the port that goal task is relied on, at least one end is monitored in real time The physical state of mouth, until the port that goal task is relied on is in available mode;If the port that goal task is relied on is equal In available, starting goal task.
As shown in figure 3, specific step is as follows for this method:
Step S301, in response to the software task enabled instruction to goal task, the port that goal task is relied on is obtained Physical state.
Wherein, goal task refers to any one software task to be launched in equipment start-up course.
In the present embodiment, the starting situation for the physical state to port and its software task relied on can be increased It is monitored, and the port monitoring control module controlled is started switch to port.Port monitoring control module can mention For obtaining application programming interface (Application Programming Interface, the abbreviation of the physical state of port API), in the physical state for needing to obtain port, the physical state of port is obtained by calling the API.
Step S302, judge whether the port that goal task is relied on is in physical link starting state.
In the present embodiment, when the port that goal task is relied on refers to goal task starting, it need to be opened prior to the goal task Dynamic port.That is, the port that goal task is relied on need to be introduced into physical link starting shape when starting goal task State.
Goal task needs to rely on certain port transmitting-receiving and obtains external information when starting, then goal task depends on these Port.For example, whether active and standby control module is it should be understood that external with the presence of other main control modules and other main control modules State, if getting correct information not over port, will lead to the body of active and standby control to determine the active and standby identity of itself Part status error.For example, not how many use started in advance before port function for NTP module, also need etc. port function complete At restarting later.
If the port that goal task is relied on is in physical link starting state, step S303 is executed, starting target is appointed Business.
If at least one port is not in physical link starting state in the port that goal task is relied on, then follow the steps S304 continues the physical state for monitoring at least one port in real time.
In the present embodiment, if at least one port is not in physical link starting shape in the port that goal task is relied on State then monitors the physical state of at least one port in real time, until the port that goal task is relied on is in physical link Starting state;Alternatively, until goal task starting time-out, determines goal task starting failure.
If step S303, the port that goal task is relied on is in physical link starting state, start goal task.
In the present embodiment, if the port that goal task is relied on is in physical link starting state, illustrate at this time Goal task can call the correlation function and status information of relied on port, can normally start, then continuing to start mesh Mark task.
If step S304, at least one port is not in physical link starting state in the port that goal task is relied on, The physical state of at least one port is then monitored in real time.
In the present embodiment, if at least one port is not in physical link starting shape in the port that goal task is relied on State then monitors the physical state of at least one port in real time, until the port that goal task is relied on is in physical link Starting state;Alternatively, until goal task starting time-out, determines goal task starting failure.
Optionally, real if at least one port is not in physical link starting state in the port that goal task is relied on When monitor the physical state of at least one port, can realize in the following way:
If at least one port is not in physical link starting state in the port that goal task is relied on, every default Second duration obtains the physical state of at least one port.
Specifically, every default second duration, the physics shape of at least one port can be obtained by the way of poll State.Wherein, preset the second duration can be set by technical staff according to practical application scene and empirical value, the present embodiment this Place is not specifically limited.
Optionally, real if at least one port is not in physical link starting state in the port that goal task is relied on When monitor the physical state of at least one port, can also realize in the following way:
If at least one port is not in physical link starting state in the port that goal task is relied on, interrupted Registration;Interrupt notification is received in real time, and interrupt notification is for illustrating that corresponding port has entered physical link starting state.
Correspondingly, in above-described embodiment two, the physical state of port is updated to physics by physical link closed state After link-up status, interrupt notification is generated, interrupt notification is for illustrating that port has entered physical link starting state.
Specifically, during the starting task execution of goal task, if at least one in the port that goal task is relied on A port is not in physical link starting state, can carry out interruption registration;Port monitoring control module is by the physics of port After state is updated to physical link starting state by physical link closed state, interrupt notification can be generated, and open close in passing through Know and informs that the physical state of the starting task port of goal task enters physical link starting state;The starting task of goal task According to the interrupt notification received, it can determine that port enters physical link starting state.
Further, if multiple ports are not in physical link starting state in the port that goal task is relied on, often After receiving an interrupt notification, the port for entering physical link starting state is determined;Then, it is determined that goal task institute according to Whether there is also the ports for being not in physical link starting state in bad port;If in the port that goal task is relied on also In the presence of the port for being not in physical link starting state, then continue waiting for receiving interrupt notification;What if goal task was relied on There is no the ports for being not in physical link starting state in port, it is determined that the port that goal task is relied on enters physics Link-up status.
Optionally, in another embodiment of the present embodiment, if at least one port in the port that goal task is relied on Be not in physical link starting state, can continue to start in goal task be not in the port of physical link starting state without The part of pass;Part relevant to the port for being not in physical link starting state, that is, dependence are not in physical link and open The part of the port of dynamic state, then enter physical link starting state in port and then continue to start.
Step S305, judge whether goal task starts time-out.
If goal task starting time-out, thens follow the steps S306, goal task starting failure is determined.
If goal task does not start time-out, step S302 is continued to execute.
In the present embodiment, timing can be started when receiving the software task enabled instruction to goal task, if counting When reaching preset task starting duration, the also inactive completion of goal task, then it is determined that goal task starting time-out, target are appointed Business starting failure.
If step S306, goal task starting time-out, it is determined that goal task starting failure.
In addition, in starting device, concurrently carrying out the Booting sequence of hardware port and software task in the present embodiment. Start port process referring to above-described embodiment one or embodiment two, during starting port, if port relied on it is soft The inactive completion of part task then waits relied on software task start completion and then continues to start port.Start software to appoint The process of business is referring to above-described embodiment three, during starting software task, if the port that software task is relied on is not in Physical link starting state, then equal relied on port start completion enters after physical link starting state, continues to start soft Part task.
The embodiment of the present invention is by equipment start-up course, in response to the software task enabled instruction to goal task, Obtain the physical state for the port that goal task is relied on;Judge whether the port that goal task is relied on is in physical link Starting state;If at least one port is not in physical link starting state in the port that goal task is relied on, in real time The physical state of at least one port is monitored, until the port that goal task is relied on is in physical link starting state, is opened Moving-target task;It is able to achieve effective control of the physical state in equipment start-up course to port;Process in starting port In, if the inactive completion of software task that port is relied on, wait relied on software task start completion and then continuation Start port;During starting software task, if the port that software task is relied on is not in physical link starting state, Then equal relied on port start completion enters after physical link starting state, continues to start software task, so as to protect Card electronic equipment normally starts.
Example IV
Fig. 4 is the structural schematic diagram for the port status control device that the embodiment of the present invention four provides.The embodiment of the present invention mentions The port status control device of confession can execute the process flow of port condition control method embodiment offer.As shown in figure 4, should Port status control device 40 includes: port monitoring control module 401 and port starting module 402.
Specifically, port monitoring control module 401, in response to the enabled instruction to port, monitoring port to be relied on Software task starting situation;After the equal start completion of software task that port is relied on, port is started switch into setting It is in an open state.
Port starting module 402 carries out link negotiation for control port;The physical state of port is closed by physical link Closed state is updated to physical link starting state.
Wherein, port is started switch for whether control port can to carry out link negotiation, is arranged to when starting switch When opening state, port can carry out link negotiation, when start switch be set to off closed state when, port be not available for link association Quotient.
Optionally, port monitoring control module is also used to:
In response to the enabled instruction to port, the starting situation for the software task that port is relied on is obtained;If port institute according to The inactive completion of at least one software task in bad software task obtains port institute after being then spaced default first duration again The starting situation of the software task of dependence, until the equal start completion of software task that port is relied on.
Optionally, port starting module is also used to:
After control port carries out link negotiation, it is spaced default starting duration, by the physical state of port by physics chain Road closed state is updated to physical link starting state.
Device provided in an embodiment of the present invention can be specifically used for executing provided by above-described embodiment one or embodiment two Embodiment of the method, details are not described herein again for concrete function.
The embodiment of the present invention is by response to the enabled instruction to port, the starting for the software task that monitoring port is relied on Situation;After the equal start completion of software task that port is relied on, the setting that starts switch of port is in an open state, control terminal Mouth carries out link negotiation;The physical state of port is updated to physical link starting state by physical link closed state;Pass through Starting switch for port is set, is started switch after being arranged to opening state, port can just carry out link negotiation, realize in port In the case that the software task starting relied on does not complete, is started switch and be in off state by default setting, can be delayed end The starting of mouth physical layer, realizes effective control to port status, in the equal start completion of software task that port is relied on In the case of, start port as soon as possible, so that port enters physical link starting state, so that relying on the software of port Task normally starts, and guarantees that electronic equipment normally starts, and can shorten the starting time of electronic equipment.
Embodiment five
Fig. 5 is the structural schematic diagram for the port status control device that the embodiment of the present invention five provides.In above-described embodiment four On the basis of, in the present embodiment, as shown in figure 5, port status control device 40 further include: task start module 403.
In the present embodiment, port monitoring control module is also used to: in response to the software task enabled instruction to goal task, Obtain the physical state for the port that goal task is relied on.
Task start module 403 is used for:
Judge whether the port that goal task is relied on is in physical link starting state;What if goal task was relied on At least one port is not in physical link starting state in port, then monitors the physical state of at least one port in real time, Until the port that goal task is relied on is in physical link starting state;If the port that goal task is relied on is in object Link-up status is managed, goal task is started.
Optionally, port monitoring control module is also used to:
If at least one port is not in physical link starting state in the port that goal task is relied on, every default Second duration obtains the physical state of at least one port.
Optionally, port monitoring control module is also used to:
If at least one port is not in physical link starting state in the port that goal task is relied on, interrupted Registration;Interrupt notification is received in real time, and interrupt notification is for illustrating that port has entered physical link starting state.
Optionally, port starting module is also used to:
After the physical state of port is updated to physical link starting state by physical link closed state, generates and interrupt Notice, interrupt notification is for illustrating that port has entered physical link starting state.
Optionally, task start module 403 is also used to:
Judge whether goal task starts time-out, if goal task starting time-out, it is determined that goal task starting failure.
Device provided in an embodiment of the present invention can be specifically used for executing embodiment of the method provided by above-described embodiment three, Details are not described herein again for concrete function.
The embodiment of the present invention is by equipment start-up course, in response to the software task enabled instruction to goal task, Obtain the physical state for the port that goal task is relied on;Judge whether the port that goal task is relied on is in physical link Starting state;If at least one port is not in physical link starting state in the port that goal task is relied on, in real time The physical state of at least one port is monitored, until the port that goal task is relied on is in physical link starting state, is opened Moving-target task;It is able to achieve effective control of the physical state in equipment start-up course to port;Process in starting port In, if the inactive completion of software task that port is relied on, wait relied on software task start completion and then continuation Start port;During starting software task, if the port that software task is relied on is not in physical link starting state, Then equal relied on port start completion enters after physical link starting state, continues to start software task, so as to protect Card electronic equipment normally starts.
Embodiment six
Fig. 6 is the structural schematic diagram for the electronic equipment that the embodiment of the present invention six provides.As shown in fig. 6, the electronic equipment 70 It include: processor 701, memory 702, and it is stored in the computer journey that can be run on memory 702 and on processor 701 Sequence.
Wherein, the port status control that any of the above-described embodiment of the method provides is realized when processor 701 runs computer program Method processed.
The embodiment of the present invention is by response to the enabled instruction to port, the starting for the software task that monitoring port is relied on Situation;After the equal start completion of software task that port is relied on, the setting that starts switch of port is in an open state, control terminal Mouth carries out link negotiation;The physical state of port is updated to physical link starting state by physical link closed state;Pass through Starting switch for port is set, is started switch after being arranged to opening state, port can just carry out link negotiation, realize in port In the case that the software task starting relied on does not complete, is started switch and be in off state by default setting, can be delayed end The starting of mouth physical layer, realizes effective control to port status, in the equal start completion of software task that port is relied on In the case of, start port as soon as possible, so that port enters physical link starting state, so that relying on the software of port Task normally starts, and guarantees that electronic equipment normally starts, and can shorten the starting time of electronic equipment.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium, the computer readable storage medium In be stored with computer program, the computer program realizes the end that any of the above-described embodiment of the method provides when being executed by processor Mouth condition control method.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or logical of device or unit Letter connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various It can store the medium of program code.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module Division progress for example, in practical application, can according to need and above-mentioned function distribution is complete by different functional modules At the internal structure of device being divided into different functional modules, to complete all or part of the functions described above.On The specific work process for stating the device of description, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.The present invention is directed to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claims are pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is only limited by appended claims System.

Claims (12)

1. a kind of port status control method characterized by comprising
In response to the enabled instruction to port, the starting situation for the software task that the port is relied on is monitored;
After the equal start completion of software task that the port is relied on, open shape is set by starting switch for the port State controls the port and carries out link negotiation;
The physical state of the port is updated to physical link starting state by physical link closed state.
2. the method according to claim 1, wherein the enabled instruction in response to port, described in monitoring The starting situation for the software task that port is relied on, comprising:
In response to the enabled instruction to port, the starting situation for the software task that the port is relied on is obtained;
If the inactive completion of at least one software task in the software task that the port is relied on, it is spaced default first duration Afterwards, the starting situation for the software task that the port is relied on is obtained again, until the software task that the port is relied on is equal Start completion.
3. the method according to claim 1, wherein the physical state by the port is closed by physical link Closed state is updated to physical link starting state, comprising:
After controlling the port and carrying out link negotiation, it is spaced default starting duration, by the physical state of the port by object Reason linkdown state is updated to physical link starting state.
4. the method according to claim 1, wherein the method also includes:
In response to the software task enabled instruction to goal task, the physics shape for the port that the goal task is relied on is obtained State;
Judge whether the port that the goal task is relied on is in physical link starting state;
If at least one port is not in physical link starting state in the port that the goal task is relied on, supervise in real time The physical state of at least one port is controlled, until the port that the goal task is relied on is in physical link starting shape State;
If the port that the goal task is relied on is in physical link starting state, start the goal task.
5. if according to the method described in claim 4, it is characterized in that, in the port that the goal task is relied at least A port is not in physical link starting state, then the physical state of at least one port is monitored in real time, until institute It states the port that goal task is relied on and is in physical link starting state, comprising:
If at least one port is not in physical link starting state in the port that the goal task is relied on, every default Second duration obtains the physical state of at least one port.
6. if according to the method described in claim 4, it is characterized in that, in the port that the goal task is relied at least A port is not in physical link starting state, then the physical state of at least one port is monitored in real time, until institute It states the port that goal task is relied on and is in physical link starting state, comprising:
If at least one port is not in physical link starting state in the port that the goal task is relied on, interrupted Registration;
Interrupt notification is received in real time, and the interrupt notification is for illustrating that port has entered physical link starting state.
7. according to the method described in claim 6, it is characterized in that, the physical state by the port is closed by physical link Closed state is updated to after physical link starting state, further includes:
Interrupt notification is generated, the interrupt notification is for illustrating that the port has entered physical link starting state.
8. the method according to any one of claim 4 to 6, which is characterized in that described in response to the soft of goal task Part task start instructs, after the physical state for obtaining the port that the goal task is relied on, further includes:
Judge whether the goal task starts time-out, if goal task starting time-out, it is determined that the goal task opens Dynamic failure.
9. a kind of port status control device characterized by comprising
Port monitoring control module, for monitoring the software task that the port is relied in response to the enabled instruction to port Starting situation;After the equal start completion of software task that the port is relied on, set starting switch for the port to Opening state;
Port starting module carries out link negotiation for controlling the port;By the physical state of the port by physical link Closed state is updated to physical link starting state.
10. device according to claim 9, which is characterized in that described device further includes task start module;Wherein,
The port monitoring control module is also used to: in response to the software task enabled instruction to goal task, obtaining the mesh The physical state for the port that mark task is relied on;
The task start module is used for:
Judge whether the port that the goal task is relied on is in physical link starting state;If goal task institute according to At least one port is not in physical link starting state in bad port, then monitors the object of at least one port in real time Reason state, until the port that the goal task is relied on is in physical link starting state;If goal task institute according to Bad port is in physical link starting state, starts the goal task.
11. a kind of electronic equipment characterized by comprising
Processor, memory, and it is stored in the computer program that can be run on the memory and on the processor;
Wherein, such as method described in any item of the claim 1 to 8 is realized when the processor runs the computer program.
12. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes such as method described in any item of the claim 1 to 8 when the computer program is executed by processor.
CN201910649909.2A 2019-07-18 2019-07-18 Port state control method, device, equipment and computer readable storage medium Active CN110365538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910649909.2A CN110365538B (en) 2019-07-18 2019-07-18 Port state control method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910649909.2A CN110365538B (en) 2019-07-18 2019-07-18 Port state control method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110365538A true CN110365538A (en) 2019-10-22
CN110365538B CN110365538B (en) 2022-09-13

Family

ID=68220147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910649909.2A Active CN110365538B (en) 2019-07-18 2019-07-18 Port state control method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110365538B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923031A (en) * 2021-10-12 2022-01-11 百果园技术(新加坡)有限公司 Data transmission method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174851A1 (en) * 2006-01-20 2007-07-26 Emulex Design & Manufacturing Corporation N-Port virtualization driver-based application programming interface and split driver implementation
CN101087204A (en) * 2005-04-01 2007-12-12 阿尔卡特公司 System and method for controlling boot-up process using preconfiguration of port hardware
CN101252532A (en) * 2008-03-18 2008-08-27 华为技术有限公司 Equipment and method for collocating Ethernet link polymerization terminal port
US20100250810A1 (en) * 2009-03-27 2010-09-30 International Business Machines Corporation Interrupt-driven link status feedback mechanism for embedded switches
CN109783158A (en) * 2019-01-14 2019-05-21 深圳市脸萌科技有限公司 Using starting task processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101087204A (en) * 2005-04-01 2007-12-12 阿尔卡特公司 System and method for controlling boot-up process using preconfiguration of port hardware
US20070174851A1 (en) * 2006-01-20 2007-07-26 Emulex Design & Manufacturing Corporation N-Port virtualization driver-based application programming interface and split driver implementation
CN101252532A (en) * 2008-03-18 2008-08-27 华为技术有限公司 Equipment and method for collocating Ethernet link polymerization terminal port
US20100250810A1 (en) * 2009-03-27 2010-09-30 International Business Machines Corporation Interrupt-driven link status feedback mechanism for embedded switches
CN109783158A (en) * 2019-01-14 2019-05-21 深圳市脸萌科技有限公司 Using starting task processing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923031A (en) * 2021-10-12 2022-01-11 百果园技术(新加坡)有限公司 Data transmission method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110365538B (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN109150831B (en) Endogenous safe cloud task execution device and method
US11888762B1 (en) VNFM assisted fault handling in virtual network function components
CN107209671B (en) Dynamic automatic monitoring and control of boot operations in a computer
US8146073B2 (en) Updating software while it is running
US8935375B2 (en) Increasing availability of stateful applications
EP2630567B1 (en) Coordinated upgrades in distributed systems
US10768960B2 (en) Method for affinity binding of interrupt of virtual network interface card, and computer device
US8122280B2 (en) Method and system for providing high availability to computer applications
TW201944236A (en) Task processing method, apparatus, and system
US11528183B1 (en) EMS assisted split-brain resolution in virtual network function components
CN103986762A (en) Process state detection method and device
EP3472971A1 (en) Technique for resolving a link failure
CN107003891A (en) Virtual machine switching method, device, electronic equipment and computer program product
CN106161086B (en) The control method and device that master control borad is restarted
EP3499373B1 (en) Method and apparatus for processing process
CN110489305B (en) Server management method and device
JP4517923B2 (en) Object relief system and method
CN110365538A (en) Port status control method, device, equipment and computer readable storage medium
US10606632B2 (en) Preventing interruption during virtual machine reboot
CN113110883B (en) Starting method, device, equipment and storage medium of block chain system
CN105487847B (en) A kind of function dissemination method and equipment
CN108234215B (en) Gateway creating method and device, computer equipment and storage medium
CN114020342B (en) Starting method and device of embedded equipment, embedded equipment and storage medium
JP2019079309A (en) Start management apparatus, start management system, start management method, and start management program
WO2024076425A1 (en) Termination of sidecar containers

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant