CN110069438A - A kind of method of isomery device Memory communication - Google Patents

A kind of method of isomery device Memory communication Download PDF

Info

Publication number
CN110069438A
CN110069438A CN201810058949.5A CN201810058949A CN110069438A CN 110069438 A CN110069438 A CN 110069438A CN 201810058949 A CN201810058949 A CN 201810058949A CN 110069438 A CN110069438 A CN 110069438A
Authority
CN
China
Prior art keywords
message
data
index
ring
message body
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810058949.5A
Other languages
Chinese (zh)
Inventor
赵彩云
赵建立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Putian Information Technology Co Ltd
Original Assignee
Putian Information 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 Putian Information Technology Co Ltd filed Critical Putian Information Technology Co Ltd
Priority to CN201810058949.5A priority Critical patent/CN110069438A/en
Publication of CN110069438A publication Critical patent/CN110069438A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

This application provides a kind of methods of isomery device Memory communication, this method comprises: the message body of message to be sent is written in the data ring when transmitting terminal sends message;The corresponding first address of message body and length in write-in data ring are updated in control ring, and are updated in the header structure and write index;When receiving end receives message, corresponding first address and corresponding length in the control ring are indexed according to the reading, message body corresponding in the data ring is read into local, and update the index of the reading in the header structure.This method can be improved the reliability of isomery communications between devices.

Description

Heterogeneous device memory communication method
Technical Field
The invention relates to the technical field of embedding, in particular to a heterogeneous device memory communication method.
Background
With the progress of science, people put better, faster and stronger requirements and challenges on the processing capability of a processor, and the technology of a multi-core processor is an effective breakthrough of the challenge.
Heterogeneous multi-core processors have multiple processor cores of different architectures, integrating two or even more than two computing cores, such as FreeScale B4860, on the same chip. Such processors are often very targeted and are often designed for a particular application.
Shared memory is the same piece of physical memory that two different cores are allowed to access. Utilizing shared memory communication is a very efficient way to share and transfer data between two running cores. One process in the kernel writes data into the shared memory, and the other kernels can respond to the changed data by reading the data in the segment of the shared memory.
At present, heterogeneous multi-core processors communicate through a shared memory, namely, a section of memory space is opened up in a physical address space, the size of each message, the maximum number of the messages, and initial values of read indexes and write indexes are 0 by both sides.
The sending core writes data into the shared memory for data caching according to requirements, and the receiving core processes the data cached in the shared memory at regular time. When the sending core writes data into the shared memory, the writing index needs to be operated, when the receiving core reads the data, the reading index needs to be operated, when the writing index reaches the maximum message number, the 0 operation needs to be performed, and when the reading index is equal to the value of the writing index, the receiving data is empty.
In application, the size of a shared memory is defined according to the maximum number of bytes of a message and the maximum number of messages, and actually, the size of each message is different and cannot reach the maximum number of bytes, so that the memory is wasted, the reasonable use of the memory is affected, the development cost is increased, if a large enough memory space is not allocated, the requirement on the read data rate of a receiving end is high, and if the sent data cannot be read in time, the sent data is covered.
Disclosure of Invention
In view of this, the present application provides a method for memory communication of heterogeneous devices, which can improve reliability of communication between heterogeneous devices.
In order to solve the technical problem, the technical scheme of the application is realized as follows:
a method for memory communication of heterogeneous devices initializes a data storage space according to a defined data structure; wherein the data structure comprises: a head structure, a control ring and a data ring; the head structure is used for storing the maximum message number, the size of the space of the data ring, the read index and the write index; the control ring is used for storing the first address and the length of the message body in the data ring; the data ring is used for storing a message body; the method comprises the following steps:
when the sending end sends the message, writing the message body of the message to be sent into the data ring; updating a first address and a length corresponding to a message body written in a data ring in a control ring, and updating a write index in the head structure;
when the receiving end receives the message, the corresponding message body in the data ring is read to the local according to the corresponding first address and the corresponding length of the read index in the control ring, and the read index in the head structure is updated.
When the sending end sends a message, writing a message body of the message to be sent into the data ring, wherein before the method further comprises the following steps:
determining whether the free space of the data ring can store a message body to be written; if yes, writing a message body of a message to be sent into the data ring; otherwise, the sending of the message is ended.
Wherein, the determining whether the free space of the data ring can store the message body to be written includes:
determining whether the unused space of the data ring can store the message body to be written in, and if so, determining that the free space of the data ring can store the message body to be written in; otherwise, starting to judge from the first address of the data ring whether a free space can store the message body to be written; if yes, determining that the free space of the data ring can store the message body to be written; otherwise, determining that the free space of the data ring can not store the message body to be written.
Before determining whether the free space of the data ring can store the message body to be written, the method further includes:
determining whether the control ring is full, if so, ending the writing of the message body; otherwise, determining whether the free space of the data ring can store the message body to be written.
Wherein the determining whether the control loop is full comprises:
determining whether the index number corresponding to the read index in the head structure is equal to the remainder obtained after adding 1 to the write index and obtaining the remainder after adding the maximum message number, and if so, determining that the control loop is full; otherwise, it is determined that the control loop is not full.
When the receiving end receives a message, before reading a message body corresponding to the data ring to a local according to a corresponding first address and a corresponding length of the read index in the control ring, the method further includes:
determining whether the received message is empty, if so, ending the message reception; otherwise, when the receiving end receives the message, the corresponding message body in the data ring is read to the local according to the corresponding first address and the corresponding length of the read index in the control ring.
Wherein the determining whether the received message is empty comprises:
determining whether the index numbers corresponding to the read index and the write index in the head structure are the same, if so, determining that the received message is empty; otherwise, the received message is determined not to be empty.
Wherein,
when updating the write index in the head structure, if the index number corresponding to the current write index reaches the maximum message number, the write index is returned to 0; if the index number corresponding to the current write index does not reach the maximum message number, the index number corresponding to the write index is increased progressively;
when updating the read index in the head structure, if the index number corresponding to the current read index reaches the maximum message number, the read index is returned to 0; and if the index number corresponding to the current read index does not reach the maximum message number, increasing the index number corresponding to the read index.
Wherein,
when the data storage space is initialized according to the defined data structure, the data storage space is initialized by a sending end or a receiving end; wherein, the initialized content comprises: maximum message number, size of data ring space, read index clear 0, write index clear 0;
when the sending end initializes the data storage space according to the defined data structure, the receiving end determines the initialized data structure by obtaining the content of the head structure;
when the receiving end initializes the data storage space according to the defined data structure, the sending end determines the initialized data structure by obtaining the content of the head structure.
Wherein,
when the transmitting end and the receiving end need bidirectional communication, a data structure is initialized respectively for each direction.
According to the technical scheme, a data storage space for communication between heterogeneous devices is initialized by defining a data structure comprising a head structure, a control ring and a data ring, basic feature information is stored in the head structure of the data structure, and the first address and the length of a message body in the data ring are stored in the control ring; storing a message body in the data ring; the number of the messages and the storage intervals of the message bodies are respectively rings and do not interfere with each other, the relevance of the number of the messages and the size of the messages is reduced, the message bodies can be more transparent in the reading and writing process, more flexible memory allocation is realized, the memory waste is reduced, and the reliability of communication between heterogeneous devices is improved.
Drawings
FIG. 1 is a schematic diagram of a data structure defined in an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating a process for implementing memory communication of a heterogeneous device in an embodiment of the present application;
fig. 3 is a schematic flow chart of sending a message by a sending end in the embodiment of the present application;
fig. 4 is a schematic flow chart of a receiving end receiving a message in the embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the technical solutions of the present invention are described in detail below with reference to the accompanying drawings and examples.
The embodiment of the application provides a method for memory communication of heterogeneous devices, which initializes a data storage space for communication between heterogeneous devices by defining a data structure comprising a head structure, a control ring and a data ring, stores basic characteristic information in the head structure of the data structure, and stores a first address and a length of a message body in the data ring in the control ring; storing a message body in the data ring; the number of the messages and the storage intervals of the message bodies are respectively rings and do not interfere with each other, the relevance of the number of the messages and the size of the messages is reduced, the message bodies can be more transparent in the reading and writing process, more flexible memory allocation is realized, the memory waste is reduced, and the reliability of communication between heterogeneous devices is improved.
The data structure defined in the embodiments of the present application includes: a head structure, a control ring and a data ring; the head structure is used for storing the maximum message number, the size of the space of the data ring, the read index and the write index; the control ring is used for storing the first address and the length of the message body in the data ring; the data ring is used for storing the message body;
and pre-configuring the corresponding position space of the maximum message number in the control ring, if the maximum message number is 100, dividing 100 position spaces in the control ring to correspond to 100 index numbers, and corresponding unique position spaces in the control ring for reading indexes and writing indexes.
Wherein the write index is an index of the written message; the read index is an index of the message to be read.
Referring to fig. 1, fig. 1 is a schematic diagram of a data structure defined in an embodiment of the present application. The information stored in the header structure of fig. 1 includes: maximum number of messages (mMaxMsgCnt), size of space of data ring (mBufferSize), read index (mReadIndex), and write index (mweitendex).
The information of the control ring comprises the head address and the length (mMsgLength) of each message body stored in the data ring, and when the information is specifically implemented, the head address of each message body is stored in an offset mode.
Since the maximum message number position space of the control loop corresponds to the write index and the read index in the header structure, the following requirements are made for the write index and the read index:
the write index and the read index are both incremented from 0;
if the index number corresponding to the write index reaches the maximum message number, the write index is returned to 0, and the increment is continued from 0;
and if the index number corresponding to the read index reaches the maximum message number, the read index is returned to 0, and the increment is continued from 0.
The body of the message, i.e. the specific data content sent when the message was sent, is stored in the data ring.
When communication between heterogeneous devices is specifically realized, a heterogeneous device needs to apply for a segment of shared physical memory space as a data storage space in advance, and the address and the size of the shared physical memory space are notified to the heterogeneous device needing communication.
The heterogeneous devices need to initialize data storage space according to the data structure defined in the present application.
In a specific implementation, the initialization may be performed by a heterogeneous device serving as a sending end, or may be performed by a heterogeneous device serving as a receiving end.
When performing initialization, the initialization content of the header structure includes: maximum number of messages, size of data ring space, read index clear 0, write index clear 0.
The content of control loop initialization includes: the head address and length for storing each message body are initialized to 0.
When the sending end initializes the data storage space according to the defined data structure, the receiving end determines the initialized data structure by obtaining the content of the head structure;
when the receiving end initializes the data storage space according to the defined data structure, the sending end determines the initialized data structure by obtaining the content of the head structure.
Namely, the initialization is performed by adopting a single-ended initialization mode.
When the sending end and the receiving end need bidirectional communication, a data structure is respectively initialized aiming at each direction, and each data structure corresponds to a data storage space.
That is, one heterogeneous device reads data and writes data, it needs to correspond to two data structures, and the heterogeneous device reads data in one data structure and writes data in the other data structure.
Heterogeneous devices in the embodiments of the present application are, for example, CPUs and DSPs of B4860, such as ARM and DSP of TMS320TCI 6614.
In specific implementation, taking the CPU and the DSP of B4860 as examples, at least one CPU and at least one DSP may communicate.
When one is used as a transmitting end, the other is used as a receiving end. The embodiment provided by the application is to perform the following processing for each sending end and each receiving end.
The following describes in detail a process of implementing memory communication of heterogeneous devices in an embodiment of the present application with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating implementation of heterogeneous device memory communication in the embodiment of the present application. The method comprises the following specific steps:
step 201, when a sending end sends a message, writing a message body of the message to be sent into the data ring; and updating the first address and the length corresponding to the message body in the write data ring in the control ring, and updating the write index in the head structure.
In the embodiment of the application, when the write message body is sent, the local message body is copied into the data ring.
Step 202, when the receiving end receives the message, the corresponding message body in the data ring is read to the local according to the corresponding first address and the corresponding length of the read index in the control ring, and the read index in the head structure is updated.
In this step, when the message body is read, the message body in the data ring is copied to the local.
When the method is specifically implemented, the stored message body in the data ring is not released, and if the message body is written, the space corresponding to the read message body is occupied and the message body is directly covered;
the first address and the length in the control loop are not deleted, and the read address and the read length are directly covered when the space corresponding to the address and the length needs to be occupied.
Steps 201 and 202 indicate that when the partial sequence is executed, the receiving end and the transmitting end respectively execute the actions to be executed respectively.
The following describes a process for implementing memory communication of heterogeneous devices from both ends of a transmitting end and a receiving end, respectively, with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 is a schematic flowchart of a message sent by a sending end in the embodiment of the present application. The method comprises the following specific steps:
in step 301, the sender needs to send a message.
Step 302, the transmitting end determines whether the control loop is full, if yes, step 306 is executed; otherwise, step 303 is performed.
In this step, determining whether the control loop is full includes:
determining whether the index number corresponding to the read index in the head structure is equal to the remainder obtained after adding 1 to the write index and obtaining the remainder after adding the maximum message number, and if so, determining that the control loop is full; otherwise, it is determined that the control loop is not full.
If the control loop is full, which indicates that the number of the stored message bodies reaches the maximum number of the messages, the message bodies can not be stored, namely, the data can not be written.
The condition for determining that the control loop is full is: the index number corresponding to the read index is equal to (the index number corresponding to the write index + 1)% of the maximum number of messages, wherein,% represents the remainder.
Step 303, the sending end determines whether the free space of the data ring can store the message body to be written; if so, go to step 304; otherwise, step 306 is performed.
In this step, determining whether the free space of the data ring can store the message body to be written in includes the following steps:
step one, determining whether the unused space of the data ring can store the message body to be written, if so, executing the step four; otherwise, the second step is executed.
Determining whether the unused space of the data ring can store the message body to be written in the step specifically comprises the following steps:
the first address of the data space which is not used currently is determined according to the numerical value (the first address and the length of the message body corresponding to the write index) in the control ring, the unused residual space is calculated according to the total size of the data space, and then the unused residual space is compared with the size of the message body to be stored, so that whether the unused space of the data ring can store the message body to be written is determined.
If the first time the store data for the entire data ring is not full, it is determined whether the unused space is sufficient to store the message body to be written.
Secondly, judging whether a free space can store a message body to be written or not from the first address of the data ring; if yes, executing the third step; otherwise, executing the fourth step.
In this step, it is determined from the first address of the data ring whether there is a free space for storing the message to be written, including:
and determining the tail address of the currently read data according to the numerical value (the head address and the length corresponding to the read index) in the control ring, wherein the length from the tail address to the head address of the data ring is the size of the released space, and further determining whether the released space can store the message body to be written.
If all the space of the entire data ring has been stored once, it is necessary to determine from the first address of the data ring whether there is data that has been released, i.e. data that has been read by the receiver, and whether the space for releasing data is sufficient to store the message body to be written.
Thirdly, determining that the free space of the data ring can store the message body to be written; i.e., determined in step 303, step 304 is performed.
Fourthly, determining that the free space of the data ring can not store the message body to be written, namely executing step 306 after determining in step 303.
Step 304, the sending end writes the message body of the message to be sent into the data ring.
And 305, the sending end updates the first address and the length corresponding to the message body in the write data ring in the control ring, updates the write index in the head structure, and ends the flow.
When updating the write index in the head structure, if the index number corresponding to the current write index reaches the maximum message number, the write index is returned to 0; and if the index number corresponding to the current write index does not reach the maximum message number, increasing the index number corresponding to the write index by 1 if the index number corresponding to the current write index does not reach the maximum message number.
When the sending end finishes writing the message body at this time, after updating the first address and the length corresponding to the message body in the write data ring in the control ring and updating the write index in the header structure, the following steps can be further executed:
and filling the initial address of the next message body in the position space corresponding to the updated write index in the control ring, filling the length to be 0, and filling the offset to identify the initial address of the next message body in the concrete implementation.
By executing the step, whether enough free space is available for storing the message body to be written can be judged when the message body is written next time. The specific calculation method is as follows: and calculating the head address of the next write message according to the head address and the offset of the sent message body.
The sender ends the sending of the message, step 306.
Waiting for the time when the message can be sent.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a process of receiving a message by a receiving end in the embodiment of the present application. The method comprises the following specific steps:
in step 401, the receiving end needs to receive a message.
Step 402, the receiving end determines whether the received message is empty, if yes, step 403 is executed; otherwise, step 404 is performed.
Determining whether the received message is empty, comprising:
determining whether the index numbers corresponding to the read index and the write index in the head structure are the same, if so, determining that the received message is empty; otherwise, the received message is determined not to be empty.
In step 403, the receiving end finishes receiving the message and ends the process.
Step 404, when the receiving end receives the message, the receiving end reads the corresponding message body in the data ring to the local according to the corresponding first address and the corresponding length of the read index in the head structure in the control ring.
In step 405, the receiving end updates the read index in the header structure.
When updating the read index in the head structure, if the index number corresponding to the current read index reaches the maximum message number, the read index is returned to 0; and if the index number corresponding to the current read index does not reach the maximum message number, increasing the index number corresponding to the read index by 1 if the index number corresponding to the current read index does not reach the maximum message number.
The method and the device open a section of memory space in a physical address space as a data space. The data space defines a data structure in terms of a header structure, a control ring, and a data ring. The data space is usually initialized by a single end, for example, the CPU and the DSP in B4860 share memory for communication, the CPU initializes the initial value of the data structure, and the DSP determines the characteristics of the communication data area by acquiring the contents of the header structure of the data area.
If two-way communication is needed between the CPU and the DSP, 2 data structures are needed to be defined in the data space, one data structure is used as a receiving data structure of the CPU, and the other data structure is used as a receiving data structure of the DSP. When the CPU sends a message to the DSP, data needs to be written into a data ring space where the DSP receiving data structure is located, the value of a control ring used by the data structure and a write index in a head structure are modified, and the DSP searches the own receiving data structure regularly to receive the message sent by the CPU. When the DSP sends a message to the CPU, data needs to be written into the data ring space where the CPU receives the data structure, the value of the control ring used by the data structure and the write index in the head structure are modified, and the CPU searches the received data structure at regular time.
The technical scheme provided by the application can use the memory more flexibly and reasonably, and improves the reliability and the communication rate of the inter-core communication.
In summary, the present application initializes a data storage space for communication between heterogeneous devices by defining a data structure including a header structure, a control ring, and a data ring, where the header structure of the data structure stores basic feature information, and the control ring stores a first address and a length of a message body in the data ring; storing a message body in the data ring; the number of the messages and the storage intervals of the message bodies are respectively rings and do not interfere with each other, the relevance of the number of the messages and the size of the messages is reduced, the message bodies can be more transparent in the reading and writing process, more flexible memory allocation is realized, the memory waste is reduced, and the reliability of communication between heterogeneous devices is improved.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A heterogeneous device memory communication method is characterized in that a data storage space is initialized according to a defined data structure; wherein the data structure comprises: a head structure, a control ring and a data ring; the head structure is used for storing the maximum message number, the size of the space of the data ring, the read index and the write index; the control ring is used for storing the first address and the length of the message body in the data ring; the data ring is used for storing a message body; the method comprises the following steps:
when the sending end sends the message, writing the message body of the message to be sent into the data ring; updating a first address and a length corresponding to a message body written in a data ring in a control ring, and updating a write index in the head structure;
when the receiving end receives the message, the corresponding message body in the data ring is read to the local according to the corresponding first address and the corresponding length of the read index in the control ring, and the read index in the head structure is updated.
2. The method according to claim 1, wherein when the sender sends a message, a message body of the message to be sent is written into the data ring, and before the method further comprises:
determining whether the free space of the data ring can store a message body to be written; if yes, writing a message body of a message to be sent into the data ring; otherwise, the sending of the message is ended.
3. The method of claim 2, wherein determining whether free space of the data ring can hold a message body to be written comprises:
determining whether the unused space of the data ring can store the message body to be written in, and if so, determining that the free space of the data ring can store the message body to be written in; otherwise, starting to judge from the first address of the data ring whether a free space can store the message body to be written; if yes, determining that the free space of the data ring can store the message body to be written; otherwise, determining that the free space of the data ring can not store the message body to be written.
4. The method of claim 2, wherein before determining whether free space of the data ring can hold a message body to be written, the method further comprises:
determining whether the control ring is full, if so, ending the writing of the message body; otherwise, determining whether the free space of the data ring can store the message body to be written.
5. The method of claim 4, wherein the determining whether the control loop is full comprises:
determining whether the index number corresponding to the read index in the head structure is equal to the remainder obtained after adding 1 to the write index and obtaining the remainder after adding the maximum message number, and if so, determining that the control loop is full; otherwise, it is determined that the control loop is not full.
6. The method according to claim 1, wherein when the receiving end receives a message, a corresponding message body in the data ring is read to a place ahead according to a corresponding first address and a corresponding length of the read index in the control ring, and the method further comprises:
determining whether the received message is empty, if so, ending the message reception; otherwise, when the receiving end receives the message, the corresponding message body in the data ring is read to the local according to the corresponding first address and the corresponding length of the read index in the control ring.
7. The method of claim 6, wherein the determining whether the received message is empty comprises:
determining whether the index numbers corresponding to the read index and the write index in the head structure are the same, if so, determining that the received message is empty; otherwise, the received message is determined not to be empty.
8. The method of claim 1,
when updating the write index in the head structure, if the index number corresponding to the current write index reaches the maximum message number, the write index is returned to 0; if the index number corresponding to the current write index does not reach the maximum message number, the index number corresponding to the write index is increased progressively;
when updating the read index in the head structure, if the index number corresponding to the current read index reaches the maximum message number, the read index is returned to 0; and if the index number corresponding to the current read index does not reach the maximum message number, increasing the index number corresponding to the read index.
9. The method according to any one of claims 1 to 8,
when the data storage space is initialized according to the defined data structure, the data storage space is initialized by a sending end or a receiving end; wherein, the initialized content comprises: maximum message number, size of data ring space, read index clear 0, write index clear 0;
when the sending end initializes the data storage space according to the defined data structure, the receiving end determines the initialized data structure by obtaining the content of the head structure;
when the receiving end initializes the data storage space according to the defined data structure, the sending end determines the initialized data structure by obtaining the content of the head structure.
10. The method according to any one of claims 1 to 8,
when the transmitting end and the receiving end need bidirectional communication, a data structure is initialized respectively for each direction.
CN201810058949.5A 2018-01-22 2018-01-22 A kind of method of isomery device Memory communication Pending CN110069438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810058949.5A CN110069438A (en) 2018-01-22 2018-01-22 A kind of method of isomery device Memory communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810058949.5A CN110069438A (en) 2018-01-22 2018-01-22 A kind of method of isomery device Memory communication

Publications (1)

Publication Number Publication Date
CN110069438A true CN110069438A (en) 2019-07-30

Family

ID=67364699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810058949.5A Pending CN110069438A (en) 2018-01-22 2018-01-22 A kind of method of isomery device Memory communication

Country Status (1)

Country Link
CN (1) CN110069438A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110737536A (en) * 2019-09-19 2020-01-31 亚信创新技术(南京)有限公司 shared memory based message storage method and message reading method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176429A1 (en) * 2001-03-21 2002-11-28 International Business Machines Corporation Apparatus, method and limited set of messages to transmit data between scheduler and a network processor
US20040107240A1 (en) * 2002-12-02 2004-06-03 Globespan Virata Incorporated Method and system for intertask messaging between multiple processors
CN101105786A (en) * 2006-07-14 2008-01-16 中兴通讯股份有限公司 Double CPU communication method based on shared memory
CN102023961A (en) * 2009-09-10 2011-04-20 中兴通讯股份有限公司 Communication method based on shared memory and apparatus thereof
CN103945456A (en) * 2014-05-12 2014-07-23 武汉邮电科学研究院 LTE (long term evolution) base station user plane efficient UDP (user datagram protocol) data transmission optimization method based on Linux system
CN104346229A (en) * 2014-11-14 2015-02-11 国家电网公司 Processing method for optimization of inter-process communication of embedded operating system
CN107241409A (en) * 2017-06-05 2017-10-10 武汉虹信通信技术有限责任公司 For RLC in LTE and the data transmission method of adjacent layer

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176429A1 (en) * 2001-03-21 2002-11-28 International Business Machines Corporation Apparatus, method and limited set of messages to transmit data between scheduler and a network processor
US20040107240A1 (en) * 2002-12-02 2004-06-03 Globespan Virata Incorporated Method and system for intertask messaging between multiple processors
CN101105786A (en) * 2006-07-14 2008-01-16 中兴通讯股份有限公司 Double CPU communication method based on shared memory
CN102023961A (en) * 2009-09-10 2011-04-20 中兴通讯股份有限公司 Communication method based on shared memory and apparatus thereof
CN103945456A (en) * 2014-05-12 2014-07-23 武汉邮电科学研究院 LTE (long term evolution) base station user plane efficient UDP (user datagram protocol) data transmission optimization method based on Linux system
CN104346229A (en) * 2014-11-14 2015-02-11 国家电网公司 Processing method for optimization of inter-process communication of embedded operating system
CN107241409A (en) * 2017-06-05 2017-10-10 武汉虹信通信技术有限责任公司 For RLC in LTE and the data transmission method of adjacent layer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110737536A (en) * 2019-09-19 2020-01-31 亚信创新技术(南京)有限公司 shared memory based message storage method and message reading method
CN110737536B (en) * 2019-09-19 2024-03-12 亚信创新技术(南京)有限公司 Message storage method and message reading method based on shared memory

Similar Documents

Publication Publication Date Title
CN110275841B (en) Access request processing method and device, computer equipment and storage medium
US6658533B1 (en) Method and apparatus for write cache flush and fill mechanisms
CN109726163B (en) SPI-based communication system, method, equipment and storage medium
US20080244231A1 (en) Method and apparatus for speculative prefetching in a multi-processor/multi-core message-passing machine
US20150143045A1 (en) Cache control apparatus and method
EP3608790B1 (en) Modifying nvme physical region page list pointers and data pointers to facilitate routing of pcie memory requests
KR20120014938A (en) Methods for controlling host memory access with memory devices and systems
JP5621918B2 (en) Information processing apparatus, parallel computer system, and control method for arithmetic processing apparatus
CN112214240B (en) Device and method for executing host output and input command and computer readable storage medium
TW200839514A (en) Memory management apparatus
TW200417857A (en) Allocating cache lines
CN112698959A (en) Multi-core communication method and device
CN103412829B (en) Expand the method and device of MCU program address space
WO2015084506A1 (en) System and method for managing and supporting virtual host bus adaptor (vhba) over infiniband (ib) and for supporting efficient buffer usage with a single external memory interface
CN115248795A (en) Peripheral Component Interconnect Express (PCIE) interface system and method of operating the same
CN116755635B (en) Hard disk controller cache system, method, hard disk device and electronic device
CN110069438A (en) A kind of method of isomery device Memory communication
CN116820579A (en) Scheduling method and device of access instruction, electronic equipment and storage medium
KR100532417B1 (en) The low power consumption cache memory device of a digital signal processor and the control method of the cache memory device
US10552343B2 (en) Zero thrash cache queue manager
CN113742115B (en) Method for processing page fault by processor
KR20190049098A (en) Computing device and non-volatile dual in-line memory module
CN108140005B (en) System and method for providing file information in a memory system protocol
GB2502858A (en) A method of copying data from a first memory location and storing it in a cache line associated with a different memory location
US12008261B2 (en) Method and device for accessing memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190730