CN1956438A - Automatic switching method of message process mode - Google Patents

Automatic switching method of message process mode Download PDF

Info

Publication number
CN1956438A
CN1956438A CN 200510116726 CN200510116726A CN1956438A CN 1956438 A CN1956438 A CN 1956438A CN 200510116726 CN200510116726 CN 200510116726 CN 200510116726 A CN200510116726 A CN 200510116726A CN 1956438 A CN1956438 A CN 1956438A
Authority
CN
China
Prior art keywords
message
mode
processing unit
central processing
computing module
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.)
Pending
Application number
CN 200510116726
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 200510116726 priority Critical patent/CN1956438A/en
Publication of CN1956438A publication Critical patent/CN1956438A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

This invention discloses an automatic switch method for information process modes including: first of all, computing the maximum number for processing information in a unit time by a central processor then computing the basic values A and B, when the number of processing information is greater than A, then the process mode of the processor is switched to a timed polling mode, when the number is less than B, then the process mode is switched to an interrupt mode.

Description

The automatic switching method of message process mode
Technical field
The present invention relates to the method that a kind of electric data digital is handled, be meant the method for handling according to the homogeneity comparative result especially.
Background technology
The data processing device of the network equipment comprises asic chip, network processing unit etc.Data processing device is responsible for receiving various data, agreement and other information, and the data that needs are handled are delivered to further analyzing and processing of central processing unit (CPU) then.The information that data processing device sends to central processing unit realizes by message mechanism, such as: data-message, new address message, error message etc.
Central processing unit has dual mode to the processing of data processing apparatus message: interrupt mode and automatic regular polling mode.
After interrupt mode is meant that central processing unit is to the initialization of data processing apparatus, the configuration data processing apparatus reports the various message that need processing with interrupt mode, the general data processing apparatus is connected to the respective interrupt circuit of central processing unit by an external interrupt lines, the interruption of opening central processing unit simultaneously receives, and is receiving that entering the respective interrupt service routine when interrupting handles.When the message that data processing device has any needs to report all can be sent the interruption application to central processing unit, after central processing unit enters interrupt service routine, what type of interrupt the interrupt status register of reading of data processing apparatus, decision are, enter concrete interrupt handling program again.In interrupt mode, central processing unit is passive, and the interrupt signal that data processing device sends to central processing unit is depended in the processing of data processing apparatus message.
After the automatic regular polling mode was meant that central processing unit is to the initialization of data processing apparatus, the configuration data processing apparatus was closed all interruptions that need report, and data processing device is in passive state.Central processing unit starts automatic regular polling mechanism, and when each Fixed Time Interval arrived, the message queue of reading of data processing apparatus initiatively if do not need the message handled, then returned immediately; If one or more message that need handle is arranged, then returns after the processing messages.
The message that the Interrupt Process mode is handled at needs can effectively be saved the processing time of central processing unit, in time the Message Processing request of response data processing apparatus more after a little while; And the automatic regular polling mode is under the situation that the more message that need handle is arranged, message queue by central processing unit active reading of data processing apparatus, can handle a plurality of message simultaneously, compare with interrupt mode and can save the central processing unit switching time that repeatedly interruption takies.
All there is obvious defects in above-mentioned two kinds of processing modes:
Under the interrupt mode, when the information of data processing device reception is abundant, the message that need send to central processing unit can reach a kind of like this state: when central processing unit has just been handled a message and returned, another data processing device sends and interrupts applying for forcing central processing unit to enter interrupt status again, so repeatedly, central processing unit can't carry out other transaction again, and this moment, the occupancy of central processing unit can be very high.
Under the automatic regular polling mode, the information that receives when data processing device is seldom the time, and central processing unit also must constantly remove the message queue of reading of data processing apparatus, and with the message that need to judge whether to handle, this can reduce the processing speed of central processing unit.
Summary of the invention
The objective of the invention is to propose a kind of automatic switching method of message process mode, make central processing unit can select the reasonable manner processing messages: when data processing device had more message to handle, central processing unit switched to processing mode the automatic regular polling mode automatically; The message of handling when needs more after a little while, central processing unit switches to interrupt mode with processing mode automatically; To promote the treatment effeciency of central processing unit.
The automatic switching method of the central processing unit message process mode that the present invention proposes may further comprise the steps:
(1) the processing mode default configuration with central processing unit is an interrupt mode;
(2) calculate the message number of central processing unit actual treatment in the current unit interval by the Message Processing computing module;
(3) count value of Message Processing computing module and the fiducial value A of setting are compared, if the count value of Message Processing computing module is more than or equal to A, then handover module changes the processing mode of central processing unit the automatic regular polling mode into and enters step (4); If the count value of Message Processing computing module is less than fiducial value A, then the processing mode of central processing unit keeps interrupt mode and returns step (2);
(4) calculate the message number of central processing unit actual treatment in the current unit interval by the Message Processing computing module;
(5) count value of Message Processing computing module and the fiducial value B of setting are compared, if the count value of Message Processing computing module is more than or equal to fiducial value B, then the processing mode of central processing unit keeps the automatic regular polling mode and returns step (4); If the count value of Message Processing computing module is less than fiducial value B, then handover module changes the processing mode of central processing unit interrupt mode into and returns step (2).
Wherein, described fiducial value A is calculated by following formula: A=MAX * (1-0.618), wherein MAX is a treatable maximum message number of central processing unit unit interval.
Wherein, described fiducial value B is calculated by following formula: B=A * 0.618.
Wherein, the described unit interval is 1 second.
Advantage of the present invention be can the dynamic tracking system processing messages situation, in time adjust the working method of central processing unit with the answering system complicated environment, the treatment effeciency of elevator system, the present invention simultaneously also provides a kind of appraisal procedure to set system processing power.
Description of drawings
Fig. 1 is a preferred embodiment of the present invention process chart.
Embodiment
Preferred embodiment of the present invention handling process as shown in Figure 1, handover module is to keep the work on hand mode or switch to the another one mode in the mode of decision central processing unit processing messages according to the count value of Message Processing computing module and fiducial value relatively.
Below in conjunction with shown in Figure 1, the present invention is specifically described:
For a both fixed system, the disposal ability of central processing unit, the affairs that need to handle, resource consumption etc. are all definite, and uncertain factor is that the central processing unit that the driving of extraneous message brings takies.Therefore be the disposal ability of evaluating system, to be environment of normal operation simulation of system, and configuration-system is operated in interrupt mode, the simulation central processing unit receives that shocking flash to the utilance of central processing unit is 100%, the message number that the record central processing unit can be handled, repeatedly test obtains mean value, just can obtain the maximum message number M AX that central processing unit can be handled in the unit interval.In addition, the present invention sets two fiducial value A and B according to MAX, and wherein, the computing formula of fiducial value A is A=MAX * (1-0.618); The computing formula of fiducial value B is B=A * 0.618.Here, fiducial value A and B are general empirical values, can decide as the case may be.
The unit interval is selected 1 second, Message Processing computing module usage counter in the present embodiment.
The present invention specifically may further comprise the steps:
The first step, configuration central processing unit are operated in interrupt mode, and each data processing device of initialization is about to the count value messageCounter zero clearing of Message Processing computing module, with time window messageTimer zero clearing, and time window is increased automatically by system.
Second step, data processing device receive message, and the message that needs are handled is put into the central processing unit formation, and request central processing unit Interrupt Process.After message of the every processing of central processing unit, messageCounter adds 1 automatically.If messageTimer 〉=1 second, zero clearing messageTimer and messageCounter also trigger it and restart counting.Thus, the Message Processing computing module can calculate the message number that central processing unit is handled in 1 second.
The 3rd goes on foot, messageCounter and fiducial value A is compared, if messageCounter 〉=A in 1 second, illustrate that the message of handling this moment is too much, need switch to the automatic regular polling mode, to promote the Message Processing efficient of central processing unit from interrupt mode.So central processing unit starts the automatic regular polling treatment mechanism, closes the interrupt function of data processing device, and enters for the 4th step; After the impeding shutdown of data processing device, still receive message and be treated to various message, but only message is put into the central processing unit formation, no longer request is interrupted, handover module changes the message process mode of central processing unit into the automatic regular polling mode, by central processing unit automatic regular polling message queue, take out Message Processing;
If messageCounter<A in time window thinks that message to be processed is fewer, the processing mode of central processing unit keeps interrupt mode, and returns for second step.
After the 4th step, message of the every processing of central processing unit, messageCounter adds 1 automatically.If messageTimer 〉=1 second, zero clearing messageTimer and messageCounter also trigger it and restart counting.
Thus, the Message Processing computing module can calculate the message number that central processing unit is handled in 1 second.
The 5th goes on foot, messageCounter and fiducial value B is compared, if messageCounter 〉=B in 1 second illustrates that the message of handling this moment remains unchanged too much, the processing mode of central processing unit keeps the automatic regular polling mode, and returns for the 4th step;
If messageCounter<B in 1 second, the message handled this moment be described seldom, handover module changes the processing mode of central processing unit into interrupt mode, and returns second and go on foot.

Claims (4)

1, a kind of automatic switching method of message process mode is characterized in that, this method may further comprise the steps:
(1) the processing mode default configuration with central processing unit is an interrupt mode;
(2) calculate the message number of central processing unit actual treatment in the current unit interval by the Message Processing computing module;
(3) count value of Message Processing computing module and the fiducial value A of setting are compared, if the count value of Message Processing computing module is more than or equal to A, then handover module changes the processing mode of central processing unit the automatic regular polling mode into and enters step (4); If the count value of Message Processing computing module is less than fiducial value A, then the processing mode of central processing unit keeps interrupt mode and returns step (2);
(4) calculate the message number of central processing unit actual treatment in the current unit interval by the Message Processing computing module;
(5) count value of Message Processing computing module and the fiducial value B of setting are compared, if the count value of Message Processing computing module is more than or equal to fiducial value B, then the processing mode of central processing unit keeps the automatic regular polling mode and returns step (4); If the count value of Message Processing computing module is less than fiducial value B, then handover module changes the processing mode of central processing unit interrupt mode into and returns step (2).
2, the automatic switching method of message process mode according to claim 1 is characterized in that, fiducial value A is calculated by following formula in the described step (3):
A=MAX * (1-0.618), wherein MAX is a treatable maximum message number of central processing unit unit interval.
3, the automatic switching method of message process mode according to claim 1 and 2 is characterized in that, fiducial value B is calculated by following formula in the described step (6): B=A * 0.618.
4, the automatic switching method of message process mode according to claim 1 and 2 is characterized in that, the described unit interval is 1 second.
CN 200510116726 2005-10-28 2005-10-28 Automatic switching method of message process mode Pending CN1956438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200510116726 CN1956438A (en) 2005-10-28 2005-10-28 Automatic switching method of message process mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200510116726 CN1956438A (en) 2005-10-28 2005-10-28 Automatic switching method of message process mode

Publications (1)

Publication Number Publication Date
CN1956438A true CN1956438A (en) 2007-05-02

Family

ID=38063534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200510116726 Pending CN1956438A (en) 2005-10-28 2005-10-28 Automatic switching method of message process mode

Country Status (1)

Country Link
CN (1) CN1956438A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861897A (en) * 2017-11-06 2018-03-30 郑州云海信息技术有限公司 One kind is interrupted and poll triggering method, system, equipment and computer-readable storage medium
CN109936502A (en) * 2017-12-15 2019-06-25 迈普通信技术股份有限公司 Data receiver method and data transmission set
CN111580949A (en) * 2020-04-30 2020-08-25 成都安恒信息技术有限公司 Automatic network packet receiving mode adjusting method
CN114882927A (en) * 2021-02-05 2022-08-09 美光科技公司 Event management for memory devices

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861897A (en) * 2017-11-06 2018-03-30 郑州云海信息技术有限公司 One kind is interrupted and poll triggering method, system, equipment and computer-readable storage medium
CN109936502A (en) * 2017-12-15 2019-06-25 迈普通信技术股份有限公司 Data receiver method and data transmission set
CN109936502B (en) * 2017-12-15 2022-05-17 迈普通信技术股份有限公司 Data receiving method and data transmission equipment
CN111580949A (en) * 2020-04-30 2020-08-25 成都安恒信息技术有限公司 Automatic network packet receiving mode adjusting method
CN111580949B (en) * 2020-04-30 2023-08-22 成都安恒信息技术有限公司 Automatic regulating method for network packet receiving mode
CN114882927A (en) * 2021-02-05 2022-08-09 美光科技公司 Event management for memory devices
US11886749B2 (en) 2021-02-05 2024-01-30 Micron Technology, Inc. Interrupt mode or polling mode for memory devices
CN114882927B (en) * 2021-02-05 2024-02-23 美光科技公司 Event management for memory devices

Similar Documents

Publication Publication Date Title
US7814224B2 (en) Information processor deactivates communication processing function without passing interrupt request for processing when detecting traffic inbound is in over-traffic state
CN1234218C (en) Processing method for case with gradation structure in communication equipment
CN100347991C (en) Data network integrated monitoring and measuring system
CN1909516A (en) Network system, communication relay device, communication terminal device, and program for communication terminal device
CN1226017A (en) Power save function remote control method, information processing apparatus and storage medium
CN1943206A (en) System and method for maximizing connectivity during network failures in a cluster system
CN110231998B (en) Detection method and device for distributed timing task and storage medium
CN101483500A (en) Processing method and apparatus for member port status changing in stacking system
CN1274112C (en) Centralized gateway warning box and warning treatment method
CN1956438A (en) Automatic switching method of message process mode
CN1508689A (en) System and method for long-distace obtaining informtion of monitroed computer
CN111988198B (en) Online user number counting method and device, electronic equipment and computer medium
CN1756377A (en) Method for detecting single board fault
CN1585356A (en) Method of controlling network system
CN1696853A (en) Process scheduling system and method
CA2272067C (en) Latency counter for scanning timers
CN1153327C (en) High-safety shutdown unit for device connected to UPS and its method
CN1465769A (en) Washing machine and information receiving method
CN111078389B (en) Junk data cleaning method and device, electronic equipment and readable storage medium
CN1206844C (en) Warning method for bluetooth equipment in abnormal association
CN1581842A (en) Method for realizing source IP address and source MAC address bound route
CN1767455A (en) Method for rapidly detecting error in high availability system
CN1437329A (en) Warning method for bluetooth equipment in abnormal association
CN1798379A (en) Method for treating failure of physical subzone pointed to local subsones of base station
CN1812334A (en) Long-distance control system for cutter blade server and long-distance switch control method 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
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20070502