CN101815034A - Intertask message sending method and communication apparatus - Google Patents

Intertask message sending method and communication apparatus Download PDF

Info

Publication number
CN101815034A
CN101815034A CN201010133485A CN201010133485A CN101815034A CN 101815034 A CN101815034 A CN 101815034A CN 201010133485 A CN201010133485 A CN 201010133485A CN 201010133485 A CN201010133485 A CN 201010133485A CN 101815034 A CN101815034 A CN 101815034A
Authority
CN
China
Prior art keywords
message
batch processing
buffering area
processing message
sending
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.)
Granted
Application number
CN201010133485A
Other languages
Chinese (zh)
Other versions
CN101815034B (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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN2010101334853A priority Critical patent/CN101815034B/en
Publication of CN101815034A publication Critical patent/CN101815034A/en
Application granted granted Critical
Publication of CN101815034B publication Critical patent/CN101815034B/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 provides an intertask message sending method and a communication apparatus, which can ensure the message sending time sequence. The method comprises the following steps: setting all messages to be sent, which are generated between any two tasks, into batch processing messages and non-batch processing messages; storing all the messages to be sent in a public send buffer; when a non-batch processing message to be sent generates, firstly sending all the batch processing messages in the send buffer, and then sending the non-batch processing message; and when a batch processing message to be sent generates, firstly storing the batch processing message in the send buffer, starting a time delay sending timer, and sending out all the batch processing messages in the send buffer after the time delay timer exceeds a preset time. On the premise of ensuring the communication efficiency, the invention ensures the time sequence of the intertask messages, so that the system is more stable and reliable.

Description

Inter-task message sending method and communication equipment
Technical field
The present invention relates to computer communication technology, relate in particular to the communication technology between multitask under the real time operating system.
Background technology
In the computer communication field, under the system of a complexity, can be placed on some functions in the different tasks and realize.A systemic-function needs a plurality of task coordinates to realize, needs more mutual necessary information between task.Adopting message communicating between task is a kind of task exchange method comparatively commonly used, and message that real-time have relatively high expectations less for quantity adopts to send in real time, then sends immediately after promptly a message produces.For having the bigger message of same alike result and quantity,, adopt batch processing and time-delay transmit mechanism usually in order to improve communication efficiency.As, produce an IPV4 route messages after, task does not send this message immediately, sends but postpone the some time again disposable batch sends in the message bag so that follow-up IPV4 route messages can be placed on.
But the time-delay transmission may cause sending message in batches and the real-time transmission timing that sends message can not be guaranteed.Such as, before the delay time that sends in batches expired, task need send a real-time messages, and this real-time messages can send immediately.The message delay time expires in batches then, just sends message in batches, like this, delays the problem that real-time messages sends with regard to there being batch message, causes message time sequence to can not get ensureing.If can not guarantee interactive messages sequential between task, will influence the stable operation of system.
Therefore, how guaranteeing the sequential of interaction message between task, is very important problem of inter-task message communicating.
Summary of the invention
Technical problem to be solved by this invention is to provide a kind of message that guarantees to transmit the inter-task message sending method and the communication equipment of sequential.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be, the inter-task message sending method comprises:
All message to be sent that produce between any two tasks are set are divided into batch processing message and non-batch processing message two classes; All message stores to be sent are set in a public transmission buffering area;
When non-batch processing message to be sent produces, earlier the batch processing message that sends in the buffering area is sent, send described non-batch processing message then;
When batch processing message to be sent produces, deposit in earlier and send in the buffering area, and start the time-delay transmission timer, the batch processing message that will send in the buffering area after waiting back off timer overtime all sends.
Concrete, when sending described non-batch processing message, earlier described non-batch processing message is deposited in and send in the buffering area, and then transmission immediately.
Concrete, the message attributes and the message-length of record batch processing message when starting timer.Before the time-delay transmission timer is overtime, when having new batch processing message to be sent to produce, whether the message attributes of the batch processing message that deposited in before at first judging described new batch processing message and sending buffering area is identical, in this way, directly the entity content stores of described new batch processing message is arrived in the transmission buffering area, and increase the message header length of batch processing message; As not, described new batch processing message directly deposits the transmission buffering area in, writes down the message attributes and the message-length of this batch processing message.Described message attributes comprises type of message.
Concrete, full as sending buffering area, the batch processing message that sends in the buffering area is sent immediately, and then current batch processing message to be sent is deposited in the transmission buffering area.
Concrete, the batch processing message transmission that will send earlier in the steps d in the buffering area finishes, and the non-batch processing message that will produce is again assembled and is sent immediately from the initial address that sends buffering area.
Concrete, described batch processing message is meant the identical message of the bigger message attributes of size of message; Described non-batch processing message is meant that size of message is little, has message sudden, real-time.
The present invention also provides a kind of communication equipment of realizing above-mentioned inter-task message sending method, comprising:
Message generating unit; Be used to produce batch processing message to be sent or non-batch processing message; When producing non-batch processing message, the batch processing message that first notification message transmitting element will send in the buffering area sends, and more described non-batch processing message is deposited in the transmission of transmission buffering area and notification message transmitting element; When producing batch processing message, deposit the transmission buffering area in;
Send buffering area: batch processing message that all that are used for producing between store tasks are to be sent or non-batch processing message;
Time-delay transmission timer unit: when being used for batch processing message and depositing the initial address of buffering area in, be set the transmission cycle of batch processing message, behind timer expiry, send trigger notice to message sending unit;
Message sending unit: the non-batch processing message and the batch processing message that are used for sending buffering area.
Concrete, described message generating unit also comprises a message record unit, is used to write down the message attributes and the message-length that deposit the batch processing message that sends buffering area in.
Concrete, described message generating unit also comprises a message processing unit, be used for when judging that sending buffering area has expired, the batch processing message transmission that the notification message transmitting element will send in the buffering area finishes, and the batch processing message that will newly produce again deposits the transmission buffering area in.
Concrete, described message processing unit, whether the batch processing message that also is used for judging new generation with to send the batch processing message attributes that buffering area deposited in identical, and assemble processing accordingly.As the batch processing message of new generation with send buffering area in the batch processing message attributes that deposited in identical, directly the entity content stores of described new batch processing message to sending in the buffering area, and the message header length of the batch processing message that deposits in before increasing; Otherwise, directly deposit described new batch processing message in the transmission buffering area, write down the message attributes and the message-length of this batch processing message and restart timer.
The invention has the beneficial effects as follows, when taking into account communication efficiency, guaranteed the sequential of inter-task message, make system more reliable and more stable.
Description of drawings
Fig. 1 is non-batch processing message transmission flow figure of the present invention;
Fig. 2 is batch processing message transmission flow figure of the present invention.
Fig. 3 is the schematic diagram of batch processing message in sending buffering area of the embodiment of the invention;
Fig. 4 is the schematic diagram of non-batch processing message in sending buffering area of the embodiment of the invention;
Fig. 5 is a communication equipment structural representation of the present invention;
Fig. 6 is the structural representation of communication equipment embodiment 1 of the present invention;
Fig. 7 is the structural representation of communication equipment embodiment 2 of the present invention.
Embodiment
Inter-task message sending method of the present invention can be applicable to arbitrarily between two tasks.Implementation of the present invention is as follows: all message to be sent that produce between task are set are divided into batch processing message and non-batch processing message two classes; And all message stores to be sent are set in a public transmission buffering area buffer.
When non-batch processing message to be sent produces, the flow process that sends non-batch processing message is as shown in Figure 1: at first check the non-batch processing message whether buffering is arranged in the buffer, if then immediately the non-batch processing message content of storing in the buffer is sent; Assemble new information and transmission immediately from the initial address of buffer then.
When batch processing message to be sent produced, the flow process of transmission batch processing message judged at first whether buffer is full as shown in Figure 3:
If buffer is full, then immediately the batch processing message of storing in the buffer is sent, assemble the batch processing message of current generation then from the initial address of buffer, and the recording messages attribute (information of can be unique determining a message, such as type of message) and message-length, a time-delay transmission timer started;
If buffer less than, then judge and whether had batch processing message among the buffer, as there being batch processing message, whether the attribute of last the batch processing message of placing in the batch processing message of then further judging current generation and the buffer is identical, if it is identical, then do not need to add message header information, directly the message entity content stores in buffer, the length of message is added original message-length, and the message-length of noting in this total message-length and the updating message header information is this total length value; If the attribute of last message of placing in the batch processing message of current generation and the buffer is inequality, then directly add in the buffer, again recording messages attribute and message-length as a new batch processing message;
If judge buffer less than and do not have batch processing message, then the batch processing message with current generation deposits in the initial address of buffer, and recording messages attribute and message-length, starts the transmission timer of delaying time;
As the transmission timer of delaying time overtime before, this task does not produce new information to be sent, wait for that then the time-delay transmission timer is overtime after, the batch processing message in the buffer is all sent; As the transmission timer of delaying time overtime before, this task has produced a new information to be sent again, if new information is non-batch processing message, then immediately the batch processing message of storing in the buffer is sent; Assemble new non-batch processing message and transmission immediately from the initial address of buffer then.If new information is a batch processing message, then get back to the initial decision step of above transmission flow.
Describe the present invention program in detail below in conjunction with specific embodiment.
With communicating by letter between certain dynamic routing protocol task and routing management task is example, and the message between two tasks is divided into batch processing message and non-batch processing message two classes.As: route messages is classified as batch processing message, and this batch processing message is divided into two types of IPV4 route messages and IPV6 route messages again; The Interface status change message of system is classified as non-batch processing message.The message stores to be sent that all generations are set is assembled the message packet content at a public transmission buffering area (buffer), waits to be sent.
When the message to be sent that at first produces when the dynamic routing protocol task is batch processing message, after depositing this batch processing message in buffering area, start a time-delay transmission timer, even also deposited other message in batches in the follow-up buffering area in, but a unified time-delay transmission timer is adopted in the transmission of all batch processing message.As shown in Figure 3, a plurality of batch processing message are docile and obedient preface and are stored in buffer (1) lining temporarily, the IPV4 batch processing message stores that the message header (2) of IPV4 batch processing message and a plurality of IPV4 route messages contents (3) form is in the buffer initial address, the batch processing message sequence of another message attributes is stored in after the IPV4 batch processing message, that is the IPV6 batch processing message that forms by message header (4) and a plurality of IPV6 route messages contents (5) of IPV6 batch processing message; After buffer fills, send IPV4 batch processing message and IPV6 batch processing message immediately, otherwise need to wait for that the time-delay transmission timer of batch processing message correspondence sends after overtime again.Non-batch processing message sends after the buffer assembling immediately, as shown in Figure 4, form by Interface status message header (6) and Interface status message content (7) as non-batch processing message interface status message, be stored in the buffer initial address after the assembling, and then send.After opposite end routing management task receives the message packet of dynamic routing protocol task, read the message header of regular length, read message attributes and message-length, comprise type of message in this message attributes from message header, according to message-length, message content is read out then.So just a complete message has been read out.
The present invention is different from the preferential mode that sends non-batch processing message of prior art, adopts to send before the non-batch processing message, and the mode of the batch processing message that deposits in before preferential the transmission has guaranteed the normal of sequential; On the other hand, before the time-delay transmission timer is overtime, as there is not new non-batch processing message generation, deposit the batch processing message that sends buffering area in and still be in state to be sent, so that can be with the batch processing message of follow-up same alike result, disposable batch sends, and has guaranteed communication efficiency.
The invention allows for a kind of communication equipment.Fig. 5 is the structural representation of the communication equipment of one embodiment of the invention proposition.Referring to Fig. 5, communication equipment comprises:
Message generating unit; Be used to produce batch processing message to be sent or non-batch processing message; When producing non-batch processing message, the batch processing message that first notification message transmitting element will send in the buffering area sends, and more described non-batch processing message is deposited in the transmission of transmission buffering area and notification message transmitting element; When producing batch processing message, deposit the transmission buffering area in;
Send buffering area: batch processing message that all that are used for producing between store tasks are to be sent or non-batch processing message;
Time-delay transmission timer unit: when being used for batch processing message and depositing the initial address of buffering area in, be set the transmission cycle of batch processing message, behind timer expiry, send trigger notice to message sending unit;
Message sending unit: the non-batch processing message and the batch processing message that are used for sending buffering area.
The structured flowchart of communication equipment embodiment 1 of the present invention is seen Fig. 6, and wherein message generating unit also comprises a message record unit, is used to write down the message attributes and the message-length that deposit the batch processing message that sends buffering area in.
The structured flowchart of communication equipment embodiment 2 of the present invention is seen Fig. 7, and wherein message generating unit comprises: a message record unit is used to write down the message attributes and the message-length that deposit the batch processing message that sends buffering area in.A message processing unit is used for when judging that sending buffering area has expired, and the batch processing message transmission that the notification message transmitting element will send in the buffering area finishes, and the batch processing message that will newly produce again deposits the transmission buffering area in.Whether described message processing unit, the batch processing message that also is used for judging new generation with to send the batch processing message attributes that buffering area deposited in identical, and assemble processing accordingly.

Claims (10)

1. the inter-task message sending method is characterized in that, comprising:
All message to be sent that produce between any two tasks are set are divided into batch processing message and non-batch processing message two classes; And all message stores to be sent are set in a public transmission buffering area;
When non-batch processing message to be sent produces, earlier the batch processing message that sends in the buffering area is sent, send described non-batch processing message then;
When batch processing message to be sent produces, deposit in earlier and send in the buffering area, and start the time-delay transmission timer, the batch processing message that will send in the buffering area after waiting back off timer overtime all sends.
2. inter-task message sending method according to claim 1 is characterized in that, when sending described non-batch processing message, earlier described non-batch processing message is deposited in and sends in the buffering area, and then send immediately.
3. inter-task message sending method according to claim 1 is characterized in that, in the steps d, batch processing message is deposited in the message attributes and the message-length of record batch processing message when sending buffering area; Before described time-delay transmission timer is overtime, when having new batch processing message to be sent to produce, whether the message attributes of the batch processing message that deposited in before at first judging described new batch processing message and sending buffering area is identical, in this way, directly the entity content stores of described new batch processing message to sending in the buffering area, and the message header length of the batch processing message that deposits in before increasing; As not, directly deposit described new batch processing message in the transmission buffering area, write down the message attributes and the message-length of this batch processing message.
4. as inter-task message sending method as described in the right 3, it is characterized in that described message attributes comprises type of message.
5. as inter-task message sending method as described in any claim of 1-4, it is characterized in that, when batch processing message to be sent produces, need to judge earlier whether the transmission buffering area is full, as it is full to send buffering area, the batch processing message that sends in the buffering area is sent immediately, then current batch processing message to be sent is deposited in the transmission buffering area.
6. as inter-task message sending method as described in the right 5, it is characterized in that described batch processing message is meant the identical message of the bigger message attributes of size of message; Described non-batch processing message is meant that size of message is little, has message sudden, real-time.
7. a communication equipment is characterized in that, comprising:
Message generating unit is used to produce batch processing message to be sent or non-batch processing message; When producing non-batch processing message, the batch processing message that first notification message transmitting element will send in the buffering area sends, and more described non-batch processing message is deposited in the transmission of transmission buffering area and notification message transmitting element; When producing batch processing message, deposit the transmission buffering area in;
Send buffering area, batch processing message that all that are used for producing between store tasks are to be sent or non-batch processing message;
Time-delay transmission timer unit when being used for batch processing message and depositing the initial address of buffering area in, is provided with the transmission cycle of batch processing message, sends notice to message sending unit behind timer expiry;
Message sending unit is used for sending the non-batch processing message or the batch processing message of buffering area.
8. communication equipment as claimed in claim 7 is characterized in that, described message generating unit comprises a message record unit, is used to write down the message attributes and the message-length that deposit the batch processing message that sends buffering area in.
9. as claim 7 or 8 described communication equipments, it is characterized in that, described message generating unit comprises a message processing unit, be used for when judging that sending buffering area has expired, the batch processing message transmission that the notification message transmitting element will send in the buffering area finishes, and the batch processing message that will newly produce again deposits the transmission buffering area in.
10. communication equipment as claimed in claim 9, it is characterized in that, described message processing unit, whether the batch processing message that is used for judging new generation is with to send the batch processing message attributes that buffering area deposited in identical, in this way, directly the entity content stores of described new batch processing message to sending in the buffering area, and the message header length of the batch processing message that deposits in before increasing; As not, directly deposit described new batch processing message in the transmission buffering area, write down the message attributes and the message-length of this batch processing message and restart timer.
CN2010101334853A 2010-03-26 2010-03-26 Intertask message sending method and communication apparatus Expired - Fee Related CN101815034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101334853A CN101815034B (en) 2010-03-26 2010-03-26 Intertask message sending method and communication apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101334853A CN101815034B (en) 2010-03-26 2010-03-26 Intertask message sending method and communication apparatus

Publications (2)

Publication Number Publication Date
CN101815034A true CN101815034A (en) 2010-08-25
CN101815034B CN101815034B (en) 2012-07-25

Family

ID=42622156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101334853A Expired - Fee Related CN101815034B (en) 2010-03-26 2010-03-26 Intertask message sending method and communication apparatus

Country Status (1)

Country Link
CN (1) CN101815034B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103199968A (en) * 2012-01-09 2013-07-10 卓望数码技术(深圳)有限公司 Sending method of messages and system
CN104468841A (en) * 2014-12-30 2015-03-25 北京奇虎科技有限公司 Method and device for transmitting information in batches
CN104717191A (en) * 2013-12-16 2015-06-17 华为技术有限公司 Message processing method and device
CN107146395A (en) * 2017-06-13 2017-09-08 珠海慧信微电子有限公司 The kilowatt meter reading-out system and meter register method communicated based on bandwidth carrier
US10432558B2 (en) 2013-01-22 2019-10-01 International Business Machines Corporation Synchronous conferencing with aggregation of messages
CN110708234A (en) * 2019-09-24 2020-01-17 深圳证券交易所 Message transmission processing method, message transmission processing device and storage medium
CN112235268A (en) * 2020-09-29 2021-01-15 北京智芯微电子科技有限公司 Secure communication method, system and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1917478A (en) * 2006-09-14 2007-02-21 杭州华为三康技术有限公司 Method for processing forwarding message, and process module
CN1921364A (en) * 2005-08-25 2007-02-28 中兴通讯股份有限公司 Method for package transmitting and self-adaptive window zooming of reliable transmission layer based on message
JP2007058874A (en) * 2006-10-10 2007-03-08 Intelligent Model:Kk Batch processor, batch processing method, batch processing program, batch processing system
CN101291194A (en) * 2008-05-20 2008-10-22 华为技术有限公司 Method and system for keeping sequence of report

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1921364A (en) * 2005-08-25 2007-02-28 中兴通讯股份有限公司 Method for package transmitting and self-adaptive window zooming of reliable transmission layer based on message
CN1917478A (en) * 2006-09-14 2007-02-21 杭州华为三康技术有限公司 Method for processing forwarding message, and process module
JP2007058874A (en) * 2006-10-10 2007-03-08 Intelligent Model:Kk Batch processor, batch processing method, batch processing program, batch processing system
CN101291194A (en) * 2008-05-20 2008-10-22 华为技术有限公司 Method and system for keeping sequence of report

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103199968A (en) * 2012-01-09 2013-07-10 卓望数码技术(深圳)有限公司 Sending method of messages and system
US10432558B2 (en) 2013-01-22 2019-10-01 International Business Machines Corporation Synchronous conferencing with aggregation of messages
CN104717191A (en) * 2013-12-16 2015-06-17 华为技术有限公司 Message processing method and device
CN104717191B (en) * 2013-12-16 2018-12-14 华为技术有限公司 Message processing method and device
CN104468841A (en) * 2014-12-30 2015-03-25 北京奇虎科技有限公司 Method and device for transmitting information in batches
CN107146395A (en) * 2017-06-13 2017-09-08 珠海慧信微电子有限公司 The kilowatt meter reading-out system and meter register method communicated based on bandwidth carrier
CN110708234A (en) * 2019-09-24 2020-01-17 深圳证券交易所 Message transmission processing method, message transmission processing device and storage medium
CN112235268A (en) * 2020-09-29 2021-01-15 北京智芯微电子科技有限公司 Secure communication method, system and device
CN112235268B (en) * 2020-09-29 2023-01-24 北京智芯微电子科技有限公司 Secure communication method, system and device

Also Published As

Publication number Publication date
CN101815034B (en) 2012-07-25

Similar Documents

Publication Publication Date Title
CN101815034B (en) Intertask message sending method and communication apparatus
WO2021121370A1 (en) Message loss detection method and apparatus for message queue
US8233399B2 (en) Generic packet generator and method
CN103023857B (en) A kind of method and system of information resources remote deployment
CN112965839B (en) Message transmission method, device, equipment and storage medium
US7310803B2 (en) Method and system for executing multiple tasks in a task set
WO2022032984A1 (en) Mqtt protocol simulation method and simulation device
CN110020046B (en) Data capturing method and device
CN102111419A (en) Message middleware-based client automatic reconnection method
JP2009509395A (en) Device management method and device management client using nodes having additional attributes
CN111064771A (en) Network request processing method and system
CN116405547A (en) Message pushing method and device, processor, electronic equipment and storage medium
CN109213955B (en) Data processing method and related equipment
CN113346973B (en) Event prompting method and device, electronic equipment and computer readable storage medium
CN108462653B (en) TTE-based rapid protocol control frame sending method
CN115665191A (en) User information synchronization method and system based on cloud storage system
Chen et al. Petri net modeling of the reconfigurable protocol stack for cloud computing control systems
CN109413118A (en) A kind of method, apparatus that realizing session synchronization and storage medium, program product
US7864781B2 (en) Information processing apparatus, method and program utilizing a communication adapter
CN114050909A (en) Method and system for drilling simulated mails and electronic equipment
CN101465854B (en) Media server and method for implementing quasi real time medium data transmission
CN109842674A (en) A kind of delay queue implementation method that multilingual interaction is cross-platform
CN101909283B (en) M2M (Machine-to-Machine) platform and method for sharing load downloaded with in high capacity
CN116527737B (en) Multi-input single-output network connection control method for PLC single-threaded system in industrial control environment
CN115209360B (en) Method and device for transmitting data of aggregation container based on object

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120725