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

Intertask message sending method and communication apparatus Download PDF

Info

Publication number
CN101815034B
CN101815034B CN2010101334853A CN201010133485A CN101815034B CN 101815034 B CN101815034 B CN 101815034B CN 2010101334853 A CN2010101334853 A CN 2010101334853A CN 201010133485 A CN201010133485 A CN 201010133485A CN 101815034 B CN101815034 B CN 101815034B
Authority
CN
China
Prior art keywords
message
batch processing
processing message
buffering area
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.)
Expired - Fee Related
Application number
CN2010101334853A
Other languages
Chinese (zh)
Other versions
CN101815034A (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 complicacy, can be placed on some functions in the various 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 and sends 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 is not sent this message immediately, redispatches but postpone the some time disposable batch sends in the message bag so that follow-up IPV4 route messages can be placed on.
But time-delay is sent the transmission timing that possibly cause sending message in batches and sending message in real time and can not be guaranteed.Such as, before the delay time that sends in batches expired, task need be sent 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 two types of batch processing message and non-batch processing message; All message stores to be sent are set in a public transmission buffering area;
When non-batch processing message to be sent produces, sent the batch processing message of sending in the buffering area earlier, send said 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 said non-batch processing message, be earlier will said non-batch processing message deposit 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 said new batch processing message and sending buffering area is identical; In this way, directly arrive the entity content stores of said new batch processing message and send in the buffering area, and increase the message header length of batch processing message; As not, said 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.Said message attributes comprises type of message.
Concrete, full as sending buffering area, the batch processing message of sending 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 of sending buffering area.
Concrete, said batch processing message is meant the identical message of the bigger message attributes of size of message; Said 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 has been sent, deposits said non-batch processing message in transmission buffering area and the transmission of notification message transmitting element again; 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, said 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 of sending buffering area in.
Concrete; Said 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, said 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 said 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 said 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 sketch map of batch processing message in sending buffering area of the embodiment of the invention;
Fig. 4 is the sketch map 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 following: all message to be sent that produce between task are set are divided into two types of batch processing message and non-batch processing message; 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 of sending 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 send the non-batch processing message content of storing in the buffer immediately; 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 sending batch processing message was as shown in Figure 3, judges at first whether buffer is full:
If buffer is full; Then send the batch processing message of storing in the buffer immediately; Assemble the batch processing message of current generation then from the initial address of buffer; And recording messages attribute (information of can be unique confirming a message is such as type of message) and message-length, starts the transmission timer of delaying time;
If buffer less than; Then judge and whether had batch processing message among the buffer; As had 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 identical; Then need not add message header information; Directly the message entity content stores in buffer, add original message-length to the length of message, note message-length in this total message-length and the updating message header information for 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, all send the batch processing message in the buffer; 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 sends the batch processing message of storing in the buffer immediately; 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 concrete examples of implementation.
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 two types of batch processing message and non-batch processing message.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, and and 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 redispatch after needing the corresponding time-delay transmission timer of wait batch processing message overtime.Non-batch processing message is sent after the buffer assembling immediately, and is as shown in Figure 4, is made up of Interface status message header (6) and Interface status message content (7) as non-batch processing message interface status message, is 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, read out message content then.So just read out a complete message.
The present invention is different from the preferential mode of sending non-batch processing message of prior art, adopts and sends 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 of sending 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 has been sent, deposits said non-batch processing message in transmission buffering area and the transmission of notification message transmitting element again; 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 of sending 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 of sending 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 said 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 (9)

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 two types of batch processing message and non-batch processing message; And all message stores to be sent are set in a public transmission buffering area;
When non-batch processing message to be sent produces, sent the batch processing message of sending in the buffering area earlier, send said 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 the time-delay transmission timer overtime all sends.
2. inter-task message sending method according to claim 1 is characterized in that, when sending said non-batch processing message, earlier said non-batch processing message is deposited in and send in the buffering area, and then send immediately.
3. inter-task message sending method according to claim 1 is characterized in that, batch processing message is deposited in the message attributes and the message-length of record batch processing message when sending buffering area; Before said 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 said new batch processing message and sending buffering area is identical; In this way, directly the entity content stores of said 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 said new batch processing message in the transmission buffering area, write down the message attributes and the message-length of said new batch processing message.
4. like the said inter-task message sending method of claim 3, it is characterized in that said message attributes comprises type of message.
5. like any said inter-task message sending method of claim 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, full as sending buffering area; The batch processing message of sending in the buffering area is sent immediately, current batch processing message to be sent is deposited in send in the buffering area then.
6. 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 has been sent, deposits said non-batch processing message in transmission buffering area and the transmission of notification message transmitting element again; 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 in the overtime back of time-delay transmission timer to message sending unit;
Message sending unit, the non-batch processing message or the batch processing message that are used for sending buffering area.
7. communication equipment as claimed in claim 6 is characterized in that, said 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 of sending buffering area in.
8. like claim 6 or 7 described communication equipments; It is characterized in that said message generating unit comprises a message processing unit, be used for when batch processing message to be sent produces; Judge whether the transmission buffering area is full; As it is full to send buffering area, 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.
9. communication equipment as claimed in claim 8; It is characterized in that; Whether said message processing unit, the batch processing message that is used for judging new generation be with to send the batch processing message attributes that buffering area deposited in identical, in this way; Directly arrive the entity content stores of the batch processing message of said new generation and send in the buffering area, and the message header length of the batch processing message that deposits in before increasing; As not, directly deposit the batch processing message of said new generation in the transmission buffering area, write down said new generation batch processing message message attributes and message-length and restart the time-delay transmission 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 CN101815034A (en) 2010-08-25
CN101815034B true 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)

Families Citing this family (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
GB2509979A (en) 2013-01-22 2014-07-23 Ibm Synchronous Conference System with aggregation of temporally proximate messages
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
CN107146395B (en) * 2017-06-13 2020-05-08 珠海慧信微电子有限公司 Meter reading system and meter reading method based on broadband carrier communication
CN110708234B (en) * 2019-09-24 2022-05-17 深圳证券交易所 Message transmission processing method, message transmission processing device and storage medium
CN112235268B (en) * 2020-09-29 2023-01-24 北京智芯微电子科技有限公司 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

Also Published As

Publication number Publication date
CN101815034A (en) 2010-08-25

Similar Documents

Publication Publication Date Title
CN101815034B (en) Intertask message sending method and communication apparatus
CN103023857B (en) A kind of method and system of information resources remote deployment
CN108268208A (en) A kind of distributed memory file system based on RDMA
WO2014101684A1 (en) Data synchronizing method, apparatus and system
JP2014531786A (en) Method for flow control in a collaborative environment and for reliable communication
CN111064771B (en) Network request processing method and system
CN113259415B (en) Network message processing method and device and network server
CN104253788A (en) Data processing method and system, client, and page engine
CN108881485A (en) The method for ensureing the high concurrent system response time under big data packet
CN102111419A (en) Message middleware-based client automatic reconnection method
WO2022120806A1 (en) Multi-cloud distributed messaging method and system for high performance computing
KR101558289B1 (en) Composing message processing pipelines
CN103546363A (en) Method, device and system for pushing instant communication messages
CN114185582A (en) Automobile software online upgrading system and method based on QUIC protocol
CN111953520A (en) Method, apparatus, device and medium for implementing group control through group virtual device
CN108334547B (en) Data sharing exchange system and method based on big data
CN108462653B (en) TTE-based rapid protocol control frame sending method
CN101626310A (en) Method, device and system for transmitting service information in trunking environment
CN101072172A (en) Method and device for realizing network data high-efficiency transfer
CN101335610B (en) ARP synchronization method in high-side Ethernet network switch
CN107786661B (en) Information synchronization method
CN110362314A (en) Information processing method and device, computer-readable medium, electronic equipment
CN116405547A (en) Message pushing method and device, processor, electronic equipment and storage medium
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

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