[go: up one dir, main page]

CN101217421B - A detection of protocol component based realization method, component group, hardware adapting method and device - Google Patents

A detection of protocol component based realization method, component group, hardware adapting method and device Download PDF

Info

Publication number
CN101217421B
CN101217421B CN2008100007965A CN200810000796A CN101217421B CN 101217421 B CN101217421 B CN 101217421B CN 2008100007965 A CN2008100007965 A CN 2008100007965A CN 200810000796 A CN200810000796 A CN 200810000796A CN 101217421 B CN101217421 B CN 101217421B
Authority
CN
China
Prior art keywords
component
detection
detection protocol
speed
interface
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.)
Expired - Fee Related
Application number
CN2008100007965A
Other languages
Chinese (zh)
Other versions
CN101217421A (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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2008100007965A priority Critical patent/CN101217421B/en
Publication of CN101217421A publication Critical patent/CN101217421A/en
Application granted granted Critical
Publication of CN101217421B publication Critical patent/CN101217421B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The invention discloses a method for realizing a component based detecting protocol and a components group of the detecting protocol, and moreover a hardware adaptation method of the detecting protocol and a hardware adaptation device of the detecting protocol; wherein, the hardware adaptation method of the detecting protocol includes: testing whether the present hardware architecture comprises one or more CPU or CPU core when the detecting protocol initializes; if YES, using a processing component of the detecting protocol on a main CPU and a adaptation component with high speed on an auxiliary CPU and communicating the adaptation component with high speed with a port component of the detecting protocol on the main CPU; or else, using the processing component of the detecting protocol and a adaptation component with low speed on the present CPU and communicating the adaptation component with low speed with a port component of the detecting protocol. The invention has the advantages of helping detecting protocol realize the automatic adaptation with different hardware architecture and having good expansibility and compatibility.

Description

Detection protocol componential realizing method, component sets, hardware adapting method and device
Technical field
The present invention relates to communication technical field, relate in particular to a kind of detection protocol componential realizing method, a kind of detection protocol component sets, a kind of detection protocol hardware adapting method and a kind of detection protocol hardware adaptive device.
Background technology
Detection protocol is used to find network defective; thereby the protection that triggers next step is switched; to improve the reliability of network; BFD (the BidirectionalForwarding Detection that proposes in succession as standardization bodies such as IETF, ITU, IEEE; two-way forwarding detection), MPLS OAM (Multi-Protocol LabelSwitch Operations and Management; multiprotocol label switching operation and management), EthernetOAM (Operations and Management, operation and management) etc.On principle, present detection protocol all is by periodically sending detection messages, and whether periodic test receives that detection messages (back message using) judges whether the path exists defective.
At present, above-mentioned detection protocol generally is with common procotol etc., is placed among the CPU and realizes.Specifically, for centralized device, above-mentioned consultation is placed in the host CPU to be realized; For distributed apparatus, above-mentioned agreement will be looked concrete condition, and the CPU that is placed on master control borad or cable card board goes up and realizes.But, detection protocol and other procotol are realized in same CPU, be easy to because the influence of other agreement makes equipment delay to send detection messages, thereby causing detecting performance is difficult to guarantee that this problem is especially obvious when the sense cycle of 10ms level detects even with submicrosecond in detection protocol.We can carry out the division of high speed detection and low-speed detection according to the numerical value of sense cycle with to detecting Effect on Performance as differentiation; For instance, when with 50ms being boundary when dividing, we are sense cycle that 50ms and following detection thereof call high speed detection, and sense cycle is that the above detection of 50ms is called low-speed detection; Again for example, with 100ms boundary when dividing, we are sense cycle that 100ms and following detection thereof call high speed detection, sense cycle is that the above detection of 100ms is called low-speed detection.It may be noted that, the cut off value of dividing high speed/low-speed detection is to be provided with according to different products or application, above-mentioned 50ms, 100ms mainly are applicable to high-end devices, and for low side devices, can with second as cut off value, sense cycle is that 1s and following detection thereof become high speed detection, and sense cycle is the low-speed detection that is called more than the 1s.In any case though depend on the ability and the objective detection demand of place equipment, the cut off value of detection protocol is also uncertain; But and other procotol is when realizing in same CPU, and detection protocol certainly exists a cut off value, when it adopts when being the high speed detection of benchmark with this cut off value, will cause detecting performance decrease.
Along with the cost of CPU constantly reduces, and the appearance of double-core even multi-core CPU, can increase auxiliary CPU by extra in system, perhaps adopt a nuclear of multi-core CPU, independently realize above-mentioned measuring ability, the performance of assurance high speed detection.For this independent CPU that realizes measuring ability, can be referred to as aiding CPU.
But, because product has different forms in actual the use, such as whether there being aiding CPU, the otherness of hardware structure when perhaps having aiding CPU (as centralized/distributed), therefore often need form, realize the setting of detection protocol by the mode of static state compiling according to product reality.This also just means, when detection protocol operates in the different products, has to carry out corresponding modification and debugging, autgmentability and compatible relatively poor.
Summary of the invention
A purpose of the embodiment of the invention is to provide a kind of componentization implementation of detection protocol, and agreement realization function and transmission-receiving function with the separation detection agreement make it support high speed detection and low-speed detection respectively.
Another purpose of the embodiment of the invention is to provide the hardware adaptation scheme of detection protocol, can realize detection protocol adaptive automatically under the different hardware framework.
For realizing above-mentioned first purpose, embodiments of the invention provide the detection protocol componential realizing method, may further comprise the steps:
Agreement is split as processing member, interface component, the adaptive member of high speed with packet sending and receiving ability and the adaptive member of low speed;
When the adaptive member of high speed enabled, this processing member called the adaptive member of described high speed by described interface component, realized detecting according to the high speed detection cycle that is provided with;
When the adaptive member of low speed enabled, this processing member called the adaptive member of described low speed by described interface component, realized detecting according to the low-speed detection cycle that is provided with.
In order to realize above-mentioned first purpose, embodiments of the invention also provide a kind of detection protocol component sets, comprising:
Adaptive member of high speed and the adaptive member of low speed with packet sending and receiving ability;
Interface component, be connected with the adaptive member of low speed with the adaptive member of this high speed respectively by this interface component, be used under the situation that the adaptive member of high speed enables, call the adaptive member of high speed, realize detecting under the situation that the adaptive member of low speed enables according to the high speed detection cycle that is provided with, call the adaptive member of low speed, realize detecting according to the low-speed detection cycle that is provided with.
In order to realize above-mentioned second purpose, embodiments of the invention provide a kind of detection protocol hardware adapting method, may further comprise the steps:
S1, when the detection protocol initialization, detect current hardware structure and whether have two above CPU or CPU nuclear;
S2, be then, the processing member of enable detection agreement on host CPU, the adaptive member of the high speed of enable detection agreement on aiding CPU, and the adaptive member of this high speed is associated to the interface component of this detection protocol on the host CPU;
S3 otherwise, the processing member of enable detection agreement and the adaptive member of low speed on current C PU, and the adaptive member of this low speed is associated to the interface component that current C PU goes up this detection protocol.
In order to realize above-mentioned second purpose, embodiments of the invention also provide a kind of detection protocol hardware adaptive device, comprising:
The hardware structure detecting unit is used for when the detection protocol initialization, detects current hardware structure and whether has two above CPU or CPU nuclear;
The high speed adaptation unit, be used to accept the triggering of this hardware structure detecting unit under situation with two above CPU or CPU nuclear, the processing member of enable detection agreement on host CPU, the adaptive member of the high speed of enable detection agreement on aiding CPU, and the adaptive member of this high speed is associated to the interface component of this detection protocol on the host CPU;
The low speed adaptation unit, be used to accept this triggering of hardware structure detecting unit under the situation that only has a monokaryon CPU, the processing member of enable detection agreement and the adaptive member of low speed on current C PU, and the adaptive member of this low speed is associated to the interface component that current C PU goes up detection protocol.
As shown from the above technical solution, embodiments of the invention are by the componentization detection protocol, and the mode that adopts the detection protocol processing capacity to separate with transmission-receiving function has following beneficial effect:
1, realizes detection protocol adaptive automatically under the different hardware framework, have favorable expansibility and compatibility;
2, under the aiding CPU framework, support protocol detection function at a high speed.
With reference to the accompanying drawing description of a preferred embodiment, above-mentioned and other purpose of the present invention, feature and advantage will be more obvious by following.
Description of drawings
Fig. 1 is the functional schematic of detection protocol;
Fig. 2 is the block diagram of detection protocol component sets one embodiment provided by the invention;
Fig. 3 is the block diagram of another embodiment of detection protocol component sets provided by the invention;
Fig. 4 is the flow chart of detection protocol hardware adapting method one embodiment provided by the invention;
Fig. 5 is the flow chart of another embodiment of detection protocol hardware adapting method provided by the invention;
Fig. 6 A be Fig. 4 or embodiment illustrated in fig. 5 in, the schematic diagram that message sends on the aiding CPU;
Fig. 6 B Fig. 4 or embodiment illustrated in fig. 5 in, the schematic diagram that message receives on the aiding CPU;
Fig. 6 C be Fig. 4 or embodiment illustrated in fig. 5 in, another schematic diagram that message sends on the aiding CPU;
The block diagram of Fig. 7 detection protocol hardware provided by the invention adaptive device one embodiment;
Fig. 8 be detection protocol hardware adaptive device provided by the invention adaptive after, the block diagram of member embodiment in host CPU and the aiding CPU.
Embodiment
To describe specific embodiments of the invention in detail below.Should be noted that the embodiments described herein only is used to illustrate, be not limited to the present invention.
At first, mandatory declaration be, general plotting of the present invention is that the detection protocol by a kind of componentization shields the difference of hardware structure, thereby on equipment, can realize detection at a high speed with centralized/distributed aiding CPU hardware, on the equipment that does not possess aiding CPU hardware, can realize the detection of low speed.
In order to realize this purpose, at first need to learn about the major function of agreement, as shown in Figure 1, be the functional schematic of detection protocol.
Wherein, finish the required processing of carrying out of detection protocol function and comprise: state machine and corresponding state computing have constituted the core processing part of agreement, have very strong extraneous dependence, need carry out state transformation according to the instruction in the external world; Accordingly, it is then irrelevant with the variation in the external world that processing is received/sent out to message, but it has very high time requirement.
In order to make detection protocol can adapt to various hardware structures with the modification of minimum, embodiments of the invention provide a kind of detection protocol componentization method, may further comprise the steps:
Agreement is split as the adaptive member of low speed of handling member, interface component, having the adaptive member of high speed of packet sending and receiving ability and have the packet sending and receiving ability; Adaptive member of this high speed and the adaptive member of this low speed can be handled component composition with this respectively by this interface component, realize complete detection protocol function.
When the adaptive member of high speed enabled, this processing member called the adaptive member of high speed by interface component, realized detecting according to the high speed detection cycle that is provided with, and promptly handled the adaptive component composition of member, interface component and high speed and was operated under the fast mode; It is pointed out that the concrete sense cycle of using the adaptive member of this high speed need be provided with according to actual conditions, such as the 50ms of high-end devices, below the 100ms, the 1s of low side devices is with inferior.
When the adaptive member of low speed enabled, this processing member called the adaptive member of low speed by interface component, realized detecting according to the low-speed detection cycle that is provided with, and promptly handled the adaptive component composition of member, interface component and low speed and was operated under the low-speed mode; It may be noted that equally the concrete sense cycle of using the adaptive member of this low speed also needs to be provided with according to actual conditions, such as the 50ms of high-end devices, more than the 100ms, the 1s of low side devices is with first-class.
By above step, just can detection protocol is independent to the high part of time requirement, realize the componentization separating treatment of detection protocol function.
Because in the protocol detection process, the easiest function that is subjected to the hardware influence is that message sends, this just makes the adaptive member of high speed have multiple method for splitting.
For example, the adaptive member of high speed only can be split as message and send sub-member, other function as periodically control, message reception etc., also is placed on to handle in the member and finishes; Thereby satisfy the most basic, the requirement that sends at a high speed for detection messages; In this case, handle member according to the high speed detection cycle that is provided with, periodically calling the adaptive member of high speed by interface component sends the relevant detection protocol massages, and receives and handle back message using voluntarily.
Again for example, the adaptive member of high speed is split as message sends sub-member and message receives sub-member, thereby further satisfies the requirement that detection messages receives stability; In this case, handle member according to the high speed detection cycle that is provided with, periodically calling the adaptive member of high speed by interface component sends the relevant detection protocol massages; And receive and handle the back message using that the adaptive member of described high speed receives by interface component.
On the basis of above-mentioned two kinds of situations, the adaptive member of high speed can also be split out the sub-member of task; Wherein, the sub-member of this task is used for periodically instructing message to send the transmission that sub-member carries out detection messages according to handling the high speed detection cycle that member issues, and further reduces the workload of handling member.That is to say, handle member and can call the adaptive member of high speed, make it, periodically send the relevant detection protocol massages according to the high speed detection cycle that is provided with by interface component.
One of ordinary skill in the art will appreciate that the adaptive member of low speed can carry out the similar fractionation of sub-member equally, does not repeat them here.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, described program can be stored in the computer read/write memory medium, this program comprises the steps: when carrying out
Agreement is split as processing member, interface component, the adaptive member of high speed with packet sending and receiving ability and the adaptive member of low speed;
When the adaptive member of high speed enabled, described processing member called the adaptive member of described high speed by described interface component, realized detecting according to the high speed detection cycle that is provided with;
When the adaptive member of low speed enabled, described processing member called the adaptive member of described low speed by described interface component, realized detecting according to the low-speed detection cycle that is provided with.
Described storage medium comprises: ROM/RAM (Read Only Memory/Random-AccessMemory, read-only memory/random-access memory), magnetic disc or CD etc.
Accordingly, embodiments of the invention provide detection protocol component sets 10, as shown in Figure 2, comprising:
Handle member 11;
Interface component 12;
Adaptive member 13 Hes of high speed with packet sending and receiving ability
The adaptive member 14 of low speed;
Wherein, handle member 11 and be connected with the adaptive member 14 of low speed with the adaptive member 13 of high speed respectively, be used under the situation that the adaptive member 13 of high speed enables, calling the adaptive member 13 of high speed, realize detecting according to the high speed detection cycle that is provided with by interface component 12; Under the situation that the adaptive member 14 of low speed enables, call the adaptive member 14 of low speed, realize detecting according to the low-speed detection cycle that is provided with.
By above-mentioned component sets 10, when the adaptive member 14 of adaptive member 13/ low speed of high speed was registered on the interface component 12, processing module 11 can be understood current detecting pattern, thereby carried out high speed/low-speed detection.
It may be noted that the adaptive member 13 of high speed comprises at least:
Message sends sub-member 13A, is used for according to the processing member 11 of detection protocol sending the relevant detection protocol massages periodically by the calling of interface component 12; Thereby satisfy the most basic, the requirement that sends at a high speed for detection messages.
Preferable, the adaptive member 13 of high speed also comprises: message receives sub-member 13B, is used to discern the detection protocol message that receives, and corresponding the triggering by interface component 12 handled members 11 and handled.
Better, in order further to reduce the workload of handling member, the adaptive member 13 of high speed also comprises the sub-member 13C of task, being arranged on interface component 12 and message sends between the sub-member 13A, be used for according to handling the high speed detection cycle that member 11 issues, the periodic triggers message sends sub-member 13A and sends the relevant detection protocol massages.
As shown in Figure 3, the block diagram that has shown 10 1 preferred embodiments of detection protocol component sets.
On the basis that the detection protocol componentization is divided, the embodiment of the invention provides the detection protocol hardware adapting method, as shown in Figure 4, may further comprise the steps:
S1, when the detection protocol initialization, detect current hardware structure and whether have two above CPU or CPU nuclear; Be execution in step S2 then, otherwise execution in step S3;
Generally speaking, the detection protocol initialization all occurs in the system starting process, can know current hardware structure by means such as existing systems self checks, does not repeat them here.
But, when having a plurality of CPU or a plurality of CPU nuclear, might the user also not necessarily wish to enable high speed detection.Therefore, have only when hardware capabilities and user configuration is all supported aiding CPU, just can enable the high speed detection ability.That is to say, detect current hardware structure among the step S 1 and have after plural CPU or the CPU nuclear, comprise also whether detection enables the step of high speed detection, is execution in step S2 then, otherwise execution in step S3.
S2, on host CPU the processing member of enable detection agreement, the adaptive member of the high speed enable detection agreement, that have high-speed message transmitting-receiving adaptation ability on aiding CPU, and the adaptive member of this high speed is associated to the interface component of detection protocol on the host CPU;
By this step S2, can be under the aiding CPU framework, finish in the detection protocol the high part of time requirement being placed on the aiding CPU, the part that dependence is strong to external world is placed on the host CPU finishes.
Further, in this step S2,, can specify host CPU at random identifying under the situation with many CPU or CPU nuclear.But because in the actual different product form, there is certain difference in the planning of aiding CPU, for instance, aiding CPU can be positioned on the master control borad of distributed apparatus, also can be positioned on the cable card board of distributed apparatus, certainly, aiding CPU also might be positioned on the centralized device.Therefore, often identify under the situation with many CPU or CPU nuclear, also need actual conditions, select a suitable host CPU according to agreement at this step S2, common, be to select the CPU of master control borad as host CPU.
The CPU that it may be noted that the option interface plate is also no problem as host CPU, just realizes going up slightly more complicated, the situation that host CPU shifts when needing the consideration interface board to extract.
S3, on current C PU the enable detection agreement the processing member and have the adaptive member of low speed of low speed packet sending and receiving adaptation ability and sense cycle be set, and the adaptive member of this low speed is associated to the interface component that current C PU goes up this detection protocol.
By above-mentioned steps S1~S3 as can be seen, by judging the existence of aiding CPU, can independently register different implementations in the interface component:, just register the interface of low speed adaption section for the system that does not support aiding CPU; For the system that supports aiding CPU, just register the interface of high speed adaption section.Like this, because the support of interface component for different detection modes arranged, when detection protocol is applied to different hardware structure (concentration/distribution formula, be/do not support aiding CPU etc.), agreement realizes that partly promptly handling member can not revise substantially, thereby realize detection protocol adaptive automatically under the different hardware framework, one cover detection protocol can be run on the hardware product of the different frameworks of many moneys, have favorable expansibility and compatibility.
Obviously, when the adaptive new hardware structure of needs, only needing increases corresponding association code, does not need to revise the code of handling member.
Simultaneously, this step S1~S3 provides using independent CPUs to realize the support of high speed detection function.
It is pointed out that above-mentioned steps S1~S3 is the hardware adaptive mechanism operation of detection protocol initial phase, makes detection protocol and current hardware configuration adaptive.But, realize detecting if want, also need the user after the detection protocol initialization procedure, need and detect according to hardware environment and require to be provided with the relevant detection cycle: owing to no longer compete with other procotol, therefore when on aiding CPU, having enabled the adaptive member of high speed, can this sense cycle of relative set be high speed detection; And when having enabled the adaptive member of low speed,, detection protocol is operated under the low-speed mode in order to guarantee to detect performance, promptly dispose the low-speed detection cycle.
Referring to Fig. 5, be the flow chart of another embodiment of hardware adapting method of detection protocol provided by the invention.
In Fig. 4 or step S2 shown in Figure 5, concrete, based on the difference fractionation mode of the adaptive member of high speed, the step that the adaptive member of high speed is associated to the interface component of detection protocol on the host CPU can comprise:
The interface that message is sent sub-member is registered on the interface component of detection protocol on the host CPU, and the processing member period that makes detection protocol is called message and sent the I/O interface transmission relevant detection protocol massages of sub-member by aiding CPU through registration interface; As shown in Figure 6A, thus satisfy the most basic, the requirement that sends at a high speed for detection messages.
It should be noted that in three agreements shown in Fig. 6 A,, determine because the host CPU of each agreement is the actual conditions of looking each agreement though it handles member and interface component all enables on host CPU, and does not mean that on same CPU.
Perhaps, the step that among the step S2 the adaptive member of high speed is associated to the interface component of detection protocol on the host CPU can comprise:
The interface that message is sent sub-member is registered on the interface component of detection protocol on the host CPU, and the processing member period that makes detection protocol is called message and sent the I/O interface transmission relevant detection protocol massages of sub-member by aiding CPU through registration interface; And, the interface that message is received sub-member is registered on the interface component of detection protocol on the host CPU, make the I/O interface of aiding CPU call the message that has enabled successively and receive sub-member, the detection protocol message that identification receives, and correspondingly trigger described processing member by registration interface and handle.Wherein, message receives the processing of sub-member on aiding CPU shown in Fig. 6 B.
Particularly, aspect the message reception,,, realize by the mode of relatively simply linking up with (Hook) so on aiding CPU, can realize complete agreement grader because the protocol type that carries on the aiding CPU is less relatively.General scheme is as follows: each agreement receives sub-member is registered to aiding CPU in the mode of hook I/O interface with its message after starting high speed detection.The function that the I/O interface of this aiding CPU is realized comprises the identification to protocol massages, and then, the message that calls registration successively receives sub-member message is handled.
Further, competition on the aiding CPU between a plurality of agreements, on the basis of situation shown in Fig. 6 A, the 6B, the registration that message can be sent sub-member replaces with the registration of the sub-member of task: the interface of the sub-member of task is registered on the interface component of the above detection protocol of host CPU, make it according to the calling of the processing member of detection protocol, the periodic triggers message sends the I/O interface of sub-member by aiding CPU and sends the relevant detection protocol massages.Be responsible for periodic message transmission work by the sub-member of independent task, can guarantee that not only the high speed of message sends, make the framework of the adaptive member of high speed more clear simultaneously, and be easy to expansion.
Further, on the basis of the sub-member of task, the priority that only message need be sent task in the system is heightened, and the sub-member of the task that is notified to, and just can guarantee the real-time that detection messages sends, thereby avoids the priority competition between a plurality of agreements.It specifically can be implemented by following steps: the sub-member of task obtains described processing member issues, detection protocol priority of messages by interface component, and with aiding CPU on the sub-member of task of other agreement carry out prioritization.
Shown in Fig. 6 C, shown the processing schematic diagram of the sub-member of task on aiding CPU.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, described program can be stored in the computer read/write memory medium, this program comprises the steps: when carrying out
S1, when the detection protocol initialization, detect current hardware structure and whether have two above CPU or CPU nuclear;
S2, be then, the processing member of enable detection agreement on host CPU, the adaptive member of the high speed of enable detection agreement on aiding CPU, and the adaptive member of described high speed is associated to the interface component of the above detection protocol of host CPU;
S3 otherwise, the processing member of enable detection agreement and the adaptive member of low speed on current C PU, and the adaptive member of described low speed is associated to the interface component of the above detection protocol of current C PU.
Described storage medium comprises: ROM/RAM (Read Only Memory/Random-AccessMemory, read-only memory/random-access memory), magnetic disc or CD etc.
Based on above-mentioned detection protocol component sets, embodiments of the invention also provide detection protocol hardware adaptive device 20, as shown in Figure 7, comprising:
Hardware structure detecting unit 21 is used for when the detection protocol initialization, detects current hardware structure and whether has two above CPU or CPU nuclear;
High speed adaptation unit 22, be used to accept the triggering of hardware structure detecting unit 21 under situation with two above CPU or CPU nuclear, the processing member of enable detection agreement on host CPU, the adaptive member of the high speed of enable detection agreement on aiding CPU, and the adaptive member of high speed is associated to the interface component of detection protocol on the host CPU;
Low speed adaptation unit 23, be used to accept the triggering of hardware structure detecting unit 21 under the situation that only has a monokaryon CPU, the processing member of enable detection agreement and the adaptive member of low speed on current C PU, and the adaptive member of low speed is associated to the interface component of the above detection protocol of current C PU.
Preferable, also comprise adaptive detecting unit 24, be used to accept the triggering of hardware structure detecting unit 21 under situation, detect current hardware structure and whether enabled high speed detection with two above CPU or CPU nuclear, be then to trigger high speed adaptation unit 22, otherwise trigger low speed adaptation unit 23.
Better, high speed adaptation unit 22 comprises host CPU selection module 221, is used for determining host CPU according to the triggering to place high speed adaptation unit 22.
Hardware adaptive device 20 by above-mentioned detection protocol as can be seen, in service in detection protocol, can register real interface according to hardware structure, thereby realize the dynamic match technology, reach shielding to hardware structure, when making detection protocol operate on the different hardware, need to revise, adaptive part significantly reduces.Simultaneously, this hardware adaptive device 20 also provides using independent CPUs to realize the support of high speed detection function.
In conjunction with detection protocol component sets 10, through the hardware adaptive device 20 of detection protocol adaptive after, exist under the situation of aiding CPU, member embodiment as shown in Figure 8 in host CPU and the aiding CPU.
Though described the present invention with reference to several exemplary embodiments, should be appreciated that used term is explanation and exemplary and nonrestrictive term.The spirit or the essence that do not break away from invention because the present invention can specifically implement in a variety of forms, so be to be understood that, the foregoing description is not limited to any aforesaid details, and should be in the spirit and scope that claim limited of enclosing explain widely, therefore fall into whole variations in claim or its equivalent scope and remodeling and all should be the claim of enclosing and contain.

Claims (11)

1.一种检测协议构件化实现方法,其特征在于,包括以下步骤:1. A detection protocol componentized implementation method, characterized in that, comprising the following steps: 将协议拆分为处理构件、接口构件、具有报文收发能力的高速适配构件和具有报文收发能力的低速适配构件;Split the protocol into processing components, interface components, high-speed adaptation components capable of sending and receiving messages, and low-speed adaptation components capable of sending and receiving messages; 当高速适配构件使能时,所述处理构件通过所述接口构件调用所述高速适配构件,根据设置的高速检测周期实现检测;When the high-speed adaptation component is enabled, the processing component invokes the high-speed adaptation component through the interface component, and realizes detection according to the set high-speed detection cycle; 当低速适配构件使能时,所述处理构件通过所述接口构件调用所述低速适配构件,根据设置的低速检测周期实现检测。When the low-speed adaptation component is enabled, the processing component invokes the low-speed adaptation component through the interface component, and realizes the detection according to the set low-speed detection cycle. 2.根据权利要求1所述的检测协议构件化实现方法,其特征在于,所述处理构件通过接口构件调用高速适配构件,根据设置的高速检测周期实现检测的步骤包括:2. The detection protocol component implementation method according to claim 1, wherein the processing component calls the high-speed adaptation component through the interface component, and the step of realizing detection according to the set high-speed detection cycle includes: 所述处理构件根据设置的高速检测周期,周期性通过接口构件调用所述高速适配构件来发送相应的检测协议报文,或者,所述处理构件通过接口构件调用所述高速适配构件,使所述高速适配构件根据设置的高速检测周期,周期性发送相应的检测协议报文;According to the set high-speed detection period, the processing component periodically calls the high-speed adaptation component through the interface component to send the corresponding detection protocol message, or the processing component calls the high-speed adaptation component through the interface component, so that The high-speed adaptation component periodically sends corresponding detection protocol messages according to the set high-speed detection cycle; 以及,所述处理构件自行接收并处理回应报文,或者,所述处理构件通过接口构件接收并处理所述高速适配构件接收的回应报文。And, the processing component receives and processes the response message by itself, or the processing component receives and processes the response message received by the high-speed adaptation component through the interface component. 3.一种检测协议构件组,其特征在于,包括:3. A detection protocol component set, characterized in that, comprising: 具有报文收发能力的高速适配构件和具有报文收发能力的低速适配构件;A high-speed adaptation component capable of sending and receiving messages and a low-speed adaptation component capable of sending and receiving messages; 接口构件;interface component; 处理构件,通过所述接口构件分别与所述高速适配构件和低速适配构件连接,用于在高速适配构件使能的情况下,调用所述高速适配构件,根据设置的高速检测周期实现检测;在低速适配构件使能的情况下,调用所述低速适配构件,根据设置的低速检测周期实现检测。The processing component is connected to the high-speed adaptation component and the low-speed adaptation component respectively through the interface component, and is used to call the high-speed adaptation component when the high-speed adaptation component is enabled, and to perform the processing according to the set high-speed detection cycle Realize the detection; when the low-speed adaptation component is enabled, call the low-speed adaptation component, and realize the detection according to the set low-speed detection period. 4.根据权利要求3所述的检测协议构件组,其特征在于,所述高速适配构件至少包括:4. The detection protocol component set according to claim 3, wherein the high-speed adaptation component comprises at least: 报文发送子构件,用于根据所述检测协议的处理构件周期性通过接口构件的调用,发送相应的检测协议报文。The message sending sub-component is used for sending the corresponding detection protocol message according to the calling of the interface component periodically by the processing component of the detection protocol. 5.根据权利要求4所述的检测协议构件组,其特征在于,所述高速适配构件还包括:5. detection protocol component group according to claim 4, is characterized in that, described high-speed adaptation component also comprises: 报文接收子构件,用于识别接收到的检测协议报文,并相应通过接口构件触发所述处理构件进行处理;The message receiving sub-component is used to identify the received detection protocol message, and correspondingly trigger the processing component to process through the interface component; 和/或and / or 任务子构件,设置在所述接口构件和所述报文发送子构件之间,用于根据所述处理构件下发的高速检测周期,周期性触发所述报文发送子构件发送相应的检测协议报文。The task sub-component is arranged between the interface component and the message sending sub-component, and is used to periodically trigger the message sending sub-component to send the corresponding detection protocol according to the high-speed detection period delivered by the processing component message. 6.一种检测协议硬件适配方法,其特征在于,包括以下步骤:6. A detection protocol hardware adaptation method, characterized in that, comprising the following steps: S1、当检测协议初始化时,检测当前硬件架构是否具有两个以上CPU或CPU核;S1. When the detection protocol is initialized, detect whether the current hardware architecture has more than two CPUs or CPU cores; S2、是则,选择一个合适的主CPU,在主CPU上使能检测协议的处理构件,在辅助CPU上使能检测协议的高速适配构件,并将所述高速适配构件关联至主CPU上所述检测协议的接口构件;S2, if so, select a suitable main CPU, enable the processing component of the detection protocol on the main CPU, enable the high-speed adaptation component of the detection protocol on the auxiliary CPU, and associate the high-speed adaptation component to the main CPU Interface components of the above-mentioned detection protocol; S3、否则,在当前CPU上使能检测协议的处理构件和低速适配构件,并将所述低速适配构件关联至当前CPU上所述检测协议的接口构件。S3. Otherwise, enable the detection protocol processing component and the low-speed adaptation component on the current CPU, and associate the low-speed adaptation component with the detection protocol interface component on the current CPU. 7.根据权利要求6所述的检测协议硬件适配方法,其特征在于,所述步骤S1中检测当前硬件架构具有两个以上的CPU或CPU核之后,还包括检测是否启用高速检测的步骤,是则执行步骤S2,否则执行步骤S3。7. The detection protocol hardware adaptation method according to claim 6, characterized in that, after detecting that the current hardware architecture has more than two CPUs or CPU cores in the step S1, it also includes the step of detecting whether to enable high-speed detection, If yes, execute step S2; otherwise, execute step S3. 8.根据权利要求6或7所述的检测协议硬件适配方法,其特征在于,所述步骤S2中将高速适配构件关联至主CPU上检测协议的接口构件的步骤包括:8. The detection protocol hardware adaptation method according to claim 6 or 7, characterized in that, in the step S2, the step of associating the high-speed adaptation component with the interface component of the detection protocol on the main CPU comprises: 将报文发送子构件的接口注册到主CPU上所述检测协议的接口构件上,使所述检测协议的处理构件周期性经注册接口,调用所述报文发送子构件通过辅助CPU的I/O接口发送相应的检测协议报文;或者,将任务子构件的接口注册到主CPU上所述检测协议的接口构件上,使其根据所述检测协议的处理构件的调用,周期性触发所述报文发送子构件通过辅助CPU的I/O接口发送相应的检测协议报文;Register the interface of the message sending subcomponent on the interface component of the detection protocol on the main CPU, make the processing component of the detection protocol periodically through the registered interface, call the message sending subcomponent through the I/O of the auxiliary CPU The O interface sends the corresponding detection protocol message; or, the interface of the task subcomponent is registered on the interface component of the detection protocol on the main CPU, so that it can be triggered periodically according to the call of the processing component of the detection protocol. The message sending sub-component sends the corresponding detection protocol message through the I/O interface of the auxiliary CPU; 和/或and / or 将报文接收子构件的接口注册到主CPU上所述检测协议的接口构件上,使所述辅助CPU的I/O接口依次调用已使能的报文接收子构件,识别接收到的检测协议报文,并相应通过注册接口触发所述处理构件进行处理。Register the interface of the message receiving sub-component on the interface component of the detection protocol on the main CPU, so that the I/O interface of the auxiliary CPU calls the enabled message receiving sub-component in turn to identify the received detection protocol message, and correspondingly trigger the processing component to process through the registration interface. 9.根据权利要求8所述的检测协议硬件适配方法,其特征在于,所述将任务子构件的接口注册到主CPU上检测协议的接口构件上的步骤还包括:所述任务子构件通过接口构件获取所述处理构件下发的所述检测协议报文的优先级,并与所述辅助CPU上其它协议的任务子构件进行优先级排序。9. The detection protocol hardware adaptation method according to claim 8, characterized in that, the step of registering the interface of the task subcomponent on the interface component of the detection protocol on the main CPU further comprises: the task subcomponent passes The interface component obtains the priority of the detection protocol message issued by the processing component, and performs priority sorting with task subcomponents of other protocols on the auxiliary CPU. 10.一种检测协议硬件适配装置,其特征在于,包括:10. A detection protocol hardware adaptation device, characterized in that it comprises: 硬件架构检测单元,用于在检测协议初始化时,检测当前硬件架构是否具有两个以上CPU或CPU核;The hardware architecture detection unit is used to detect whether the current hardware architecture has more than two CPUs or CPU cores when the detection protocol is initialized; 高速适配单元,用于接受所述硬件架构检测单元在具有两个以上CPU或CPU核的情况下的触发,在主CPU上使能检测协议的处理构件,在辅助CPU上使能检测协议的高速适配构件,并将所述高速适配构件关联至主CPU上所述检测协议的接口构件;所述高速适配单元包括主CPU选择模块,用于根据对所在高速适配单元的触发,确定主CPU;The high-speed adaptation unit is used to accept the triggering of the hardware architecture detection unit when there are more than two CPUs or CPU cores, enable the processing components of the detection protocol on the main CPU, and enable the processing components of the detection protocol on the auxiliary CPU. A high-speed adaptation component, and associate the high-speed adaptation component with the interface component of the detection protocol on the main CPU; the high-speed adaptation unit includes a main CPU selection module for triggering the high-speed adaptation unit where it is located, Determine the main CPU; 低速适配单元,用于接受所述硬件架构检测单元在仅具有一个单核CPU的情况下的触发,在当前CPU上使能检测协议的处理构件和低速适配构件,并将所述低速适配构件关联至当前CPU上所述检测协议的接口构件。The low-speed adaptation unit is configured to accept the trigger of the hardware architecture detection unit when there is only one single-core CPU, enable the processing component and the low-speed adaptation component of the detection protocol on the current CPU, and transfer the low-speed adaptation The configuration component is associated with the interface component of the detection protocol on the current CPU. 11.根据权利要求10所述的检测协议硬件适配装置,其特征在于,还包括适配检测单元,用于接受所述硬件架构检测单元在具有两个以上CPU或CPU核的情况下的触发,检测当前硬件架构是否启用了高速检测,是则触发所述高速适配单元,否则触发所述低速适配单元。11. The detection protocol hardware adaptation device according to claim 10, further comprising an adaptation detection unit configured to accept the triggering of the hardware architecture detection unit when there are more than two CPUs or CPU cores , detecting whether high-speed detection is enabled in the current hardware architecture, and if so, triggering the high-speed adaptation unit, otherwise triggering the low-speed adaptation unit.
CN2008100007965A 2008-01-17 2008-01-17 A detection of protocol component based realization method, component group, hardware adapting method and device Expired - Fee Related CN101217421B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100007965A CN101217421B (en) 2008-01-17 2008-01-17 A detection of protocol component based realization method, component group, hardware adapting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100007965A CN101217421B (en) 2008-01-17 2008-01-17 A detection of protocol component based realization method, component group, hardware adapting method and device

Publications (2)

Publication Number Publication Date
CN101217421A CN101217421A (en) 2008-07-09
CN101217421B true CN101217421B (en) 2010-08-18

Family

ID=39623786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100007965A Expired - Fee Related CN101217421B (en) 2008-01-17 2008-01-17 A detection of protocol component based realization method, component group, hardware adapting method and device

Country Status (1)

Country Link
CN (1) CN101217421B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556641A (en) * 2004-01-01 2004-12-22 浙江大学 Component-based Realization Method of Communication Protocol
CN101079759A (en) * 2007-07-24 2007-11-28 杭州华三通信技术有限公司 Distributed bidirectional forwarding detection method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556641A (en) * 2004-01-01 2004-12-22 浙江大学 Component-based Realization Method of Communication Protocol
CN101079759A (en) * 2007-07-24 2007-11-28 杭州华三通信技术有限公司 Distributed bidirectional forwarding detection method and device

Also Published As

Publication number Publication date
CN101217421A (en) 2008-07-09

Similar Documents

Publication Publication Date Title
WO2017152633A1 (en) Port binding implementation method and device
JP4885316B2 (en) Test apparatus and test method
US9898435B2 (en) Aggregate baseboard management controller (BMC) controller
CN101226502B (en) Automatization test method and system
CN103164309A (en) SOL functional test method and system
CN115361327B (en) Method, device, terminal and medium for automatically testing NCSI command of network card
CN106997313B (en) Signal processing method and system of application program and terminal equipment
CN104683486A (en) Method and device for processing synchronous messages in distributed system and distributed system
CN101706752B (en) Method and device for in-situ software error positioning
CN103186447B (en) Bus read-write detection device
CN112787886B (en) Processing method, device driver, readable storage medium and computer for real-time system network device auto-negotiation
CN101217421B (en) A detection of protocol component based realization method, component group, hardware adapting method and device
CN109669905A (en) A kind of hot removing method, system and the relevant apparatus of PCIE device
JP2006164185A (en) Debug device
CN102819474A (en) Test method and device for system operation
CN115134427B (en) Communication protocol coordination method, device, computer equipment and storage medium
CN115933591A (en) Controller diagnosis method, device, equipment and storage medium
JP6509474B2 (en) Gateway apparatus, priority changing method and priority changing program
CN114461350A (en) Container usability testing method and device
CN101699417A (en) Interrupt method
US8205117B2 (en) Migratory hardware diagnostic testing
CN112152736A (en) Client front-end device, failure detection method for client front-end device, and storage medium
CN113497740A (en) Network forwarding equipment, link fault detection method, device and storage medium
CN115525415B (en) Data processing method, device, equipment and medium
CN117472440B (en) Chip control method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: NEW H3C TECHNOLOGIES Co.,Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: HANGZHOU H3C TECHNOLOGIES Co.,Ltd.

CP03 Change of name, title or address
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100818

CF01 Termination of patent right due to non-payment of annual fee