[go: up one dir, main page]

CN1332529C - A method for controlling single-board user command execution by router host - Google Patents

A method for controlling single-board user command execution by router host Download PDF

Info

Publication number
CN1332529C
CN1332529C CNB031053076A CN03105307A CN1332529C CN 1332529 C CN1332529 C CN 1332529C CN B031053076 A CNB031053076 A CN B031053076A CN 03105307 A CN03105307 A CN 03105307A CN 1332529 C CN1332529 C CN 1332529C
Authority
CN
China
Prior art keywords
timer
user
user command
veneer
command
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
CNB031053076A
Other languages
Chinese (zh)
Other versions
CN1525688A (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 CNB031053076A priority Critical patent/CN1332529C/en
Publication of CN1525688A publication Critical patent/CN1525688A/en
Application granted granted Critical
Publication of CN1332529C publication Critical patent/CN1332529C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Storage Device Security (AREA)

Abstract

本发明公开了一种路由器主机控制单板用户命令执行的方法,该方法是路由器主机系统对用户下发的每一条命令申请一个定时器,该定时器由系统分配的定时器指针唯一识别,并构造相关结构,将命令及相关信息发送给单板;单板完成命令的处理,构造相关结构,并向路由器主机发送信息;路由器主机系统根据接收到的信息查找相关结构,释放定时器及相关结构,并输出命令执行结果。如果定时器发生超时,则提示用户对应的单板处理对应的命令超时,释放该定时器及相关结构。运用本发明的方法使用户可以通过定时器来监控单板对用户下发的命令的执行情况,解决了原有技术中用户只能通过单板返回给路由器主机的信息来得知单板对用户命令的执行情况。

Figure 03105307

The invention discloses a method for a router host to control the execution of user commands on a single board. In the method, the router host system applies for a timer for each command issued by the user, and the timer is uniquely identified by a timer pointer assigned by the system, and Construct related structures, send commands and related information to the board; the board completes the processing of commands, constructs related structures, and sends information to the router host; the router host system searches for related structures based on the received information, and releases the timer and related structures , and output the command execution result. If the timer times out, the user is prompted that the corresponding board processing the corresponding command times out, and the timer and related structures are released. Using the method of the present invention enables the user to monitor the execution of the commands issued by the single board to the user through the timer, and solves the problem that in the prior art, the user can only know the command of the single board to the user through the information returned by the single board to the router host. of the implementation.

Figure 03105307

Description

一种路由器主机控制单板用户命令执行的方法A method for the router host to control single-board user command execution

技术领域technical field

本发明涉及通讯领域,更确切地说是涉及通讯领域中的一种路由器主机控制单板用户命令执行的方法。The invention relates to the field of communication, more specifically to a method for a router host in the field of communication to control the execution of user commands on a single board.

背景技术Background technique

对于包括路由器主机和单板的系统,在用户通过路由器主机向单板发送命令时,路由器主机只是将命令以数据的形式发送给单板,对于单板是否收到该命令、如何处理以及何时返回对该命令的处理结果都不可知,只有在接收到单板返回的处理结果后才能向用户反馈该命令的执行结果。该系统中的单板可以是加密卡,路由器主机根据加密卡的处理结果向用户反馈用户命令执行结果,如果加密卡没有返回处理结果,则路由器主机无法向用户反馈该命令的处理结果。For a system including a router host and a single board, when the user sends a command to the single board through the router host, the router host just sends the command to the single board in the form of data. Regarding whether the single board receives the command, how to process it, and when The processing result of the command returned is unknown, and the execution result of the command can be fed back to the user only after receiving the processing result returned by the board. The single board in the system can be an encryption card, and the router host feeds back the execution result of the user command to the user according to the processing result of the encryption card. If the encryption card does not return the processing result, the router host cannot feed back the processing result of the command to the user.

这种命令处理机制可以节省系统的资源,在大多数情况下也可以正常运行,但是容易产生这样的问题:如果单板没有接收到命令、单板在执行命令的过程中发生了异常或者单板的反馈结果被丢失,用户就会一直处于等待状态,而且无法知道该命令的执行情况,从而延误了其他命令的执行。This command processing mechanism can save system resources and can run normally in most cases, but it is easy to cause such problems: if the board does not receive the command, the board has an exception during the execution of the command, or the board If the feedback result of the command is lost, the user will always be in a waiting state, and cannot know the execution status of the command, thereby delaying the execution of other commands.

发明内容Contents of the invention

有鉴于此,本发明的主要目的是提供一种路由器主机控制单板用户命令执行的方法,应用该方法使用户能够监控单板执行用户命令的情况,避免了因单板没有接收到命令、单板在执行任务的过程中发生了异常或者单板的反馈结果被丢失而造成的用户的不必要的等待。In view of this, the main purpose of the present invention is to provide a method for the router host to control the execution of user commands on a single board. Using this method enables the user to monitor the situation of the single board executing user commands, and avoids single boards not receiving commands. Unnecessary waiting for the user due to an abnormality in the process of executing a task on the board or loss of the feedback result of the board.

为达到上述目的,本发明的技术方案具体是这样实现的:一种路由器主机控制单板用户命令执行的方法,其特征在于该方法至少包括以下步骤:In order to achieve the above object, the technical solution of the present invention is specifically implemented as follows: a method for the execution of a router host control single board user command, characterized in that the method at least includes the following steps:

a.路由器主机系统接收用户向单板下发的命令,申请并维护一个定时器,该定时器通过一个全局唯一的定时器指针标识;a. The router host system receives the command issued by the user to the single board, applies for and maintains a timer, and the timer is identified by a globally unique timer pointer;

b.构造包含上述定时器指针的用户命令定时器结构,该用户命令定时器结构至少包括定时器指针、命令的属性标识以及单板所在的槽位号;b. constructing a user command timer structure comprising the above-mentioned timer pointer, the user command timer structure at least including the timer pointer, the attribute identification of the command and the slot number where the single board is located;

c.构造包含上述定时器指针的消息帧头,与命令数据一起发送给单板;c. Construct a message frame header that includes the above-mentioned timer pointer, and send it to the single board together with the command data;

d.单板完成命令的处理,构造包含上述下发的定时器指针的消息帧头,与单板对命令的处理结果一起发送给路由器主机系统;d. the single board completes the processing of the command, constructs the message frame header comprising the timer pointer issued above, and sends it to the router host system together with the processing result of the command by the single board;

e.路由器主机系统接收单板返回的数据,根据消息帧头中的定时器指针查找相应的用户命令定时器结构,释放定时器及用户命令定时器结构,输出命令执行结果;e. The router host system receives the data returned by the single board, searches for the corresponding user command timer structure according to the timer pointer in the message frame header, releases the timer and user command timer structure, and outputs the command execution result;

f.如果定时器发生超时,则根据定时器指针查找用户命令定时器结构,释放定时器及用户命令定时器结构,提示用户超时错误。f. If the timer overtime occurs, search the user command timer structure according to the timer pointer, release the timer and the user command timer structure, and prompt the user for a timeout error.

所述步骤b中的用户命令定时器结构进一步包括指向单板的前一个用户命令定时器的结构指针,根据该结构指针构造以单板区分的单向链表的用户命令定时器结构队列,所述步骤e中的用户命令定时器结构根据消息帧头中的定时器指针在该单板的用户命令定时器结构队列中查找。The user command timer structure in the step b further includes a structure pointer pointing to the previous user command timer of the single board, and according to the structure pointer, the user command timer structure queue of the singly linked list distinguished by the single board is constructed, and the The user command timer structure in step e is searched in the user command timer structure queue of the single board according to the timer pointer in the message frame header.

所述步骤b中的用户命令定时器结构进一步包括指向单板的后一个用户命令定时器的结构指针,根据该结构指针构造以单板区分的单向链表的用户命令定时器结构队列,所述步骤e中的用户命令定时器结构根据消息帧头中的定时器指针在该单板的用户命令定时器结构队列中查找。The user command timer structure in the step b further includes a structure pointer pointing to the next user command timer of the single board, and according to the structure pointer, the user command timer structure queue of the singly linked list distinguished by the single board is constructed, and the The user command timer structure in step e is searched in the user command timer structure queue of the single board according to the timer pointer in the message frame header.

所述步骤b中的用户命令定时器结构进一步包括指向单板的前一个用户命令定时器的结构指针和指向单板的后一个用户命令定时器的结构指针,根据该结构指针构造以单板区分的双向链表的用户命令定时器结构队列,所述步骤e中的用户命令定时器结构根据消息帧头中的定时器指针在该单板的用户命令定时器结构队列中查找。The user command timer structure in the step b further includes a structure pointer pointing to the previous user command timer of the single board and a structure pointer pointing to the next user command timer of the single board, and according to the structure pointer structure, the single board is distinguished The user command timer structure queue of the doubly linked list, the user command timer structure in the step e searches in the user command timer structure queue of the single board according to the timer pointer in the message frame header.

所述的路由器主机系统维护一个定时器是通过构建一个定时器结构实现,释放定时器即释放对应的定时器结构,该定时器结构至少包括定时器指针以及该定时器超时后需调用的函数指针、函数输入参数。The maintenance of a timer by the router host system is realized by constructing a timer structure, releasing the timer means releasing the corresponding timer structure, the timer structure at least includes a timer pointer and a function pointer to be called after the timer expires , function input parameters.

所述步骤a进一步包括,路由器主机系统申请定时器如果不成功,则向用户提示申请定时器错误,并终止该命令的执行。The step a further includes, if the router host system fails to apply for the timer, prompting the user that the application timer is wrong, and terminating the execution of the command.

步骤c所述的消息帧头至少包括消息类型、消息属性和定时器指针,其中消息类型是命令或数据类型中的任一种类型,消息属性是命令属性或数据属性中的任一种属性。The message frame header described in step c at least includes a message type, a message attribute and a timer pointer, wherein the message type is any type of command or data type, and the message attribute is any one of command attribute or data attribute.

所述步骤e进一步包括,查找用户命令定时器结构如果不成功,则向用户提示单板执行命令失败,结束处理。Said step e further includes, if searching for the user command timer structure is unsuccessful, prompting the user that the single board fails to execute the command, and ending the process.

所述步骤f进一步包括,根据定时器指针查找用户命令定时器结构如果失败,则向用户提示系统错误,结束处理。The step f further includes, if searching the user command timer structure according to the timer pointer fails, prompting the user for a system error and ending the process.

步骤f所述的提示用户超时错误包括根据用户命令定时器结构中的单板所在的槽位号查出该命令定时器对应的单板,根据命令的属性标识查出超时的用户命令,提示用户该单板执行该命令超时。The prompting user timeout error described in step f comprises finding out the single board corresponding to the command timer according to the slot number of the single board in the user command timer structure, finding out the overtime user command according to the attribute identification of the command, and prompting the user The board executed the command timed out.

本发明方法是路由器主机系统在路由器主机接收到用户下发的命令时申请一个定时器,该定时器以系统分配的定时器指针来唯一识别,同时构造用户命令定时器结构及用户命令定时器结构队列,根据用户命令生成命令数据及消息帧头,将定时器指针插入消息帧头一起发送给单板;单板处理用户下发的命令,并构造新的包含有下发的定时器指针的消息帧头,将处理结果和该消息帧头一起发送给路由器主机;路由器主机系统根据接收到的定时器指针查找相关的用户命令定时器结构,释放对应的定时器及用户命令定时器结构,并向用户输出命令执行的结果信息。路由器主机系统查找超时的定时器对应的用户命令定时器结构,并确定该命令定时器对应的单板和命令,提示用户该单板执行该命令发生超时,最后释放该定时器和用户命令定时器结构。The method of the present invention is that the router host system applies for a timer when the router host receives a command issued by the user, and the timer is uniquely identified by the timer pointer assigned by the system, and simultaneously constructs a user command timer structure and a user command timer structure Queue, generate command data and message frame header according to user commands, insert the timer pointer into the message frame header and send them to the board together; the board processes the commands issued by the user, and constructs a new message containing the issued timer pointer frame header, and send the processing result together with the message frame header to the router host; the router host system searches for the relevant user command timer structure according to the received timer pointer, releases the corresponding timer and user command timer structure, and sends The user outputs the result information of command execution. The router host system searches for the user command timer structure corresponding to the timeout timer, and determines the board and command corresponding to the command timer, prompts the user that the board executes the command timeout, and finally releases the timer and user command timer structure.

本发明方法通过命令的定时器超时处理向用户提示其所下发的命令在执行过程中出现错误,避免了用户无限期的等待,确保用户能够实时获知单板的信息而使得用户能够处于主控地位。The method of the present invention prompts the user that an error occurs during the execution of the issued command through the timer timeout processing of the command, avoiding the user's indefinite wait, ensuring that the user can know the information of the single board in real time, so that the user can be in the master control status.

附图说明Description of drawings

图1为路由器主机维护的定时器结构的示意图;Fig. 1 is a schematic diagram of a timer structure maintained by a router host;

图2为本发明中不包括结构指针的用户命令定时器结构的示意图;Fig. 2 is the schematic diagram of the user command timer structure that does not comprise structure pointer among the present invention;

图3为本发明中包括结构指针的用户命令定时器结构的示意图;Fig. 3 is a schematic diagram of a user command timer structure including a structure pointer in the present invention;

图4为形成双向链表的用户命令定时器结构队列的示意图;Fig. 4 is the schematic diagram that forms the user order timer structure queue of doubly linked list;

图5为消息帧头结构的示意图;Fig. 5 is a schematic diagram of a message frame header structure;

图6为路由器主机系统采用不包括结构指针的用户命令定时器结构时根据用户的命令申请命令定时器的流程图;Fig. 6 is the flow chart of applying for a command timer according to a user's command when the router host system adopts a user command timer structure not including a structure pointer;

图7为路由器主机系统采用包括结构指针的用户命令定时器结构时根据用户的命令申请命令定时器的流程图;Fig. 7 is the flow chart of applying for a command timer according to a user's command when the router host system adopts a user command timer structure comprising a structure pointer;

图8为路由器主机系统处理加密卡返回的命令处理结果的流程图;Fig. 8 is a flow chart of the command processing result returned by the router host system processing the encryption card;

图9为路由器主机系统针对命令定时器超时所作的处理的流程图。FIG. 9 is a flow chart of processing performed by the router host system for command timer timeout.

具体实施方式Detailed ways

下面结合附图及具体实施例对本发明作进一步详细的说明。The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.

定时器可以理解为闹钟,而设置一个定时器也就相当于为闹钟设置一个振铃的时间。当经过定时器所设置长度的时间后,系统就会触发一个事件,并通过这个事件来唤醒特定任务的执行。在很多程序中都会使用到定时器,而定时器也有许多种类,如命令定时器、延时定时器等。本发明即通过命令的定时器处理实现路由器主机对单板用户命令的执行的控制。A timer can be understood as an alarm clock, and setting a timer is equivalent to setting a ringing time for the alarm clock. When the time set by the timer elapses, the system will trigger an event, and use this event to wake up the execution of a specific task. Timers are used in many programs, and there are many types of timers, such as command timers and delay timers. The invention implements the control of the execution of the single-board user commands by the router host through the timer processing of the commands.

本发明中所述的单板可以是加密卡,下面以加密卡为例对路由器主机通过命令的定时器控制单板对用户命令的执行作详细说明。The single board described in the present invention may be an encryption card. The following uses the encryption card as an example to describe in detail how the router host controls the execution of user commands by the single board through the command timer.

路由器主机对命令的定时器处理包括以下几个方面:The timer processing of the command by the router host includes the following aspects:

路由器主机系统维护命令定时器的一个特定结构,该命令定时器结构通过一个全局唯一的定时器标识(ulTimer)来检索。如图1所示,该定时器结构中保存了与命令定时器相关的信息,包括上述命令定时器标识(ulTimer)以及命令定时器超时后需要调用的函数指针、函数输入参数等相关信息。The router host system maintains a specific structure of the command timer, which is retrieved by a globally unique timer identifier (ulTimer). As shown in FIG. 1 , the timer structure stores information related to the command timer, including the command timer identifier (ulTimer) and related information such as function pointers and function input parameters that need to be called after the command timer expires.

为实现路由器主机和加密卡之间的通信,路由器主机系统还需构造一个如图2所示的用户命令定时器结构,该结构用于保存用户在发送每一条命令时所申请的定时器以及该命令的各种属性信息。用户命令定时器结构包括的字段有ulTimer、usAttribute和ulSlotID,其中的ulTimer为系统所申请的定时器的标识;usAttribute用于标识与该命令定时器相关的命令的属性;ulSlotID用于标识与该命令定时器相关的加密卡所在的槽位号,与加密卡一一对应,可以唯一标识一块加密卡。该结构还可以进一步包括Prev和Next字段,增加这两个字段后的用户命令定时器结构如图3所示,该结构可以同时增加这两个字段,也可以只增加其中的一个,这两个子段均为结构指针,Prev指向加密卡的前一个命令定时器,Next指向加密卡的后一个命令定时器,如果同时使用这两个结构指针,则可以组成一个双向链表的队列,该双向链表参见图4,对应地,可以通过这两个结构指针在队列中双向查找某一个用户命令定时器结构。这两个结构指针也可以单独使用,使用任何一个结构指针都可以使和一块加密卡相关的所有用户命令定时器结构组成一个单向链表的队列,其结构与双向链表的队列类似,在查找某一个用户命令定时器结构时则根据组成队列所采用的结构指针向前或向后查找。In order to realize the communication between the router host and the encryption card, the router host system also needs to construct a user command timer structure as shown in Figure 2, which is used to save the timer and the timer requested by the user when sending each command. Various attribute information of the command. The user command timer structure includes the fields ulTimer, usAttribute and ulSlotID, where ulTimer is the identifier of the timer applied by the system; usAttribute is used to identify the attribute of the command related to the command timer; ulSlotID is used to identify the The slot number of the encryption card related to the timer is in one-to-one correspondence with the encryption card, which can uniquely identify an encryption card. This structure can also further include Prev and Next fields, and the user command timer structure after adding these two fields is shown in Figure 3, this structure can increase these two fields at the same time, also can only increase one of them, these two subfields The segments are all structure pointers, Prev points to the previous command timer of the encryption card, and Next points to the next command timer of the encryption card. If these two structure pointers are used at the same time, a queue of a doubly linked list can be formed. For the doubly linked list, see As shown in Fig. 4, correspondingly, a certain user command timer structure can be bidirectionally searched in the queue through these two structure pointers. These two structure pointers can also be used independently. Using any one of the structure pointers can make all user command timer structures related to an encryption card form a single-way linked list queue, which is similar to the double-linked list queue. When a user commands the timer structure, it searches forward or backward according to the structure pointer used to form the queue.

路由器主机系统还需要定义一个消息帧头结构以实现路由器主机和加密卡之间的通信。参见图5,该消息帧头结构包含消息类型、消息属性、ulTimer和其他信息。其中的消息类型包括命令、数据或其他类型;消息属性包括命令属性、数据属性或其他属性。这个消息帧头和用户命令数据本身一同在路由器主机和加密卡之间传输。The router host system also needs to define a message frame header structure to realize the communication between the router host and the encryption card. Referring to Fig. 5, the message frame header structure includes message type, message attribute, ulTimer and other information. The message type includes command, data or other types; the message attribute includes command attribute, data attribute or other attribute. This message frame header is transmitted between the router host and the encryption card together with the user command data itself.

路由器主机系统在接收到用户下发给加密卡的命令时申请定时器并进行处理,其中,路由器主机系统申请定时器有以下几种情况:The router host system applies for a timer and processes it when it receives a command issued by the user to the encryption card. Among them, the router host system applies for a timer in the following situations:

1、用户通过路由器主机向加密卡发送第一条命令时,路由器主机系统为该命令申请一个定时器,对应这个定时器维护一个定时器结构,并创建一个用户命令定时器结构,将该定时器连同该命令的各种属性一起保存在该用户命令定时器结构中。之后向该加密卡发送的命令使用同一个定时器及对应的两个结构。1. When the user sends the first command to the encryption card through the router host, the router host system applies for a timer for the command, maintains a timer structure corresponding to this timer, and creates a user command timer structure, and the timer Stored in the user command timer structure along with various attributes of the command. The commands sent to the encryption card later use the same timer and the corresponding two structures.

2、用户通过路由器主机向加密卡发送的每一条命令,路由器主机系统都为该命令申请一个定时器,对应这个定时器维护一个定时器结构,并创建一个用户命令定时器结构,将该定时器连同该命令的各种属性一起保存在该用户命令定时器结构中。所创建的用户命令定时器结构如果包含结构指针,则可以根据结构指针将与该加密卡相关的所有用户命令定时器结构组成一个单向或双项链表的队列,建立队列的优点是方便查询,如果已经得知某块加密卡被用户禁用,则可以根据所建立的队列来统一释放该加密卡相关的所有用户命令定时器结构,从而保证该加密卡不会在被禁用之后还向用户提示命令超时信息。2. For each command sent by the user to the encryption card through the router host, the router host system applies for a timer for the command, maintains a timer structure corresponding to this timer, and creates a user command timer structure, and the timer Stored in the user command timer structure along with various attributes of the command. If the created user command timer structure contains a structure pointer, all user command timer structures related to the encrypted card can be formed into a one-way or double-entry linked list queue according to the structure pointer. The advantage of establishing a queue is that it is convenient for query. If it is known that an encryption card is disabled by the user, all user command timer structures related to the encryption card can be released according to the established queue, so as to ensure that the encryption card will not prompt the user for commands after being disabled timeout information.

路由器主机申请定时器并进行处理的流程参见图6,路由器主机系统根据用户下发的命令申请定时器,之后判断此次申请是否成功,如果成功,则分配命令定时器指针,如果定时器申请失败,则向用户提示错误信息,并终止该命令的执行。Refer to Figure 6 for the process of the router host applying for a timer and processing it. The router host system applies for a timer according to the command issued by the user, and then judges whether the application is successful. If it is successful, it assigns a command timer pointer. If the timer application fails , an error message will be prompted to the user and the execution of the command will be terminated.

在分配完命令定时器指针之后,由路由器主机系统统一分配标识该命令定时器指针的ulTimer,该ulTimer可以全局唯一地标识定时器;同时设置用户命令定时器结构中的ulSlotID字段为用户要下发命令的加密卡所在的槽位号,使其能唯一地标识与该命令相关的加密卡;设置用户命令定时器结构中的usAttribute字段为用户下发命令的属性值以表明该命令是什么命令。After allocating the command timer pointer, the router host system uniformly allocates the ulTimer that identifies the command timer pointer, and the ulTimer can globally uniquely identify the timer; at the same time, set the ulSlotID field in the user command timer structure as the The slot number of the encryption card of the command, so that it can uniquely identify the encryption card related to the command; set the usAttribute field in the user command timer structure as the attribute value of the command issued by the user to indicate what the command is.

如果用户命令定时器结构中还可以设置结构指针,则可以根据结构指针构成用户命令定时器结构的队列,这种情况下的流程参见图7。如果只设置了一个结构指针Prev或Next,则通过该结构指针将该用户命令定时器结构添加到与这块加密卡相关的所有用户命令定时器结构所组成的单向链表的队列中,如果这两个结构指针都被设置了,则通过这两个结构指针将该用户命令定时器结构添加到与原有的双向链表的队列中。If a structure pointer can also be set in the user command timer structure, a queue of the user command timer structure can be formed according to the structure pointer, and the flow in this case is shown in FIG. 7 . If only a structure pointer Prev or Next is set, then the user command timer structure is added to the queue of the one-way linked list formed by all user command timer structures related to this encryption card by the structure pointer, if this Both structure pointers are set, then the user command timer structure is added to the queue with the original doubly linked list through these two structure pointers.

最后,路由器主机系统将用户命令定时器结构中的ulTimer添加到和加密卡通信的消息帧头中,连同用户命令数据一起发送到加密卡。Finally, the router host system adds the ulTimer in the user command timer structure to the header of the message frame communicating with the encryption card, and sends it to the encryption card together with the user command data.

加密卡接收到路由器主机下发的用户命令后,对该命令作处理。完成处理后构造新的消息帧头,该消息帧头中保存了原下发的消息帧头中的ulTimer,并将其与加密卡对命令的处理结果一起发送给路由器主机。After the encryption card receives the user command issued by the router host, it processes the command. After the processing is completed, a new message frame header is constructed, which stores the ulTimer in the original message frame header, and sends it to the router host together with the processing result of the command by the encryption card.

参见图8,路由器主机系统处理加密卡返回的信息,并将处理结果反馈给用户的具体处理流程为:Referring to Figure 8, the router host system processes the information returned by the encryption card and feeds back the processing result to the user. The specific processing flow is as follows:

路由器主机系统接收加密卡返回的数据,从返回数据的消息帧头中获取ulTimer,根据ulTimer查找相应的用户命令定时器结构,如果查找失败,则说明该命令定时器已经超时,即加密卡在指定的时间内没有执行完命令,加密卡执行该命令已经超时,因此向用户提示加密卡对该条命令的执行失败,结束处理。The router host system receives the data returned by the encryption card, obtains ulTimer from the message frame header of the returned data, and searches for the corresponding user command timer structure according to the ulTimer. If the search fails, it means that the command timer has timed out, that is, the encryption card is in the designated The command has not been executed within the specified time, and the execution of the command by the encryption card has timed out, so the user is prompted that the execution of the command by the encryption card failed, and the processing ends.

如果查找到相应的用户命令定时器结构,说明加密卡在指定的时间内完成了命令的执行,此时认为加密卡对该条命令的执行是成功的。因此,首先根据ulTimer中的命令定时器指针释放对应的定时器,并释放该用户命令定时器结构,最后向用户输出命令执行结果。If the corresponding user command timer structure is found, it means that the encryption card has completed the execution of the command within the specified time, and at this time it is considered that the encryption card has successfully executed the command. Therefore, first release the corresponding timer according to the command timer pointer in the ulTimer, and release the user command timer structure, and finally output the command execution result to the user.

如果某条命令的定时器发生超时,说明加密卡对该定时器对应命令的执行发生超时,即加密卡没有在指定时间内返回命令执行的结果。这时,可以认为加密卡对该条命令的执行已经失败。参见图9,路由器主机对命令定时器超时的具体处理流程为:If the timer of a certain command times out, it means that the execution of the command corresponding to the timer by the encryption card has timed out, that is, the encryption card does not return the command execution result within the specified time. At this time, it can be considered that the execution of the command by the encryption card has failed. Referring to Figure 9, the specific processing flow for the router host to command timer timeout is as follows:

首先通过ulTimer的定时器指针查找对应的用户命令定时器结构,如果查找失败,则提示用户系统出错,结束处理。否则,根据用户命令定时器结构中保存的usAttribute和ulSlotID分别确定该定时器对应的加密卡和命令,并向用户提示该加密卡在执行该命令的过程中发生超时,最后释放对应的定时器和用户命令定时器结构。First, search for the corresponding user command timer structure through the timer pointer of ulTimer. If the search fails, it will prompt the user for a system error and end the processing. Otherwise, according to the usAttribute and ulSlotID stored in the user command timer structure, respectively determine the encryption card and command corresponding to the timer, and prompt the user that the encryption card has timed out during the execution of the command, and finally release the corresponding timer and command. User command timer structure.

应用本发明方法可以使用户通过定时器来监控加密卡对用户下发的命令的执行情况,用户在向加密卡下发命令以后,如果加密卡在处理任务时发生异常而不能及时响应用户的命令,则申请的命令定时器会发生超时,并通过路由器主机对定时器的超时处理来提示用户加密卡在执行用户下发的命令的过程中出现了错误,避免了用户无限期的等待,确保用户能够及时地获知加密卡的信息。The application of the method of the present invention enables the user to monitor the execution of the commands sent by the encryption card to the user through the timer. After the user sends the command to the encryption card, if the encryption card is abnormal when processing the task and cannot respond to the user's command in time , the command timer applied for will time out, and the router host will process the timeout of the timer to prompt the user that the encryption card has an error in the process of executing the command issued by the user, which avoids the user's indefinite waiting and ensures the user The information of the encrypted card can be obtained in time.

Claims (10)

1, the method for a kind of host computer with router control veneer user command execution is characterized in that this method may further comprise the steps at least:
A. router host computer system receives the user to the order that veneer issues, and applies for and safeguard a timer, and this timer is by the timer pointer mark that the overall situation is unique;
B. structure comprises the user command timer construction of above-mentioned timer pointer, and this user command timer construction comprises the attribute-bit of timer pointer, order and the slot number at veneer place at least;
C. structure comprises the message frame head of above-mentioned timer pointer, sends to veneer with order data;
D. veneer is finished process of commands, and structure comprises the message frame head of the above-mentioned timer pointer that issues, and with veneer the process of commands result is sent to router host computer system;
E. router host computer system receives the data that veneer returns, and searches corresponding user command timer construction according to the timer pointer in the message frame head, release timer and user command timer construction, outputs command executing result;
If f. the timer generation is overtime, then search the user command timer construction, release timer and user command timer construction, prompting user time-out error according to the timer pointer.
2, method according to claim 1, it is characterized in that, user command timer construction among the described step b further comprises the structured fingers of the previous user command timer that points to veneer, according to the user command timer construction formation of this structured fingers structure with the single-track link table of veneer differentiation, the user command timer construction among the described step e is searched in the user command timer construction formation of this veneer according to the timer pointer in the message frame head.
3, method according to claim 1, it is characterized in that, user command timer construction among the described step b further comprises the structured fingers of a back user command timer that points to veneer, according to the user command timer construction formation of this structured fingers structure with the single-track link table of veneer differentiation, the user command timer construction among the described step e is searched in the user command timer construction formation of this veneer according to the timer pointer in the message frame head.
4, method according to claim 1, it is characterized in that, user command timer construction among the described step b further comprises the structured fingers of the previous user command timer that points to veneer and points to the structured fingers of a back user command timer of veneer, according to the user command timer construction formation of this structured fingers structure with the doubly linked list of veneer differentiation, the user command timer construction among the described step e is searched in the user command timer construction formation of this veneer according to the timer pointer in the message frame head.
5, method according to claim 1, it is characterized in that, described router host computer system safeguards that a timer is to realize by making up a timer construction, release timer promptly discharges corresponding timer construction, and this timer construction comprises function pointer, the function input parameter that need call behind timer pointer and this timer expiry at least.
6, method according to claim 1 is characterized in that described step a further comprises, if router host computer system application timer is unsuccessful, then to user prompt application timer mistake, and stops the execution of this order.
7, method according to claim 1, it is characterized in that, the described message frame head of step c comprises type of message, message attributes and timer pointer at least, wherein type of message is any type in order or the data type, and message attributes is any attribute in command property or the data attribute.
8, method according to claim 1 is characterized in that described step e further comprises, if it is unsuccessful to search the user command timer construction, then to the failure of user prompt veneer fill order, end process.
9, method according to claim 1 is characterized in that described step f further comprises, if search the failure of user command timer construction according to the timer pointer, then to user alert system mistake, end process.
10, method according to claim 1, it is characterized in that, the described prompting of step f user time-out error comprises the veneer of finding this order timer correspondence according to the slot number at the veneer place in the user command timer construction, attribute-bit according to order is found overtime user command, and this veneer of prompting user is carried out this command timeout.
CNB031053076A 2003-02-25 2003-02-25 A method for controlling single-board user command execution by router host Expired - Fee Related CN1332529C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031053076A CN1332529C (en) 2003-02-25 2003-02-25 A method for controlling single-board user command execution by router host

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031053076A CN1332529C (en) 2003-02-25 2003-02-25 A method for controlling single-board user command execution by router host

Publications (2)

Publication Number Publication Date
CN1525688A CN1525688A (en) 2004-09-01
CN1332529C true CN1332529C (en) 2007-08-15

Family

ID=34282601

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031053076A Expired - Fee Related CN1332529C (en) 2003-02-25 2003-02-25 A method for controlling single-board user command execution by router host

Country Status (1)

Country Link
CN (1) CN1332529C (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100459503C (en) * 2006-08-25 2009-02-04 华为技术有限公司 A method and system for obtaining the physical slot number and slot type of a single board
CN101207509B (en) * 2006-12-22 2011-05-11 中兴通讯股份有限公司 System and method of implementation for independently translating business plate port speed
CN115766881A (en) * 2022-11-02 2023-03-07 海尔优家智能科技(北京)有限公司 Timing scheduling monitoring method, storage medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802042A (en) * 1996-06-28 1998-09-01 Cisco Systems, Inc. Autosensing LMI protocols in frame relay networks
CN1234159A (en) * 1996-09-24 1999-11-03 诺基亚电信公司 Packet routing in telecommunications network
CN1379330A (en) * 2001-04-06 2002-11-13 华为技术有限公司 Method for testing single board presence
US20030005357A1 (en) * 1999-09-15 2003-01-02 I-Bus/Phoenix, Incorporated Standby SBC backplane

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802042A (en) * 1996-06-28 1998-09-01 Cisco Systems, Inc. Autosensing LMI protocols in frame relay networks
CN1234159A (en) * 1996-09-24 1999-11-03 诺基亚电信公司 Packet routing in telecommunications network
US20030005357A1 (en) * 1999-09-15 2003-01-02 I-Bus/Phoenix, Incorporated Standby SBC backplane
CN1379330A (en) * 2001-04-06 2002-11-13 华为技术有限公司 Method for testing single board presence

Also Published As

Publication number Publication date
CN1525688A (en) 2004-09-01

Similar Documents

Publication Publication Date Title
CN101453367B (en) Software deployment method and system, software deployment server and user server
CN110716793B (en) Method, device, equipment and storage medium for executing distributed transaction
US20030154115A1 (en) Method, system, and program for processing a job in an event driven workflow environment
JP2010500673A (en) Storage management system for maintaining consistency of remote copy data (storage management system, storage management method, and computer program)
CN105159783A (en) System task distribution method
CN103457770A (en) Method for controlling and executing network transaction, network controller and transmission devices
WO2025113672A1 (en) Distributed task scheduling system based on rabbitmq, redis and mongodb
US20150319036A1 (en) Network transaction control method and executing method, network controller, and forwarding device
CN109189431A (en) A kind of client side upgrading method, device, equipment and readable storage medium storing program for executing
CN105373417A (en) Method and system for virtual machine management in cloud computing
CN109245979B (en) CANopen master-slave station reliability control method and overall management device thereof
CN111984561A (en) A kind of IPMI command processing method, system, device and medium of BMC
CN113157411B (en) Celery-based reliable configurable task system and device
CN1332529C (en) A method for controlling single-board user command execution by router host
CN109905263A (en) A kind of automation O&M deployment system
CN106331081A (en) Information synchronization method and device
US7240088B2 (en) Node self-start in a decentralized cluster
CN113658351B (en) Method and device for producing product, electronic equipment and storage medium
CN102291303B (en) Single board and method for determining primary and standby states for the same
CN115525707A (en) Data generation method and device, electronic equipment and storage medium
US8825796B2 (en) Transaction processing system and operation of the transaction process system
CN114095343A (en) Disaster recovery method, device, equipment and storage medium based on double-active system
CN102843247A (en) Method and system for concurrently processing network element message
CN119988012A (en) A blockchain-based collaborative resource scheduling method and system for on-chain and off-chain tasks
CN109450757B (en) Method for starting CANopen master station and overall management device thereof

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: 20070815

Termination date: 20150225

EXPY Termination of patent right or utility model