[go: up one dir, main page]

CN1984025B - Method and store-and-forward device for releasing invalidly occupied resources - Google Patents

Method and store-and-forward device for releasing invalidly occupied resources Download PDF

Info

Publication number
CN1984025B
CN1984025B CN2006100783810A CN200610078381A CN1984025B CN 1984025 B CN1984025 B CN 1984025B CN 2006100783810 A CN2006100783810 A CN 2006100783810A CN 200610078381 A CN200610078381 A CN 200610078381A CN 1984025 B CN1984025 B CN 1984025B
Authority
CN
China
Prior art keywords
output port
timer
data
data message
timing
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
CN2006100783810A
Other languages
Chinese (zh)
Other versions
CN1984025A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN2006100783810A priority Critical patent/CN1984025B/en
Publication of CN1984025A publication Critical patent/CN1984025A/en
Application granted granted Critical
Publication of CN1984025B publication Critical patent/CN1984025B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a method for releasing invalid occupied resources and a store-and-forward device, the core of which is that: when detecting that no data message is sent on the output port, starting a timer set corresponding to the output port to start timing; and when the timing time of the timer reaches a timing period, releasing the resources occupied by the invalidation. By the invention, when the output port works abnormally, the distributed resources can be released in time, and the participation of a CPU and the operation of software are not needed.

Description

释放被无效占用的资源的方法和存储转发装置Method and store-and-forward device for releasing invalidly occupied resources

技术领域 technical field

本发明涉及通信领域,尤其涉及存储转发技术。  The present invention relates to the communication field, in particular to store and forward technology. the

背景技术 Background technique

在数据通信的芯片中通常使用如图1所示的“存储-转发”的结构,该结构包括接收管理模块、报文数据的缓存模块、转发处理模块和发送管理模块。所述接收管理模块包括至少一个接收端口,所述发送管理模块包括至少一个输出端口,以及对应所述输出端口的输出队列。  The "store-and-forward" structure shown in Figure 1 is usually used in the data communication chip, which includes a receiving management module, a buffer module for message data, a forwarding processing module and a sending management module. The receiving management module includes at least one receiving port, and the sending management module includes at least one output port, and an output queue corresponding to the output port. the

在进行数据通信时,所述接收管理模块通过各个接收端口将报文数据完整地接收下来,然后向报文数据缓存模块申请相应的缓存资源,如果不能够申请到相应的缓存资源,则将接收到的报文数据丢弃掉;如果能够申请到相应的缓存资源,则所述接收管理模块会获得存储接收到的报文数据的存储地址,并按照所述存储地址将接收到的数据存储到报文数据缓存模块中,同时将所述存储地址与报文数据的部分内容(包括位于报文数据头部的“目的地址”信息与“源地址”信息等)作为转发处理信息,发送给所述转发处理模块;所述转发处理模块对转发处理信息进行分析处理,并根据分析结果确定报文数据的转发信息,包括报文数据是否需要丢弃,或是转发到哪个输出端口等。当所述转发处理模块得出报文数据的转发信息后,将根据所述转发信息将报文数据对应的存储地址信息写入到每个输出端口对应的“先进先出”的输出队列中,然后等待发送。所述发送管理模块根据输出端口输出数据的情况读取输出队列中的地址信息,并根据所述地址信息从报文数据缓存模块  中读取对应所述地址的报文数据,然后通过对应的输出端口发送出去。  When performing data communication, the receiving management module receives the message data completely through each receiving port, and then applies for the corresponding cache resource to the message data cache module, if the corresponding cache resource cannot be applied for, it will receive The received message data is discarded; if the corresponding cache resource can be applied for, the receiving management module will obtain the storage address for storing the received message data, and store the received data in the report according to the storage address In the text data cache module, at the same time, the storage address and part of the message data (including the "destination address" information and the "source address" information at the head of the message data, etc.) are used as forwarding processing information and sent to the A forwarding processing module; the forwarding processing module analyzes and processes the forwarding processing information, and determines the forwarding information of the message data according to the analysis result, including whether the message data needs to be discarded, or which output port to forward to, etc. After the forwarding processing module obtains the forwarding information of the message data, it will write the storage address information corresponding to the message data into the "first in first out" output queue corresponding to each output port according to the forwarding information, Then wait to send. The sending management module reads the address information in the output queue according to the output data of the output port, and reads the address information from the message data cache module according to the address information The message data corresponding to the address is read from the computer, and then sent out through the corresponding output port. the

当报文数据从输出端口输出后,所述芯片释放被所述报文数据所占用的缓存资源和队列资源。  After the message data is output from the output port, the chip releases the cache resources and queue resources occupied by the message data. the

上述过程中,当芯片对当前数据报文的转发处理信息进行分析处理时,接收端口可能会接收到后续到达的一些数据报文,此时芯片必须分配一些缓存资源来对报文数据进行存储;然而这些存储资源与队列资源要等到报文数据从输出端口发送出去后才能被回收再次利用。另外,在芯片进行工作的过程中,有时会出现某些输出端口突然链路中断的情况,例如网线断开、突然停电、用户没有按照规定程序关闭对接的网络设备等,此时在芯片中已经有一些缓存或队列资源分配给该输出端口,如果这些端口不能够及时恢复正常,那么这些已经被分配的缓存或队列资源将会被长时间占用,不能再被其它端口利用,从而对芯片的性能造成影响。因此需要经常检测输出端口的工作状态,以便及时判断链路的连接状态,并当链路中断时,能够及时释放已经被分配的缓存或队列资源。  In the above process, when the chip analyzes and processes the forwarding and processing information of the current data message, the receiving port may receive some subsequent data messages, and the chip must allocate some cache resources to store the message data; However, these storage resources and queue resources cannot be recovered and reused until the packet data is sent out from the output port. In addition, when the chip is working, sometimes some output ports will be interrupted suddenly, such as network cable disconnection, sudden power failure, and the user does not shut down the connected network device according to the prescribed procedures. There are some cache or queue resources assigned to the output port. If these ports cannot return to normal in time, these allocated cache or queue resources will be occupied for a long time and cannot be used by other ports, thus affecting the performance of the chip. make an impact. Therefore, it is necessary to check the working status of the output port frequently, so as to judge the connection status of the link in time, and when the link is interrupted, the allocated buffer or queue resources can be released in time. the

与本发明有关的现有技术一提供了一种释放已经被分配的缓存或队列资源的方法,其主要思想是:  The prior art related to the present invention provides a method for releasing allocated cache or queue resources, the main idea of which is:

发送管理模块不断检查输出端口上的电路连接信号,即Link信号来获知输出端口的链路的连接状态,并将检测到的信息主动上报给CPU;当所述CPU根据所述上报的信息获知输出端口发生链路中断后,控制所述发送管理模块不断地从相应的队列、缓存中将发送到该输出端口的数据报文丢弃,直至所述CPU获知到输出端口的链路恢复连接,则停止这种丢弃处理,恢复正常的数据报文发送。  The sending management module constantly checks the circuit connection signal on the output port, that is, the Link signal to know the connection status of the link of the output port, and actively reports the detected information to the CPU; when the CPU knows the output according to the reported information After the link of the port is interrupted, control the sending management module to continuously discard the data packets sent to the output port from the corresponding queue and buffer until the CPU learns that the link of the output port is restored, then stop This discarding process restores the normal sending of data packets. the

现有技术一需要CPU进行处理,从而会增加CPU的负担。  The prior art 1 requires the CPU to perform processing, thereby increasing the burden on the CPU. the

与本发明有关的现有技术二提供了另一种释放已经被分配的缓存或队列资源的方法,其主要思想是:  The prior art 2 related to the present invention provides another method for releasing allocated cache or queue resources, the main idea of which is:

通过高层软件定时地、不断地检查输出端口是否在发送数据(特别是一些协议类型的数据报文),并根据检测到的信息判断链路是否一直在线;当检查到输出端口发生链路中断后,不断地从相应的队列、缓存中将发送到该输出端口的数据报文丢弃,从而实现被占用资源的回收。一旦重新检查到端口的链路恢复连接,则停止这种丢弃处理,恢复正常的数据报文发送。  Regularly and continuously check whether the output port is sending data (especially data packets of some protocol types) through the high-level software, and judge whether the link is always online according to the detected information; when the link interruption occurs at the output port , continuously discard the data packets sent to the output port from the corresponding queue and cache, so as to realize the recovery of occupied resources. Once the link of the port is re-checked and the connection is restored, the discarding process is stopped and the normal sending of data packets is resumed. the

现有技术二需要高层软件来进行处理,会造成软件运行开销,增加了运行软件的CPU的负担。  The second prior art requires high-level software for processing, which will cause software running overhead and increase the burden on the CPU running the software. the

发明内容Contents of the invention

本发明的目的是提供一种释放被无效占用的资源的方法和存储转发装置,通过本发明,解决了现有技术中当输出端口工作异常时,为实现被占用资源的回收,需要CPU的参与,或需要运行高层软件来进行处理等弊端。  The purpose of the present invention is to provide a method for releasing invalidly occupied resources and a store-and-forward device. Through the present invention, when the output port works abnormally in the prior art, the CPU needs to be involved in order to realize the recovery of occupied resources. , or the need to run high-level software for processing and other drawbacks. the

本发明的目的是通过以下技术方案实现的:  The purpose of the present invention is achieved by the following technical solutions:

本发明提供一种释放被无效占用的资源的方法,其包括:  The present invention provides a method for releasing invalidly occupied resources, which includes:

A、当检测到输出端口上没有数据报文发送时,则启动对应所述输出端口而设置的定时器开始计时;  A. When it is detected that there is no data message sent on the output port, the timer set corresponding to the output port is started to start counting;

B、当所述定时器的计时时间达到定时周期时,释放被无效占用的数据资源。  B. When the counting time of the timer reaches the timing period, release the invalidly occupied data resources. the

其中,所述定时器的定时周期大于正常输出时每一个数据报文发送时所需要的时间。  Wherein, the timing period of the timer is longer than the time required for sending each data packet during normal output. the

其中,所述步骤A具体包括:  Wherein, the step A specifically includes:

发送管理模块检测设置在其内的各个输出端口上是否有数据报文发送,并当检测到某一输出端口上没有数据报文发送时,则启动对应所述输出端口而设置的定时器开始计时;  The sending management module detects whether there is a data message sent on each output port set therein, and when it detects that there is no data message sent on a certain output port, it starts the timer set corresponding to the output port and starts counting ;

或,  or,

发送管理模块检测设置在其外部的各个输出端口上是否有数据报文发  送,并当检测到某一输出端口上没有数据报文发送时,则对应所述输出端口而设置的定时器开始计时。  The sending management module detects whether there is a data packet sent on each output port outside it. and when it is detected that there is no data message sent on a certain output port, the timer set corresponding to the output port starts counting. the

其中,在所述步骤B具体包括:  Wherein, in said step B specifically include:

B1、在所述定时器的计时时间未到达定时周期之前,继续检测所述输出端口上是否有数据报文正常发送,并且当检测到所述输出端口上有数据报文发送时,则将所述定时器进行复位,并停止计时,然后继续步骤A;当检测到所述输出端口上没有数据报文发送时,则执行步骤B2;  B1. Before the timing time of the timer reaches the timing period, continue to detect whether there is a data message sent on the output port normally, and when it is detected that the data message is sent on the output port, then send all The timer is reset, and stop counting, and then continue to step A; when it is detected that there is no data message sent on the output port, then perform step B2;

B2、当所述定时器的定时时间达到定时周期时,则读取所述输出端口对应的输出队列中的存储地址,并根据所述存储地址从报文数据缓存模块中读取对应所述存储地址的报文数据,然后将其丢弃掉,并释放所述存储地址对应的队列资源以及所述报文数据对应的缓存资源;同时将所述定时器进行复位,然后转入步骤A。  B2. When the timing time of the timer reaches the timing period, read the storage address in the output queue corresponding to the output port, and read the corresponding storage address from the message data cache module according to the storage address Address message data, and then discard it, and release the queue resource corresponding to the storage address and the cache resource corresponding to the message data; at the same time, reset the timer, and then turn to step A. the

本发明提供一种存储转发装置,包括至少一个输出端口,其中,对应每一个输出端口还包括一个定时器,用于当输出端口没有数据报文发送时,则启动开始计时,并当计时时间达到定时周期时,则触发所述存储转发装置释放被无效占用的数据资源。  The present invention provides a storage and forwarding device, which includes at least one output port, wherein each output port also includes a timer, which is used to start counting when no data message is sent from the output port, and when the counting time reaches When the timing period expires, the store-and-forward device is triggered to release invalidly occupied data resources. the

其中,所述定时器的定时周期大于正常输出时每一个数据报文发送时所需要的时间。  Wherein, the timing period of the timer is longer than the time required for sending each data packet during normal output. the

其中,所述定时器位于输出端口内部,或位于输出端口的外部。  Wherein, the timer is located inside the output port, or located outside the output port. the

其中,所述的存储转发装置,还包括:  Wherein, the store-and-forward device also includes:

发送管理模块,用于检测所述输出端口是否有数据报文发送,当没有数据报文发送时,发送信号触发所述定时器;并且当定时器的计时时间到达定时周期时,释放被无效占用的数据资源。  The sending management module is used to detect whether the output port has a data message to send, and when there is no data message to send, the sending signal triggers the timer; and when the timing time of the timer reaches the timing period, the release is invalidly occupied data resources. the

其中,所述被无效占用的数据资源包括:  Among them, the invalidly occupied data resources include:

已经分配给输出端口但不能在定时器的定时周期内被发送的输出队列中  的队列资源;和对应在报文数据缓存模块中缓存的报文资源。  In the output queue that has been assigned to the output port but cannot be sent within the timing period of the timer queue resources; and correspond to message resources cached in the message data cache module. the

其中,所述输出端口位于所述发送管理模块内部,或位于所述发送管理模块外部,并与所述发送管理模块连接。  Wherein, the output port is located inside the sending management module, or located outside the sending management module, and connected to the sending management module. the

由上述本发明提供的技术方案可以看出,本发明中,当检测到某个输出端口上没有数据报文发送时,启动对应所述输出端口而设置的定时器开始计时;并当所述定时器的计时时间达到定时周期时,释放被无效占用的资源。因此当输出端口工作异常时,本发明不仅能够及时释放已经被分配的资源,而且不需要CPU的参与,不需要软件的运行。  As can be seen from the technical solution provided by the above-mentioned present invention, in the present invention, when it is detected that there is no data message to send on a certain output port, start the timer set corresponding to the output port and start counting; and when the timing When the timing time of the timer reaches the timing period, the resources that are invalidly occupied are released. Therefore, when the output port works abnormally, the present invention can not only release allocated resources in time, but also does not require the participation of the CPU and the operation of software. the

附图说明Description of drawings

图1为背景技术中给出的“存储-转发”结构的芯片的工作原理图;  Fig. 1 is the working principle diagram of the chip of "store-and-forward" structure provided in the background technology;

图2为本发明提供的第一实施例的流程图;  Fig. 2 is the flowchart of the first embodiment provided by the present invention;

图3为本发明提供的第二实施例的原理图;  Fig. 3 is the schematic diagram of the second embodiment provided by the present invention;

图4为本发明提供的第三实施例中当输出端口设置在发送管理模块外部,并且各个定时器设置在发送管理模块中,并与各个输出端口对应时的存储转发装置的原理图。  Fig. 4 is a schematic diagram of the store-and-forward device when the output port is set outside the sending management module and each timer is set in the sending management module and corresponds to each output port in the third embodiment provided by the present invention. the

具体实施方式Detailed ways

对“存储-转发”结构的数据通信芯片,当其在工作过程中出现某些输出端口发生链路突然中断的情况(例如网线断开、突然停电、用户没有按照规定程序离线等)时,此时在芯片中已经有一些缓存资源或队列资源分配给该输出端口,这些资源被称为被无效占用的资源,如果这些资源得到及时的释放,则能够使有限的资源得到充分的利用,而且如果没有CPU的参与或者 高层软件的参与就能够及时释放被无效占用的资源,则更为理想。  For a data communication chip with a "store-and-forward" structure, when the link of some output ports is suddenly interrupted during its operation (such as disconnection of the network cable, sudden power failure, and the user does not follow the prescribed procedures to go offline, etc.), this When there are already some buffer resources or queue resources allocated to the output port in the chip, these resources are called invalidly occupied resources, if these resources are released in time, the limited resources can be fully utilized, and if without CPU involvement or It is more ideal that the participation of high-level software can release the invalidly occupied resources in time. the

本发明提供了第一实施例是不需要CPU参与或者高层软件的参与就能够及时释放被无效占用的资源的一种方法,其核心是:对应各个输出端口设置一个定时器,当所述发送管理模块检测到某个输出端口上没有数据报文发送时,则启动对应所述输出端口上的定时器开始计时。当所述定时器的计时时间达到定时周期时,则所述发送管理模块对无效占用的资源进行释放。其具体实施过程如图2所示,包括如下步骤:  The present invention provides a first embodiment, which is a method for timely releasing invalidly occupied resources without the participation of CPU or high-level software. Its core is to set a timer corresponding to each output port, and when the sending management When the module detects that there is no data message sent on a certain output port, it starts the timer on the corresponding output port to start counting. When the counting time of the timer reaches the timing period, the sending management module releases the invalidly occupied resources. Its specific implementation process is shown in Figure 2, including the following steps:

步骤1,对应各个输出端口设置一个定时器,并设定所述定时器的定时周期大于正常输出时每一个数据报文发送时所需要的时间。  Step 1: Set a timer corresponding to each output port, and set the timing period of the timer to be longer than the time required for sending each data message during normal output. the

所述定时器只有在对应的输出端口上没有数据报文发送时,才开始计时,当对应的输出端口上有数据报文正常输出时,则所述定时器处于复位状态,不会进行计时处理。  The timer starts counting only when there is no data message to be sent on the corresponding output port, and when the corresponding output port has a data message to output normally, the timer is in the reset state and will not perform timing processing . the

所述定时器的定时周期可以设置不同的数值,以适应不同的工作情况。  The timing period of the timer can be set to different values to adapt to different working conditions. the

步骤2,发送管理模块检测各个输出端口上是否有数据报文发送,并当检测到某一输出端口上没有数据报文发送时,则执行步骤3,即启动设置在所述输出端口上的定时器开始计时,然后执行步骤5;当检测到各个输出端口均有数据报文发送时,则执行步骤4,即将所述定时器置于复位状态,然后继续步骤2。  Step 2, the sending management module detects whether there is a data message to be sent on each output port, and when it is detected that there is no data message to be sent on a certain output port, then perform step 3, that is, start the timer set on the output port The timer starts timing, and then performs step 5; when it is detected that each output port has a data message to send, then perform step 4, that is, put the timer in a reset state, and then continue with step 2. the

步骤5,在所述定时器的计时时间未到达定时周期之前,继续检测所述输出端口上是否有数据报文正常发送,当所述发送管理模块检测到所述输出端口上有数据报文发送时,则执行步骤6,即将所述定时器进行复位,并停止计时,然后继续步骤2;当检测到所述输出端口上没有数据报文发送时,则执行步骤7。  Step 5, before the timing time of the timer reaches the timing period, continue to detect whether there is a data message sent on the output port normally, when the sending management module detects that there is a data message sent on the output port , then execute step 6, that is, reset the timer, stop timing, and then continue to step 2; when it is detected that no data message is sent on the output port, then execute step 7. the

步骤7,当所述定时器的定时时间达到定时周期时,则所述发送管理模块读取与所述输出端口对应的输出队列中的存储地址信息,并根据所述存储地  址信息从报文数据缓存模块中读取对应所述存储地址的报文数据,然后将其丢弃掉,释放所述存储地址信息对应的队列资源以及所述报文数据对应的缓存资源。同时将所述定时器进行复位,然后转入步骤2。  Step 7, when the timing time of the timer reaches the timing period, the sending management module reads the storage address information in the output queue corresponding to the output port, and according to the storage location The address information reads the message data corresponding to the storage address from the message data cache module, and then discards it, releasing the queue resource corresponding to the storage address information and the cache resource corresponding to the message data. At the same time, reset the timer, and then go to step 2. the

一旦输出端口的链路发生中断,则输出端口上将长时间不能发送数据保文,这时所述输出端口上的定时器可以达到规定的定时周期。  Once the link of the output port is interrupted, the data message cannot be sent on the output port for a long time, and the timer on the output port can reach the specified timing period at this time. the

本发明提供的第二实施例,是一种存储转发装置,其工作原理如图3所示,包括:  The second embodiment provided by the present invention is a store-and-forward device, the working principle of which is shown in Figure 3, including:

接收管理模块、报文数据缓存模块、转发处理模块和发送管理模块;其中所述接收管理模块包括至少一个接收端口,所述发送管理模块包括至少一个输出端口、对应所述输出端口的输出队列以及设置在各个输出端口上的定时器;所述定时器的定时周期大于正常输出时每一个数据报文发送时所需要的时间。  A receiving management module, a message data cache module, a forwarding processing module, and a sending management module; wherein the receiving management module includes at least one receiving port, and the sending management module includes at least one output port, an output queue corresponding to the output port, and A timer set on each output port; the timing period of the timer is greater than the time required for sending each data message during normal output. the

在进行数据通信时,所述接收管理模块通过所述各个接收端口将报文数据完整地接收下来,然后向所述报文数据缓存模块申请相应的缓存资源,如果不能够申请到相应的缓存资源,则将接收到的报文数据丢弃掉;如果能够申请到相应的缓存资源,则所述接收管理模块会获得存储接收到的报文数据的存储地址,并按照所述存储地址将接收到的数据存储到所述报文数据缓存模块中,同时将所述存储地址与报文数据中的部分内容信息(包括位于报文数据头部的“目的地址”信息与“源地址”信息等)作为转发处理信息,发送给所述转发处理模块。  When performing data communication, the receiving management module receives the message data completely through the receiving ports, and then applies to the message data cache module for corresponding cache resources, if the corresponding cache resources cannot be applied for , the received message data is discarded; if the corresponding cache resource can be applied for, the receiving management module will obtain the storage address for storing the received message data, and will receive the received message data according to the storage address The data is stored in the message data cache module, and at the same time, the storage address and part of the content information in the message data (including the "destination address" information and "source address" information at the head of the message data, etc.) are used as The forwarding processing information is sent to the forwarding processing module. the

所述转发处理模块对转发处理信息进行分析处理,并根据分析结果确定报文数据的转发信息,包括报文数据是否需要丢弃,或是转发到哪个输出端口等。当转发处理模块得出报文数据的转发信息后,将根据所述转发信息将报文数据对应的存储地址写入到所述发送管理模块中的对应的输出端口的  “先进先出”的输出队列中,然后等待发送。  The forwarding processing module analyzes and processes the forwarding processing information, and determines the forwarding information of the message data according to the analysis result, including whether the message data needs to be discarded, or which output port to forward to, etc. After the forwarding processing module obtains the forwarding information of the message data, the storage address corresponding to the message data will be written into the corresponding output port in the sending management module according to the forwarding information "First in, first out" output queue, and then waiting to be sent. the

所述发送管理模块检测所述输出端口上是否有数据报文发送,当检测到所述输出端口上有数据报文正常发送时,则不断读取所述输出端口对应的输出队列中的存储地址,并根据所述存储地址从报文数据缓存模块中读取对应所述存储地址的报文数据,然后通过所述输出端口发送出去。  The sending management module detects whether a data message is sent on the output port, and when it detects that a data message is sent normally on the output port, it continuously reads the storage address in the output queue corresponding to the output port , and read the message data corresponding to the storage address from the message data cache module according to the storage address, and then send it out through the output port. the

当所述发送管理模块检测到所述输出端口上没有数据报文发送时,则启动设置在所述输出端口上的定时器开始计时;如果在所述定时器的计时时间未到达定时周期之前,并且所述发送管理模块检测到所述输出端口上有数据报文发送时,则所述发送管理模块将所述定时器进行复位,并停止计时。如果在所述定时器的计时时间到达定时周期之前,始终没有数据报文在所述输出端口上发送,则所述定时器的定时时间会达到定时周期,此时所述定时器会触发所述发送管理模块释放被无效占用的资源:也就是说,所述发送管理模块则读取所述输出端口对应的输出队列中的存储地址,并根据所述存储地址从报文数据缓存模块中读取对应所述存储地址的报文数据,然后将其丢弃掉,并释放所述存储地址对应的队列资源以及所述报文数据对应的缓存资源。随后将所述定时器复位,重新开始计时,这样周而复始,每当所述定时器的计时时间达到其定时周期时,则丢弃一个数据报文,并释放相应的缓存和队列资源。当所述发送管理模块检测到所述端口上有数据报文发送时,才停止丢弃。  When the sending management module detects that there is no data message to send on the output port, then start the timer set on the output port to start counting; if the timing time of the timer does not reach the timing period before, And when the sending management module detects that there is a data message to be sent on the output port, the sending management module resets the timer and stops timing. If no data message is sent on the output port before the timing time of the timer reaches the timing period, the timing time of the timer will reach the timing period, and the timer will trigger the The sending management module releases resources that are invalidly occupied: that is to say, the sending management module reads the storage address in the output queue corresponding to the output port, and reads from the message data cache module according to the storage address The message data corresponding to the storage address is discarded, and the queue resource corresponding to the storage address and the cache resource corresponding to the message data are released. Then, the timer is reset, and timing is restarted, so that it goes round and round, and whenever the timing time of the timer reaches its timing period, a data message is discarded, and corresponding cache and queue resources are released. When the sending management module detects that there is a data packet to be sent on the port, it stops discarding. the

上述实施例中,所述定时器也可以不设置在各个输出端口上,而独立于各个输出端口而设置在发送管理模块中,但此时所述各个定时器仍需要对应各个输出端口。  In the above embodiment, the timer may not be set on each output port, but set in the sending management module independently of each output port, but at this time, each timer still needs to correspond to each output port. the

本发明提供的第三实施例,是另一种存储转发装置,其与第二实施例的区别在于,所述输出端口设置在发送管理模块外部,并与所述发送管理模块连接。此时各个定时器可以设置在发送管理模块中,并且与各个输出端口对  应;各个定时器也可以设置在对应的各个输出端口上。如图4所示给出了输出端口设置在发送管理模块外部,并且各个定时器设置在发送管理模块中,并与各个输出端口对应时的存储转发装置的原理图。  The third embodiment provided by the present invention is another store-and-forward device, which is different from the second embodiment in that the output port is set outside the sending management module and connected to the sending management module. At this time, each timer can be set in the sending management module, and is connected with each output port should be; each timer can also be set on each corresponding output port. As shown in FIG. 4 , a schematic diagram of the store-and-forward device is provided when the output port is set outside the sending management module, and each timer is set in the sending management module and corresponds to each output port. the

第三实施例中各个模块与定时器间的信息传递过程与第二实施例基本类似,这里不再详细描述。  The information transfer process between each module and the timer in the third embodiment is basically similar to that in the second embodiment, and will not be described in detail here. the

由上述本发明的具体实施方案可以看出,本发明中当检测到某个输出端口上没有数据报文发送时,启动对应所述输出端口而设置的定时器开始计时;并当所述定时器的计时时间达到定时周期时,释放被无效占用的资源。因此当输出端口工作异常时,本发明不仅能够及时释放已经被分配的资源,而且不需要CPU的参与,不需要软件的运行。  As can be seen from the specific embodiments of the present invention described above, when detecting that there is no data message sent on a certain output port in the present invention, start the timer set corresponding to the output port and start counting; and when the timer When the timing time reaches the timing period, the resources that are invalidly occupied are released. Therefore, when the output port works abnormally, the present invention can not only release allocated resources in time, but also does not require the participation of the CPU and the operation of software. the

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。  The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims. the

Claims (7)

1.一种释放被无效占用的资源的方法,其特征在于,包括:1. A method for releasing invalidly occupied resources, comprising: A、当检测到输出端口上没有数据报文发送时,则启动对应所述输出端口而设置的定时器开始计时;A, when detecting that there is no data message to send on the output port, then start the timer that is set corresponding to the output port and start counting; B、当所述定时器的计时时间达到定时周期时,释放被无效占用的数据资源;B. When the timing time of the timer reaches the timing period, release the invalidly occupied data resource; 其中,所述步骤B包括:Wherein, the step B includes: B1、在所述定时器的计时时间未到达定时周期之前,继续检测所述输出端口上是否有数据报文正常发送,并且当检测到所述输出端口上有数据报文发送时,则将所述定时器进行复位,并停止计时,然后继续步骤A;当检测到所述输出端口上没有数据报文发送时,则执行步骤B2;B1. Before the timing time of the timer reaches the timing period, continue to detect whether there is a data message sent on the output port normally, and when it is detected that the data message is sent on the output port, then send all The timer is reset, and stop counting, and then continue to step A; when it is detected that there is no data message sent on the output port, then perform step B2; B2、当所述定时器的定时时间达到定时周期时,则读取所述输出端口对应的输出队列中的存储地址,并根据所述存储地址从报文数据缓存模块中读取对应所述存储地址的报文数据,然后将其丢弃掉,并释放所述存储地址对应的队列资源以及所述报文数据对应的缓存资源;同时将所述定时器进行复位,然后转入步骤A。B2. When the timing time of the timer reaches the timing period, read the storage address in the output queue corresponding to the output port, and read the corresponding storage address from the message data cache module according to the storage address Address message data, and then discard it, and release the queue resource corresponding to the storage address and the cache resource corresponding to the message data; at the same time, reset the timer, and then turn to step A. 2.根据权利要求1所述的方法,其特征在于:2. The method according to claim 1, characterized in that: 所述定时器的定时周期大于正常输出时每一个数据报文发送时所需要的时间。The timing period of the timer is longer than the time required for sending each data message during normal output. 3.根据权利要求1或2所述的方法,其特征在于,所述步骤A具体包括:3. The method according to claim 1 or 2, wherein said step A specifically comprises: 发送管理模块检测设置在其内的各个输出端口上是否有数据报文发送,并当检测到某一输出端口上没有数据报文发送时,则启动对应所述输出端口而设置的定时器开始计时;The sending management module detects whether there is a data message sent on each output port set therein, and when it detects that there is no data message sent on a certain output port, it starts the timer set corresponding to the output port and starts counting ; 或,or, 发送管理模块检测设置在其外部的各个输出端口上是否有数据报文发送,并当检测到某一输出端口上没有数据报文发送时,则对应所述输出端口而设置的定时器开始计时。The sending management module detects whether there is a data message sent on each output port set outside it, and when it detects that there is no data message sent on a certain output port, the timer set corresponding to the output port starts counting. 4.一种存储转发装置,包括至少一个输出端口,其特征在于,对应每一个输出端口还包括一个定时器,用于当输出端口没有数据报文发送时,则启动开始计时,并当计时时间达到定时周期时,则触发所述存储转发装置释放被无效占用的数据资源;4. A storage and forwarding device, comprising at least one output port, is characterized in that, corresponding to each output port also includes a timer, for when the output port does not have a data message to send, then start timing, and when the timing When the timing period is reached, the store-and-forward device is triggered to release invalidly occupied data resources; 还包括:发送管理模块,用于检测所述输出端口是否有数据报文发送,当没有数据报文发送时,发送信号触发所述定时器;并且当定时器的计时时间到达定时周期时,释放已经分配给输出端口但不能在定时器的定时周期内被发送的输出队列中的队列资源,以及对应在报文数据缓存模块中缓存的报文资源。Also includes: a sending management module, used to detect whether the output port has a data message to send, when there is no data message to send, send a signal to trigger the timer; and when the timing time of the timer reaches the timing period, release The queue resources in the output queue that have been allocated to the output port but cannot be sent within the timing period of the timer, and the corresponding message resources buffered in the message data buffer module. 5.根据权利要求4所述的存储转发装置,其特征在于:5. The store and forward device according to claim 4, characterized in that: 所述定时器的定时周期大于正常输出时每一个数据报文发送时所需要的时间。The timing period of the timer is longer than the time required for sending each data message during normal output. 6.根据权利要求4所述的存储转发装置,其特征在于:6. The store and forward device according to claim 4, characterized in that: 所述定时器位于输出端口内部,或位于输出端口的外部。The timer is internal to the output port, or external to the output port. 7.根据权利要求4所述的存储转发装置,其特征在于:7. The store and forward device according to claim 4, characterized in that: 所述输出端口位于所述发送管理模块内部,或位于所述发送管理模块外部,并与所述发送管理模块连接。The output port is located inside or outside the sending management module and connected to the sending management module.
CN2006100783810A 2006-05-17 2006-05-17 Method and store-and-forward device for releasing invalidly occupied resources Expired - Fee Related CN1984025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2006100783810A CN1984025B (en) 2006-05-17 2006-05-17 Method and store-and-forward device for releasing invalidly occupied resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2006100783810A CN1984025B (en) 2006-05-17 2006-05-17 Method and store-and-forward device for releasing invalidly occupied resources

Publications (2)

Publication Number Publication Date
CN1984025A CN1984025A (en) 2007-06-20
CN1984025B true CN1984025B (en) 2012-05-30

Family

ID=38166273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2006100783810A Expired - Fee Related CN1984025B (en) 2006-05-17 2006-05-17 Method and store-and-forward device for releasing invalidly occupied resources

Country Status (1)

Country Link
CN (1) CN1984025B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699795B (en) * 2009-10-29 2012-07-18 中兴通讯股份有限公司 Message congestion processing method and system
CN102137293B (en) * 2010-12-31 2015-01-21 华为技术有限公司 Resource allocation method, user business terminal and head end system of streaming media service
CN103077152B (en) * 2012-12-25 2015-09-30 北京四方继保自动化股份有限公司 A kind of communication acceleration method for terminal equipment of intelligent substation chip chamber
CN104461924A (en) * 2014-11-04 2015-03-25 福建星网锐捷网络有限公司 Collection method and system for message memories
CN107634914B (en) * 2016-07-18 2021-01-22 深圳市中兴微电子技术有限公司 Frame stream control method and device
CN110297732B (en) * 2019-06-14 2024-01-23 杭州迪普科技股份有限公司 FPGA state detection method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1391771A (en) * 1999-09-17 2003-01-15 艾利森电话股份有限公司 Channel allocation and release for packet data services
CN1708141A (en) * 2004-06-08 2005-12-14 华为技术有限公司 Method for realeasing terminal resource in media gateway

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1391771A (en) * 1999-09-17 2003-01-15 艾利森电话股份有限公司 Channel allocation and release for packet data services
CN1708141A (en) * 2004-06-08 2005-12-14 华为技术有限公司 Method for realeasing terminal resource in media gateway

Also Published As

Publication number Publication date
CN1984025A (en) 2007-06-20

Similar Documents

Publication Publication Date Title
US9030936B2 (en) Flow control with reduced buffer usage for network devices
US7796509B2 (en) Method and apparatus for managing flow control in a data processing system
CN102118309B (en) Method and system for double-machine hot backup
CN101188560B (en) Inter-board flow control method and device based on dynamic detection of forwarding capability
JP3214454B2 (en) Packet processing device with built-in program
CN114745331A (en) Congestion notification method and equipment
WO2024125098A1 (en) Data transmission method and apparatus, and device and computer-readable storage medium
CN1984025B (en) Method and store-and-forward device for releasing invalidly occupied resources
CN113572582B (en) Data transmission and retransmission control method and system, storage medium and electronic device
US20030014516A1 (en) Recovery support for reliable messaging
WO2015032048A1 (en) Method for internal communication of mobile terminal
US8040540B2 (en) Communication information processing system
CN101145968B (en) Data sending and receiving method between network management system and transmission equipment
CN111314432B (en) Message processing method and device
US6799229B1 (en) Data-burst-count-base receive FIFO control design and early packet discard for DMA optimization
TWI505675B (en) Network switch and data updating method
US20100309909A1 (en) Communication apparatus, control method for communication apparatus, and computer program
CN101276314A (en) Transmission device, transmission system and data transmission method
CN115941603A (en) A method and network equipment for processing packets
CN115033506A (en) Interrupt processing method and device
JP2010049314A (en) Task scheduling device and task scheduling method
CN114827300A (en) Hardware-guaranteed data reliable transmission system, control method, equipment and terminal
JP2001203705A (en) Device and method for controlling flow and storage medium recording flow control program
JP2002057712A (en) Memory leakage recovery method for packet memory and buffer processing unit
JP5013952B2 (en) Monitoring control method and communication apparatus

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120530

Termination date: 20170517

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