CN1658176A - Method and equipment of data communication - Google Patents

Method and equipment of data communication Download PDF

Info

Publication number
CN1658176A
CN1658176A CN 200410005658 CN200410005658A CN1658176A CN 1658176 A CN1658176 A CN 1658176A CN 200410005658 CN200410005658 CN 200410005658 CN 200410005658 A CN200410005658 A CN 200410005658A CN 1658176 A CN1658176 A CN 1658176A
Authority
CN
China
Prior art keywords
data
processor
dma
address
destination
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200410005658
Other languages
Chinese (zh)
Other versions
CN1331070C (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 CNB2004100056588A priority Critical patent/CN1331070C/en
Publication of CN1658176A publication Critical patent/CN1658176A/en
Application granted granted Critical
Publication of CN1331070C publication Critical patent/CN1331070C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

This invention discloses a data-communicating method and equipment. It is used to make communication between the handlers which has master slave relation. The method is that shared memory is mapped between the master handler and the slave one which is linked by bus. The master handler and the slave one separately set the address of data to be received in the shared memory, and when data is sent out, the initial end get the address of the data to be received on the destination end from the shared memory, and then it will write the data into the storage mediator corresponding to the address. After that, the destination end will get the data from the address.

Description

The method and apparatus of data communication
Technical field
The present invention relates to data communication technology, relate in particular to the method and the equipment thereof of data communication.
Background technology
In data communication field, the transmission of data and reception are the fields that industry is paid close attention to always, and it is the basis of data communication.In data communication field in the past, it is normally remote that everybody pays close attention to, the perhaps data communication problem between the equipment, and the transmission of the data normally physical link by equipment room, trunking etc. is transmitted.For the data transmission of in-plant data transmission, particularly device interior, everybody or keep secret, perhaps do not have widespread usage.
Application number is called " data transferring method and data transfer equipment " for the Chinese patent of " 98800800 " discloses name, its technical scheme is: direct memory visit (DMA) communication mechanism of two processors by the rank equity is realized the transmission of data, these two processors are separate, do not have direct incidence relation.These two processors use separately independently that data bus carries out data transmission, and the data interaction between the processor realizes by a bus repeater.
Technique scheme is applicable between the central processing unit (CPU) of two equities and communicates, yet for the communication between the CPU with master slave relation, this mode be because need carry out conversion process by interrupter, so can cause that the promptness of data transfer is poor, the speed of data transmission and efficient is low.
Summary of the invention
The invention provides a kind of method and equipment thereof of data communication, have promptness difference and the low problem of speed when transmitting data between two processors of master slave relation having to solve prior art.
Realize the technical scheme of invention:
A kind of method of data communication, this method is:
Shine upon shared drive at the primary processor that connects by bus with between the processor;
Primary processor and the address that receives data is set respectively described shared drive from processor;
When sending data, the source end obtains the address that destination receives data from described shared drive, and data is write in the storage medium of this address correspondence, and destination then obtains data from this address.
Wherein:
Primary processor and visit described shared drive by privately owned address from processor.
The source end judges whether destination is ready to receive data before sending data, with metadata cache, and send when destination is ready to receive data when the unripe reception data of destination again.
Be provided with the status indicator that the master and slave processor of expression receives data mode in the described shared drive, the source end judges from the status indicator that shared drive obtains destination whether destination is ready to receive data before sending data.
The source end judges by special interrupt mode whether destination is ready to receive data.
Described data send direct memory visit (DMA) mode that adopts.
When the catena mode in adopting dma mode is transmitted data, also be provided with data segment information in the described shared drive, be used to show the data that source end dma controller sends how many individual independently data segments are made of.
A kind of data transmission set, comprise bus, visit (DMA) controller by processor, memory medium and direct memory that bus connects, wherein, described processor comprises the primary processor that has master slave relation and link to each other by described bus and from processor, this master and slave processor is connected with dma controller respectively, and described memory medium comprises and allows primary processor and from the shared memory of processor access; In transmission during data, the address that the dma controller of source end obtains destination in the described shared memory.
This programme provides the effective ways of a large amount of, quick Data transmission between a kind of master-slave cpu, this method can improve data transmit-receive efficient between the CPU, effectively reduce the utilization rate (promptly economizing on resources) of CPU, guaranteed the promptness that data send simultaneously to a certain extent.
Description of drawings
Fig. 1 is the structural representation of data transmission set of the present invention;
Fig. 2 is a DAM catena mode synoptic diagram;
Fig. 3 is for receiving the preceding initialization flowchart of data;
Fig. 4 is for sending the process flow diagram of data;
Fig. 5 is for receiving the process flow diagram of data;
Fig. 6 is the transmission data flowchart that regularly triggers.
Embodiment
Consult shown in Figure 1ly, transmission equipment comprises bus, the primary processor (host CPU) that connects by bus, from CPU, memory medium and direct memory visit (DMA) controller.Link to each other by common bus between the master and slave processor, and can send interruption to the other side by direct or indirect mode; By common bus, CPU can visit the outer exterior storage medium that is hung on CPU, carries out the data write operation.
For host CPU, it shines upon the address space that a part is hung on the memory medium on the common bus outward to the memory headroom from CPU, allows from CPU it to be read and write; Host CPU still can be read and write this mapping memory headroom., can not visit to storage medium address space for non-mapping from CPU from CPU.
Has independently memory address space from CPU, for the storage medium that is mapped to from CPU, conduct interviews by its privately owned address from CPU, promptly for certain zone (byte) of same memory medium, have two addresses: one is the address of host CPU, and another is the address from CPU.Among Fig. 1, storage space J2 (dash area) among the memory medium J1 is shone upon to the storage medium from CPU by host CPU, host CPU can access memory medium J2 whole storage mediums space, can only visit storage space J2 from CPU, for within the memory medium J1 and at storage space J2 memory headroom in addition, from the CPU inaccessible.
The dma mode that uses CPU to provide is provided data, and there is " catena " and " non-catena " dual mode in the DMA transmission.So-called " catena " mode is exactly the data that have a plurality of different addresses and length in a DMA sends.Only send the data of an address and length among the each DMA of " non-catena " mode." non-catena " mode can be regarded a special case of DMA " catena " mode as.
The present invention is by being provided with primary processor and receiving the address of data from processor in shared drive, when sending data, the source end obtains the address that destination receives data from shared drive, then data are write in the storage medium of this address correspondence, and destination then obtains data from this address.
When sending data, can know in order to make the source end whether destination is ready to receive data, two DMA transmission control word K1 and K2: control word K1 are set in the shared drive medium are used to identify the state that host CPU receives data, control word K2 is used to identify the state that receives data from CPU.In control word K1 and K2, comprise following information:
Mode field: this field is used to represent whether current C PU has carried out the preparation that receives data, at least expression " ready " and " hurrying " two states.
The number of data: be used to show that the data that DMA sends over are made of the several separate data segment.Certainly, for " non-catena " mode, this field can be omitted.
Two address table L1 and L2 also are set in the shared drive medium.Address table L1 is used to store the start address that host CPU can receive data, and address table L2 is used to store the start address that can receive data from CPU.Because the DMA transmission is the data transmission procedure of the total system scope on common bus, so the address in these two address tables all needs memory absolute address, i.e. the address of the storage medium of host CPU use.
For the data transmission of dma mode, need know source address, destination address and three fundamentals of data length, see also shown in Figure 2.According to these three fundamentals, what such data segments know simultaneously has need to transmit, CPU just can use DMA mechanism to finish the transport process of data.
Possessed outside mode control word and the address table, the data segment number of DMA " catena " is limited, being defined as the predetermined value that each DMA at most can data segments is N, and this N value can be set according to actual conditions.Why do such qualification,, can not unrestrictedly prepare to receive the address of data for DMA at first from the angle of memory management; Secondly, consider, need the restriction of a data segment number equally from the promptness aspect of data transfer.
The restriction of data segment number has also solved DMA simultaneously and has triggered the problem on opportunity, has promptly possessed mode control word and address list, and under the condition that can carry out the DMA transmission, the DMA triggering is opportunity:
The number of A, the data segment that transmits at needs is under N or the situation greater than N, triggers DMA and transmits;
B, there is being data segment to need DMA to transmit, and do not satisfying under the situation of method one,, then triggering dma operation if the time that the preceding DMA of distance sends is satisfied certain time interval (such as 10 milliseconds).
Judgment processing for control word: before data send, judge at first whether control word is set to " ready " state to opposite end CPU, for " ready " attitude, at first " ready " attitude with control word changes to " doing " attitude, triggers the judgment processing on opportunity then; Control word is if " hurrying " attitude, and the data that then will need to send are carried out buffer memory, waits for that opposite end CPU control word is set to " ready " attitude.
After triggering dma operation, source end CPU has data to need to receive by the form notice destination CPU that interrupts, and at this moment the interrupt service routine of destination CPU will be carried out the Data Receiving processing, and for the DMA Data Receiving is ready next time.
Consult shown in Figure 3ly, the initialization flow process of master and slave processor is as follows:
Step 300: initialization system variable.
Step 310: application free memory space is used for the DMA Data Receiving.
Step 320: initialization DMA control word state is " ready ".
Consult shown in Figure 4ly, the flow process that sends data is as follows:
Step 400: application program is carried out data processing.
Step 410: the data segment quantity of judging transmission if then carry out step 420, otherwise carry out step 430 according to whether greater than predetermined value.
Step 420: judge that whether receiving end control word state is " ready ", if then carry out 440, otherwise carry out step 430.
Step 430:, wait to be sent and process ends with metadata cache.
Step 440: the data " catena " that will need to send are handled.
Step 450: trigger DMA and transmit data.
Step 460: the control word state is set to " doing ".
Step 470: send interruption to receiving end, the notice destination receives data and process ends.
Consult shown in Figure 5ly, the flow process that receives data is as follows:
Step 500: remove and interrupt.
Step 510: fetch data according to sequential read in the data segment number address table in the DMA control word.
Step 520: in please corresponding number free space replenish, to prepare to receive the data of next time.
Step 530: with the status devices of control word for " ready " and finish this flow process.
Consult shown in Figure 6ly, it is as follows regularly to trigger the flow process that the DMA data send:
Step 600: judged whether that data need DMA to send, if then carry out step 610, otherwise finish this flow process.
Step 610: whether the control word state of judging destination is " ready ", if then carry out step 620, otherwise finishes this flow process.
Step 620: carry out the DMA data sending processing.
Step 630: judge that whether the DMA transmission is finished, if then carry out step 620, otherwise carry out step 640.
Step 640: send interruption to receiving end, notice destination data arrive and process ends.
In the present invention, be not limited to one from processor, can be for a plurality of, primary processor and each are from all establishing shared drive between the primary processor, and its principle of work is identical.
The present invention utilizes shared drive to transmit the status signal of master and slave processor and receives data address, can guarantee the promptness that data send, and can improve data transmit-receive efficient between the CPU, is the effective ways of a large amount of, quick Data transmission between the master-slave cpu.

Claims (11)

1, a kind of method of data communication is characterized in that comprising step:
Shine upon shared drive at the primary processor that connects by bus with between the processor;
Primary processor and the address that receives data is set respectively described shared drive from processor;
When sending data, the source end obtains the address that destination receives data from described shared drive, and data is write in the storage medium of this address correspondence, and destination then obtains data from this address.
2, the method for claim 1 is characterized in that, primary processor and visit described shared drive by privately owned address from processor.
3, the method for claim 1 is characterized in that, the source end judges whether destination is ready to receive data before sending data, if during the unripe reception data of destination with metadata cache, and when destination is ready to receive data, send again.
4, method as claimed in claim 3, it is characterized in that, be provided with the status indicator that the master and slave processor of expression receives data mode in the described shared drive, the source end judges from the status indicator that shared drive obtains destination whether destination is ready to receive data before sending data.
As claim 3 or 4 described methods, it is characterized in that 5, the source end judges by special interrupt mode whether destination is ready to receive data.
As one of claim 1 to 4 described method, it is characterized in that 6, described data send direct memory visit (DMA) mode that adopts.
7, method as claimed in claim 6, it is characterized in that, when the catena mode in adopting dma mode is transmitted data, also be provided with data segment information in the described shared drive, be used to show the data that source end dma controller sends how many individual independently data segments are made of.
8, method as claimed in claim 7 is characterized in that, when the quantity of the data segment that transmits when needs is no less than predetermined value, triggers DMA and transmits; The quantity of the data segment that transmits when needs is not more than time interval that predetermined value and the preceding DMA of distance send when reaching setting value, triggers DMA and transmits.
9, a kind of data transmission set, comprise bus, visit (DMA) controller by processor, memory medium and direct memory that bus connects, it is characterized in that, described processor comprises the primary processor that has master slave relation and link to each other by described bus and from processor, this master and slave processor is connected with described dma controller respectively, and described memory medium comprises and allows primary processor and from the shared memory of processor access; In transmission during data, the address that the dma controller of source end obtains destination in the described shared memory.
10, data transmission set as claimed in claim 9 is characterized in that, described master and slave processor is visited described shared memory with privately owned address.
As claim 9 or 10 described data transmission sets, it is characterized in that 11, described is a plurality of from processor.
CNB2004100056588A 2004-02-21 2004-02-21 Method and equipment of data communication Expired - Fee Related CN1331070C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100056588A CN1331070C (en) 2004-02-21 2004-02-21 Method and equipment of data communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100056588A CN1331070C (en) 2004-02-21 2004-02-21 Method and equipment of data communication

Publications (2)

Publication Number Publication Date
CN1658176A true CN1658176A (en) 2005-08-24
CN1331070C CN1331070C (en) 2007-08-08

Family

ID=35007673

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100056588A Expired - Fee Related CN1331070C (en) 2004-02-21 2004-02-21 Method and equipment of data communication

Country Status (1)

Country Link
CN (1) CN1331070C (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100454241C (en) * 2006-02-28 2009-01-21 华为技术有限公司 Method and device for storing C++ object in shared memory
CN102281421A (en) * 2010-06-12 2011-12-14 无锡中星微电子有限公司 Method and device for playing video image data
CN1964286B (en) * 2006-12-13 2012-02-29 杭州华三通信技术有限公司 A master control device with double CPU
CN102760109A (en) * 2012-06-15 2012-10-31 华为技术有限公司 Data communication method, device and system
CN104199702A (en) * 2014-09-08 2014-12-10 吴健辉 Software version loading method
CN105302489A (en) * 2015-10-30 2016-02-03 致象尔微电子科技(上海)有限公司 Heterogeneous multi-core remote embedded memory system and method
CN106527968A (en) * 2016-09-21 2017-03-22 苏州市广播电视总台 File through technology-based file transmission method
CN107832240A (en) * 2017-10-27 2018-03-23 北京腾凌科技有限公司 A kind of DMA data exchange method and device based on information record structure
CN107995129A (en) * 2017-11-30 2018-05-04 锐捷网络股份有限公司 A kind of NFV message forwarding methods and device
CN108011913A (en) * 2016-12-29 2018-05-08 北京车和家信息技术有限责任公司 Data transmission method, vehicle device display device, vehicle multimedia device and system
CN108566552A (en) * 2018-04-20 2018-09-21 四川长虹网络科技有限责任公司 Multi-medium play method and system suitable for top box of digital machine
CN110647493A (en) * 2018-06-26 2020-01-03 大唐移动通信设备有限公司 Data transmission method, processor and PCIE system
CN111339000A (en) * 2020-02-24 2020-06-26 深圳震有科技股份有限公司 AMP system memory file transmission method and device
CN113434089A (en) * 2021-06-29 2021-09-24 苏州科达科技股份有限公司 Data moving method and device and PCIE system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164369A (en) * 2013-02-22 2013-06-19 深圳市硅格半导体有限公司 Control method and device for data transmission

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63158657A (en) * 1986-12-23 1988-07-01 Fanuc Ltd Coprocessor control system
US5167028A (en) * 1989-11-13 1992-11-24 Lucid Corporation System for controlling task operation of slave processor by switching access to shared memory banks by master processor
JPH04367963A (en) * 1991-06-15 1992-12-21 Hitachi Ltd Shared storage communication system
US5913227A (en) * 1997-03-24 1999-06-15 Emc Corporation Agent-implemented locking mechanism

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100454241C (en) * 2006-02-28 2009-01-21 华为技术有限公司 Method and device for storing C++ object in shared memory
CN1964286B (en) * 2006-12-13 2012-02-29 杭州华三通信技术有限公司 A master control device with double CPU
CN102281421A (en) * 2010-06-12 2011-12-14 无锡中星微电子有限公司 Method and device for playing video image data
CN102281421B (en) * 2010-06-12 2015-11-25 无锡中星微电子有限公司 A kind of player method of vedio data and playing device
CN102760109A (en) * 2012-06-15 2012-10-31 华为技术有限公司 Data communication method, device and system
CN102760109B (en) * 2012-06-15 2016-03-30 华为技术有限公司 The communication means of data, Apparatus and system
CN104199702A (en) * 2014-09-08 2014-12-10 吴健辉 Software version loading method
CN105302489A (en) * 2015-10-30 2016-02-03 致象尔微电子科技(上海)有限公司 Heterogeneous multi-core remote embedded memory system and method
CN105302489B (en) * 2015-10-30 2018-03-13 致象尔微电子科技(上海)有限公司 A kind of remote embedded accumulator system of heterogeneous polynuclear and method
CN106527968A (en) * 2016-09-21 2017-03-22 苏州市广播电视总台 File through technology-based file transmission method
CN108011913A (en) * 2016-12-29 2018-05-08 北京车和家信息技术有限责任公司 Data transmission method, vehicle device display device, vehicle multimedia device and system
CN108011913B (en) * 2016-12-29 2021-08-20 北京车和家信息技术有限责任公司 Data transmission method, vehicle display device, vehicle multimedia equipment and system
CN107832240A (en) * 2017-10-27 2018-03-23 北京腾凌科技有限公司 A kind of DMA data exchange method and device based on information record structure
CN107832240B (en) * 2017-10-27 2020-06-09 北京腾凌科技有限公司 DMA data interaction method and device based on information recording structure
CN107995129A (en) * 2017-11-30 2018-05-04 锐捷网络股份有限公司 A kind of NFV message forwarding methods and device
CN107995129B (en) * 2017-11-30 2021-12-17 锐捷网络股份有限公司 NFV message forwarding method and device
CN108566552A (en) * 2018-04-20 2018-09-21 四川长虹网络科技有限责任公司 Multi-medium play method and system suitable for top box of digital machine
CN108566552B (en) * 2018-04-20 2021-05-25 四川长虹网络科技有限责任公司 Multimedia playing method and system suitable for digital set top box
CN110647493A (en) * 2018-06-26 2020-01-03 大唐移动通信设备有限公司 Data transmission method, processor and PCIE system
CN110647493B (en) * 2018-06-26 2022-04-01 大唐移动通信设备有限公司 Data transmission method, processor and PCIE system
CN111339000B (en) * 2020-02-24 2021-07-06 深圳震有科技股份有限公司 AMP system memory file transmission method and device
CN111339000A (en) * 2020-02-24 2020-06-26 深圳震有科技股份有限公司 AMP system memory file transmission method and device
CN113434089A (en) * 2021-06-29 2021-09-24 苏州科达科技股份有限公司 Data moving method and device and PCIE system
CN113434089B (en) * 2021-06-29 2022-08-16 苏州科达科技股份有限公司 Data moving method and device and PCIE system

Also Published As

Publication number Publication date
CN1331070C (en) 2007-08-08

Similar Documents

Publication Publication Date Title
CN108733601B (en) Low latency direct access block storage in NVMe-oF Ethernet SSD
US11899596B2 (en) System and method for facilitating dynamic command management in a network interface controller (NIC)
CN109582614B (en) NVM EXPRESS controller for remote memory access
CN1658176A (en) Method and equipment of data communication
CN107995129B (en) NFV message forwarding method and device
US8521934B1 (en) Multi-port context-based host controller
US9740439B2 (en) Solid-state storage management
US7761642B2 (en) Serial advanced technology attachment (SATA) and serial attached small computer system interface (SCSI) (SAS) bridging
US9137179B2 (en) Memory-mapped buffers for network interface controllers
CN1749967A (en) Data processing system having a channel adapter shared by multiple operating systems
CN1647054A (en) Network device driving system structure
US20150026368A1 (en) Direct memory access to storage devices
CN1991810A (en) A dma controller with multiple intra-channel software request support
US20050144402A1 (en) Method, system, and program for managing virtual memory
CN1700196A (en) System and method for accessing controller communication data through direct memory
US10901624B1 (en) Dummy host command generation for supporting higher maximum data transfer sizes (MDTS)
US20140082119A1 (en) Processing data packets from a receive queue in a remote direct memory access device
CN102662910A (en) Network interaction system based on embedded system and network interaction method
CN1581853A (en) Method for treating group to be transmitted on network, system and programe thereof
CN100351824C (en) Bus system and bus interface connected to bus
US11029847B2 (en) Method and system for shared direct access storage
CN102843435A (en) Access and response method and access and response system of storing medium in cluster system
US8055817B2 (en) Efficient handling of queued-direct I/O requests and completions
CN1955890A (en) Method for raising communication speed of HID equipment
CN1153154C (en) Converter and transmission method from DMA to general-purpose serial bus

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070808

Termination date: 20130221