CN1175631C - Method of implementing base data message receiving - Google Patents

Method of implementing base data message receiving Download PDF

Info

Publication number
CN1175631C
CN1175631C CNB02117606XA CN02117606A CN1175631C CN 1175631 C CN1175631 C CN 1175631C CN B02117606X A CNB02117606X A CN B02117606XA CN 02117606 A CN02117606 A CN 02117606A CN 1175631 C CN1175631 C CN 1175631C
Authority
CN
China
Prior art keywords
data message
task
timer
data
reception
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
CNB02117606XA
Other languages
Chinese (zh)
Other versions
CN1414747A (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 CNB02117606XA priority Critical patent/CN1175631C/en
Publication of CN1414747A publication Critical patent/CN1414747A/en
Application granted granted Critical
Publication of CN1175631C publication Critical patent/CN1175631C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The present invention discloses a method for realizing receiving a bottom data message. The method comprises: a task of receiving a data message is created, and priority is set for the task; b) a timer interruption is set; when the time of the timer is up, a system enters interruption handling, checks a bottom data accepted flag, and judges whether a data message is received or not, if a data message is received, the system activates semaphore to which the task currently received is corresponding, closes the timer interruption, sets the task currently received to be a ready state, exits from the interruption processing, and schedules received tasks; else, the system directly exits from the interruption, and waits for the next timer interruption. By using the method, the receiving condition of the bottom data message can be queried in time, and the data message is processed in time, so that the stability and the reliability of the whole system are improved; simultaneously, the waste of system resources is avoided.

Description

The implementation method that a kind of base data message receives
Technical field
The present invention relates to the bottom data reception technique, refer to that especially a kind of task scheduling inquiry and bottom of being used in combination receives interrupt mode and inquire about the also method of Treated Base data message.
Background of invention
Modern communication requirement equipment has very high backboard disposal ability, such as: in switch, adopt the bottom layer driving module of 8260 Fast Communications Controllers (FCC) usually, the receiving data rate and the reliability of FCC data proposed very high requirement as the backboard communication.
At present, the method for designing of bottom data reception has following several:
1) adopt the task scheduling inquiry mode: system creates a reception task, and certain task priority is set, and when being dispatched to this task, checks whether bottom receives data message, if data message is arranged, then carries out the reception of bottom data.
2) adopt the FCC bottom to receive interrupt mode: when bottom receives the individual data message of or N (N>1), to enter interruption, in interruption, carry out the reception of bottom data.
For the Data Receiving of task scheduling inquiry mode, it does not need to handle interrupting, and working method realizes the simplest.But this mode is at flow system flow hour, may not have data message to receive at interval at timing, and the reception task will check still whether each passage receives data message, wastes the CPU time; And when flow system flow is big,,, receiving buffer descriptor (BD, Buffer Desriptor) with full because it is untimely to receive processing if task priority is low, obliterated data message phenomenon can appear; If the task priority height can limit other tasks and carry out the system works instability; And, can not in time handle urgent message.
For the Data Receiving that bottom receives interrupt mode, it has overcome the defective of task scheduling inquiry mode: at flow system flow hour, according to whether actual reception is carried out the data message reception to data message, can not waste the CPU time; When flow system flow is big, receive owing to can in time carry out data message, obliterated data message phenomenon can not appear; Simultaneously, for urgent message, also can in time handle.But this mode can frequently enter interruption when flow system flow is big, carries out data message and receives, and other tasks and interruption can not be carried out, though will give the upper strata after the data message reception, the upper strata can not be handled; System task can not in time be carried out, and influences the stability of system.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of implementation method of base data message reception, make it can guarantee in time to inquire the reception condition of base data message, and timely deal with data message, thereby improve stable, the reliability of whole system, avoid resource waste simultaneously.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
The implementation method that a kind of base data message receives, this method comprises the steps:
A. create the task of a receiving data packets, and be this task setting priority;
B., a timer is set to interrupt;
C. work as timer time then, system enters Interrupt Process, check the data accepted flag of bottom, judged whether that data message receives,, then activated the semaphore of current reception task correspondence if having, the timeing closing device interrupts, it is the Ready state that current reception task is set, and withdraws from Interrupt Process, calls and carry out the reception task according to priority preset; Otherwise, directly withdraw from this interruption, wait for that timer interrupts next time.
Wherein, step c further comprises: in the timer Interrupt Process, systems inspection Fast Communications Controller (FCC) receives sign according to the data message in the FCC interrupt register, judges whether to receive data message.
And the reception task scheduling among the step c further comprises:
C1. system's real time detection signal amount after the semaphore of finding current reception task correspondence has been activated, is then called this reception task and is carried out Data Receiving;
C2. after data all receive, open timer and interrupt, wait for that timer interrupts next time.
In such scheme, the priority level that receives task is set between 1 to 100.The time interval of timer is arranged between the 1ms to 10ms.
By such scheme as can be seen, key of the present invention is: be pre-created a reception task, and set the priority of this reception task, one timer is set simultaneously to interrupt, adopt task scheduling inquiry and bottom to receive the mode that interruption combines, in the timing Interrupt Process, carry out the inquiry of data transmit-receive state, with calling of semaphore control reception task, to guarantee the data message of inquiry in time and Treated Base.
Therefore, the implementation method that base data message provided by the present invention receives adopts timer interrupt inquiry bottom-up information, can guarantee in time to inquire the base data message reception condition; Higher owing to task priority being designed, also can in time carry out uploading of data message.In data traffic hour, can guarantee certain response time; When data traffic was big, in time the deal with data message guaranteed other tasks execution simultaneously, improves the stability and the reliability of whole system.
Description of drawings
The schematic flow sheet that Fig. 1 realizes for the present invention;
Fig. 2 is the realization flow schematic diagram that receives task scheduling in the inventive method.
Embodiment
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
Be received as example with the FCC bottom data, referring to Fig. 1, shown in Figure 2, the present invention specifically comprises the steps: in conjunction with the method for interruption and task state inquiry and Treated Base Data Receiving
1) creating a reception task, prepare to carry out the reception of data message, is priority of this task setting simultaneously, the corresponding semaphore X of this reception task.In fact, this task is stopped up by semaphore X at ordinary times, and so-called semaphore just is equivalent to a sign; Stop up and just to be meant just do not have semaphore when not receiving data, task can not be performed, and must receive after data semaphore is activated, and the reception task could be carried out, and improves system effectiveness with this.
Generally, the setting range of task priority is 1~100, and the priority of this task can be provided with higherly, so just can in time handle the reception data, if low excessively, system just can not respond rapidly.
2) timer is set and interrupts, when timer counter during to the value that is provided with, cause the timer interruption, system enters Interrupt Process; Otherwise timer counting.This interrupting value is fixed according to coming at interval the break period of system requirements, the common system requirements maximum 10ms in interval break period, minimum 1ms.If it is excessive that this value is provided with, system can not respond rapidly; Be provided with too smallly, job insecurity can frequent be interrupted in system.
3) in the timer Interrupt Process, systems inspection FCC bottom receives sign according to the data message in the FCC interrupt register (FCCE), judged whether that data message receives, if no, then withdraw from this interruption, return step 2) wait for that timer interrupts next time; If there is data message to receive, then the timeing closing device interrupts, activation signal amount X, send corresponding semaphore promptly for current reception task, and the reception task is set is the Ready attitude, withdraws from Interrupt Process then, enters the step 4) system and receives task scheduling according to priority preset.
4) system detects all semaphores of corresponding various tasks in real time, and after finding that semaphore X is activated, because that the priority of the task of reception is provided with is higher, system can call the reception task of this semaphore X correspondence very soon, carries out the reception of data; After data message was received, system opened timer and interrupts, and returns step 2) wait for that timer interrupts next time.
Bottom data receiving handling method of the present invention is applicable in the various chips, as long as this chip satisfies following condition:
A. the timer that has the time that to be provided with;
B. can be provided with and allow/forbid timer to interrupt;
C. the sign that can return data receives is such as utilizing certain register to return;
D. allow multitasking.
As seen,, all can adopt method of the present invention, receive data, the purpose of raising system's receiving data rate and reliability to reach the fast processing bottom as long as all kinds of chips of also control timer interruption flexibly, support multitask can be set.

Claims (5)

1, a kind of implementation method of base data message reception is characterized in that this method comprises the steps:
A. create the task of a receiving data packets, and be this task setting priority;
B., a timer is set to interrupt;
C. work as timer time then, system enters Interrupt Process, check the data accepted flag of bottom, judged whether that data message receives,, then activated the semaphore of current reception task correspondence if having, the timeing closing device interrupts, for ready for Ready state of current reception task is set, withdraws from Interrupt Process, call and carry out the reception task according to priority preset; Otherwise, directly withdraw from this interruption, wait for that timer interrupts next time.
2, implementation method according to claim 1, it is characterized in that step c further comprises: in the timer Interrupt Process, systems inspection Fast Communications Controller FCC, receive sign according to the data message in the Fast Communications Controller interrupt register, judge whether to receive data message.
3, implementation method according to claim 1 is characterized in that the reception task scheduling among the step c further comprises:
C1. system's real time detection signal amount after the semaphore of finding current reception task correspondence has been activated, is then called this reception task and is carried out Data Receiving;
C2. after data all receive, open timer and interrupt, wait for that timer interrupts next time.
4, implementation method according to claim 1 is characterized in that: set and receive the priority of task rank between 1 to 100.
5, implementation method according to claim 1 is characterized in that: the time interval of setting timer is between 1ms to 10ms.
CNB02117606XA 2002-05-08 2002-05-08 Method of implementing base data message receiving Expired - Fee Related CN1175631C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB02117606XA CN1175631C (en) 2002-05-08 2002-05-08 Method of implementing base data message receiving

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB02117606XA CN1175631C (en) 2002-05-08 2002-05-08 Method of implementing base data message receiving

Publications (2)

Publication Number Publication Date
CN1414747A CN1414747A (en) 2003-04-30
CN1175631C true CN1175631C (en) 2004-11-10

Family

ID=4744467

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB02117606XA Expired - Fee Related CN1175631C (en) 2002-05-08 2002-05-08 Method of implementing base data message receiving

Country Status (1)

Country Link
CN (1) CN1175631C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100426789C (en) * 2004-11-01 2008-10-15 华为技术有限公司 High-speed message transmitting method with high reliability
CN101593130A (en) * 2008-05-26 2009-12-02 新奥特(北京)视频技术有限公司 Multimedia timer processing method in a kind of multithreading transmission
CN103455310B (en) * 2012-05-29 2017-02-08 中兴通讯股份有限公司 Timing method and device for semaphore pend interface
DE102014108586A1 (en) * 2014-06-18 2015-12-24 Phoenix Contact Gmbh & Co. Kg Parameterizable automation technology device

Also Published As

Publication number Publication date
CN1414747A (en) 2003-04-30

Similar Documents

Publication Publication Date Title
CN101938396B (en) Data stream control method and device
US5404536A (en) Scheduling mechanism for network adapter to minimize latency and guarantee background processing time
CN105373425A (en) Method and device for performance optimization of embedded Linux system
CN100346307C (en) Method of real time task regulation in Java operation system
CN1175631C (en) Method of implementing base data message receiving
CN1430350A (en) Processing method for case with gradation structure in communication equipment
CN1849001A (en) Processing method when dual-mode terminal receiving 1x call on high-speed packet data network
CN110515715A (en) Task processing method and device based on thread pool
CN109343960A (en) A kind of method for scheduling task of linux system, system and relevant apparatus
CN103077140A (en) Communication method and communication device for motion control card of robot and host
CN105634502A (en) Realization method of key scanning based on state machine
CN88100756A (en) The mode of computer command is changed
US8180943B1 (en) Method and apparatus for latency based thread scheduling
US6910133B1 (en) Reflected interrupt for hardware-based encryption
CN101046785A (en) Method and device for limitting command of base plate management controller
CN102200770A (en) Information interactive system and method based on PCI (Peripheral Component Interconnect) and upper computer
CN101349975B (en) Method for implementing interrupt bottom semi-section mechanism in embedded operation system
JPH02311932A (en) Preference control system
Hills Structured interrupts
CN1383074A (en) Method for arbitrating bus control right and its arbitrator
CN1299213C (en) Method for making centralized control processing by utilizing CPU on system board
CN1577289A (en) Apparatus and method for controlling CPU speed transition
ATE445296T1 (en) METHOD AND DEVICE FOR PRIORITIZING INTERRUPTS IN A COMMUNICATIONS SYSTEM
CN1209207A (en) Job scheduling for intruction processor
CN101295270B (en) Command information processing method and system

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20041110

Termination date: 20120508