CN110471747A - A kind of scheduling application method, device and the terminal device of DMA multichannel - Google Patents
A kind of scheduling application method, device and the terminal device of DMA multichannel Download PDFInfo
- Publication number
- CN110471747A CN110471747A CN201910597794.7A CN201910597794A CN110471747A CN 110471747 A CN110471747 A CN 110471747A CN 201910597794 A CN201910597794 A CN 201910597794A CN 110471747 A CN110471747 A CN 110471747A
- Authority
- CN
- China
- Prior art keywords
- channel
- dma channel
- dma
- working condition
- request
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000004891 communication Methods 0.000 claims abstract description 16
- 238000012545 processing Methods 0.000 claims description 41
- 238000004590 computer program Methods 0.000 claims description 21
- MHABMANUFPZXEB-UHFFFAOYSA-N O-demethyl-aloesaponarin I Natural products O=C1C2=CC=CC(O)=C2C(=O)C2=C1C=C(O)C(C(O)=O)=C2C MHABMANUFPZXEB-UHFFFAOYSA-N 0.000 claims description 15
- 238000004064 recycling Methods 0.000 claims description 8
- 238000012163 sequencing technique Methods 0.000 claims description 8
- 238000007599 discharging Methods 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000006399 behavior Effects 0.000 claims 1
- 238000007726 management method Methods 0.000 abstract description 11
- 238000005516 engineering process Methods 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 2
- 230000017260 vegetative to reproductive phase transition of meristem Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
Abstract
The present invention is suitable for field of communication technology, provides scheduling application method, device and the terminal device of a kind of DMA multichannel, and method includes: to obtain the number of DMA channel, and mark the working condition in each channel;Wherein, working condition includes occupied state or idle state, if getting the request of application DMA channel, then obtain the number for the DMA channel that working condition is idle state, if the number that working condition is the DMA channel of idle state, which is greater than or equal to, requests corresponding number, it is then the DMA channel of idle state according to the working condition that the request distributes corresponding number, and marking the working condition of assigned DMA channel is occupied state, controls the assigned DMA channel and handles business corresponding with the request.The present invention provides the management methods that a kind of centralized scheduling uses DMA channel resource, realize the United Dispatching distribution of DMA channel resource, reduce the time that DMA channel is in idle condition, improve the timeslice utilization rate of whole DMA channel resource.
Description
Technical field
The invention belongs to field of communication technology more particularly to a kind of scheduling application method, device and the terminals of DMA multichannel
Equipment.
Background technique
In modem computer systems, DMA (Direct memory Access, direct memory access) is provided in peripheral hardware
High speed data transfer between memory or between memory and memory, the intervention without CPU.Pass through DMA data
It can fast move, save cpu resource to do other operations.
As hardware technology continues to develop, DMAC (dma controller) generally has multiple logic DMA channels, each transmission
Channel can choose different source devices and different purpose equipments, the transmission between no longer dedicated two equipment of Mr. Yu.
However, management method of the modern operating system to hardware DMAC resource, is by using single DMA channel as dedicated
Resource, the business processing for single drive module.It above method inefficiency and takes a long time.
Summary of the invention
In view of this, the embodiment of the invention provides scheduling application method, device and the terminals of a kind of DMA multichannel to set
Standby, to solve, modern operating system is to the management method inefficiency of hardware DMAC resource in the prior art and what is taken a long time ask
Topic.
The first aspect of the embodiment of the present invention provides a kind of scheduling application method of DMA multichannel, comprising:
The number of DMA channel is obtained, and marks the working condition in each channel;Wherein, working condition includes occupied state
Or idle state;
If getting the request of application DMA channel, the number for the DMA channel that working condition is idle state is obtained;
If the number that working condition is the DMA channel of idle state, which is greater than or equal to, requests corresponding number, according to institute
Stating request and distributing the working condition of corresponding number is the DMA channel of idle state, and marks the work shape of assigned DMA channel
State is occupied state;
It controls the assigned DMA channel and handles business corresponding with the request.
Optionally, after the control assigned DMA channel processing business corresponding with the request, further includes:
Obtain the business processing status of the assigned DMA channel;
If the business processing status of the assigned DMA channel is that processing is completed, it is logical to discharge the assigned DMA
Road;
The assigned DMA channel is recycled, and markers work state is idle state;
It returns and executes the number for obtaining DMA channel, and mark the operation of the working condition in each channel.
Optionally, if the request for getting application DMA channel, it is logical to obtain the DMA that working condition is idle state
After the number in road, further includes:
If working condition is that the number of the DMA channel of idle state is less than the number of the corresponding DMA channel of request, root
The corresponding distribution DMA channel of time sequencing sent according to request, and the unallocated request to DMA channel is hung up;
When getting the DMA channel after discharging, the DMA channel after the release is distributed according to the request of hang-up.
Optionally, the DMA channel is the DMAC in 6 channels;
Optionally, the DMAC in 6 channel includes:
ETH ethernet channel, SPI serial communication channels, UART asynchronous serial communication channel, SD card channel, CAN bus are logical
Road and USB drive service channel.
The second aspect of the embodiment of the present invention provides a kind of scheduling use device of DMA multichannel, comprising:
Mark module for obtaining the number of DMA channel, and marks the working condition in each channel;Wherein, working condition
Including occupied state or idle state;
First obtains module, if the request for getting application DMA channel, obtaining working condition is idle state
The number of DMA channel;
First distribution module, if the number for the DMA channel that working condition is idle state is greater than or equal to request pair
The number answered, then be the DMA channel of idle state according to the working condition that the request distributes corresponding number, and marks and be assigned
DMA channel working condition be occupied state;
Control module handles business corresponding with the request for controlling the assigned DMA channel.
Optionally, described device, further includes:
Second obtains module, for obtaining the business processing status of the assigned DMA channel;
Release module, if the business processing status for the assigned DMA channel is that processing is completed, described in release
Assigned DMA channel;
Recycling module, for recycling the assigned DMA channel, and markers work state is idle state;
Return module executes the number for obtaining DMA channel for returning, and mark the working condition in each channel
Operation.
Optionally, described device further include:
Judgment module, if the number for the DMA channel that working condition is idle state is less than the corresponding DMA of request and leads to
The number in road, then the corresponding distribution DMA channel of the time sequencing sent according to request, and the unallocated request to DMA channel is hung
It rises;
Second distribution module, when for getting the DMA channel after discharging, after distributing the release according to the request of hang-up
DMA channel.
Optionally, the DMA channel is the DMAC in 6 channels;
Optionally, the DMAC in 6 channel includes:
ETH ethernet channel, SPI serial communication channels, UART asynchronous serial communication channel, SD card channel, CAN bus are logical
Road and USB drive service channel.
The third aspect of the embodiment of the present invention provides a kind of terminal device, comprising: memory, processor and is stored in
In the memory and the computer program that can run on the processor, when the processor executes the computer program
It realizes such as the step of the above method.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage
Media storage has computer program, realizes when the computer program is executed by processor such as the step of the above method.
The embodiment of the present invention marks the working condition in each channel, if getting application by the number of acquisition DMA channel
The request of DMA channel then obtains the DMA channel that working condition is idle state, and the work of corresponding number is distributed according to request
State is the DMA channel of idle state, and marking the working condition of assigned DMA channel is occupied state, is controlled assigned
Corresponding with the request business of DMA channel processing provides a kind of management method of centralized scheduling using DMA channel resource, reality
The United Dispatching distribution for having showed DMA channel resource, reduces the time that DMA channel is in idle condition, and improves whole DMA channel
The timeslice utilization rate of resource.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some
Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is the flow diagram of the scheduling application method for the DMA multichannel that the embodiment of the present invention one provides;
Fig. 2-5 is the flow chart of the management for 6 DMA channels that the embodiment of the present invention one provides;
Fig. 6 is that the time resource for the existing DMA channel resource management mode that the embodiment of the present invention one provides uses signal
Figure;
Fig. 7 is that the time resource of the scheduling application method for the DMA multichannel that the embodiment of the present invention one provides uses schematic diagram;
Fig. 8 is the flow diagram of the scheduling application method of DMA multichannel provided by Embodiment 2 of the present invention;
Fig. 9 is the flow diagram of the scheduling application method for the DMA multichannel that the embodiment of the present invention three provides;
Figure 10 is the structural schematic diagram of the scheduling use device for the DMA multichannel that the embodiment of the present invention four provides;
Figure 11 is the structural schematic diagram of the scheduling use device for the DMA multichannel that the embodiment of the present invention five provides;
Figure 12 is the structural schematic diagram of the scheduling use device for the DMA multichannel that the embodiment of the present invention six provides;
Figure 13 is the schematic diagram for the terminal device that the embodiment of the present invention seven provides.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical solution in the embodiment of the present invention are explicitly described, it is clear that described embodiment is the present invention one
The embodiment divided, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, should fall within the scope of the present invention.
Description and claims of this specification and term " includes " and their any deformations in above-mentioned attached drawing, meaning
Figure, which is to cover, non-exclusive includes.Such as process, method or system comprising a series of steps or units, product or equipment do not have
It is defined in listed step or unit, but optionally further comprising the step of not listing or unit, or optionally also wrap
Include the other step or units intrinsic for these process, methods, product or equipment.In addition, term " first ", " second " and
" third " etc. is for distinguishing different objects, not for description particular order.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one
As shown in Figure 1, the present embodiment provides a kind of scheduling application method of DMA multichannel, this method can be applied to as
The terminal devices such as mobile phone, PC, tablet computer.The scheduling application method of DMA multichannel provided by the present embodiment, comprising:
S101, the number for obtaining DMA channel, and mark the working condition in each channel;Wherein, working condition includes occupying
State or idle state.
In a particular application, the number of DMA channel in current system is obtained, and marks the working condition in each channel.Its
In, working condition includes occupied state or idle state.
In one embodiment, it can be marked by working condition of the array to each channel.
If S102, the request for getting application DMA channel obtain for the DMA channel that working condition is idle state
Number.
In a particular application, logical using DMA if getting the application that any one or more drive module is sent
The request in road then obtains the number for the DMA channel that the working condition under the current time in system is idle state.
If the number that S103, working condition are the DMA channel of idle state, which is greater than or equal to, requests corresponding number, root
According to the working condition that the request distributes corresponding number it is the DMA channel of idle state, and marks the work of assigned DMA channel
Making state is occupied state.
In a particular application, if working condition is corresponding more than or equal to requesting for the number of the DMA channel of idle state
Number, then the DMA channel number in current system is able to satisfy the drive module for sending above-mentioned request, according to request distribution corresponding
Several working conditions is the DMA channel of idle state to the drive module for sending above-mentioned request, and marks assigned DMA channel
Working condition be occupied state.
S104, the control assigned DMA channel handle business corresponding with the request.
In a particular application, it controls assigned DMA channel and handles business corresponding with request.Specifically, control is sent
The drive module of above-mentioned request handles business corresponding with request by assigned DMA channel.
In one embodiment, the DMA channel is the DMAC in 6 channels;
In one embodiment, the DMAC in 6 channel includes:
ETH ethernet channel, SPI serial communication channels, UART asynchronous serial communication channel, SD card channel, CAN bus are logical
Road and USB drive service channel.
In a particular application, DMA channel be 6 channels DMAC, wherein the DMAC in 6 channels include: ETH ethernet channel,
SPI serial communication channels, UART asynchronous serial communication channel, SD card channel, CAN bus channel and USB drive service channel.
As shown in Figure 2-5, the flow chart of the management of existing 6 DMA channels is illustratively illustrated.
Such as Fig. 6, the time resource for illustratively illustrating existing DMA channel resource management mode uses schematic diagram, it may be assumed that
Total time is T, by under m timeslice, the time resource service condition of existing DMA channel resource management mode.
According to Fig. 6, it will be seen that, each DMA channel is only capable of handling a kind of driving business, and a type of DMA channel is whole
It is independently occupied in the life cycle of a software systems operation by corresponding task type, a large amount of DMA timeslices is caused to waste.
Such as Fig. 7, the time resource for illustratively illustrating a kind of scheduling application method of DMA multichannel uses schematic diagram.
As can be seen from FIG. 6, it is originally intended to UART, SPI, when there are many DMA channels of CAN etc. relatively slow task processing
Between on piece free time.In Fig. 7, all timeslices are filled up by being inserted into other tasks at a slow speed.
As can be seen from FIG. 6, it is originally intended to ETH Ethernet reception task and has taken entire DMA channel.In Fig. 7, it is set specially
Door occupies a channel, to reduce the time of scheduling of resource application.It is used at full capacity so that the DMA timeslice in system reaches.
The present embodiment marks the working condition in each channel by the number of acquisition DMA channel, if getting application DMA
The request in channel then obtains the DMA channel that working condition is idle state, and the working condition of corresponding number is distributed according to request
For the DMA channel of idle state, marking the working condition of assigned DMA channel is occupied state, and it is logical to control assigned DMA
Processing corresponding with request business in road provides a kind of centralized scheduling using the management method of DMA channel resource, realizes
The United Dispatching of DMA channel resource distributes, and reduces the time that DMA channel is in idle condition, and improves whole DMA channel resource
Timeslice utilization rate.
Embodiment two
As shown in figure 8, the present embodiment is the further explanation to the method and step in embodiment one.In the present embodiment,
After step S104, comprising:
S105, the business processing status for obtaining the assigned DMA channel.
In a particular application, the business processing status of assigned DMA channel is obtained.Wherein, processing status includes but not
It is limited to armed state, present state handles completion status.
If the business processing status of S106, the assigned DMA channel is that processing is completed, discharge described assigned
DMA channel.
In a particular application, if the business processing status of assigned DMA channel is processing completion status, release is divided
The DMA channel matched.
If the business processing status of assigned DMA channel is present state, wait, until be assigned
The business processing status of DMA channel is updated to processing completion status, discharges assigned DMA channel.
S107, the recycling assigned DMA channel, and markers work state is idle state.
In a particular application, the assigned DMA channel after recycling release, and markers work state is idle state, with
It waits and executes new business processing operation according to new request.
S108, the number for executing the acquisition DMA channel is returned to, and marks the operation of the working condition in each channel.
In a particular application, the number for executing and obtaining DMA channel is returned, the working condition and later in each channel is marked
Operation carries out the request processing batch operation of a new round.
The present embodiment passes through the business processing status for obtaining assigned DMA channel in real time, and in assigned DMA channel
Business processing when completing, release DMA channel simultaneously recycles, and improves and dispatches the utilization rate and efficiency that use to DMA channel.
Embodiment three
As shown in figure 9, the present embodiment is the further explanation to the method and step in embodiment one.In the present embodiment,
After step S102, comprising:
If the number that S201, working condition are the DMA channel of idle state is less than of the corresponding DMA channel of request
Number, then the corresponding distribution DMA channel of the time sequencing sent according to request, and the unallocated request to DMA channel is hung up.
In a particular application, lead to if the number that working condition is the DMA channel of idle state is less than the corresponding DMA of request
The number in road, then the sequencing of the time sent according to request corresponding distribution DMA channel, and by the unallocated DMA channel that arrives
Request is hung up.For example, requesting of corresponding DMA channel if the number that working condition is the DMA channel of idle state is 5
Number is 7, then it is first 5 drive modules for sending request that the state of sharing out the work, which is DMA channel to the time sequencing of idle state, will
Sending time is that the request of the 6th cis-position and the 7th cis-position is hung up, and working condition is waited to be updated to the DMA channel of idle state.
S202, when getting the DMA channel after release, the DMA channel after the release is distributed according to the request of hang-up.
In a particular application, when getting the DMA channel after discharging, the working condition of the DMA channel after marking the release
For idle state, and according to the DMA channel after the request distribution release of hang-up, the drive module that control sends above-mentioned request passes through
Assigned DMA channel handles business corresponding with request.
The present embodiment, which passes through, hangs up the request being not assigned to, and obtains working condition in real time and is updated to idle state
DMA channel is simultaneously allocated, and improves the efficiency that distribution is scheduled to DMA channel.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Example IV
As shown in Figure 10, the present embodiment provides a kind of scheduling use devices 100 of DMA multichannel, for executing embodiment
Method and step in one.The scheduling use device 100 of DMA multichannel provided in this embodiment, comprising:
Mark module 101 for obtaining the number of DMA channel, and marks the working condition in each channel;Wherein, it works
State includes occupied state or idle state;
First obtains module 102, if the request for getting application DMA channel, obtains working condition as idle shape
The number of the DMA channel of state;
First distribution module 103, if the number for the DMA channel that working condition is idle state is greater than or equal to request
Corresponding number, then be the DMA channel of idle state according to the working condition that the request distributes corresponding number, and marks and divided
The working condition for the DMA channel matched is occupied state;
Control module 104 handles business corresponding with the request for controlling the assigned DMA channel.
Optionally, the DMA channel is the DMAC in 6 channels;
Optionally, the DMAC in 6 channel includes:
ETH ethernet channel, SPI serial communication channels, UART asynchronous serial communication channel, SD card channel, CAN bus are logical
Road and USB drive service channel.
The present embodiment marks the working condition in each channel by the number of acquisition DMA channel, if getting application DMA
The request in channel then obtains the DMA channel that working condition is idle state, and the working condition of corresponding number is distributed according to request
For the DMA channel of idle state, marking the working condition of assigned DMA channel is occupied state, and it is logical to control assigned DMA
Processing corresponding with request business in road provides a kind of centralized scheduling using the management method of DMA channel resource, realizes
The United Dispatching of DMA channel resource distributes, and reduces the time that DMA channel is in idle condition, and improves whole DMA channel resource
Timeslice utilization rate.
Embodiment five
As shown in figure 11, in the present embodiment, the scheduling use device 100 of the DMA multichannel in example IV further includes
For execute method and step in embodiment two with flowering structure:
Second obtains module 105, for obtaining the business processing status of the assigned DMA channel;
Release module 106 discharges if the business processing status for the assigned DMA channel is that processing is completed
The assigned DMA channel;
Recycling module 107, for recycling the assigned DMA channel, and markers work state is idle state;
Return module 108 executes the number for obtaining DMA channel for returning, and marks the work shape in each channel
The operation of state.
The present embodiment passes through the business processing status for obtaining assigned DMA channel in real time, and in assigned DMA channel
Business processing when completing, release DMA channel simultaneously recycles, and improves and dispatches the utilization rate and efficiency that use to DMA channel.
Embodiment six
As shown in figure 12, in the present embodiment, the scheduling use device 100 of the DMA multichannel in example IV further includes
For execute method and step in embodiment three with flowering structure:
Judgment module 201, if the number for the DMA channel that working condition is idle state is less than corresponding to request
The number of DMA channel, then the corresponding distribution DMA channel of the time sequencing sent according to request, and by unallocated asking to DMA channel
Ask hang-up;
Second distribution module 202 when for getting the DMA channel after discharging, is released according to the request of hang-up distribution
DMA channel after putting.
The present embodiment, which passes through, hangs up the request being not assigned to, and obtains working condition in real time and is updated to idle state
DMA channel is simultaneously allocated, and improves the efficiency that distribution is scheduled to DMA channel.
Embodiment seven
Figure 13 is the schematic diagram of terminal device provided in this embodiment.As shown in figure 13, the terminal device 13 of the embodiment
Include: processor 130, memory 131 and is stored in the memory 131 and can be run on the processor 130
Computer program 132, such as the scheduling of DMA multichannel use program.The processor 130 executes the computer program 132
Step in the scheduling application method embodiment of the above-mentioned each DMA multichannel of Shi Shixian, such as step S101 shown in FIG. 1 is extremely
S104.Alternatively, the processor 130 realizes each module in above-mentioned each Installation practice/mono- when executing the computer program 132
The function of member, such as the function of module 101 to 104 shown in Figure 10.
Illustratively, the computer program 132 can be divided into one or more module/units, it is one or
Multiple module/the units of person are stored in the memory 131, and are executed by the processor 130, to complete the present invention.Institute
Stating one or more module/units can be the series of computation machine program instruction section that can complete specific function, the instruction segment
For describing implementation procedure of the computer program 132 in the terminal device 13.For example, the computer program 132
It is as follows that mark module, the first acquisition module, the first distribution module and control module, each module concrete function can be divided into:
Mark module for obtaining the number of DMA channel, and marks the working condition in each channel;Wherein, working condition
Including occupied state or idle state;
First obtains module, if the request for getting application DMA channel, obtaining working condition is idle state
The number of DMA channel;
First distribution module, if the number for the DMA channel that working condition is idle state is greater than or equal to request pair
The number answered, then be the DMA channel of idle state according to the working condition that the request distributes corresponding number, and marks and be assigned
DMA channel working condition be occupied state;
Control module handles business corresponding with the request for controlling the assigned DMA channel.
The terminal device 13 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.The terminal device may include, but be not limited only to, processor 130, memory 131.It will be understood by those skilled in the art that
Figure 13 is only the example of terminal device 13, does not constitute the restriction to terminal device 13, may include more or more than illustrating
Few component perhaps combines certain components or different components, such as the terminal device can also be set including input and output
Standby, network access equipment, bus etc..
Alleged processor 130 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng.
The memory 131 can be the internal storage unit of the terminal device 13, such as the hard disk of terminal device 13
Or memory.The memory 131 is also possible to the External memory equipment of the terminal device 13, such as on the terminal device 13
The plug-in type hard disk of outfit, intelligent memory card (Smart Media Card, SMC), safe digital card (Secure Digital,
SD), flash card (Flash Card) etc..Further, the memory 131 can also be both interior including the terminal device 13
Portion's storage unit also includes External memory equipment.The memory 131 is for storing the computer program and the terminal
Other programs and data needed for equipment.The memory 131, which can be also used for temporarily storing, have been exported or will be defeated
Data out.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing
The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also
To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list
Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as
Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device
Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium
It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code
Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions
Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified
Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of scheduling application method of DMA multichannel characterized by comprising
The number of DMA channel is obtained, and marks the working condition in each channel;Wherein, working condition includes occupied state or sky
Not busy state;
If getting the request of application DMA channel, the number for the DMA channel that working condition is idle state is obtained;
If the number that working condition is the DMA channel of idle state, which is greater than or equal to, requests corresponding number, asked according to
Seeking the working condition for distributing corresponding number is the DMA channel of idle state, and marks the working condition of assigned DMA channel to be
Occupied state;
It controls the assigned DMA channel and handles business corresponding with the request.
2. the scheduling application method of DMA multichannel as described in claim 1, which is characterized in that the control assigned DMA
Channel is handled after business corresponding with the request, further includes:
Obtain the business processing status of the assigned DMA channel;
If the business processing status of the assigned DMA channel is that processing is completed, the assigned DMA channel is discharged;
The assigned DMA channel is recycled, and markers work state is idle state;
It returns and executes the number for obtaining DMA channel, and mark the operation of the working condition in each channel.
3. the scheduling application method of DMA multichannel as described in claim 1, which is characterized in that if described get application DMA
The request in channel, then obtain working condition be idle state DMA channel number after, further includes:
If working condition is that the number of the DMA channel of idle state is less than the number of the corresponding DMA channel of request, basis is asked
The corresponding distribution DMA channel of the time sequencing of transmission is sought, and the unallocated request to DMA channel is hung up;
When getting the DMA channel after discharging, the channel DMA after the release is distributed according to the request of hang-up.
4. the scheduling application method of DMA multichannel as described in claim 1, which is characterized in that the DMA channel is 6 channels
DMAC.
5. the scheduling application method of DMA multichannel as described in claim 1, which is characterized in that the DMAC packet in 6 channel
It includes:
ETH ethernet channel, SPI serial communication channels, UART asynchronous serial communication channel, SD card channel, CAN bus channel and
USB drives service channel.
6. a kind of scheduling use device of DMA multichannel characterized by comprising
Mark module for obtaining the number of DMA channel, and marks the working condition in each channel;Wherein, working condition includes
Occupied state or idle state;
First obtains module, if the request for getting application DMA channel, obtains the DMA that working condition is idle state
The number in channel;
First distribution module, if the number for the DMA channel that working condition is idle state is corresponding more than or equal to requesting
Number, then be the DMA channel of idle state according to the working condition that the request distributes corresponding number, and marks and be assigned
The working condition of DMA channel is occupied state;
Control module handles business corresponding with the request for controlling the assigned DMA channel.
7. the scheduling use device of DMA multichannel as claimed in claim 6, which is characterized in that further include:
Second obtains module, for obtaining the business processing status of the assigned DMA channel;
Release module discharges described divided if the business processing status for the assigned DMA channel is that processing is completed
The DMA channel matched;
Recycling module, for recycling the assigned DMA channel, and markers work state is idle state;
Return module executes the number for obtaining DMA channel for returning, and marks the behaviour of the working condition in each channel
Make.
8. the scheduling use device of DMA multichannel as claimed in claim 6, which is characterized in that further include:
Judgment module, if the number for the DMA channel that working condition is idle state is less than the corresponding DMA channel of request
Number, then the corresponding distribution DMA channel of the time sequencing sent according to request, and the unallocated request to DMA channel is hung up;
Second distribution module, when for getting the DMA channel after discharging, after distributing the release according to the request of hang-up
DMA channel.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor
The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 5 when executing the computer program
The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists
In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910597794.7A CN110471747A (en) | 2019-07-04 | 2019-07-04 | A kind of scheduling application method, device and the terminal device of DMA multichannel |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910597794.7A CN110471747A (en) | 2019-07-04 | 2019-07-04 | A kind of scheduling application method, device and the terminal device of DMA multichannel |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110471747A true CN110471747A (en) | 2019-11-19 |
Family
ID=68506807
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910597794.7A Pending CN110471747A (en) | 2019-07-04 | 2019-07-04 | A kind of scheduling application method, device and the terminal device of DMA multichannel |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110471747A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112748880A (en) * | 2021-01-14 | 2021-05-04 | 苏州浪潮智能科技有限公司 | IO channel balance control method and device in storage system and readable storage medium |
CN114598414A (en) * | 2022-05-09 | 2022-06-07 | 荣耀终端有限公司 | Time slice configuration method and electronic equipment |
CN117331702A (en) * | 2023-10-31 | 2024-01-02 | 中科驭数(北京)科技有限公司 | Request distribution method, request distribution device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6898646B1 (en) * | 2000-05-03 | 2005-05-24 | Hewlett-Packard Development Company, L.P. | Highly concurrent DMA controller with programmable DMA channels |
US20110022767A1 (en) * | 2009-07-27 | 2011-01-27 | Electronics And Telecommunications Research Institute | Dma controller with interrupt control processor |
CN104123252A (en) * | 2013-04-26 | 2014-10-29 | 韩国科亚电子股份有限公司 | Multi-channel direct memory access controller and control method thereof |
CN104461674A (en) * | 2013-09-18 | 2015-03-25 | 联想(北京)有限公司 | Data processing method and electronic device |
-
2019
- 2019-07-04 CN CN201910597794.7A patent/CN110471747A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6898646B1 (en) * | 2000-05-03 | 2005-05-24 | Hewlett-Packard Development Company, L.P. | Highly concurrent DMA controller with programmable DMA channels |
US20110022767A1 (en) * | 2009-07-27 | 2011-01-27 | Electronics And Telecommunications Research Institute | Dma controller with interrupt control processor |
CN104123252A (en) * | 2013-04-26 | 2014-10-29 | 韩国科亚电子股份有限公司 | Multi-channel direct memory access controller and control method thereof |
CN104461674A (en) * | 2013-09-18 | 2015-03-25 | 联想(北京)有限公司 | Data processing method and electronic device |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112748880A (en) * | 2021-01-14 | 2021-05-04 | 苏州浪潮智能科技有限公司 | IO channel balance control method and device in storage system and readable storage medium |
CN112748880B (en) * | 2021-01-14 | 2023-01-10 | 苏州浪潮智能科技有限公司 | IO channel balance control method and device in storage system and readable storage medium |
CN114598414A (en) * | 2022-05-09 | 2022-06-07 | 荣耀终端有限公司 | Time slice configuration method and electronic equipment |
CN114598414B (en) * | 2022-05-09 | 2022-09-27 | 荣耀终端有限公司 | Time slice configuration method and electronic equipment |
CN117331702A (en) * | 2023-10-31 | 2024-01-02 | 中科驭数(北京)科技有限公司 | Request distribution method, request distribution device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110471747A (en) | A kind of scheduling application method, device and the terminal device of DMA multichannel | |
CN110162388A (en) | A kind of method for scheduling task, system and terminal device | |
CN104794100A (en) | Heterogeneous multi-core processing system based on on-chip network | |
CN108228354A (en) | Dispatching method, system, computer equipment and medium | |
CN109533756A (en) | A kind of storage method of substrate, device and warehouse control system | |
CN104331321A (en) | Cloud computing task scheduling method based on tabu search and load balancing | |
CN110046038A (en) | A kind of task processing method and device based on thread pool | |
CN104461737B (en) | A kind of EMS memory management process and device | |
CN109495542A (en) | Load allocation method and terminal device based on performance monitoring | |
CN109343972A (en) | Task processing method and terminal device | |
CN103136047A (en) | Multithreading management method and framework | |
CN106598727A (en) | Computation resource distribution method and system for communication system | |
CN104125166A (en) | Queue scheduling method and computing system | |
CN108399136A (en) | A kind of control method of serial line interface, device and host | |
CN107396445A (en) | A kind of information reporting dispatching method, system, host device and slave devices | |
CN109840141A (en) | Thread control method, device, electronic equipment and storage medium based on cloud monitoring | |
CN115562846A (en) | Resource scheduling method and device and computing node | |
CN110505655A (en) | Data command processing method, storage medium and bluetooth shield | |
CN108536527A (en) | A kind of method for scheduling task and device of embedded software | |
CN107229591A (en) | Multi-serial communication method and device | |
CN108121596A (en) | Data transmission method and device, storage medium, electronic equipment | |
CN111831452A (en) | Task execution method and device, storage medium and electronic device | |
CN105474732A (en) | Device control method, device and system under centralized baseband pool architecture | |
CN109542615A (en) | A kind of implementation method, device and the terminal device of variable node generic queue | |
CN206331335U (en) | Computer motherboard and computer |
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: 20191119 |