CN109359069A - A kind of data transmission method and device - Google Patents

A kind of data transmission method and device Download PDF

Info

Publication number
CN109359069A
CN109359069A CN201811114500.2A CN201811114500A CN109359069A CN 109359069 A CN109359069 A CN 109359069A CN 201811114500 A CN201811114500 A CN 201811114500A CN 109359069 A CN109359069 A CN 109359069A
Authority
CN
China
Prior art keywords
data
transmitted
dma
priority
memory
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
CN201811114500.2A
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.)
Jinan Inspur Hi Tech Investment and Development Co Ltd
Original Assignee
Jinan Inspur Hi Tech Investment and Development 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 Jinan Inspur Hi Tech Investment and Development Co Ltd filed Critical Jinan Inspur Hi Tech Investment and Development Co Ltd
Priority to CN201811114500.2A priority Critical patent/CN109359069A/en
Publication of CN109359069A publication Critical patent/CN109359069A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/30Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal with priority control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/28DMA

Abstract

The present invention provides a kind of data transmission method and device, which includes: to read at least one data to be transmitted from first memory according to the reading address got;For each of at least one data to be transmitted data to be transmitted, according to the priority of the data to be transmitted, the corresponding DMA data channel is selected to move the data to be transmitted from least two direct memory access DMA data channels being pre-created;Encryption and decryption processing is carried out to each the described data to be transmitted moved by the DMA data channel, and the data to be transmitted for meeting memory requirement after progress encryption and decryption processing is stored to second memory.The data transmission device includes: data-reading unit, data channel arbitration unit and data encryption/decryption element.The efficiency that computer processor carries out data processing can be improved in this programme.

Description

A kind of data transmission method and device
Technical field
The present invention relates to field of communication technology, in particular to a kind of data transmission method and device.
Background technique
It needs to carry out data friendship in the system for including computer and external equipment, between computer and external equipment Mutually, specially external equipment is uploaded to data are uploaded calculator memory and handles for computer processor, computer disposal Device will issue data distributing to external equipment in calculator memory.
Currently, data exchange process is completed by computer processor when computer and external equipment carry out data interaction, I.e. computer processor is responsible for the upload data-moving in external equipment to computer content, and being responsible for will be in computer content Issue data-moving to external equipment.
For the method that current computer and external equipment carry out data interaction, computer processor is in external equipment and meter Between calculation machine memory during moving data, computer processor is not available for other work, is caused at computer The efficiency for managing device progress data processing is lower.
Summary of the invention
The embodiment of the invention provides a kind of data transmission method and devices, can be improved computer processor and carry out data The efficiency of processing.
In a first aspect, the embodiment of the invention provides a kind of data transmission methods, comprising:
At least one data to be transmitted is read from first memory according to the reading address got;
For each of at least one data to be transmitted data to be transmitted, according to the excellent of the data to be transmitted First grade selects the corresponding DMA data channel from least two direct memory access DMA data channels being pre-created The data to be transmitted is moved;
Encryption and decryption processing is carried out to each the described data to be transmitted moved by the DMA data channel, and The data to be transmitted for meeting memory requirement after progress encryption and decryption processing is stored to second memory.
Optionally,
Before at least one data to be transmitted is read from first memory in the reading address that the basis is got, into one Step includes:
At least one preset register is read out, according at least one descriptor determination read Read address.
Optionally,
In the priority according to the data to be transmitted, selected from least two DMA data channels being pre-created It selects before the corresponding DMA data channel moves the data to be transmitted, further comprises:
The header of the data to be transmitted is parsed, the header information of the data to be transmitted is obtained, wherein The header information includes that priority tag and encryption identification, decryption identify, are in bright logical mark and discarding mark any one It is a;
The priority of the data to be transmitted is determined according to the priority tag that the header information includes.
Optionally,
The priority according to the data to be transmitted is selected from least two DMA data channels being pre-created The corresponding DMA data channel is moved by the data to be transmitted, comprising:
Judge whether the data to be transmitted and a upper data to be transmitted being read into are corresponding with identical priority;
If so, determining selected the first DMA number moved to the upper data to be transmitted being read into The next of priority corresponding to first DMA data channel is selected according to priority from the sequence of up to low circulation according to channel A priority corresponding second DMA data channel is moved by the data to be transmitted;
If not, being selected from least two DMA data channel corresponding with the priority of the data to be transmitted Third DMA data channel the data to be transmitted is moved.
Optionally,
Described pair of each described data to be transmitted moved by the DMA data channel carries out at encryption and decryption Reason, and the data to be transmitted for meeting memory requirement after progress encryption and decryption processing is stored to second memory, comprising:
For data to be transmitted described in each, if the header information of the data to be transmitted includes the encryption Mark, then be encrypted the data to be transmitted, and the data to be transmitted storage after being encrypted is arrived The second memory;
For data to be transmitted described in each, if the header information of the data to be transmitted includes the decryption Mark, then be decrypted the data to be transmitted, and the data to be transmitted storage after being decrypted is arrived The second memory;
For data to be transmitted described in each, if the header information of the data to be transmitted is logical including stating clearly Mark then directly stores the data to be transmitted to the second memory;
For data to be transmitted described in each, if the header information of the data to be transmitted includes the discarding Mark, then abandon the data to be transmitted.
Optionally,
The corresponding DMA data channel pair is selected from least two DMA data channels being pre-created described After the data to be transmitted is moved, and described in each moved by the DMA data channel at described Dui Before data to be transmitted carries out encryption and decryption processing, further comprise:
Judge to move through at least two DMA data channel belongs at least two described to be transmitted of same data group Whether data occur random ordering;
If so, resequencing at least two data to be transmitted for belonging to same data group.
Second aspect, the embodiment of the invention also provides a kind of data transmission devices, comprising: data-reading unit, data Channel arbitration unit and data encryption/decryption element;
The data-reading unit, it is to be passed for reading at least one from first memory according to the reading address got Transmission of data;
The data channel arbitration unit, at least one to be to be passed described in reading for the data-reading unit Each of transmission of data data to be transmitted, according to the priority of the data to be transmitted, from at least DMA being pre-created two The corresponding DMA data channel is selected to move the data to be transmitted in data channel;
The data encrypting and deciphering unit, for being carried out to the data channel arbitration unit by the DMA data channel Each moved data to be transmitted carries out encryption and decryption processing, and the institute that will meet memory requirement after progress encryption and decryption processing Data to be transmitted storage is stated to second memory.
Optionally,
The data channel arbitration unit is further used for parsing the header of the data to be transmitted, obtain Obtain the header information of the data to be transmitted, wherein the header information includes priority tag and encryption identification, decryption Any one in mark, bright logical mark and discarding mark, and determines institute according to the priority tag that the header information includes State the priority of data to be transmitted.
Optionally,
The data channel arbitration unit, for judging the data to be transmitted and upper one number to be transmitted being read into According to whether being corresponding with identical priority, if so, determine it is selected to the upper data to be transmitted being read into The first DMA data channel that row is moved selects first DMA data channel according to priority from the sequence of up to low circulation The data to be transmitted is moved in next priority corresponding second DMA data channel of corresponding priority, otherwise Select third DMA data corresponding with the priority of the data to be transmitted logical from least two DMA data channel Road is moved by the data to be transmitted.
Optionally,
The data encrypting and deciphering unit, for being directed to each described data to be transmitted, if the data to be transmitted The header information includes the encryption identification, then the data to be transmitted is encrypted, and will be encrypted The data to be transmitted afterwards is stored to the second memory, if the header information of the data to be transmitted includes institute Decryption mark is stated, then the data to be transmitted is decrypted, and the data to be transmitted after being decrypted The second memory is stored, if the header information of the data to be transmitted includes stating logical mark clearly, directly By data to be transmitted storage to the second memory, if the header information of the data to be transmitted includes described Mark is abandoned, then is abandoned the data to be transmitted.
Optionally,
The data transmission device further comprises: data random ordering rearrangement units;
The data random ordering rearrangement units, for judging through the data channel arbitration unit by described at least two Whether at least two data to be transmitted that DMA data channel was moved belong to same data group occur random ordering, if so, right At least two data to be transmitted for belonging to same data group are resequenced.
Data transmission method and device provided in an embodiment of the present invention are being stored according to the reading address got from first After device reads at least one data to be transmitted, for each data to be transmitted got, according to the excellent of the data to be transmitted First grade selects a corresponding DMA data channel to the number to be transmitted from least two DMA data channels being pre-created According to being moved, encryption and decryption processing can be carried out to each data to be transmitted moved by DMA data channel later, Meet the data to be transmitted storage of memory requirement into second memory after encryption and decryption processing will finally be carried out.It can be seen that logical DMA data channel is crossed by the data-moving in first memory to second memory, data-moving process is not necessarily to computer disposal Device participates in, and data-moving process computer processor can execute other data processing tasks, so as to improve at computer Manage the efficiency that device carries out data processing.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is a kind of flow chart of data transmission method provided by one embodiment of the present invention;
Fig. 2 is a kind of method by MDA data by being moved to data provided by one embodiment of the present invention Flow chart;
Fig. 3 is the schematic diagram of equipment where a kind of data transmission device provided by one embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of data transmission device provided by one embodiment of the present invention;
Fig. 5 is the schematic diagram of another data transmission device provided by one embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, this method may comprise steps of the embodiment of the invention provides a kind of data transmission method:
Step 101: at least one data to be transmitted is read from first memory according to the reading address got;
Step 102: for each of at least one data to be transmitted data to be transmitted, according to the data to be transmitted Priority selects corresponding DMA data channel to the data to be transmitted from least two DMA data channels being pre-created It is moved;
Step 103: encryption and decryption processing is carried out to each data to be transmitted moved by DMA data channel, and The data to be transmitted for meeting memory requirement after progress encryption and decryption processing is stored to second memory.
The embodiment of the invention provides a kind of data transmission method, according to the reading address got from first memory After reading at least one data to be transmitted, for each data to be transmitted got, according to the preferential of the data to be transmitted Grade, selects a corresponding DMA data channel to the data to be transmitted from least two DMA data channels being pre-created It is moved, encryption and decryption processing can be carried out to each data to be transmitted moved by DMA data channel later, most Meet the data to be transmitted storage of memory requirement into second memory after carrying out encryption and decryption processing at last.It can be seen that passing through Data-moving in first memory to second memory, data-moving process are not necessarily to computer processor by DMA data channel It participates in, data-moving process computer processor can execute other data processing tasks, so as to improve computer disposal The efficiency of device progress data processing.
In embodiments of the present invention, first memory can be calculator memory, and second memory is external equipment at this time, First memory can also be external equipment, and second memory is calculator memory at this time, therefore the data transmission method can be with Realize that the two-way of data is moved between calculator memory and external equipment, it can directly will be external without computer processor Data-moving in equipment, can also directly will be in calculator memory without computer processor into calculator memory Data-moving is into external equipment, so that computer processor executes other data processing tasks by more times, further Improve the efficiency that computer processor carries out data processing.
Data are moved according to the priority of data by DMA data channel, need not move through computer processor Transfer, so that the speed of data transmission is faster.In addition, by the way that the data come out from DMA data channel are encrypted or are decrypted Processing can promote the safety of data transmission.To sum up two o'clock, the data transmission method can be suitable for high-speed encryption data and pass Defeated system.
In embodiments of the present invention, direct memory access (Direct Memory Access, DMA) is that one kind can disobey Rely a large amount of interrupt loads in CPU to realize that the hardware device of friction speed carries out the technology of data interaction.In addition, the present invention is real The data transmission method for applying example offer can be based on field programmable gate array (Field-Programmable Gate Array, FPGA) it realizes.
Optionally, on the basis of data transmission method shown in Fig. 1, step 101 according to the reading address got from In first memory before reading data to be transmitted, it is necessary first to obtain and read address, the process for obtaining reading address specifically may be used To realize by the following method:
At least one preset register is read out, is determined and is read according at least one descriptor read Address, wherein reading address is the address data memory for being stored with data to be transmitted.
One or more registers are pre-created, control reading data by the way that descriptor is written into each register Starting, terminate, read address and storage address etc., guarantee can according to the demand of user from specified address reading data simultaneously The data read are stored to specified address, so that the data transmission method can satisfy the personalized of different user and need It asks, promotes the user satisfaction of user.
For example, multiple deposits can be written in some address of FPGA when the data transmission method is based on FPGA realization When needing the data-moving in memory A to memory B corresponding descriptor is written, in turn in device in each register Data can be read after the descriptor stored in reading each register from memory A, and the data read are removed It moves on in memory B.
Optionally, on the basis of data transmission method shown in Fig. 1, in step 102 according to the priority of data to be transmitted Before data to be transmitted is moved in selection DMA data channel, it is necessary first to determine the priority of data to be transmitted, determine to The process of transmission data priority can be specifically accomplished in that
For each data to be transmitted, the header of the data to be transmitted is parsed, obtains the number to be transmitted According to header information, wherein header information other than including priority tag, further include encryption identification, decryption mark, it is bright It is logical to identify and abandon any one in mark and then true according to the priority tag that the header information of the data to be transmitted includes The priority of the fixed data to be transmitted.
Data to be transmitted is transmitted by way of message, can obtain header letter by parsing to header It ceases, does not comprise only priority tag in header information, further include thering is encryption identification, decryption mark, bright logical mark or discarding to mark Know, wherein priority tag is used to define the priority of data to be transmitted, and encryption identification, which is used to indicate, to be needed to treat test data It is encrypted, decryption mark, which is used to indicate, to be needed to treat test data and be decrypted, and bright logical mark is for specified without to be passed Transmission of data is handled and is directly forwarded, and is abandoned mark and is used to indicate data to be transmitted discarding without being forwarded.
By the header to data to be transmitted carry out parsing obtain header information, according to header information include it is preferential Grade mark can determine the priority of data to be transmitted, and then can select corresponding DMA according to the priority of data to be transmitted Data channel moves data to be transmitted, on the one hand can be removed by multiple DMA data channels to data to be transmitted It moves, so that having faster data transmission bauds, on the other hand the higher data to be transmitted of priority can preferentially be passed It is defeated, so that data transmission procedure is more reasonable.
Optionally, on the basis of data transmission method shown in Fig. 1, step 102 is selected according to the priority of data to be transmitted It selects DMA data channel to move data to be transmitted, as shown in Fig. 2, the step can be specifically accomplished in that
Step 201: being directed to each data to be transmitted, it is to be transmitted to judge that the data to be transmitted is read into upper one Whether data are corresponding with identical priority, if so, step 202 is executed, it is no to then follow the steps 205;
Step 202: determining the first DMA data channel, wherein the first DMA data channel is to the upper of the data to be transmitted The DMA data channel that one data to be transmitted being read all is moved;
Step 203: determining the second DMA data channel, wherein according to priority from the sequence of up to low circulation, the 2nd DMA Priority corresponding to data channel is next priority of priority corresponding to the first DMA data channel;
Step 204: the data to be transmitted being moved by the second DMA data channel, and terminates current process;
Step 205: determining third DMA data channel, wherein third DMA data channel is preferential with the data to be transmitted Grade is corresponding;
Step 206: the data to be transmitted being moved by third DMA data channel.
Each the DMA data channel being pre-created corresponds to a priority of data to be transmitted, different DMA data channels Corresponding different priority.If the priority of a data to be transmitted is identical as the priority of a upper data to be transmitted, it is It avoids distributing to continuous two data to be transmitted the same DMA data channel to be moved and cause data-moving etc. Wait the first DMA data channel for being moved to a upper data to be transmitted be determined, according to priority from up to low circulation Sequence, it is logical by the second DMA data that corresponding priority is the next priority of priority corresponding to the first DMA data channel Road is moved by the data to be transmitted.If the priority of the priority of a data to be transmitted and a upper data to be transmitted Difference will then carry out the data to be transmitted by third DMA data channel corresponding with the priority of the data to be transmitted It moves.
It is whether identical by comparing priority corresponding to two neighboring data to be transmitted, according to excellent if priority difference First grade selects corresponding DMA data channel to move data to be transmitted, logical according to DMA data if priority is identical Priority corresponding to road recycles incremental order to select DMA data channel to move data to be transmitted, can reduce in this way It distributes the same DMA data channel to move continuously multiple data to be transmitted, shortens the data to be transmitted waiting time, from And the efficiency of data-moving can be promoted.
Optionally, on the basis of data transmission method shown in Fig. 1, when the header information of data to be transmitted includes encryption mark Know, decryption mark, it is bright it is logical mark and discarding mark in any one when, step 103 to data to be transmitted carry out encryption and decryption at When managing and storing the data to be transmitted for meeting memory requirement into second memory, for each data to be transmitted step It can specifically be accomplished in that
If the header information of the data to be transmitted includes encryption identification, according to preset symmetric encipherment algorithm pair The data to be transmitted is encrypted, and stores the data to be transmitted into second memory after being encrypted;
If the header information of the data to be transmitted includes decryption mark, according to preset symmetric encipherment algorithm pair The data to be transmitted is decrypted, and stores the data to be transmitted into second memory after being decrypted;
If the header information of the data to be transmitted includes bright logical mark, directly the data to be transmitted is stored to second In memory;
If the header information of the data to be transmitted includes abandoning mark, which is abandoned, i.e., will not be incited somebody to action The data to be transmitted is stored into second memory.
According to content included by the header information of data to be transmitted, data to be transmitted can be encrypted, be solved Close processing, bright logical processing or discard processing promote the transmission side data so as to meet different types of data filtering rule The applicability of method.
It optionally, can be to generation between step 102 and step 103 on the basis of data transmission method shown in Fig. 1 Out-of-order data to be transmitted is resequenced, and can be specifically accomplished in that
Judge whether send out by least two data to be transmitted for belonging to same data group that each DMA data channel is moved It is raw out-of-order, if it is, resequencing at least two data to be transmitted for belonging to same data group, treating later It transmits data and carries out encryption and decryption processing.
For example, message, can be according to the classification in agreement after through DMA data channel for the message of such as PCIE class (tag) mark establishes tag resource pool, and different tag are established with different caching First Input First Outputs (FIFO), is receiving entirety Data Integration is being carried out after message, will exported after the sequence of out-of-order message.
By resequencing to the data to be transmitted that random ordering occurs, guarantee to store data to be transmitted to second memory When data to be transmitted have correctly sequence, thereby may be ensured that the accuracy of transmitted data.
As shown in Figure 3, Figure 4, the embodiment of the invention provides a kind of data transmission devices.Installation practice can be by soft Part is realized, can also be realized by way of hardware or software and hardware combining.For hardware view, as shown in figure 3, being this hair A kind of hardware structure diagram of equipment where the data transmission device that bright embodiment provides, in addition to processor shown in Fig. 3, memory, Except network interface and nonvolatile memory, the equipment in embodiment where device usually can also include other hardware, Such as it is responsible for the forwarding chip of processing message.Taking software implementation as an example, as shown in figure 4, as the dress on a logical meaning It sets, is that computer program instructions corresponding in nonvolatile memory are read into memory by fortune by the CPU of equipment where it What row was formed.Data transmission device provided in this embodiment, comprising: data-reading unit 401, data channel arbitration unit 402 With data encryption/decryption element 403;
Data-reading unit 401, it is to be passed for reading at least one from first memory according to the reading address got Transmission of data;
Data channel arbitration unit 402, at least one data to be transmitted for being read for data-reading unit 401 Each of data to be transmitted, according to the priority of data to be transmitted, from two data channel of at least DMA being pre-created Corresponding DMA data channel is selected to move data to be transmitted;
Data encrypting and deciphering unit 403, for what is moved to data channel arbitration unit 402 by DMA data channel Each data to be transmitted carries out encryption and decryption processing, and the data to be transmitted for meeting memory requirement after progress encryption and decryption processing is deposited Store up second memory.
Optionally, on the basis of data transmission device shown in Fig. 4,
Data-reading unit 401 can be further used for being read out at least one preset register, according to At least one descriptor read, which determines, reads address.
Optionally, on the basis of data transmission device shown in Fig. 4,
Data channel arbitration unit 402 is further used for parsing the header of data to be transmitted, obtains to be passed The header information of transmission of data, wherein header information include priority tag and encryption identification, decryption mark, bright logical mark and Any one in mark is abandoned, and determines the priority of data to be transmitted according to the priority tag that header information includes.
Optionally, on the basis of data transmission device shown in Fig. 4,
Data channel arbitration unit 402, for judging that data to be transmitted is with a upper data to be transmitted being read into It is no to be corresponding with identical priority, selected a upper data to be transmitted being read into is moved if so, determining First DMA data channel selects priority corresponding to the first DMA data channel according to priority from the sequence of up to low circulation Next priority corresponding second DMA data channel data to be transmitted is moved, otherwise from least two DMA datas Third DMA data channel corresponding with the priority of data to be transmitted is selected to move data to be transmitted in channel.
Optionally, on the basis of data transmission device shown in Fig. 4,
Data encrypting and deciphering unit 403, for being directed to each data to be transmitted, if the header information packet of data to be transmitted Encryption identification is included, then data to be transmitted is encrypted, and the data to be transmitted storage after being encrypted is to the Two memories are decrypted data to be transmitted if the header information of data to be transmitted includes decryption mark, and will Data to be transmitted after being decrypted is stored to second memory, if the header information of data to be transmitted includes bright logical mark Know, then directly stores data to be transmitted to second memory, if the header information of data to be transmitted includes abandoning mark, Data to be transmitted is abandoned.
Optionally, on the basis of data transmission device shown in Fig. 4, as shown in figure 5, the data transmission device further wraps It includes: data random ordering rearrangement units 404;
Data random ordering rearrangement units 404 pass through at least two DMA datas through data channel arbitration unit 403 for judging Whether at least two data to be transmitted that channel was moved belong to same data group occur random ordering, if so, to same number is belonged to It resequences according at least two data to be transmitted of group.
It should be noted that the contents such as information exchange, implementation procedure between each unit in above-mentioned apparatus, due to this Inventive method embodiment is based on same design, and for details, please refer to the description in the embodiment of the method for the present invention, no longer superfluous herein It states.
It is further to note that data transmission device provided in an embodiment of the present invention can be realized by FPGA, when this Data transmission device is based on FPGA when realizing, data-reading unit 401 which includes, data channel arbitration are single Member 402, data encrypting and deciphering unit 403 and data random ordering rearrangement units 404 are deployed on FPGA.
The embodiment of the invention also provides a kind of readable mediums, including execute instruction, when the processor of storage control is held When executing instruction described in row, the storage control executes the data transmission method that above-mentioned each embodiment provides.
The embodiment of the invention also provides a kind of storage controls, comprising: processor, memory and bus;
The memory is executed instruction for storing, and the processor is connect with the memory by the bus, when When the storage control is run, the processor executes the described of memory storage and executes instruction, so that the storage Controller executes the data transmission method that above-mentioned each embodiment provides.
In conclusion data transmission method and device that each embodiment of the present invention provides, at least have following beneficial to effect Fruit:
1, in embodiments of the present invention, to read at least one from first memory according to the reading address that gets to be passed After transmission of data, for each data to be transmitted got, according to the priority of the data to be transmitted, from be pre-created to A corresponding DMA data channel is selected to move the data to be transmitted in few two DMA data channels, it later can be with Encryption and decryption processing is carried out to each data to be transmitted moved by DMA data channel, will finally be carried out at encryption and decryption The data to be transmitted for meeting memory requirement after reason is stored into second memory.It can be seen that passing through DMA data channel for first Data-moving in memory is to second memory, and data-moving process is without computer processor participation, data-moving process Computer processor can execute other data processing tasks, so as to improve the effect that computer processor carries out data processing Rate.
2, in embodiments of the present invention, first memory can be calculator memory, and second memory sets at this time for outside Standby, first memory can also be external equipment, and second memory is calculator memory at this time, therefore the data transmission method can To realize, the two-way of data is moved between calculator memory and external equipment, can directly will be outer without computer processor Data-moving in portion's equipment, can also directly will be in calculator memory without computer processor into calculator memory Data-moving into external equipment so that computer processor executes other data processing tasks by more times, into one Step improves the efficiency that computer processor carries out data processing.
3, one or more registers in embodiments of the present invention, are pre-created, are retouched by being written into each register Symbol is stated to control the starting of reading data, end, read address and storage address etc., guarantee can according to the demand of user from Specified address reading data simultaneously stores the data read to specified address, so that the data transmission method can satisfy The individual demand of different user promotes the user satisfaction of user.
4, parsing in embodiments of the present invention, is carried out by the header to data to be transmitted and obtains header information, root The priority tag for including according to header information can determine the priority of data to be transmitted, and then can be according to data to be transmitted Priority selects corresponding DMA data channel to move data to be transmitted, on the one hand can pass through multiple DMA data channels Data to be transmitted is moved so that have faster data transmission bauds, on the other hand can it is higher to priority to It transmits data and carries out prioritised transmission, so that data transmission procedure is more reasonable.
5, in embodiments of the present invention, whether identical by comparing priority corresponding to two neighboring data to be transmitted, such as Fruit priority difference then selects corresponding DMA data channel to move data to be transmitted according to priority, if preferentially Grade is identical, recycles incremental order according to priority corresponding to DMA data channel to select DMA data channel to data to be transmitted It is moved, the same DMA data channel of distribution can be reduced in this way, continuously multiple data to be transmitted are moved, shortened The data to be transmitted waiting time, so as to promote the efficiency of data-moving.
6, in embodiments of the present invention, the content according to included by the header information of data to be transmitted, can be to be transmitted Data are encrypted, decryption processing, bright logical processing or discard processing, so as to meet different types of data filtering rule Then, the applicability of the data transmission method is promoted.
7, in embodiments of the present invention, by resequencing to the data to be transmitted that random ordering occurs, guarantee to second Data to be transmitted has correctly sequence when memory stores data to be transmitted, thereby may be ensured that the accurate of transmitted data Property.
It should be noted that, in this document, such as first and second etc relational terms are used merely to an entity Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation Any actual relationship or order.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non- It is exclusive to include, so that the process, method, article or equipment for including a series of elements not only includes those elements, It but also including other elements that are not explicitly listed, or further include solid by this process, method, article or equipment Some elements.In the absence of more restrictions, the element limited by sentence " including one ", is not arranged Except there is also other identical factors in the process, method, article or apparatus that includes the element.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, the program When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: ROM, RAM, magnetic disk or light In the various media that can store program code such as disk.
Finally, it should be noted that the foregoing is merely presently preferred embodiments of the present invention, it is merely to illustrate skill of the invention Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention, Equivalent replacement, improvement etc., are included within the scope of protection of the present invention.

Claims (10)

1. a kind of data transmission method characterized by comprising
At least one data to be transmitted is read from first memory according to the reading address got;
For each of at least one data to be transmitted data to be transmitted, according to the preferential of the data to be transmitted Grade, selects the corresponding DMA data channel pair from least two direct memory access DMA data channels being pre-created The data to be transmitted is moved;
Encryption and decryption processing carried out to each the described data to be transmitted moved by the DMA data channel, and will be into The data to be transmitted for meeting memory requirement after the processing of row encryption and decryption is stored to second memory.
2. the method according to claim 1, wherein being stored in the reading address that the basis is got from first Before device reads at least one data to be transmitted, further comprise:
At least one preset register is read out, the reading is determined according at least one descriptor read Address.
3. the method according to claim 1, wherein in the priority according to the data to be transmitted, from Selected at least two DMA data channels being pre-created the corresponding DMA data channel to the data to be transmitted into Before row is moved, further comprise:
The header of the data to be transmitted is parsed, obtains the header information of the data to be transmitted, wherein described Header information includes priority tag and encryption identification, decrypts mark, bright logical mark and abandon any one in mark;
The priority of the data to be transmitted is determined according to the priority tag that the header information includes.
4. according to the method described in claim 3, it is characterized in that, the priority according to the data to be transmitted, from pre- The corresponding DMA data channel is selected to carry out the data to be transmitted in at least two DMA data channels first created It moves, comprising:
Judge whether the data to be transmitted and a upper data to be transmitted being read into are corresponding with identical priority;
If so, determining that selected the first DMA data moved to the upper data to be transmitted being read into is logical Road selects the next excellent of priority corresponding to first DMA data channel according to priority from the sequence of up to low circulation First grade corresponding second DMA data channel is moved by the data to be transmitted;
If not, selecting corresponding with the priority of the data to be transmitted the from least two DMA data channel Three DMA data channels are moved by the data to be transmitted.
5. according to the method described in claim 3, it is characterized in that, described pair is moved by the DMA data channel Each described data to be transmitted carries out encryption and decryption processing, and meets the described to be passed of memory requirement after carrying out encryption and decryption processing Transmission of data is stored to second memory, comprising:
For data to be transmitted described in each, if the header information of the data to be transmitted includes the encryption mark Know, then the data to be transmitted is encrypted, and the data to be transmitted storage after being encrypted is to institute State second memory;
For data to be transmitted described in each, if the header information of the data to be transmitted includes the solution secret mark Know, then the data to be transmitted is decrypted, and the data to be transmitted storage after being decrypted is to institute State second memory;
For data to be transmitted described in each, if the header information of the data to be transmitted includes stating logical mark clearly Know, then directly stores the data to be transmitted to the second memory;
For data to be transmitted described in each, if the header information of the data to be transmitted includes the discarding mark Know, then abandons the data to be transmitted.
6. according to claim 1 to any method in 5, which is characterized in that described from be pre-created at least two After selecting the corresponding DMA data channel to move the data to be transmitted in DMA data channel, and described Before carrying out encryption and decryption processing to each the described data to be transmitted moved by the DMA data channel, further Include:
Judge that moves through at least two DMA data channel belongs at least two data to be transmitted of same data group Whether random ordering is occurred;
If so, resequencing at least two data to be transmitted for belonging to same data group.
7. a kind of data transmission device characterized by comprising data-reading unit, data channel arbitration unit and data add Decryption unit;
The data-reading unit, for reading at least one number to be transmitted from first memory according to the reading address got According to;
The data channel arbitration unit, for for the data-reading unit read described at least one number to be transmitted According to each of data to be transmitted, according to the priority of the data to be transmitted, from two data of at least DMA being pre-created The corresponding DMA data channel is selected to move the data to be transmitted in channel;
The data encrypting and deciphering unit, for being moved to the data channel arbitration unit by the DMA data channel Each described data to be transmitted carry out encryption and decryption processing, and will carry out meeting after encryption and decryption processing described in memory requirement to Data storage is transmitted to second memory.
8. device according to claim 7, which is characterized in that
The data channel arbitration unit is further used for parsing the header of the data to be transmitted, obtains institute State the header information of data to be transmitted, wherein the header information include priority tag and encryption identification, decryption mark, Any one in bright logical mark and discarding mark, and determined according to the priority tag that the header information includes described to be passed The priority of transmission of data.
9. device according to claim 8, which is characterized in that
The data channel arbitration unit, for judging that the data to be transmitted is with a upper data to be transmitted being read into It is no to be corresponding with identical priority, the upper data to be transmitted being read into is removed if so, determining and being selected The the first DMA data channel moved selects first DMA data channel institute right according to priority from the sequence of up to low circulation Next priority corresponding second DMA data channel of priority is answered to move the data to be transmitted, otherwise from institute It states and selects third DMA data channel pair corresponding with the priority of the data to be transmitted at least two DMA data channels The data to be transmitted is moved;
And/or
The data encrypting and deciphering unit, for being directed to each described data to be transmitted, if the data to be transmitted is described Header information includes the encryption identification, then the data to be transmitted is encrypted, and after being encrypted The data to be transmitted storage is to the second memory, if the header information of the data to be transmitted includes the solution Secret mark is known, then the data to be transmitted is decrypted, and the data to be transmitted storage after being decrypted To the second memory, if the header information of the data to be transmitted includes stating logical mark clearly, directly by institute Data to be transmitted storage is stated to the second memory, if the header information of the data to be transmitted includes the discarding Mark, then abandon the data to be transmitted.
10. according to the device any in claim 7 to 9, which is characterized in that further comprise: data random ordering is reset single Member;
The data random ordering rearrangement units pass through at least two DMA number through the data channel arbitration unit for judging Whether random ordering occurs according at least two data to be transmitted for belonging to same data group that channel is moved, if so, to described At least two data to be transmitted for belonging to same data group are resequenced.
CN201811114500.2A 2018-09-25 2018-09-25 A kind of data transmission method and device Pending CN109359069A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811114500.2A CN109359069A (en) 2018-09-25 2018-09-25 A kind of data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811114500.2A CN109359069A (en) 2018-09-25 2018-09-25 A kind of data transmission method and device

Publications (1)

Publication Number Publication Date
CN109359069A true CN109359069A (en) 2019-02-19

Family

ID=65351370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811114500.2A Pending CN109359069A (en) 2018-09-25 2018-09-25 A kind of data transmission method and device

Country Status (1)

Country Link
CN (1) CN109359069A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765059A (en) * 2019-09-29 2020-02-07 苏州浪潮智能科技有限公司 PCIE data priority management method and device
CN110928817A (en) * 2019-12-27 2020-03-27 广东电科院能源技术有限责任公司 Communication method, device and storage medium for double-core electric energy meter
CN112231735A (en) * 2020-11-02 2021-01-15 北京蜂窝科技有限公司 Data transmission method and system
WO2021203927A1 (en) * 2020-04-08 2021-10-14 华为技术有限公司 Data management apparatus, data management method, and data storage device
WO2022156370A1 (en) * 2021-01-20 2022-07-28 苏州浪潮智能科技有限公司 Fpga-based dma device and dma data migration method
CN114817098A (en) * 2022-04-28 2022-07-29 重庆大学 Perception data processing system and method
WO2023160639A1 (en) * 2022-02-24 2023-08-31 华为技术有限公司 Data processing method, direct memory access engine and computing device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1252912A (en) * 1997-04-24 2000-05-10 松下电器产业株式会社 Data transfer method
CN103299313A (en) * 2011-11-10 2013-09-11 株式会社理光 Transmission management apparatus, program, transmission management system, and transmission management method
CN103647807A (en) * 2013-11-27 2014-03-19 华为技术有限公司 Information caching method, device and communication apparatus
CN103714027A (en) * 2014-01-10 2014-04-09 浪潮(北京)电子信息产业有限公司 Data transmission method and device for direct memory access controller
CN103793342A (en) * 2012-11-02 2014-05-14 中兴通讯股份有限公司 Multichannel direct memory access (DMA) controller

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1252912A (en) * 1997-04-24 2000-05-10 松下电器产业株式会社 Data transfer method
CN103299313A (en) * 2011-11-10 2013-09-11 株式会社理光 Transmission management apparatus, program, transmission management system, and transmission management method
CN103793342A (en) * 2012-11-02 2014-05-14 中兴通讯股份有限公司 Multichannel direct memory access (DMA) controller
CN103647807A (en) * 2013-11-27 2014-03-19 华为技术有限公司 Information caching method, device and communication apparatus
CN103714027A (en) * 2014-01-10 2014-04-09 浪潮(北京)电子信息产业有限公司 Data transmission method and device for direct memory access controller

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765059A (en) * 2019-09-29 2020-02-07 苏州浪潮智能科技有限公司 PCIE data priority management method and device
CN110928817A (en) * 2019-12-27 2020-03-27 广东电科院能源技术有限责任公司 Communication method, device and storage medium for double-core electric energy meter
CN110928817B (en) * 2019-12-27 2021-06-08 南方电网电力科技股份有限公司 Communication method, device and storage medium for double-core electric energy meter
WO2021203927A1 (en) * 2020-04-08 2021-10-14 华为技术有限公司 Data management apparatus, data management method, and data storage device
CN112231735A (en) * 2020-11-02 2021-01-15 北京蜂窝科技有限公司 Data transmission method and system
WO2022156370A1 (en) * 2021-01-20 2022-07-28 苏州浪潮智能科技有限公司 Fpga-based dma device and dma data migration method
WO2023160639A1 (en) * 2022-02-24 2023-08-31 华为技术有限公司 Data processing method, direct memory access engine and computing device
CN114817098A (en) * 2022-04-28 2022-07-29 重庆大学 Perception data processing system and method

Similar Documents

Publication Publication Date Title
CN109359069A (en) A kind of data transmission method and device
CN110288094B (en) Model parameter training method and device based on federal learning
CN106446067A (en) Transaction data acquisition method and apparatus
CN107196900A (en) A kind of method and device for verification of knowing together
CN104468401B (en) A kind of message processing method and device
JP6104184B2 (en) Data encryption processing apparatus and method for cloud storage system
CN107707579A (en) Data encryption and transmission method
CN107294714A (en) Cryptographic key negotiation method, device and its equipment
CN103577266A (en) Method and system for distributing field programmable gate array (FPGA) resources
CN107256363A (en) A kind of high-speed encryption and decryption device being made up of encryption/decryption module array
CN107967291A (en) Journal entries clone method, device, computer equipment and storage medium
CN103473188B (en) Method, device and system for data interaction between digital signal processor (DSP) and external memory
CN106354795A (en) Distributed data exchanging system
CN105897737B (en) A kind of method of secure data exchange
CN106874781A (en) A kind of tables of data encryption method and server
CN107818013A (en) A kind of application scheduling method thereof and device
CN107181698A (en) The system and method for single queue multi-stream service shaping
CN107707577A (en) Multi-layer data encryption method based on encryption transmission system
CN112231735A (en) Data transmission method and system
CN104243348A (en) Data processing method and device
CN106650496A (en) Data processing method and device
CN105577363A (en) Extensible pipelined circuit aiming at SM4 cryptographic algorithm and implementation method thereof
CN114861204A (en) Big data information safe storage encryption system
CN104618231B (en) Deep packet identification method, device and system in the Wi-fi systems of high in the clouds
CN109800074A (en) Task data concurrently executes method, apparatus and electronic equipment

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: 20190219