CN104679667B - Efficient sampling port amortization management method - Google Patents
Efficient sampling port amortization management method Download PDFInfo
- Publication number
- CN104679667B CN104679667B CN201310628993.2A CN201310628993A CN104679667B CN 104679667 B CN104679667 B CN 104679667B CN 201310628993 A CN201310628993 A CN 201310628993A CN 104679667 B CN104679667 B CN 104679667B
- Authority
- CN
- China
- Prior art keywords
- write
- port
- count value
- data
- reading
- 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.)
- Active
Links
Landscapes
- Communication Control (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
A kind of efficient sampling port amortization management method, including:1)When sample port initializes;2)When source port writes data, write data into the buffering area of temporary pointer sensing;3)After data write, the pointer for pointing to two buffering areas is exchanged, while updates Write post counter, the count value of Write post counter is added 1;4)When reading data from source port, the count value of Write post counter is preserved first, then data are read from the buffering area pointed by valid pointer, after the completion of reading compared with the count value of current newest Write post counter, judge whether the count value of Write post counter changes;If so, then repeat step 4)Until the count value of Write post counter does not change;Completed if it is not, then reading;5)By calling sample port to send message and reading message.The invention provides a kind of efficient sampling port amortization management method of communication efficiency for improving sample port.
Description
Technical field
The invention belongs to computer software control technical field, is related to a kind of efficient sampling port amortization management method.
Background technology
In order to adapt to modularization, the demand of synthetic aviation electronic IMA systems, there is multi partition operating system.More points
It is mutually isolated on room and time that area's operating system is noteworthy characterized by each subregion, and inter-partition communication is real between subregion
The main path that existing information exchanges, wherein sample port are a kind of important communication modes of inter-partition communication, sample port function
A piece of news is only safeguarded in upper requirement, and when source port writes message, no matter whether the message of preceding write-once is read, and new information is all
Previous message can be covered;Destination interface only reads a piece of news reached recently.Sample port needs to support 1 source port
Message is write, N number of destination interface reads the function of message, and needs to ensure in zone time that port can be where it at any time
The functional characteristic of access port message.A key technology for wherein needing to solve is how sample port bottom message to be passed
Buffer management in defeated, while functional characteristic is realized, there is provided efficient communication performance.
It is that system only distributes a buffering area than a kind of more typical scheme, 1 source port and N number of destination interface are shared
This buffering area, source port writes data to this buffering area, and destination interface reads message from this buffering area.So design class
It is similar to common blackboard mechanism, it is necessary to which, to buffering area plus mutually exclusive operation, the message for avoiding writing or reading is imperfect.This mutual exclusion
Operation the shortcomings that bringing is, if Message Payload is bigger or in the case that the time window of subregion is smaller, if port exists
Actual time window access port does not complete, and because it is to the increased mutually exclusive operation of shared buffer, can cause other subregions
Destination interface can not its zone time complete port is conducted interviews, can influence its port at any time may have access to characteristic while,
Also reduce the efficiency of communication.
In order to reduce the performance issue that mutually exclusive operation is brought, according to the thinking traded space for time, a kind of mode is to be every
Individual destination interface increases by 1 buffering area, and so each destination interface need not be with other N-1 destination interface mutual exclusions, but band
The problem of coming is that the bottom message copying number of message can increase n times, and there are still between source port and 1 destination interface
Mutually exclusive operation, very big performance loss can be brought.
If it is considered that there is new message to write, it is necessary to which situation about re-reading, above-mentioned again during message is read
The performance of two methods can further decline.It is then desired to a kind of new amortization management method is proposed, to realize inter-partition communication
Sample port characteristic and efficient communication performance provide support.
The content of the invention
In order to solve above-mentioned technical problem present in background technology, the invention provides a kind of sample port that improves
The efficient sampling port amortization management method of communication efficiency.
The present invention technical solution be:The invention provides a kind of efficient sampling port amortization management method, and it is special
Different part is:It the described method comprises the following steps:
1)When sample port initializes, two buffering areas and a Write post counter are distributed for sample port, respectively
Two buffering areas are pointed to using two pointers, described two pointers are temporary pointer and valid pointer respectively;
2)When source port writes data, write data into the buffering area of temporary pointer sensing;
3)After data write, the pointer for pointing to two buffering areas is exchanged, while updates Write post counter, by Write post
The count value of counter adds 1;
4)When reading data from source port, the count value of Write post counter is preserved first, then from valid pointer institute
Data are read in the buffering area of sensing, after the completion of reading compared with the count value of current newest Write post counter, are sentenced
Whether the count value of disconnected Write post counter changes;If so, then repeat step 4)Until the count value of Write post counter
Do not change;Completed if it is not, then reading;
5)By calling sample port to send message and reading message.
It is an advantage of the invention that:
The invention provides a kind of efficient sampling port amortization management method, this method is will to distribute two for sample port
Shared buffering, each buffering is not fixed as source port or destination interface is special, and source port alternately writes two bufferings, destination
Mouth reads message when reading message from the buffering area being currently asserted.Present invention, avoiding Write post in cache management and
Reading buffering needs the mutually exclusive operation that carries out, and key area only processing and exchanging pointer and Write post count equal travel time and determined and very
Short data, do not handle operation and buffer the data that such time loss may be very big, in its zone time, source port can be with
Data are write at any time, and destination interface can also read data at any time, effectively real so as to solve the performance bottleneck in cache management
The functional characteristic that sample port can access at any time is showed, has improved the communication efficiency of sample port, while met by stages and lead to
Letter is to the requirement of sample port functional characteristic and time requirement.
Brief description of the drawings
Fig. 1 is the working method schematic diagram that the present invention writes message the buffered port that tempData is pointed to;
Fig. 2 is the working method schematic diagram of exchange pointer of the present invention;
Fig. 3 be destination interface from buffer read data when schematic flow sheet.
Embodiment
The invention provides a kind of efficient sampling port amortization management method, this method are specific as follows:
1st, when sample port initializes, two bufferings is distributed for sample port, in order to express easily, are respectively designated as
BUFFER_1 and BUFFER_2, the two bufferings are pointed to using two pointers of tempData and validData respectively, are preserved simultaneously
One Write post counts counter.
2nd, when source port writes message, by the space of message write-in tempData sensings, BUFFER_1 as shown in Figure 1
In.
3rd, after the completion of message write-in, task scheduling is closed, tempData is pointed to the buffering of validData sensings, will
ValidData points to the buffering that tempData is pointed to, that is, exchanges pointer, while updates Write post and count counter, will
Counter adds 1, then opens task scheduling.Data are read in the buffering that destination interface points to from validData all the time, such as Fig. 2 institutes
Show.
4th, when source port has new message write-in, by the buffering of message write-in tempData sensings, the difference with step 2
The buffering that tempData is actually pointed to that is in changed, i.e., it is actual that new information is written with another buffering, as shown in Figure 2
BUFFER_2 in.Whenever thering is new message to write buffering, repeat step 2,3,4.
5th, when destination interface reads message from validData, task scheduling is closed first, obtains counter values, is opened and is appointed
Business scheduling, then read message in the buffering pointed to from validData.If in message process is read, there is new message write-in,
Now validData sensing has occurred that change, and counter values are also changed in the case.Destination interface exists
After the completion of message is read, it is consistent with the count value preserved before to rejudge counter values, if it is inconsistent, reading again
Take message, until counter no longer changes, with ensure the data read be it is correct and current newest, as shown in Figure 3.
The core algorithm of Write post is as follows:
/ * to buffered copy message */
Bcopy (pSrcMsg, portId->TempData, length);Write in the buffering that/* points to tempData all the time
Enter message */
task_disable_dispatch();/ * passes task scheduling, processing key area */
swap(portId->TempData, portId->validData);/ * exchanges pointer, and legal buffer value occurs
Change */
portId->counter++;/ * renewal write-in buffering countings */
_task_enable_dispatch();/ * open task scheduling */
The core algorithm for reading buffering is as follows:
Do{
task_disable_dispatch();/ * passes task scheduling, processing key area */
cpt=portId->counter;/ * acquisition write-in buffering countings */
task_enable_dispatch();/ * open task scheduling */
bcopy(portId->ValidData, pDstMsg, length);In the buffering that/* points to from validData all the time
Reading message */
}while(cpt!=pPortSrc->counter)。
Claims (1)
- A kind of 1. efficient sampling port amortization management method, it is characterised in that:The efficient sampling port amortization management method bag Include following steps:1)When sample port initializes, two buffering areas and a Write post counter are distributed for sample port, are used respectively Two pointers point to two buffering areas, and described two pointers are temporary pointer and valid pointer respectively;2)When source port writes data, write data into the buffering area of temporary pointer sensing;3)After data write, the pointer for pointing to two buffering areas is exchanged, while updates Write post counter, Write post is counted The count value of device adds 1;4)When reading data from source port, the count value of Write post counter is preserved first, then from pointed by valid pointer Buffering area in read data, after the completion of reading compared with the count value of current newest Write post counter, judge to write Whether the count value of buffer counter changes;If so, then repeat step 4)Until the count value of Write post counter is not sent out It is raw to change;Completed if it is not, then reading;5)By calling sample port to send message and reading message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310628993.2A CN104679667B (en) | 2013-11-28 | 2013-11-28 | Efficient sampling port amortization management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310628993.2A CN104679667B (en) | 2013-11-28 | 2013-11-28 | Efficient sampling port amortization management method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104679667A CN104679667A (en) | 2015-06-03 |
CN104679667B true CN104679667B (en) | 2017-11-28 |
Family
ID=53314745
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310628993.2A Active CN104679667B (en) | 2013-11-28 | 2013-11-28 | Efficient sampling port amortization management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104679667B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3668615A4 (en) | 2017-09-19 | 2021-04-28 | BAE Systems Controls Inc. | System and method for managing multi-core accesses to shared ports |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101655824A (en) * | 2009-08-25 | 2010-02-24 | 北京广利核系统工程有限公司 | Implementation method of double-port RAM mutual exclusion access |
CN102075291A (en) * | 2010-12-17 | 2011-05-25 | 北京控制工程研究所 | Method for realizing receiving completeness of telemeter data |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7260104B2 (en) * | 2001-12-19 | 2007-08-21 | Computer Network Technology Corporation | Deferred queuing in a buffered switch |
JP2004127383A (en) * | 2002-09-30 | 2004-04-22 | Mitsumi Electric Co Ltd | Optical disk device |
-
2013
- 2013-11-28 CN CN201310628993.2A patent/CN104679667B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101655824A (en) * | 2009-08-25 | 2010-02-24 | 北京广利核系统工程有限公司 | Implementation method of double-port RAM mutual exclusion access |
CN102075291A (en) * | 2010-12-17 | 2011-05-25 | 北京控制工程研究所 | Method for realizing receiving completeness of telemeter data |
Also Published As
Publication number | Publication date |
---|---|
CN104679667A (en) | 2015-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103218176B (en) | Data processing method and device | |
CN103279428B (en) | A kind of explicit multi-core Cache consistency active management method towards stream application | |
CN103426208A (en) | Cell phone attendance system based on WiFi signals | |
US20150304124A1 (en) | Message Processing Method and Device | |
CN103207846A (en) | Memory controller and method thereof | |
CN101206614B (en) | Simulator for simulating register with specific function | |
CN110362348A (en) | A kind of method, apparatus and electronic equipment of queue access data | |
US11397560B2 (en) | System and method for managing multi-core accesses to shared ports | |
CN105320513A (en) | I/O (input/output) method suitable for any SEG-Y seismic data | |
CN103714127A (en) | Information-grouping showing method and information-grouping showing system for tables | |
CN104679667B (en) | Efficient sampling port amortization management method | |
US20180136905A1 (en) | First-in-first-out buffer | |
CN103731364B (en) | X86 platform based method for achieving trillion traffic rapid packaging | |
CN101866277A (en) | Data reordering method and device | |
CN104536700A (en) | Code stream data rapid storage/reading method and system | |
CN107544937A (en) | A kind of coprocessor, method for writing data and processor | |
CN111401934A (en) | Distributed advertisement statistical method and device | |
CN106843748A (en) | It is a kind of to improve the method and system that data write movable storage device speed | |
US20120265948A1 (en) | Emulating a skip read command | |
CN102930898A (en) | Method of structuring multiport asynchronous storage module | |
CN104407367B (en) | Improve the apparatus and method of satellite navigation terminal receiver baseband signal disposal ability | |
CN106209370A (en) | Elliptic curve cipher device, system and data cache control method | |
CN104778131A (en) | Data caching method and buffer memory | |
CN108921976A (en) | A kind of drive recorder receives time dissemination system by serial communication interface automatically | |
US9380006B2 (en) | Packet processing method, and packet transmission apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |