CN114936173B - Read-write method, device, equipment and storage medium of eMMC device - Google Patents
Read-write method, device, equipment and storage medium of eMMC device Download PDFInfo
- Publication number
- CN114936173B CN114936173B CN202210684491.0A CN202210684491A CN114936173B CN 114936173 B CN114936173 B CN 114936173B CN 202210684491 A CN202210684491 A CN 202210684491A CN 114936173 B CN114936173 B CN 114936173B
- Authority
- CN
- China
- Prior art keywords
- read
- write
- emmc
- mode
- dma
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000007717 exclusion Effects 0.000 claims description 21
- 238000002955 isolation Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 16
- 238000012545 processing Methods 0.000 claims description 8
- 238000004806 packaging method and process Methods 0.000 claims description 6
- 238000013507 mapping Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000010187 selection method Methods 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 235000003642 hunger Nutrition 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000037351 starvation Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
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
- 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/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1668—Details of memory controller
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The invention discloses a read-write method, a read-write device, read-write equipment and a storage medium of an eMMC device. The method comprises the following steps: configuring a read-write mode of an eMMC device and a pre-designed eMMC read-write scheduler, wherein the read-write mode comprises a CPU cache read-write mode and a DMA read-write mode; when the eMMC read-write scheduler acquires an eMMC read-write request, a CPU cache read-write mode or a DMA read-write mode is called to realize the read-write operation of the eMMC device. By configuring the read-write mode of the eMMC device and a pre-designed eMMC read-write scheduler, different read-write modes can be called to carry out read-write operation on the eMMC device according to read-write requests, the read-write speed can be greatly improved due to the adoption of cache when the CPU cache read-write mode is called, the CPU does not need to be occupied when the DMA read-write mode is called, CPU resources are saved, and efficient read-write of the eMMC device is realized under the condition that resources are reserved for other services in the system.
Description
Technical Field
The invention relates to the technical field of integrated circuits, in particular to a read-write method, a device, equipment and a storage medium of an eMMC device.
Background
An Embedded multimedia controller (eMMC) consists of an Embedded storage solution with an MMC interface, a flash memory device and a host controller.
When a current microkernel operating system reads and writes an eMMC device, a CPU (central processing unit) is used for reading and writing data by operating a memory address, and the memory operates the eMMC device through an MMC interface.
However, program instructions run by the CPU are in the DDR memory, so that the CPU needs to execute a large number of instructions when reading and writing the eMMC device, and each instruction needs to access the DDR memory, which not only reduces the reading and writing speed of the eMMC device, but also affects normal operation of other services of the microkernel operating system because a large amount of CPU resources in the microkernel operating system are occupied.
Disclosure of Invention
The invention provides a read-write method, a device, equipment and a storage medium of an eMMC device, which are used for realizing efficient read-write of the eMMC device.
According to an aspect of the present invention, there is provided a method for reading and writing an eMMC device, including: configuring a read-write mode of an eMMC device and a pre-designed eMMC read-write scheduler, wherein the read-write mode comprises a CPU cache read-write mode and a DMA read-write mode;
and when the eMMC read-write scheduler acquires an eMMC read-write request, calling the CPU cache read-write mode or the DMA read-write mode to realize the read-write operation of the eMMC device.
According to another aspect of the present invention, there is provided a read/write apparatus for an eMMC device, including:
the eMMC device comprises a configuration module, a data processing module and a control module, wherein the configuration module is used for configuring a read-write mode of an eMMC device and a pre-designed eMMC read-write scheduler, and the read-write mode comprises a CPU cache read-write mode and a DMA read-write mode;
and the eMMC device read-write module is used for calling the CPU cache read-write mode or the DMA read-write mode to realize the read-write operation of the eMMC device when the eMMC read-write scheduler acquires an eMMC read-write request.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method according to any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium having stored thereon computer instructions for causing a processor to execute a method according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, the read-write mode of the eMMC device and the pre-designed eMMC read-write scheduler are configured, so that different read-write modes can be called to carry out read-write operation on the eMMC device according to read-write requests, the cache is adopted when the CPU cache read-write mode is called, the read-write speed can be greatly improved, the CPU is not occupied when the DMA read-write mode is called, the CPU resource is saved, and the efficient read-write of the eMMC device is realized under the condition that resources are reserved for other services in the system.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a read-write method for an eMMC device according to an embodiment of the present invention;
fig. 2 is an application framework diagram of a read/write method for an eMMC device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a preconfigured eMMC device scheduler according to an embodiment of the present invention;
fig. 4 is a flowchart of a read-write method of an eMMC device according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a read-write apparatus for an eMMC device according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a read-write method for an eMMC device according to an embodiment of the present invention, where this embodiment is applicable to a case of reading from and writing to an eMMC device in a microkernel operating system, and the method may be executed by a read-write apparatus for an eMMC device according to an embodiment of the present invention, where the read-write apparatus may be implemented in hardware and/or software, and the apparatus may be configured in an electronic device. As shown in fig. 1, the method includes:
and step S101, configuring a read-write mode of the eMMC device and a pre-designed eMMC read-write scheduler.
Optionally, configuring a read-write mode of the eMMC device includes: configuring a drive of an eMMC device, and enabling all memory operations of an eMMC program to be cached; and configuring the drive of the eMMC device, and mapping the memory address of the eMMC operation to the DMA.
Optionally, configuring a drive of the eMMC device, and after enabling Cache of all memory operations of the eMMC program, further includes: determining a current instruction executed by a CPU in a memory; and transferring the specified number of target instructions related to the current instruction from the memory into the Cache.
Specifically, the read/write modes in this embodiment include a CPU cache read/write mode and a DMA read/write mode. As shown in fig. 2, which is an application framework diagram of the present embodiment, when configuring a drive of an eMMC device, specifically, an enable _ Cache () in an eMMC driver, so that all memory operations of the eMMC program are Cache enabled. And when the memory contains 100 instructions, the current instruction executed by the CPU in the memory is determined to be the 11 th instruction, and under the condition that the capacity of the Cache is 10 instructions, the 11 th to 21 th instructions are taken as target instructions to be transferred to the Cache from the memory, so that the configuration of the read-write mode of the CPU Cache is realized. In addition, when the drive of the eMMC device is configured, the Memory address of the eMMC operation is mapped into Direct Memory Access (DMA), so that the configuration of a DMA read-write mode is realized, and the Access to the eMMC device is directly realized through the DMA according to the mapping relation without occupying the Memory.
Fig. 3 is a schematic structural diagram of a preconfigured eMMC read-write scheduler, which specifically includes an API module providing a read-write interface for a user, a CPU mode read-write module for calling a CPU cache read-write mode, a DMA mode read-write module for calling a DMA read-write mode, an eMMC drive initialization module, and an eMMC resource isolation mutual exclusion module. The eMMC drive initialization module is used for initializing an eMMC drive so as to provide interfaces corresponding to different read-write modes, and the eMMC resource isolation mutual exclusion module is used for isolating mutual exclusion of resources of the eMMC device and ensuring that no conflict occurs when the eMMC device is read and written by adopting different read-write modes.
It should be noted that the API module for providing a Read-Write interface for a user mainly includes an eMMC Read-Write function, for example, a Read function eMMC _ Read () or a Write function eMMC _ Write (), and at the same time, also configures a Read-Write duty configuration file eMMC _ qos.
Optionally, configuring an eMMC read-write scheduler includes: a CPU mode read-write interface and a DMA mode read-write interface for accessing the eMMC device are provided through the drive of the eMMC device; and performing read-write packaging on the CPU mode read-write interface through the CPU mode read-write module, and performing read-write packaging on the DMA mode read-write interface through the DMA mode read-write module.
Optionally, the pre-designed eMMC read-write scheduler further includes: the eMMC resource isolation mutual exclusion module; when an eMMC read-write scheduler is configured, a read-write proportion configuration file which is configured in advance is called, and the read-write proportion configuration file comprises read-write modes matched with each address resource in an eMMC device; and performing isolation and mutual exclusion operation on resources under each address in the eMMC device through the eMMC resource isolation and mutual exclusion module based on the read-write proportion configuration file.
Specifically, when the system is determined to be powered on and started, the eMMC resource isolation and mutual exclusion module is used for carrying out isolation and mutual exclusion operation on resources under various addresses in the eMMC device based on the read-write proportion configuration file. For example, the read-write mode matched with the resource 1 at the address x in the eMMC device included in the read-write duty configuration file is a CPU cache read-write mode, and the read-write mode matched with the resource 2 at the address y is a DMA read-write mode. Isolating and mutually exclusive the resource 1 and the resource 2 through the eMMC resource isolation and mutual exclusion module according to the read-write proportion configuration file, namely configuring the eMMC device, so that only a CPU cache read-write mode can be adopted for the resource 1 under the address x, and the read-write operation on the resource 1 under the address x cannot be realized when a DMA read-write mode is adopted; similarly, only a DMA read-write mode can be adopted for the resource 2 at the address y, and when a CPU cache read-write mode is adopted, the read-write operation on the resource 2 at the address y cannot be realized. In addition, the drive of the eMMC device is initialized through the eMMC drive initialization module so as to provide interfaces corresponding to different modes for accessing the eMMC device, for example, a CPU cache read-write mode interface and a DMA read-write mode interface.
And step S102, when the eMMC read-write scheduler acquires the eMMC read-write request, calling a CPU cache read-write mode or a DMA read-write mode to realize the read-write operation on the eMMC device.
Optionally, when the eMMC read-write scheduler obtains the eMMC read-write request, the CPU cache read-write mode or the DMA read-write mode is called, including: when receiving an eMMC read-write request input by a user through an API module, extracting a read-write address of an eMMC device from the eMMC read-write request; inquiring a read-write proportion configuration file according to the read-write address, and determining a read-write mode matched with resources under the read-write address; and calling a CPU cache read-write mode or a DMA read-write mode according to the matched read-write mode.
In a specific implementation, a Read initial address x input by a user and a Read data request with a Read-write length of 2 are received through an eMMC _ Read () function in a user operation API module, read addresses x1 and x2 of an eMMC device are extracted from the Read-write request, a Read-write duty configuration file is queried according to the Read-write addresses, and a Read-write mode matched with resources at the Read address is determined to be a DMA Read-write mode.
In a specific implementation, when the read-write mode is determined to be the CPU cache read-write mode, the CPU cache read-write mode interface is called by the CPU mode read-write module in the eMMC read-write scheduler, and the read-write request is sent to the CPU through the CPU cache read-write mode interface. For example, when the read data request includes a read initial address x and the read-write length is 2, the CPU executes a first row of instruction "send the read data request to the eMMC device" from the cache, and when the CPU obtains a response from the eMMC device, continues to access a second instruction "read initial address data" in the cache and send the read initial address data "to the eMMC device, receives a resource 1 at the x1 address fed back by the eMMC device, and writes the resource 1 into the memory; and then continuing to access a third instruction in the cache, namely reading next address data after the initial address, sending the third instruction to the eMMC device, receiving a resource 2 under the x2 address fed back by the eMMC device, and writing the resource 2 into the memory. Of course, the embodiment is only an example of the read operation, and the principle of the write operation is substantially the same as the above operation, and the details are not repeated in the embodiment.
It should be noted that the cache in this embodiment is used for dynamically transferring instructions from the memory, and when one instruction in the cache is executed completely, new instructions are sequentially transferred from the memory to the cache, so that the CPU only needs to access the cache without accessing the memory when executing a program instruction, thereby improving the read-write efficiency of the eMMC device.
In another specific implementation, when the read-write mode is determined to be the DMA read-write mode, the DMA read-write mode interface is called by the DMA read-write module, the read-write request is sent to the DMA unit through the DMA read-write mode interface, and the read-write operation on the eMMC device is directly executed through the DMA unit. For example, when the read data request includes a read initial address x and the read-write length is 2, the CPU directly sends the read data request to the eMMC device, and writes the resource 1 at the x1 address and the resource 2 at the x2 address fed back by the eMMC device into the memory, so that when the eMMC reads data in a DMA read-write mode, the DMA is used to read data from the peripheral to the memory, and the CPU does not need to participate, thereby saving the resources of the CPU. Of course, in this embodiment, only the read operation is taken as an example, and when data is written to the eMMC device, the data of the eMMC device is written in a manner of "from the memory to the peripheral" using DMA.
It is worth mentioning that the eMMC device is read and written by combining the two read-write modes through the scheduling coordination of the eMMC read-write scheduler, so that the read-write of the optimal and most efficient eMMC equipment is realized on the premise of reserving system resources for other services under the condition that other services are not influenced in a microkernel system.
According to the embodiment of the application, by configuring the read-write mode of the eMMC device and the pre-designed eMMC read-write scheduler, different read-write modes can be called to carry out read-write operation on the eMMC device according to read-write requests, the read-write speed can be greatly improved due to the adoption of the cache when the CPU cache read-write mode is called, the CPU does not need to be occupied when the DMA read-write mode is called, CPU resources are saved, and efficient read-write of the eMMC device is realized under the condition that resources are reserved for other services in the system.
Example two
Fig. 4 is a flowchart of a read-write method for an eMMC device according to a second embodiment of the present invention, where this embodiment is based on the foregoing embodiment, and after the read-write operation on the eMMC device is implemented in different read-write manners, the method further includes detecting a read-write operation result of the eMMC device, where the method includes:
step S201, configuring a read-write mode of the eMMC device and a pre-designed eMMC read-write scheduler.
Optionally, configuring a read-write mode of the eMMC device includes: configuring a drive of an eMMC device, and enabling all memory operations of an eMMC program to be cached; and configuring the drive of the eMMC device, and mapping the memory address of the eMMC operation to the DMA.
Optionally, configuring a drive of the eMMC device, and after enabling Cache of all memory operations of the eMMC program, further includes: determining a current instruction executed by a CPU in a memory; and transferring the specified number of target instructions related to the current instruction from the memory into the Cache.
Optionally, configuring an eMMC read-write scheduler includes: a CPU mode read-write interface and a DMA mode read-write interface for accessing the eMMC device are provided through the drive of the eMMC device; and performing read-write packaging on the CPU mode read-write interface through the CPU mode read-write module, and performing read-write packaging on the DMA mode read-write interface through the DMA mode read-write module.
Optionally, the pre-designed eMMC read-write scheduler further includes: an eMMC resource isolation mutual exclusion module; when an eMMC read-write scheduler is configured, a pre-configured read-write proportion configuration file is called, and the read-write proportion configuration file comprises read-write modes matched with each address resource in an eMMC device; and performing isolation and mutual exclusion operation on resources under each address in the eMMC device through the eMMC resource isolation and mutual exclusion module based on the read-write proportion configuration file.
Step S202, when the eMMC read-write scheduler obtains the eMMC read-write request, a CPU cache read-write mode or a DMA read-write mode is called to realize the read-write operation of the eMMC device.
Optionally, when the eMMC read-write scheduler obtains the eMMC read-write request, the CPU cache read-write mode or the DMA read-write mode is called, including: when receiving an eMMC read-write request input by a user through an API module, extracting a read-write address of an eMMC device from the eMMC read-write request; inquiring a read-write proportion configuration file according to the read-write address, and determining a read-write mode matched with resources under the read-write address; and calling a CPU cache read-write mode or a DMA read-write mode according to the matched read-write mode.
In step S203, the read/write operation result of the eMMC device is detected.
Specifically, in this embodiment, after performing a read/write operation on the eMMC device in a different manner, the read/write operation result of the eMMC device is detected, for example, when it is determined that the performed operation is to write data into the eMMC device, the eMMC device is detected, and it is determined that the write operation result on the eMMC device is abnormal if it is found that data resources at each address in the eMMC device have not changed before and after the write operation is performed. The reason for the exception may be that a hardware structure DMA unit, a CPU, or a memory in the microkernel system may fail, or that information transmission is invalid due to network interrupt, or that a scheduler software configuration manner is incorrect. It is to be understood that this embodiment is merely an example, and the specific cause of the abnormality is not limited.
When the read-write operation result is detected to determine the abnormality, an alarm is given to prompt a user, so that the user is informed to timely overhaul hardware or software according to the alarm prompt, and the read-write efficiency and accuracy of the eMMC device are further improved.
According to the embodiment of the application, the read-write mode of the eMMC device and the designed eMMC read-write scheduler are configured, so that different read-write modes can be called to carry out read-write operation on the eMMC device according to read-write requests, the read-write speed can be greatly improved due to the adoption of the cache when the CPU cache read-write mode is called, the CPU does not need to be occupied when the DMA read-write mode is called, CPU resources are saved, and efficient read-write of the eMMC device is realized under the condition that resources are reserved for other services in the system. And the read-write operation result of the eMMC device is detected, and alarm prompt is carried out under the condition of abnormal starvation, so that a user can conveniently and timely overhaul, and the read-write efficiency and accuracy of the eMMC device are further improved.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a read/write apparatus for an eMMC device according to a third embodiment of the present invention, and as shown in fig. 5, the apparatus includes: a configuration module 310 and an eMMC device read-write module 320.
The configuration module 310 is configured to configure a read-write mode of the eMMC device and a pre-designed eMMC read-write scheduler, where the read-write mode includes a CPU cache read-write mode and a DMA read-write mode;
the eMMC device read-write module 320 is configured to call a CPU cache read-write mode or a DMA read-write mode when the eMMC read-write scheduler obtains an eMMC read-write request, so as to implement a read-write operation on the eMMC device.
Optionally, the configuration module is configured to configure a drive of the eMMC device, and enable all memory operations of the eMMC program to a Cache;
and configuring the drive of the eMMC device, and mapping the memory address of the eMMC operation to the DMA.
Optionally, the pre-designed eMMC read-write scheduler includes: the system comprises an API module for providing a read-write interface for a user, a CPU mode read-write module for calling a CPU cache read-write mode and a DMA mode read-write module for calling a DMA read-write mode.
Optionally, the pre-designed eMMC read-write scheduler further includes: an eMMC resource isolation mutual exclusion module;
the configuration module is further used for calling a pre-configured read-write proportion configuration file when the eMMC read-write scheduler is configured, wherein the read-write proportion configuration file comprises read-write modes matched with each address resource in the eMMC device;
and performing isolation and mutual exclusion operation on resources under each address in the eMMC device through the eMMC resource isolation and mutual exclusion module based on the read-write proportion configuration file.
Optionally, the eMMC device read-write module is configured to extract a read-write address of the eMMC device from the eMMC read-write request when the eMMC read-write request input by the user is received through the API module;
inquiring a read-write proportion configuration file according to the read-write address, and determining a read-write mode matched with resources under the read-write address;
and calling a CPU cache read-write mode or a DMA read-write mode according to the matched read-write mode.
Optionally, the apparatus further includes an instruction cache module, configured to determine a current instruction executed by the CPU in the memory;
and transferring the specified number of target instructions related to the current instruction from the memory into the Cache.
The tower crane control device provided by the embodiment of the invention can execute the task selection method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 6 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the read-write method of the eMMC device.
In some embodiments, the task selection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the task selection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the read-write method of the eMMC device by any other suitable means (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (9)
1. A method for reading and writing an eMMC device is characterized by comprising the following steps:
configuring a read-write mode of an eMMC device and a pre-designed eMMC read-write scheduler, wherein the read-write mode comprises a CPU cache read-write mode and a DMA read-write mode;
when the eMMC read-write scheduler acquires an eMMC read-write request, the CPU cache read-write mode or the DMA read-write mode is called to realize the read-write operation on the eMMC device;
wherein, the pre-designed eMMC read-write scheduler includes: an eMMC resource isolation mutual exclusion module;
when the eMMC read-write scheduler is configured, a pre-configured read-write proportion configuration file is called, wherein the read-write proportion configuration file comprises read-write modes matched with each address resource in the eMMC device;
and performing isolation and mutual exclusion operation on resources under each address in the eMMC device through the eMMC resource isolation and mutual exclusion module based on the read-write proportion configuration file.
2. The method of claim 1, wherein configuring read and write modes of the eMMC device comprises:
configuring a drive of the eMMC device, and enabling all memory operations of an eMMC program to be cached;
and configuring the drive of the eMMC device, and mapping the memory address of the eMMC operation to the DMA.
3. The method of claim 1, wherein the pre-designed eMMC read-write scheduler comprises: the system comprises an API module for providing a read-write interface for a user, a CPU mode read-write module for calling a CPU cache read-write mode and a DMA mode read-write module for calling a DMA read-write mode.
4. The method of claim 3, wherein configuring the eMMC read-write scheduler comprises:
the method comprises the steps that a CPU mode read-write interface and a DMA mode read-write interface for accessing an eMMC device are provided through driving of the eMMC device;
and performing read-write packaging on the CPU mode read-write interface through the CPU mode read-write module, and performing read-write packaging on the DMA mode read-write interface through the DMA mode read-write module.
5. The method of claim 3 or 4, wherein invoking the CPU cache read-write mode or the DMA read-write mode when the eMMC read-write scheduler obtains the eMMC read-write request comprises:
when receiving an eMMC read-write request input by a user through the API module, extracting a read-write address of an eMMC device from the eMMC read-write request;
inquiring the read-write proportion configuration file according to the read-write address, and determining a read-write mode matched with the resource under the read-write address;
and calling the CPU cache read-write mode or the DMA read-write mode according to the matched read-write mode.
6. The method of claim 1, wherein configuring the driver of the eMMC device further comprises, after enabling Cache for all memory operations of an eMMC program:
determining a current instruction executed by a CPU in a memory;
and transferring the specified number of target instructions related to the current instruction from the memory to the Cache.
7. A read-write apparatus for an eMMC device, comprising:
the eMMC device comprises a configuration module, a data processing module and a control module, wherein the configuration module is used for configuring a read-write mode of an eMMC device and a pre-designed eMMC read-write scheduler, and the read-write mode comprises a CPU cache read-write mode and a DMA read-write mode;
the eMMC device read-write module is used for calling the CPU cache read-write mode or the DMA read-write mode when the eMMC read-write scheduler acquires an eMMC read-write request so as to realize the read-write operation of the eMMC device;
the pre-designed eMMC read-write scheduler comprises: an eMMC resource isolation mutual exclusion module; the configuration module is further configured to, when configuring the eMMC read-write scheduler, invoke a pre-configured read-write duty configuration file, where the read-write duty configuration file includes read-write modes matched with address resources in the eMMC device; and performing isolation and mutual exclusion operation on resources under each address in the eMMC device through the eMMC resource isolation and mutual exclusion module based on the read-write proportion configuration file.
8. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A computer-readable storage medium, having stored thereon computer instructions for causing a processor, when executed, to implement the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210684491.0A CN114936173B (en) | 2022-06-16 | 2022-06-16 | Read-write method, device, equipment and storage medium of eMMC device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210684491.0A CN114936173B (en) | 2022-06-16 | 2022-06-16 | Read-write method, device, equipment and storage medium of eMMC device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114936173A CN114936173A (en) | 2022-08-23 |
CN114936173B true CN114936173B (en) | 2023-03-31 |
Family
ID=82867959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210684491.0A Active CN114936173B (en) | 2022-06-16 | 2022-06-16 | Read-write method, device, equipment and storage medium of eMMC device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114936173B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116225345B (en) * | 2023-05-08 | 2023-08-11 | 珠海妙存科技有限公司 | Data storage method, controller and readable storage medium of eMMC |
CN116383091B (en) * | 2023-05-29 | 2023-08-29 | 珠海妙存科技有限公司 | Starting method and starting device of eMMC verification platform and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101685450A (en) * | 2008-09-27 | 2010-03-31 | 比亚迪股份有限公司 | Method for realizing function of database in embedded operation system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8296467B2 (en) * | 2000-01-06 | 2012-10-23 | Super Talent Electronics Inc. | Single-chip flash device with boot code transfer capability |
US10025735B2 (en) * | 2013-01-31 | 2018-07-17 | Seagate Technology Llc | Decoupled locking DMA architecture |
CN103631534B (en) * | 2013-11-12 | 2017-01-11 | 北京兆芯电子科技有限公司 | Data storage system and managing method thereof |
KR102238652B1 (en) * | 2014-11-12 | 2021-04-09 | 삼성전자주식회사 | Data storage devce, method thereof, and method for operating data processing system having the same |
CN107710175B (en) * | 2015-04-20 | 2021-12-14 | 奈特力斯股份有限公司 | Memory module and operating system and method |
US11086808B2 (en) * | 2019-11-25 | 2021-08-10 | Micron Technology, Inc. | Direct memory access (DMA) commands for noncontiguous source and destination memory addresses |
-
2022
- 2022-06-16 CN CN202210684491.0A patent/CN114936173B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101685450A (en) * | 2008-09-27 | 2010-03-31 | 比亚迪股份有限公司 | Method for realizing function of database in embedded operation system |
Also Published As
Publication number | Publication date |
---|---|
CN114936173A (en) | 2022-08-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114936173B (en) | Read-write method, device, equipment and storage medium of eMMC device | |
CN113934464A (en) | Method and device for starting android application in Linux system and electronic equipment | |
US20110219373A1 (en) | Virtual machine management apparatus and virtualization method for virtualization-supporting terminal platform | |
CN113849312A (en) | Data processing task allocation method and device, electronic equipment and storage medium | |
CN113835887B (en) | Video memory allocation method and device, electronic equipment and readable storage medium | |
CN114564435A (en) | Inter-core communication method, device and medium for heterogeneous multi-core chip | |
CN112905314A (en) | Asynchronous processing method and device, electronic equipment, storage medium and road side equipment | |
CN113986497B (en) | Queue scheduling method, device and system based on multi-tenant technology | |
CN115617451A (en) | Data processing method and data processing device | |
CN115756322A (en) | Data storage method and device, electronic equipment and storage medium | |
CN116243983A (en) | Processor, integrated circuit chip, instruction processing method, electronic device, and medium | |
CN115390992A (en) | Virtual machine creating method, device, equipment and storage medium | |
CN115469866A (en) | Page rendering method and device of applet, electronic device and storage medium | |
CN115964166A (en) | Resource allocation method, device, equipment and storage medium | |
CN115729742A (en) | Error processing method and device, electronic equipment and storage medium | |
CN115237574A (en) | Scheduling method and device of artificial intelligence chip and electronic equipment | |
CN114386577A (en) | Method, apparatus, and storage medium for executing deep learning model | |
CN113986134A (en) | Method for storing data, method and device for reading data | |
CN116579914B (en) | Execution method and device of graphic processor engine, electronic equipment and storage medium | |
CN117009000A (en) | Component, method, device, apparatus and medium for operating open source buddha system | |
CN115599307B (en) | Data access method, device, electronic equipment and storage medium | |
CN118132001A (en) | Data processing method, data processing system, chip, device and medium | |
CN114416359A (en) | Virtual memory processing method and device, electronic equipment and storage medium | |
CN115309568A (en) | Method, device, equipment and medium for realizing multi-process file sharing | |
CN115268790A (en) | Data reading and writing method and device, electronic equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |