CN101873257B - Method and system for receiving messages - Google Patents

Method and system for receiving messages Download PDF

Info

Publication number
CN101873257B
CN101873257B CN2010101919142A CN201010191914A CN101873257B CN 101873257 B CN101873257 B CN 101873257B CN 2010101919142 A CN2010101919142 A CN 2010101919142A CN 201010191914 A CN201010191914 A CN 201010191914A CN 101873257 B CN101873257 B CN 101873257B
Authority
CN
China
Prior art keywords
message
application heap
application
write
heap
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
CN2010101919142A
Other languages
Chinese (zh)
Other versions
CN101873257A (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 CN2010101919142A priority Critical patent/CN101873257B/en
Publication of CN101873257A publication Critical patent/CN101873257A/en
Application granted granted Critical
Publication of CN101873257B publication Critical patent/CN101873257B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention discloses a method and a system for receiving messages, relating to the field of a data communication technology and designed for reducing the waiting time for writing the messages into a memory unit and improving the operating efficiency for receiving the messages. The method comprises the following steps: writing the messages into a first memory segment of the memory unit; when the message writing into the first memory segment is end, writing messages into a second memory segment according to a segment initial address of the second memory segment; and when the message writing into the first memory segment is end, reading the written messages from the first memory segment. The embodiment of the invention further discloses a system for receiving the messages, which corresponds to the method and comprises a memory unit, a memory application and configuration unit, a message writing unit and a message reading unit. The embodiment of the invention is used for receiving the messages in a communication system.

Description

A kind of method and system that receive message
Technical field
The present invention relates to data communication technology field, relate in particular to a kind of method and system that receive message.
Background technology
In most of communication systems, all there is the message interaction process between message writing unit and the message reading unit, the message writing unit is with message write memory unit, then the message reading unit reads the described message of write memory unit from described internal storage location, this process is the process that receives message, is called packet receiving.
In prior art one, the process that realizes a packet receiving is as follows: as shown in Figure 1, at first, the message reading unit is to message writing unit configuration " bag initial address ", then start and receive the message function, after the message writing unit writes a message to internal storage location at every turn, can to message reading unit indication " end-of-packet ", so that reading the described message that has write from internal storage location, process the message reading unit.Like this, very simple for once receiving the message process implementation, if but when running into the situation that message in enormous quantities need to receive, the message reading unit will be continuously to message writing unit configuration " bag initial address ", then start the message receiving function, and want continuous response " end-of-packet " to process the message data of write memory unit, like this message reading unit ceaselessly stop with responsive state in switch, expend very much the resource of message reading unit.
In the prior art two, also there is the another kind of method that receives message, realizes that namely the interruption of message reading unit in processing procedure is in conjunction with (interrupt coalescing).Specific practice is, be maximum message amount or the maximum delay of receiving of internal storage location configuration, the message of receiving when internal storage location reaches the maximum received quantity of configuration, perhaps from receiving first start of heading timing, after reaching the maximum millisecond time-delay of configuration, send interrupt signal to the message reading unit, wait for the data of message reading unit processing write memory unit this moment, like this, greatly reduced the interruption times that receives in the message process the message reading unit.If the message reading unit can be processed the message of internal storage location in real time, be that the message reading unit is processed the needed time of message in the internal storage location to the stand-by period that internal storage location writes message then next time.If message reading unit operating load is very large suddenly, can't the real-time response interrupt signal, be also need increase a message reading unit on the needed time basis of message and handle the stand-by period that the internal storage location message is processed in other operation again processing to the stand-by period that internal storage location writes message so next time.
To sum up, the technical scheme of prior art two, although reduced in the prior art one resource cost to the message reading unit, but there are the following problems also: writing to internal storage location in the stand-by period of message next time, the work of message writing unit must suspend, and has reduced the operating efficiency of system.
Summary of the invention
The embodiment of the invention provides a kind of method and system that receive message, can reduce the stand-by period that writes message to internal storage location, improves the operating efficiency that message receives.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of method that receives message comprises:
In the first application heap of internal storage location, write message;
When writing ENMES to described the first application heap, according to the segment base of the second application heap, in described the second application heap, write message;
After writing ENMES to described the first application heap, read the message that has write from described the first application heap.
A kind of system that receives message comprises:
Internal storage location is used for temporary message;
Internal memory application and dispensing unit are used for to described internal storage location application the first application heap and the second application heap, dispose the segment base of described the first internal storage location and described the second internal storage location;
The message writing unit is used for writing message to described the first application heap and described second application heap of described internal storage location; Wherein, when writing ENMES to described the first application heap, according to the segment base of described the second application heap, in described the second application heap, write message;
The message reading unit is used for reading the message that has write from described the first application heap after described message writing unit writes ENMES to described the first application heap.
The method and system of the reception message that the embodiment of the invention provides, based on the application heap that at least two logics link to each other, make message to write and read order be to carry out according to the segmentation of internal storage location.When receiving message, write message to the first application heap; After described the first application heap writes ENMES, just then jump to the initial address of the second application heap, write message to described the second application heap, at this moment, the data that write in described the first application heap etc. are to be read; Reading data in described the first application heap can write message with described the second application heap and carry out simultaneously also can having certain time-delay to carry out, thereby the message of write memory unit can be processed according to segmentation, and be to process in batches for the message in each application heap.Write message to internal storage location in this process, only be that an application heap writes the backward required time of another application heap redirect the break time that internal storage location writes message always, improved the operating efficiency that message receives.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the below will do to introduce simply to the accompanying drawing of required use among the embodiment, apparently, accompanying drawing in the following describes only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is that prior art one message receives schematic diagram;
Fig. 2 is the method flow diagram that the embodiment of the invention one receives message;
Fig. 3 is system corresponding to method that the embodiment of the invention two receives message;
Fig. 4 is the method flow diagram that the embodiment of the invention two receives message;
Fig. 5 is that the embodiment of the invention two application heaps are 4 reception message status transition diagram;
Fig. 6 is that the embodiment of the invention four application heaps are 4 reception message status transition diagram;
Fig. 7 is the system schematic that the embodiment of the invention five receives message;
Fig. 8 is the embodiment of the invention six message writing unit block diagrams.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment one
As shown in Figure 2, the embodiment of the invention one receives the method for message, comprising:
S11, in the first application heap of internal storage location, write message.
Internal storage location can be divided at least two application heaps according to application, and logic links to each other between the application heap, and the application heap that any two logics link to each other in described at least two application heaps all can be described as the first application heap and the second application heap.Not with the linking to each other as the connection judgment standard of physical address, but adopt state machine between the application heap, these application heaps organically are engaged togather by jump condition, namely when an application heap satisfies specific jump condition, turn to another application heap.This jump condition can be the heap(ed) capacity of each application heap setting, or the reception message time of each application heap etc.And the continuous execution sequence that shows as the application heap executable operations of the logic of application heap, for example, after one of them application heap in described at least two application heaps satisfies certain jump condition, turn to another application heap executable operations, the order of this executable operations is the order that the application heap logic links to each other.
After starting the reception message, when writing message to described the first application heap, according to the sequence of addresses of the first application heap, write successively message.
S12, when writing ENMES to described the first application heap, according to the segment base of the second application heap, in described the second application heap, write message.
When described the first application heap writes ENMES, jump to the segment base of the second application heap, write message according to the sequence of addresses of described the second application heap to described the second application heap.It is the jump condition that writes message to described the second application heap that described the first application heap writes ENMES, its write end can with the capacity of application heap or to the application heap write time as criterion.
S13, after writing ENMES to described the first application heap, read the message that has write from described the first application heap.
After writing end to described the first application heap, the message in this application heap etc. are pending, read the message in described the first application heap.If the message reading unit can in time respond the medium outstanding message of the first application heap, read so in described the first application heap message can with write message to described the second application heap and carry out simultaneously; If the message reading unit temporarily can't respond the message that reads in described the first application heap, the message that then reads in described the first application heap also can postpone to carry out in writing message to the second application heap.
Repeating step S11 to S13, the logic order of connection according between the application heap writes message to application heap, and according to the logic order of connection between the application heap, reads the message that has write from application heap.Say that from system perspective at synchronization, writing message and read message from the memory field to internal storage location is parallel work-flow.
The method of the reception message that the embodiment of the invention provides, based on the application heap that at least two logics link to each other, make message to write and read order be to carry out according to the segmentation of internal storage location.When receiving message, according to the sequence of addresses of the first application heap, write message to the first application heap; After described the first application heap writes ENMES, just then jump to the segment base of the second application heap, write message to described the second application heap, at this moment, the data that write in described the first application heap etc. are to be read; Reading data in described the first application heap can write message with described the second application heap and carry out simultaneously also can having certain time-delay to carry out, thereby the message that makes the message of write memory unit and read internal storage location can be processed according to segmentation, and is to process in batches for the message in each application heap.Write message to internal storage location in this process, only be that an application heap writes the backward required time of another application heap redirect the break time that internal storage location writes message always, improved the operating efficiency that message receives.
Embodiment two
The embodiment of the invention two is based on embodiment one, as an example of system that Fig. 3 is comprised of message writing unit, internal storage location and message reading unit example embodiments of the present invention is described in further detail.As shown in Figure 4, the embodiment of the invention comprises following content:
S21, at least two application heaps of internal storage location application (being described the first application heap and described the second application heap), dispose the segment base of each described application heap to the message writing unit.Wherein, described at least two application heap logics are joined, and form buffer circle.
Further, the embodiment of the invention also comprises: dispose the maximum message segment quantity that described the first application heap and described the second application heap can write message, i.e. each application heap maximum message segment quantity that can write.
Every sector address space is an application heap.The address is continuous in each application heap, but the address between the application heap may be continuous, also may disperse.This is that it no longer is continuous making the memory address that can write message because internal storage location may be because of other data or professional existence, but non-conterminous, discrete.
After the success of application application heap, dispose the segment base of each described application heap and the maximum message segment quantity segN_len that each described application heap receives to the message writing unit, N represents N section application heap.
Be the maximum message segment quantity of each application heap configuration section initial address and reception, then the memory capacity of each application heap maximum message segment quantity that equals every section configuration multiply by maximum message size.Wherein, described maximum message size represents that internal memory receives the ability of message, the packet maximum length that namely can receive, but not the actual maximum length that enters the message of internal storage location, generally speaking, internal storage location can receive the message that is 2 kilobytes to the maximum, and actual message length is generally about 1.5 kilobytes.For example in the embodiment of the invention, the initial address of allocate memory section Seg0 is 9000_A000, it is 1000 that allocate memory section Seg0 receives maximum message segment quantity, then the maximum message segment quantity * maximum message size of the memory capacity of application heap Seg0=configuration=1000*2 kilobytes=2 Mbytes.The similar calculating of the memory capacity of other application heap.
The embodiment of the invention is in receiving the message process, aforementioned non-conterminous address space can be used, adopt the design of state machine, these are non-conterminous, discrete application heap organically is engaged togather, form buffer circle (Ring Buffer), namely write or read message to application heap and circulate by section.For the embodiment of the invention, each application heap is set certain jump condition, when satisfying described jump condition, redirect order according to state machine design, jump to next application heap executable operations, this redirect sequentially is the logic order of connection of application heap, and in the embodiment of the invention, the redirect between the application heap sequentially circulates.When the jump condition in the embodiment of the invention reaches the heap(ed) capacity of this application heap for the message amount that writes when application heap, then carry out redirect.With write message accordingly, the message reading unit reads message according to the logic order of connection of application heap from internal storage location.Such as Fig. 3, the message reading unit to the internal storage location application n+1 section interval, the arrow indication between the application heap has sequentially represented the logic order of connection between the application heap.
Fig. 5 for example understands the state transition diagram between 4 application heaps, IDLE is the initial condition of state machine, SegN represents N section application heap (N is 0,1,2 or 3), when the message amount that the arrow indication expression application heap between the application heap writes reaches this section maximum quantity of configuration, jump to next application heap executable operations, when the arrow of application heap SegN sensing initial condition represents that the time arrives, the message writing unit stops write operation, the present invention gets back to initial condition, so also should comprise step S22.
S22, be set the total time that receives message.
This total time, can determine that the embodiment of the invention receives the duration of message, can get according to the demand of message reading unit for message analysis.The timing of this total time arrives, and receives the stop condition of message for this system.The total time that receives message is set, and the message writing unit begins timing, enters the reception message status.For example, in the embodiment of the invention, the total time that configuration receives message is 2 minutes, then begins timing, receives message, when arriving 2 minutes, stops to write message to internal storage location.Timing is 0.1 millisecond integral multiple, can from 0.1 millisecond to minute rank timing, even can be with a hour rank timing.
S23, write message to the first application heap of described at least two application heaps.
The beginning timing, the message writing unit can be taked the screening measure to message, the message analysis demand that the message reading unit is concrete is depended in this screening measure, for example, the message reading unit is set the specified conditions that the message needs satisfy according to Processing tasks, then with described specified conditions as the screening measure, will meet the message write memory section of screening measure.
Further, when writing message to application heap, the embodiment of the invention also comprises, indicates the message amount that has write in the current described application heap that is writing.
Accurately indicate each application heap to write what messages by the counting module that is arranged at the message writing unit, when reaching the maximum message segment quantity of this application heap, then carry out redirect to next application heap.Writing the application heap of message when particularly arriving for the time, then the message reading unit can also pass through the message amount of the counting module indication of this application heap, accurately read the message amount that writes (because existing on the application heap outside the message that writes based on the embodiment of the invention, because the message reading unit is carried out other professional data of still keeping at this application heap that produce, and these data are nonsensical for the Processing tasks of message reading unit processing embodiment of the invention indication), counting module can pointer be processed the task of embodiment of the invention indication and has been write what messages, when the message reading unit reads, the message of read-only fetching registration amount, the message of this application heap (comprising what other business produced) can not be read entirely, thereby has avoided the wasting of resources of message reading unit.
S24, when writing ENMES to described the first application heap, according to the segment base of the second application heap, in described the second application heap, write message.More specifically, this step comprises the steps:
S241, when the message amount that writes to described the first application heap reaches the pre-configured maximum message segment quantity of this section, indicate described the first application heap to write to finish and send interrupt requests, jump to simultaneously the segment base of the second application heap.
In the embodiment of the invention, come this section of mark whether to write end by one of them flag bit of register in the definition message writing unit for section end mark position, namely by changing the binary condition of this flag bit, mark whether to write end, each application heap all arranges a section end mark position.Write when finishing when an application heap is labeled, send an interrupt requests to the message reading unit simultaneously, the message in this application heap is read in request.
For example Fig. 3 and Fig. 5, during maximum message segment quantity 1000 that the message number that application heap Seg0 writes in the embodiment of the invention equals to dispose, when namely satisfying rev_cnt0=seg0_len, application heap redirect order based on design, jump to the initial address of application heap Seg1, indicate simultaneously described application heap Seg0 to write and finish and the transmission interrupt requests, concrete measure can pass through mark " the 0th section end " on the section end mark position of the register of message writing unit, simultaneously to the request of message reading unit reporting interruption, the messages of indicating this application heap of message reading unit to write end and having write etc. are to be read, the message reading unit reads message after receiving this interrupt requests.
S242, write message to described the second application heap.
After jumping to the initial address of application heap Seg1 in the embodiment of the invention, write message according to the sequence of addresses of application heap Seg1 to application heap Seg1.
S25, after writing ENMES to described the first application heap, read the message that has write from described the first application heap.
For example the message amount of write memory section Seg0 is 1000 o'clock in the embodiment of the invention, message writing unit mark " the 0th section end " and send interrupt requests to the message reading unit on a section end mark position of register represents that namely the message etc. in the application heap Seg0 is pending.This interrupt requests if the message reading unit makes an immediate response when writing message to described the second application heap, reads the described message that has write from described the first application heap.Message in the application heap Seg0 can be read and process by the message reading unit immediately so, namely with write message to application heap Seg1 and carry out simultaneously, then system perspective is taken a fancy to, receive in the process of message, the message writing unit writes message and message reading unit to internal storage location, and to read message from internal storage location be parallel work-flow.If but the message reading unit fails in time to respond this interrupt requests, then the message reading unit can lag behind the message writing unit and write message to the second application heap, but in this process, keeps writing message to internal storage location always, has improved the message receiving efficiency.
Need to prove, said the first application heap of the present invention and the second application heap, only refer to the relative order between two application heaps, do not refer in particular to first application heap and second application heap in all application heap serial numbers, in like manner the application heap mentioned of the embodiment of the invention also is not limited to only have two application heaps.
According to the order that the application heap logic is joined, repeating step S23 is to step S25, and in the embodiment of the invention, all application heap circulations are joined, that is:
When writing ENMES to described the second application heap, according to the segment base of described the first application heap, in described the first application heap, write message;
After writing ENMES to described the second application heap, from described the second application heap, read the message that has write.
Wherein, described the second application heap and described the first application heap represent respectively last application heap in the circular order and first application heap, and this circular order can be with any one application heap as initial order.
When last application heap write complete after, jump to first application heap, again write message to first application heap.For the embodiment of the invention, also may there be another situation, even read the message delay that write in described the first application heap in the overlong time that writes message to described the second application heap, when then again jumping to described the first application heap, the message that write before in this application heap also is untreated, this kind situation can wait for that the message reading unit handles the message that has write, and then with new message write memory section, perhaps can enter step S26.
S26, again write message to described the first application heap, cover the message that this application heap has write, and described the first application heap message of mark is capped.
Repeating step S23-S25, until after described at least two application heaps all write end, if the data that first application heap last time writes are not also read away by the message reading unit, then repeat to write message to this application heap, cover and write message last time, for other application heaps, if message also was not read and taked too the covering measure last time.
In the embodiment of the invention, one of them flag bit of register is that message covering flag bit comes the mark message capped or capped in the message writing unit by defining, namely by changing the binary condition of this flag bit, change capped or covered state not, each application heap all arranges a message and covers flag bit.
For example, in the embodiment of the invention, the reception maximum message segment quantity that the message number that writes as application heap Seg3 equals to dispose, then cycling jump is write application heap Seg0, and while mark " the 3rd section end " on the section end mark position of register is so that subsequent treatment.At this moment, also fail to process the batch message that application heap Seg0 section write last time such as the message reading unit, the message writing unit comes mark " the 0th section covers " at the message covering flag bit of register by change " 0 ", one state so, shows that application heap Seg0 has been covered by new message.Other application heaps cover sign by that analogy.
S27, reach described total time of configuration when the time that receives message, arrive and indicate the current current application heap that is writing to write end instruction time, the message writing unit stops to write message to described current application heap, and message that has write described current application heap etc. is to be read.
After the total time of the reception message that disposes arrives, thinking the message reading unit has read, message is analyzed desired message amount, the application heap that is then writing is even without the maximum message segment quantity of finishing configuration, also can stop to write, mark " section finishes ", simultaneously to arriving message reading unit indication total time, the message writing unit stops to write message to current application heap, after the message reading unit receives and total time arrives indication, after having read the message of described current application heap, stop to read message, receive the message process and finish.
In the embodiment of the invention, when configuration received the timing arrival of message after 2 minutes, if write message to application heap Seg2, then application heap Seg2 is even without the maximum message segment quantity that writes configuration, also can mark " section finishes ", arrive to message reading unit indication timing simultaneously, the message writing unit stops to write message to any application heap, the message reading unit stops to any application heap read operation after having read the message that application heap Seg2 writes.
The method of the reception message that the embodiment of the invention provides, to the application heap that at least two logics of internal storage location application link to each other and circulation is joined, application heap forms buffer circle, write message and read message and can carry out simultaneously from internal memory to internal memory on system perspective, the message reading unit can segment processing, the batch process message.The embodiment of the invention gives and again jumps to certain application heap and write fashionablely, and also be untreated to the message that this application heap writes last time, the solution of this special circumstances.When the embodiment of the invention makes and writes message to internal storage location, except the redirect required time, keep on the time writing message to internal storage location continuously, also can constantly make internal storage location maintain the message that can read for the message reading unit simultaneously.The embodiment of the invention gives a kind of stop condition of message receiving course, when namely the time arrives, stops to receive message.The embodiment of the invention has improved the efficient that message receives.
Embodiment three
Embodiment three is roughly the same with embodiment two technical schemes, and different from embodiment one is the condition that stops to receive message behind step S26, and the embodiment of the invention behind step S26, comprising:
Determine to satisfy the quantity demand that message is processed from the message amount that internal storage location reads out, stop to write and reading message from application heap to application heap.
Embodiment of the invention message reading unit is based on the message in enormous quantities that has read from internal storage location, add up judgement, if think that the message that reads from internal storage location has in enormous quantities satisfied the message reading unit deal with data process to the demand of data bulk or the demand of calculating in batches, the message reading unit just can send halt instruction to the message writing unit, stop to write or reading message from a certain application heap to a certain application heap, finish the message process that receives, but the message writing unit flag bit mark " section finishes ", does not arrive to the message reading unit instruction time yet.
The embodiment of the invention provides the stop condition of another kind of reception message, when the message amount that receives satisfies processing demands, stops to receive message.The embodiment of the invention can improve the efficient that message receives based on the explanation identical with embodiment two.
Need to prove that for receiving course, timing arrives and judges that the message amount that receives satisfies processing demands, all are conditions that receiving course can stop, satisfy arbitrary in the stop condition, just can stop to receive message, make reception message process more flexible.
Embodiment four
The embodiment of the invention is with respect to embodiment two and three difference, logic connected mode between described at least two application heaps is joined for order, but do not circulate, namely when last application heap satisfies jump condition, get back to the initial condition of state machine.
Accordingly, after repeating embodiment two step S23 to S25, if the maximum message segment quantity that the message amount that last application heap writes equals to dispose, after the message writing unit indication " section finishes ", even regularly do not arrive total time, the message writing unit also stops again to write message to internal storage location, and the message of write memory unit waits for that the message reading unit reads.
For example Fig. 6 take four application heaps as example, illustrates the state transitions between the application heap, the reception maximum message segment quantity that the message amount that writes as application heap Seg3 equals to dispose, and then mark " the 3rd section end " sends interrupt requests to the message reading unit simultaneously.At this moment, even timing does not arrive, also stop to write message to internal storage location, the message of write memory unit waits for that the message reading unit reads.
The embodiment of the invention can improve the efficient that receives message equally as the reduction procedure of embodiment two and embodiment three.
Embodiment five
As shown in Figure 7, the embodiment of the invention also provides a kind of system 1 that receives message, comprising: internal storage location 2 is used for temporary message; Internal memory application and dispensing unit 5 are used for to described internal storage location application the first application heap and the second application heap, dispose the segment base of described the first internal storage location and described the second internal storage location; Message writing unit 3 is used for writing message to described the first application heap and described second application heap of described internal storage location; Wherein, when writing ENMES to described the first application heap, according to the segment base of described the second application heap, in described the second application heap, write message; Message reading unit 4 is used for reading the message that has write from described the first application heap after described message writing unit writes ENMES to described the first application heap.
Internal memory application and dispensing unit are initiated application by call function to internal storage location, application at least two sector address spaces, and every sector address space is an application heap.The address is continuous in each application heap, but the address between the application heap may be continuous, also may disperse.This is that it no longer is continuous making the memory address that can write message because internal storage location may be because of other data or professional existence, but non-conterminous, discrete.After internal memory application and the success of dispensing unit application application heap, dispose the segment base of each described application heap to the message writing unit.
Not with the linking to each other as the connection judgment standard of physical address, but in the state machine mode, these application heaps organically are engaged togather by jump condition between the application heap, namely when an application heap satisfies specific jump condition, turn to another application heap.This jump condition can be the heap(ed) capacity of each application heap setting, or the reception message time of each application heap etc.And the continuous execution sequence that shows as the application heap executable operations of the logic of application heap, for example, after one of them application heap in described at least two application heaps satisfies certain jump condition, turn to another application heap executable operations, the order of this executable operations is the order that the application heap logic links to each other.
After starting the reception message, when the message writing unit writes message to described the first application heap, according to the sequence of addresses of the first application heap, write successively message.When the message writing unit writes ENMES to described the first application heap, jump to the initial address of the second application heap of described at least two application heaps, write message according to the sequence of addresses of described the second application heap to described the second application heap.It is the jump condition that writes message to described the second application heap that described the first application heap writes ENMES, its write end can with the capacity of application heap or to the application heap write time as criterion.If the message reading unit can in time respond the medium outstanding message of the first application heap, the message reading unit reads message in described the first application heap and can write message to described the second application heap with the message writing unit and carry out simultaneously so; If the message reading unit temporarily can't respond the message in described the first application heap, the message that then reads in described the first application heap also can postpone to carry out in writing message to the second application heap.
The system of the reception message that the embodiment of the invention provides, based on the application heap that at least two logics link to each other, make message to write and read order be to carry out according to the segmentation of internal storage location.When receiving message, internal memory application and dispensing unit dispose the segment base of described the first internal storage location and described the second internal storage location afterwards to described internal storage location applied address space to the message writing unit; The message writing unit writes message to the first application heap; After the message writing unit writes ENMES to described the first application heap, just then jump to the initial address of the second application heap, write message to described the second application heap, at this moment, the data that write in described the first application heap etc. are to be read; The message reading unit reads data in described the first application heap and can write message to described the second application heap with the message writing unit and carry out simultaneously also can having certain time-delay to carry out, thereby the message of write memory unit can be processed according to segmentation, and be to process in batches for the message in each application heap.The message writing unit writes message to internal storage location always in this process, and only be that an application heap writes the backward required time of another application heap redirect the break time that internal storage location writes message, has improved the operating efficiency that message receives.
Embodiment six
Embodiment six is based on embodiment five, and the unit basis that comprises in the system that embodiment five receives message is described in further details.
Further, described internal memory application and dispensing unit dispose the maximum message segment quantity segN_len that each described application heap receives, and N represents N section application heap.Then the memory capacity of each application heap maximum message segment quantity that equals every section configuration multiply by maximum message size.Wherein, described maximum message size represents that internal memory receives the ability of message, the packet maximum length that namely can receive, but not the actual maximum length that enters the message of internal memory, generally speaking, internal memory can receive the message that is 2 kilobytes to the maximum, and actual message length is generally about 1.5 kilobytes.For example in the embodiment of the invention, the initial address that disposes the 0th application heap Seg0 is 9000_A000, disposing the 0th application heap Seg0 reception maximum message segment quantity is 1000, then the maximum message segment quantity * maximum message size of the memory capacity of the 0th application heap=configuration=1000*2 kilobytes=2 Mbytes.The similar calculating of the memory capacity of other application heap.
The embodiment of the invention is in receiving the message process, aforementioned non-conterminous address space can be used, adopt the design of state machine, these are non-conterminous, discrete address space organically is engaged togather, form buffer circle (Ring Buffer), namely write or read message to application heap and circulate by section.For the embodiment of the invention, each application heap is set certain jump condition, when satisfying described jump condition, redirect order according to state machine design, jump to next application heap executable operations, this redirect sequentially is the logic order of connection of application heap, in the embodiment of the invention, redirect between the application heap sequentially circulates, and namely forms buffer circle.When the jump condition in the embodiment of the invention reaches the heap(ed) capacity of this application heap for the message amount that writes when application heap, then carry out redirect.With write message accordingly, the message reading unit reads message according to the logic order of connection of application heap from internal storage location.
As shown in Figure 8, further, described message writing unit 3 comprises timing module 31, is used for arranging the total time that described system receives message.
This total time, can determine that the embodiment of the invention receives the duration of message, can get according to the demand of message reading unit for message analysis.The timing of this total time arrives, and receives the stop condition of message for this system.Timing module begins timing, triggers the message receiving function, enters the reception message status.
Further, described message writing unit also comprises counting module 32, is used to indicate the message amount that has write in the current described application heap that is writing.
The message writing unit can accurately indicate each application heap to write what messages by counting module, when reaching the maximum message segment quantity of this application heap, then carries out redirect to next application heap.Writing the application heap of message when particularly arriving for the time, then the message reading unit can also pass through the message amount of the counting module indication of this application heap, accurately reads the message amount that writes.
Further, the described message writing unit 3 also section of comprising finishes and interrupt module 33, be used for when the message amount that writes to described the first application heap or the second application heap reaches the pre-configured maximum message segment quantity of this application heap, indicate the message of described application heap to write end, and to the request of described message reading unit reporting interruption.
In the embodiment of the invention, can come this section of mark whether to write end for section end mark position by one of them flag bit of definition register, namely by changing the binary condition of this flag bit, mark whether to write end, each application heap all arranges a section end mark position.Write when finishing when application heap is labeled, section finishes and interrupt module sends an interrupt requests to the message reading unit simultaneously, and the message in this application heap is read in request.
In the embodiment of the invention, the circulation of all application heaps is joined, when last application heap write complete after, jump to first application heap, again write message to first application heap.For the embodiment of the invention, also may there be another situation, even the message reading unit reads the interior message delay of described the first application heap in the overlong time that writes message to described the second application heap, then again jump to described the second application heap and write fashionablely, the message that writes before in possible this application heap also is untreated.
For this kind situation, the described message writing unit of the embodiment of the invention also is used for again writing message to described the first application heap, covers the message that this application heap has write; Described message writing unit 3 also comprises covering indicating module 34, and when the message that is used for having write when described the first application heap was capped, described the first application heap message of mark was capped.
In the embodiment of the invention, described covering indicating module can be realized by one of them flag bit of definition register, specific practice is for by changing the binary condition of this flag bit, changes capped or covered state not, and each application heap all arranges a message and covers flag bit.
Further, described section is finished and interrupt module 33, also be used for when the time of described internal storage location reception message reaches the total time of configuration, indicating the current application heap that is writing to write end, and the arrival of calling time on the described message reading unit.
When after timing module begins timing, reaching the total time of setting, thinking the message reading unit has read, message is analyzed desired message amount, the application heap that is then writing is even without the maximum message segment quantity of finishing configuration, section finishes and interrupt module also can be to the current application heap mark " section finishes " that is writing, simultaneously to arriving message reading unit indication total time, after the message reading unit receives and total time arrives indication, after having read the message of described current application heap, stop to read message, receive the message process and finish.
As embodiment of the invention perfect scheme further, embodiment of the invention message reading unit 4 comprises indication stopping modular 42, be used for to determine to satisfy the quantity demand that message is processed from the message amount that described internal storage location reads out, indication stops to write and reading message from described internal storage location to described internal storage location
If before timing arrives, processing module is based on all messages that read, add up judgement, if think that the message of write memory in enormous quantities has satisfied in the processing procedure demand to message amount, just can stop to receive message, finish receiving the message process, but the message writing unit is not indicated " section finishes ", also do not arrive in instruction time.
As a kind of reduction procedure of the embodiment of the invention, the form that the state machine employing between described at least two application heaps is sequentially joined namely when last application heap satisfies jump condition, is got back to the initial condition of state machine.The maximum message segment quantity that the message amount that if last application heap writes between the application heap equals to dispose, behind section end and the interrupt module mark " section finishes ", even regularly do not arrive total time, also stop again to write message to internal memory, the message of write memory waits for that the message reading unit reads.
The system of the reception message that the embodiment of the invention provides, message reading unit and internal memory application and dispensing unit can be the CPU in the network (Central Processing Unit) subsystem, the message writing unit is by ASIC (application-specific integrated circuit (ASIC), Application SpecificIntegrated Circuit) subsystem or field programmable gate array (FPGA, Field-Programmable Gate Array) subsystem consists of.
The system of the reception message that the embodiment of the invention provides at least two application heaps of internal storage location application, writes message and reads message and can carry out simultaneously from internal memory to internal memory on the macroscopic view.The embodiment of the invention writes the situation of message cycle for application heap, has provided when again writing message to an application heap, and the message that write last time also is untreated, the solution of this special circumstances; And not having recurrence relation between application heap, last application heap writes the solution after the end.When the embodiment of the invention made and writes message to internal memory, maintenance write continuously except the redirect required time, also can constantly make internal memory keep can read message simultaneously, thereby can carry out segment processing, batch process message.The embodiment of the invention gives two kinds of stop conditions of message receiving course, when namely the time arrives, stops to receive message and satisfies processing demands with the message amount that reads, and stops to connect literary composition.The embodiment of the invention has improved the efficient that message receives.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by hardware, also can realize by the mode that software adds necessary general hardware platform.Based on such understanding, technical scheme of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the above-mentioned method of each embodiment of the present invention.
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module in the accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of above-described embodiment can be merged into a module, also can further split into a plurality of submodules.
The invention described above embodiment sequence number does not represent the quality of embodiment just to description.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, the changes that any person skilled in the art can think of all should fall into protection scope of the present invention.

Claims (11)

1. method that receives message is characterized in that the method comprises:
In the first application heap of internal storage location, write message;
When writing ENMES to described the first application heap, according to the segment base of the second application heap, in described the second application heap, write message, wherein, described the second application heap and described the first application heap adopt state machine to be engaged togather by jump condition;
After writing ENMES to described the first application heap, read the message that has write from described the first application heap.
2. according to the method for reception message claimed in claim 1, it is characterized in that, described write message in the first application heap of internal storage location before, described method also comprises:
To described the first application heap of described internal storage location application and described the second application heap, dispose the segment base of each described application heap.
3. according to the method for reception message claimed in claim 2, it is characterized in that described method also comprises:
Dispose the maximum message segment quantity that described the first application heap and described the second application heap can write message.
4. according to the method for reception message claimed in claim 3, it is characterized in that, describedly when writing ENMES to described the first application heap, according to the segment base of the second application heap, in described the second application heap, write message, comprising:
When the message amount that writes to described the first application heap reaches pre-configured maximum message segment quantity, according to the segment base of described the second application heap, in described the second application heap, write message.
5. according to the method for reception message claimed in claim 1, it is characterized in that described method also comprises:
When writing ENMES to described the second application heap, according to the segment base of described the first application heap, in described the first application heap, write message;
After writing ENMES to described the second application heap, from described the second application heap, read the message that has write.
6. according to the method for reception message claimed in claim 1, it is characterized in that, describedly after writing ENMES to described the first application heap, read the message that has write from described the first application heap, comprising:
When writing message to described the second application heap, from described the first application heap, read the described message that has write.
7. a system that receives message is characterized in that, described system comprises:
Internal storage location is used for temporary message;
Internal memory application and dispensing unit are used for to described internal storage location application the first application heap and the second application heap, dispose the segment base of described the first internal storage location and described the second internal storage location;
The message writing unit is used for writing message to described the first application heap and described second application heap of described internal storage location; Wherein, when writing ENMES to described the first application heap, according to the segment base of described the second application heap, in described the second application heap, write message, described the second application heap and described the first application heap adopt state machine to be engaged togather by jump condition;
The message reading unit is used for reading the message that has write from described the first application heap after described message writing unit writes ENMES to described the first application heap.
8. according to the system of reception message claimed in claim 7, it is characterized in that:
The described message writing unit section of comprising finishes and interrupt module, be used for when the message amount that writes to described the first application heap or the second application heap reaches the pre-configured maximum message segment quantity of this application heap, indicate the message of described application heap to write end, and to the request of described message reading unit reporting interruption.
9. according to the system of reception message claimed in claim 8, it is characterized in that:
Described section is finished and interrupt module, also be used for when the time of described internal storage location reception message reaches the total time of configuration, indicating the current application heap that is writing to write end, and the arrival of calling time on the described message reading unit.
10. according to the system of reception message claimed in claim 7, it is characterized in that:
Described message reading unit comprises the indication stopping modular, be used for to determine to satisfy the quantity demand that message is processed from the message amount that described internal storage location reads out, and indication stops to write and reading message from described internal storage location to described internal storage location.
11. the system according to reception message claimed in claim 7 is characterized in that:
Described message writing unit also comprises counting module, is used to indicate the message amount that has write in the current described application heap that is writing.
CN2010101919142A 2010-06-04 2010-06-04 Method and system for receiving messages Expired - Fee Related CN101873257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101919142A CN101873257B (en) 2010-06-04 2010-06-04 Method and system for receiving messages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101919142A CN101873257B (en) 2010-06-04 2010-06-04 Method and system for receiving messages

Publications (2)

Publication Number Publication Date
CN101873257A CN101873257A (en) 2010-10-27
CN101873257B true CN101873257B (en) 2013-04-17

Family

ID=42997928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101919142A Expired - Fee Related CN101873257B (en) 2010-06-04 2010-06-04 Method and system for receiving messages

Country Status (1)

Country Link
CN (1) CN101873257B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006615A (en) * 2010-11-25 2011-04-06 中兴通讯股份有限公司 Method and device for processing massage
CN102348237B (en) * 2011-10-28 2014-07-16 重庆邮电大学 Data queuing method in broadband wireless communication system
CN103686349B (en) * 2013-12-27 2017-04-12 深圳市九洲电器有限公司 Multi-screen interaction method and device, set-top box
CN108280030B (en) * 2018-01-12 2020-11-10 厦门科灿信息技术有限公司 Register address allocation method, system and related device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101150485A (en) * 2007-11-15 2008-03-26 曙光信息产业(北京)有限公司 A management method for network data transmission of zero copy buffer queue
CN101178694A (en) * 2006-11-07 2008-05-14 莱克斯信息技术(北京)有限公司 Intel e1000 zero copy method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7177941B2 (en) * 2003-12-11 2007-02-13 International Business Machines Corporation Increasing TCP re-transmission process speed
CN101702326B (en) * 2009-10-30 2012-08-29 曙光信息产业(北京)有限公司 Memory controller

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178694A (en) * 2006-11-07 2008-05-14 莱克斯信息技术(北京)有限公司 Intel e1000 zero copy method
CN101150485A (en) * 2007-11-15 2008-03-26 曙光信息产业(北京)有限公司 A management method for network data transmission of zero copy buffer queue

Also Published As

Publication number Publication date
CN101873257A (en) 2010-10-27

Similar Documents

Publication Publication Date Title
CN101128807B (en) Systems and methods for an augmented interrupt controller and synthetic interrupt sources
CN1104680C (en) Apparatus for processing instruction in computer system
US3689895A (en) Micro-program control system
CN104750510A (en) Chip start method and multi-core processor chip
CN101873257B (en) Method and system for receiving messages
CN104636202A (en) Computer system and scheduling method thereof
JP5309703B2 (en) Shared memory control circuit, control method, and control program
CN115033352A (en) Task scheduling method, device and equipment for multi-core processor and storage medium
CN106155806A (en) A kind of multi-task scheduling method and server
CN102934102A (en) Multiprocessor system, execution control method and execution control program
CN114416308A (en) Task scheduling method and device, computer equipment and storage medium
AU747974B2 (en) Method for improved interrupt handling within a microprocessor
CN104331330A (en) Resource pool generation method and device
US4837688A (en) Multi-channel shared resource processor
CN113515366A (en) Bus load balancing processing method and device and storage medium
CN102495776A (en) Method for debugging basic input output system (BIOS) of storage controller applicable to cloud storage
CN113360215A (en) Program running method and device and computer readable storage medium
CN115809126A (en) Job scheduling method and device in mixed deployment scene and electronic equipment
CN113672373A (en) Thread binding method and device and electronic equipment
CN114625502A (en) Word-throwing task processing method and device, storage medium and electronic equipment
CN109947564B (en) Service processing method, device, equipment and storage medium
CN113806025B (en) Data processing method, system, electronic device and storage medium
CN114390592A (en) Application access method, device, equipment and medium in double-WIFI network
CN110134502A (en) Task processing method, device, system, computer equipment and storage medium
CN116028180A (en) Central processing unit and task processing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130417

Termination date: 20180604