CN113076070A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN113076070A
CN113076070A CN202110623389.5A CN202110623389A CN113076070A CN 113076070 A CN113076070 A CN 113076070A CN 202110623389 A CN202110623389 A CN 202110623389A CN 113076070 A CN113076070 A CN 113076070A
Authority
CN
China
Prior art keywords
command
state
executed
commands
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110623389.5A
Other languages
Chinese (zh)
Inventor
柳阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Niuxin Semiconductor Shenzhen Co ltd
Original Assignee
Niuxin Semiconductor Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Niuxin Semiconductor Shenzhen Co ltd filed Critical Niuxin Semiconductor Shenzhen Co ltd
Priority to CN202110623389.5A priority Critical patent/CN113076070A/en
Publication of CN113076070A publication Critical patent/CN113076070A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data processing method and device. The method comprises the following steps: acquiring the state of a read-write state machine in a double-rate synchronous dynamic random access memory; acquiring a designated command corresponding to a state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block aimed at by the designated command in the double-rate synchronous dynamic random access memory; selecting a command to be executed aiming at a target block from commands to be selected except for processing the specified command; the command to be executed is executed to process the data in the target block, the times of block switching when the command to be executed in the double-rate synchronous dynamic random access memory is executed are reduced, the waiting time spent on block switching is saved, and the data processing efficiency is improved.

Description

Data processing method and device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a data processing method and apparatus.
Background
Inside a Double Data Rate (DDR) memory, there is usually a command queue for buffering and controlling read and write commands accessing the DDR. The command queue is usually a queue that is in and out of order, and command execution is messy, which affects read-write efficiency of the DDR.
Disclosure of Invention
The application aims to provide a data processing method and device, which can improve data processing efficiency to a certain extent.
According to an aspect of an embodiment of the present application, there is provided a data processing method, including: acquiring the state of a read-write state machine in a double-rate synchronous dynamic random data memory; acquiring a designated command corresponding to the state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block to which the designated command in the double-rate synchronous dynamic random access memory aims; selecting a command to be executed for the target block from commands to be selected except the specified command; and executing the command to be executed so as to process the data in the target block.
According to an aspect of an embodiment of the present application, there is provided a data processing apparatus including: the state acquisition module is configured to acquire the state of a read-write state machine in the double-rate synchronous dynamic random data memory; a command acquisition module configured to acquire a designated command corresponding to the state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block in the double-rate synchronous dynamic random access memory to which the designated command is directed; the selecting module is configured to select a command to be executed for the target block from commands to be selected except the specified command; and the execution module is configured to execute the command to be executed so as to process the data in the target block.
In an embodiment of the present application, based on the foregoing solution, the selecting module is further configured to: counting the number of the commands to be executed which are continuously selected and aim at the target block, and taking the number as a first number; and if the first quantity reaches a first quantity threshold value, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the reselected assigned command corresponding to the state is directed at other blocks except the target block in the double-rate synchronous dynamic random data memory.
In an embodiment of the application, based on the foregoing solution, the specified command includes a command type of the specified command, and before the command to be executed is executed, the selecting module is further configured to: and selecting commands to be executed of the same type as the command type of the specified command from the commands to be selected except the specified command.
In an embodiment of the present application, based on the foregoing solution, the selecting module is further configured to: counting the number of the commands to be executed which are continuously selected and have the same type as the command type of the specified command, and taking the number as a second number; and if the second number reaches a second set threshold, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the command type of the appointed command corresponding to the reselected state of the read-write state machine is different from the command type of the command continuously selecting the second number of commands to be executed.
In an embodiment of the application, based on the foregoing solution, the command type includes a read type or a write type, and the obtaining module is further configured to: and responding to a power-on instruction of the state machine, and setting the state of the state machine to be a state corresponding to the read type.
In an embodiment of the application, based on the foregoing scheme, before obtaining the designated command corresponding to the state selected by the double-data-rate-synchronous dynamic random access memory in the commands to be selected, the selecting module is further configured to: and selecting a designated command corresponding to the state of the state machine from the commands to be selected stored in the command group corresponding to the state of the state machine by adopting a polling scheduling method.
In an embodiment of the application, based on the foregoing solution, after selecting the specific command corresponding to the state of the state machine, the selecting module is further configured to: and deleting the specified command corresponding to the state of the state machine from the command group corresponding to the state of the state machine.
In an embodiment of the application, based on the foregoing solution, before selecting the specific command corresponding to the state of the state machine, the selecting module is further configured to: acquiring a control command; analyzing the control command to obtain the command to be selected; and storing the commands to be selected corresponding to the same state in the same command group.
In an embodiment of the application, based on the foregoing solution, the control command includes a control command type and an address targeted by the control command, and the execution module is configured to: determining a block to which the control command is directed as a block to which the command to be executed is directed based on the address; taking the control command type as the command type of the command to be selected; and combining the block to which the command to be selected is directed and the command type of the command to be selected to obtain the command to be selected.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in the technical solutions provided by some embodiments of the present application, the state of a read/write state machine in a double-rate synchronous dynamic random access memory is obtained; acquiring a designated command corresponding to a state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block aimed at by the designated command in the double-rate synchronous dynamic random access memory; selecting a command to be executed aiming at a target block from commands to be selected except for a specified command; the command to be executed is executed to process the data in the target block, the times of block switching when the command to be executed in the double-rate synchronous dynamic random access memory is executed are reduced, the waiting time spent on block switching is saved, and the data processing efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
Fig. 2 schematically shows a flow chart of a data processing method according to an embodiment of the application.
FIG. 3 schematically shows a schematic diagram of a command queue according to an embodiment of the present application.
FIG. 4 schematically shows a schematic diagram of a state machine control command set according to one embodiment of the present application.
FIG. 5 schematically shows a read-write control state machine diagram according to an embodiment of the application.
Fig. 6 schematically shows a block diagram of a data processing device according to an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a schematic diagram of an exemplary system architecture 100 to which the technical solutions of the embodiments of the present application can be applied.
As shown in fig. 1, the system architecture 100 may include a Double Data Rate (DDR) memory 101, a network 102, and a controller 103. Network 102 is used to provide a medium for a communication link between double rate synchronous dynamic random access memory 101 and controller 103. Network 102 may include various types of connections, such as wired communication links, wireless communication links, and so forth, which are not limiting in this application.
It should be understood that the number of double rate synchronous dynamic random access memories 101, networks 102 and controllers 103 in fig. 1 is merely illustrative. There may be any number of double rate synchronous dynamic random access memories 101, networks 102 and controllers 103, as desired for an implementation. For example, the controller 103 may be, but is not limited to, a console, a server, a client, or the like.
In one embodiment of the present application, the controller 103 obtains the state of the read/write state machine in the double rate synchronous dynamic random access memory 101; acquiring a designated command corresponding to a state selected by the double-rate synchronous dynamic random access memory 101 in a command to be selected, wherein the designated command indicates a target block targeted by the designated command in the double-rate synchronous dynamic random access memory 101; selecting a command to be executed aiming at a target block from commands to be selected except for a specified command; the command to be executed is executed to process the data in the target block, so that the times of block switching when the command to be executed in the double-rate synchronous dynamic random access memory 101 is executed are reduced, the waiting time spent on block switching is saved, and the data processing efficiency is improved.
It should be noted that the data processing method provided in the embodiment of the present application is generally executed by the controller 103, and accordingly, the data processing apparatus is generally disposed in the controller 103. However, in other embodiments of the present application, the double data rate sdram 101 may also have a similar function to the controller 103, so as to perform the data processing method provided by the embodiments of the present application.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 2 schematically shows a flowchart of a data processing method according to an embodiment of the present application, where an execution subject of the data processing method may be an upper computer, such as the controller 103 shown in fig. 1.
Referring to fig. 2, the data processing method at least includes steps S210 to S240, which are described in detail as follows:
in step S210, the state of the read/write state machine in the double rate synchronous dynamic random access memory is obtained.
In an embodiment of the present application, a state machine, a command group, and a block are stored in a DDR sdram, the block stored in the DDR sdram is called a DDR (Double Data Rate) ram block, and only Data in one Rank can be accessed at a time, where the block is used for storing Data and the command group is used for storing a command to be selected. The state of a read/write state machine in the double-rate synchronous dynamic random access memory can be read and obtained, the double-rate synchronous dynamic random access memory selects a command to be selected from a command group according to the state of the state machine, the selected command to be selected is executed on a block, and data in the block is processed, wherein the number of the blocks can be multiple, the number of the states of the state machine can be multiple, the number of the command groups can be multiple, and each command group can have at least one command to be selected.
In one embodiment of the present application, the command to be selected in the double data rate synchronous dynamic random access memory may include a read command, a write command, or the like, wherein the command type of the command to be selected may be a read type, a write type, or the like.
In one embodiment of the present application, a control command may be obtained; the control command is analyzed to obtain a command to be selected, where the control command may be a control command from the controller 103 received by the ddr sdram, the control command includes a control command type and an address to which the control command is directed, and the control command may be a control command received by the controller 103 and used for reading data in a certain address.
In one embodiment of the present application, the control command types may include a read type, a write type, and the like.
In this embodiment, the process of analyzing the control command to obtain the command to be selected may include: determining a block to which the control command aims as a block to which the command is to be selected, based on the address to which the control command aims; taking the control command type as the command type of the command to be selected; and combining the blocks targeted by the commands to be selected and the command types of the commands to be selected to obtain the commands to be selected, wherein the combination mode can be splicing.
With reference to fig. 2, in step S220, a designated command corresponding to a state selected by the ddr sdram in the to-be-selected command is obtained, where the designated command indicates a target block to which the designated command in the ddr sdram is directed.
In one embodiment of the present application, each command to be selected in the command group corresponds to a state in the state machine, and a state in the state machine may correspond to one or more commands to be selected. Each command group may correspond to one state, commands to be selected corresponding to the same state may all be in one command group, or commands to be selected corresponding to the same state may all be in multiple command groups, and commands to be selected in the multiple command groups all correspond to the same state, so as to facilitate selection of the designated command.
In an embodiment of the application, before a specific command corresponding to a state is selected from the commands to be selected, the commands to be selected corresponding to the same state may be stored in the same command group, so as to facilitate the selection of the specific command.
In an embodiment of the present application, a command to be selected may be randomly selected from a command group corresponding to a state as a designated command, and a block to which the designated command is directed is used as a target block, for example, if the state of a read/write state machine in a double data rate synchronous dynamic random access memory is a read block 0 state, the double data rate synchronous dynamic random access memory randomly selects a read block 0 command as the designated command from the command group corresponding to the read block 0 state in the command to be selected, and uses the block 0 as the target block.
In an embodiment of the present application, a round-robin scheduling method may be adopted to select a specific command corresponding to the state of the state machine from commands to be selected stored in a command group corresponding to the state of the state machine.
With continued reference to fig. 2, in step S230, a command to be executed for the target block is selected among commands to be selected other than the designated command.
In an embodiment of the present application, the state machine may have a plurality of states, and the plurality of states may respectively correspond to different blocks, or some of the plurality of states may correspond to the same block. One command to be selected may be randomly selected from one or more command groups corresponding to the target block as a command to be executed.
In an embodiment of the present application, after the designated command corresponding to the state of the state machine is obtained, the designated command corresponding to the state of the state machine may be deleted from the command group corresponding to the state of the state machine, so as to facilitate subsequent obtaining of the command to be executed, and to avoid repeatedly executing the same command.
In an embodiment of the present application, the selected command to be selected may be subjected to invalidation, the command to be selected that is not subjected to invalidation in the command group corresponding to the state is taken as an effective command, and an effective command may be randomly selected from the effective commands in the command group corresponding to the state as a command to be executed, so as to avoid repeatedly executing the same command.
In step S240, a command to be executed is executed to process the data in the target block.
In one embodiment of the present application, if the command to be executed is a read command for a target block, a read operation is performed on the target block; and if the command to be executed is a write command for the target block, performing write operation on the target block.
In the embodiment of fig. 2, the state of the read/write state machine in the double rate synchronous dynamic random access memory is obtained; acquiring a designated command corresponding to a state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block aimed at by the designated command in the double-rate synchronous dynamic random access memory; selecting a command to be executed aiming at a target block from commands to be selected except for a specified command; the command to be executed is executed to process the data in the target block, the times of block switching when the command to be executed in the double-rate synchronous dynamic random access memory is executed are reduced, the waiting time spent on block switching is saved, and the data processing efficiency is improved.
In an embodiment of the present application, the data processing method may further include: counting the number of the commands to be executed aiming at the target block, which are continuously selected, as a first number; and if the first quantity reaches a first quantity threshold value, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the appointed command corresponding to the reselected state aims at other blocks except the target block in the double-rate synchronous dynamic random access memory.
In this embodiment, not only the waiting time spent on switching the blocks is saved, but also the target block can be prevented from being read too much, and data blocking caused by that other blocks except the target block cannot be read all the time is avoided.
In an embodiment of the present application, the time of the command to be executed for the target block, which is continuously selected, may be counted as the first time; and if the first time reaches a first time threshold, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the appointed command corresponding to the reselected state aims at other blocks except the target block in the double-rate synchronous dynamic random access memory to prevent the target block from being read for too long, and the other blocks except the target block cannot be read all the time to cause data blocking.
In an embodiment of the application, the designated command includes a command type of the designated command, and a command to be executed of the same type as the command type of the designated command can be selected from commands to be selected except the designated command, so as to reduce waiting time spent on switching command types as much as possible, further save time, and reduce waste of bandwidth.
In an embodiment of the present application, the number of commands to be executed of the same type as the command type of the designated command, which are continuously selected, may be counted as the second number; and if the second number reaches a second set threshold, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the command type of the appointed command corresponding to the reselected state of the read-write state machine is different from the command type of the command which continuously selects the second number of commands to be executed.
In the embodiment, not only the waiting time spent on switching the command types is considered to be saved, but also excessive commands to be executed of the same type as the command type of the specified command can be prevented from being executed, and data blocking caused by the fact that other command types except the command type of the specified command cannot be executed all the time is avoided.
In an embodiment of the present application, the time of the command to be executed, which is continuously selected and has the same type as the command type of the specified command, may be counted as the second time; and if the second time reaches a second set threshold, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the command type of the appointed command corresponding to the reselected state of the read-write state machine is different from the command type of the command to be executed continuously at the second time.
In this embodiment, not only the saving of the waiting time taken for switching the command type is taken into consideration, but also the command to be executed of the same type as that of the specified command can be prevented from being executed for too long, and the command types other than the command type of the specified command can not be executed all the time, resulting in data blocking.
In an embodiment of the present application, in response to a power-on instruction of the state machine, the state of the state machine may be set to a state corresponding to a read type or a write state, so as to determine a first state of the state machine after power-on.
In this embodiment, the first state of the state machine after power-on is determined as the read state, which can avoid data loss caused by writing data into a full memory when the data storage in the double-data-rate synchronous dynamic random access memory is full.
In one embodiment of the present application, a state quantity threshold may be set for each state to control the switching of the states.
An embodiment of selecting a command to be executed by applying the Data processing method of the present application is described as follows, in which two blocks (Data RANK) are used: the command type to be selected includes a read type and a write type, for example, the read command or the write command for the block 0 or the block 1 is parsed from the command unit for storing the command to be selected, and the parsing method may be decoding. Decoding to obtain: read bank 0 (rd _ cs 0), read bank 1 (rd _ cs 1), write bank 0 (wr _ cs 0), and write bank 1 (wr _ cs 1). And a read-write control state machine consisting of four states is arranged outside the command queue to schedule which command to be selected is preferentially executed.
FIG. 3 schematically shows a schematic diagram of a command queue according to an embodiment of the present application, where the command queue in FIG. 3 contains n +1 command units, i.e., the depth of the command queue is n + 1. The larger the depth of the command queue is, the larger the space for the read-write control state machine to dispatch is, and the DDR access efficiency is improved. Each command unit in the command queue outputs four to-be-selected commands rd _ cs0, rd _ cs1, wr _ cs0 and wr _ cs1, and stores the four to-be-selected commands into four groups of command groups, as shown in fig. 4, each group has n +1 to-be-selected commands of the same kind, the four groups of command groups correspond to rd _ cs0, rd _ cs1, wr _ cs0 and wr _ cs1, the four groups of command groups are controlled by a read-write control state machine, and fig. 4 schematically illustrates a schematic diagram of a state machine control command group according to an embodiment of the present application.
FIG. 5 schematically shows a read-write control state machine diagram according to an embodiment of the application. The state machine comprises four states, namely READ _ CS0, READ _ CS1, WRITE _ CS0 and WRITE _ CS1, which can be switched under the control of the controller. The command corresponding to the state of READ _ CS0 is rd _ CS0, the command corresponding to the state of READ _ CS1 is rd _ CS1, the command corresponding to the state of WRITE _ CS0 is wr _ CS0, and the command corresponding to the state of WRITE _ CS1 is wr _ CS 1. In order to prevent the command number of continuous reading or writing from being too large, which leads to the other command being blocked for too long, a second set threshold value max _ rd _ wr _ cnt is introduced, which represents the maximum number of commands of the same type to be executed continuously, which is allowed by the read-write control state machine. In order to prevent the excessive number of commands for reading and writing the same block continuously, which results in the blocking time of the access command of another block being too long, a first number threshold max _ rank _ access _ cnt of a control parameter is introduced, which represents the maximum number of continuous reading and writing the same block allowed by the read/write control state machine.
In this embodiment, if the current state of the READ/write state machine is READ _ CS0, the obtained designated command is rd _ CS0, and the conditions for jumping to other states are as follows:
A1) and if the commands of rd _ CS0 exist in the commands to be selected, the continuous reading quantity is less than max _ rd _ wr _ cnt, and the continuous execution quantity of rd _ CS0 is less than max _ rank _ access _ cnt, the state is still kept in the READ _ CS0 state, and rd _ CS0 is selected as the commands to be executed.
A2) And if the condition of A1) is not met, the continuous reading quantity is less than max _ rd _ wr _ cnt, the rd _ CS0 quantity is greater than max _ rank _ access _ cnt, and the commands to be selected comprise rd _ CS1 commands, jumping to the state of READ _ CS1, and selecting rd _ CS1 as the commands to be executed.
A3) And if the conditions of A1) and A2) are not met, the continuous reading quantity is larger than max _ rd _ wr _ cnt, the number of rd _ CS0 is larger than max _ rank _ access _ cnt, and the commands to be selected comprise wr _ CS1 commands, jumping to a WRITE _ CS1 state, and selecting wr _ CS1 as the commands to be executed.
A4) And if A1), A2) and A3) are not met, the continuous reading quantity is larger than max _ rd _ wr _ cnt, the rd _ CS0 quantity is larger than max _ rank _ access _ cnt, no command of wr _ CS1 exists in the to-be-selected commands, and a command of wr _ CS0 exists in the to-be-selected commands, jumping to a WRITE _ CS0 state, and selecting wr _ CS0 as the to-be-executed commands.
In this embodiment, if the current state is READ _ CS1, the obtained designated command is rd _ CS1, and the conditions for jumping to other states are as follows:
B1) and if the commands of rd _ CS1 exist in the commands to be selected, the continuous reading quantity is less than max _ rd _ wr _ cnt, and the continuous reading quantity of rd _ CS1 is less than max _ rank _ access _ cnt, the state is still kept in the READ _ CS1, and rd _ CS1 is selected as the commands to be executed.
B2) And if the condition of B1) is not met, the continuous reading amount is less than max _ rd _ wr _ cnt, the rd _ CS1 number is more than max _ rank _ access _ cnt, and the commands to be selected comprise rd _ CS0 commands, jumping to the state of READ _ CS0, and selecting rd _ CS0 as the commands to be executed.
B3) And if the conditions of B1) and B2) are not met, the continuous reading amount is larger than max _ rd _ wr _ cnt, the rd _ CS1 number is larger than max _ rank _ access _ cnt, and the commands to be selected comprise wr _ CS0 commands, jumping to a WRITE _ CS0 state, and selecting wr _ CS0 as the commands to be executed.
B4) And if B1), B2) and B3) are not met, the continuous reading amount is larger than max _ rd _ wr _ cnt, the continuous rd _ CS1 number is larger than max _ rank _ access _ cnt, no command of wr _ CS0 exists in the commands to be selected, and a command of wr _ CS1 exists in the commands to be selected, jumping to a WRITE _ CS1 state, and selecting wr _ CS1 as the command to be executed.
In this embodiment, if the current state is WRITE _ CS0, the obtained designated command is wr _ CS0, and the conditions for jumping to other states are as follows:
C1) and if the commands to be selected comprise the commands of wr _ CS0, the continuous writing quantity is less than max _ rd _ wr _ cnt, and the continuous execution quantity of wr _ CS0 is less than max _ rank _ access _ cnt, the state is still kept in the WRITE _ CS0, and wr _ CS0 is selected as the commands to be executed.
C2) And if the condition of C1) is not met, the number of continuous WRITEs is less than max _ rd _ wr _ cnt, the number of continuous executions of wr _ CS0 is greater than max _ rank _ access _ cnt, and the commands to be selected comprise wr _ CS1 commands, jumping to a WRITE _ CS1 state, and selecting wr _ CS1 as the commands to be executed.
C3) And if the conditions of C1) and C2) are not met, the number of continuous writes is larger than max _ rd _ wr _ cnt, the number of continuously executed wr _ CS0 is larger than max _ rank _ access _ cnt, and the command of rd _ CS1 is selected to be selected, the state of the READ _ CS1 is jumped to, and rd _ CS1 is selected as the command to be executed.
C4) And if C1), C2) and C3) are not met, the number of continuous writes is larger than max _ rd _ wr _ cnt, the number of continuously executed wr _ CS0 is larger than max _ rank _ access _ cnt, no command rd _ CS1 exists in the to-be-selected commands, and a command rd _ CS0 exists in the to-be-selected commands, jumping to a READ _ CS0 state, and selecting rd _ CS0 as the to-be-executed commands.
In this embodiment, if the current state is WRITE _ CS1, the obtained designated command is wr _ CS1, and the conditions for jumping to other states are as follows:
D1) and if the commands to be selected comprise the commands of wr _ CS1, the continuous writing quantity is less than max _ rd _ wr _ cnt, and the continuous execution quantity of wr _ CS1 is less than max _ rank _ access _ cnt, the state is still kept in the WRITE _ CS1, and wr _ CS1 is selected as the commands to be executed.
D2) And if the condition of D1) is not met, the number of continuous WRITEs is less than max _ rd _ wr _ cnt, the number of continuously executed wr _ CS1 is greater than max _ rank _ access _ cnt, and the command to be selected comprises a wr _ CS0 command, jumping to a WRITE _ CS0 state, and selecting wr _ CS0 as the command to be executed.
D3) And if the conditions of D1) and D2) are not met, the number of continuous writes is larger than max _ rd _ wr _ cnt, the number of wr _ CS1 is larger than max _ rank _ access _ cnt, and the commands with rd _ CS0 are continuously executed, jumping to the state of READ _ CS0, and selecting rd _ CS0 as the commands to be executed.
D4) And if D1), D2) and D3) are not met, the number of continuous writes is larger than max _ rd _ wr _ cnt, the number of wr _ CS1 is larger than max _ rank _ access _ cnt, no command of rd _ CS0 exists in the to-be-selected commands, and a command of rd _ CS1 exists in the to-be-selected commands, jumping to a READ _ CS1 state, and selecting rd _ CS1 as the to-be-executed commands.
Referring again to fig. 4, a diagram of the correspondence between the read/write control state machine and the command queue is shown. Rd _ cs0_0 … rd _ cs0_ n, rd _ cs1_0 … rd _ cs1_ n, wr _ cs0_0 … wr _ cs0_ n and wr _ cs1_0 … wr _ cs1_ n output by all the command units in the command queue are divided into four groups of command groups, and the command groups can store commands to be selected. When the current state of the READ-write control state machine is READ _ CS0, selecting an effective command rd _ CS0_ x in a command group where rd _ CS0 is located to send; when the current state of the READ-write control state machine is READ _ CS1, selecting an effective command rd _ CS1_ x in a command group where rd _ CS1 is located to send; when the current state of the read-WRITE control state machine is WRITE _ CS0, selecting an effective command wr _ CS0_ x in a command group where wr _ CS0 is located to send; when the current state of the read-WRITE control state machine is WRITE _ CS1, selecting the valid command wr _ CS1_ x in the command group where wr _ CS1 is located to send.
According to the embodiment, read-write switching and different block access switching are realized as few as possible, so that DDR access efficiency is improved, and bandwidth utilization rate is improved. The invention takes the read-write access of two blocks as an example, if there are four blocks, a read-write control state machine with 16 states of 2 to the power of 4 is needed to control the read-write command output.
The following describes embodiments of an apparatus of the present application, which may be used to perform the data processing method in the above-described embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the data processing method described above in the present application.
Fig. 6 schematically shows a block diagram of a data processing device according to an embodiment of the present application.
Referring to fig. 6, a data processing apparatus 600 according to an embodiment of the present application includes a status acquiring module 601, a command acquiring module 602, a selecting module 603, and an executing module 604.
According to an aspect of the embodiment of the present application, based on the foregoing solution, the state obtaining module 601 is configured to obtain a state of a read/write state machine in a double-rate synchronous dynamic random access memory; the command obtaining module 602 is configured to obtain a designated command corresponding to a state selected by the ddr sdram in a command to be selected, where the designated command indicates a target block in the ddr sdram to which the designated command is directed; the selecting module 603 is configured to select a command to be executed for the target block from commands to be selected except for the specified command; the execution module 604 is configured to execute the command to be executed to process the data in the target block.
In an embodiment of the present application, based on the foregoing solution, the selecting module 603 is further configured to: counting the number of the commands to be executed aiming at the target block, which are continuously selected, as a first number; and if the first quantity reaches a first quantity threshold value, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the appointed command corresponding to the reselected state aims at other blocks except the target block in the double-rate synchronous dynamic random access memory.
In an embodiment of the application, based on the foregoing solution, the specified command includes a command type of the specified command, and before the command to be executed is executed, the selecting module 603 is further configured to: and selecting the commands to be executed with the same type as the command type of the specified command from the commands to be selected except for the specified command.
In an embodiment of the present application, based on the foregoing solution, the selecting module 603 is further configured to: counting the number of the commands to be executed which are continuously selected and have the same type as the command type of the specified command, and taking the number as a second number; and if the second number reaches a second set threshold, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the command type of the appointed command corresponding to the reselected state of the read-write state machine is different from the command type of the command which continuously selects the second number of commands to be executed.
In an embodiment of the application, based on the foregoing solution, the command type includes a read type or a write type, and the status obtaining module 601 is further configured to: and responding to a power-on instruction of the state machine, and setting the state of the state machine to be the state corresponding to the read type.
In an embodiment of the application, based on the foregoing scheme, before obtaining the designated command corresponding to the state selected by the double-rate synchronous dynamic random access memory in the commands to be selected, the selecting module 603 is further configured to: and selecting a designated command corresponding to the state of the state machine from the commands to be selected stored in the command group corresponding to the state of the state machine by adopting a polling scheduling method.
In an embodiment of the present application, based on the foregoing solution, after selecting the specific command corresponding to the state of the state machine, the selecting module 603 is further configured to: the designated command corresponding to the state of the state machine is deleted from the group of commands corresponding to the state of the state machine.
In an embodiment of the present application, based on the foregoing solution, before selecting the specific command corresponding to the state of the state machine, the selecting module 603 is further configured to: acquiring a control command; analyzing the control command to obtain a command to be selected; and storing the commands to be selected corresponding to the same state in the same command group.
In an embodiment of the present application, based on the foregoing solution, the control command includes a control command type and an address to which the control command is directed, and the execution module 604 is configured to: determining a block to which the control command aims as a block to which the command is to be selected based on the address; taking the control command type as the command type of the command to be selected; and combining the block to which the command to be selected is directed and the command type of the command to be selected to obtain the command to be executed.
While the present application has been described with reference to several exemplary embodiments, it is understood that the terminology used is intended to be in the nature of words of description and illustration, rather than of limitation. As the present application may be embodied in several forms without departing from the spirit or essential characteristics thereof, it should also be understood that the above-described embodiments are not limited by any of the details of the foregoing description, but rather should be construed broadly within its spirit and scope as defined in the appended claims, and therefore all changes and modifications that fall within the meets and bounds of the claims, or equivalences of such meets and bounds are therefore intended to be embraced by the appended claims.

Claims (10)

1. A data processing method, comprising:
acquiring the state of a read-write state machine in a double-rate synchronous dynamic random access memory;
acquiring a designated command corresponding to the state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block to which the designated command in the double-rate synchronous dynamic random access memory aims;
selecting a command to be executed for the target block from commands to be selected except the specified command;
and executing the command to be executed so as to process the data in the target block.
2. The data processing method of claim 1, wherein the method further comprises:
counting the number of the commands to be executed which are continuously selected and aim at the target block, and taking the number as a first number;
and if the first quantity reaches a first quantity threshold value, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the appointed command corresponding to the reselected state aims at other blocks except the target block in the double-rate synchronous dynamic random access memory.
3. The data processing method according to claim 1, wherein the specified command includes a command type of the specified command, and before executing the command to be executed, the method further comprises:
and selecting commands to be executed of the same type as the command type of the specified command from the commands to be selected except the specified command.
4. The data processing method of claim 3, wherein the method further comprises:
counting the number of the commands to be executed which are continuously selected and have the same type as the command type of the specified command, and taking the number as a second number;
and if the second number reaches a second set threshold, changing the state of the read-write state machine, and reacquiring the state of the read-write state machine to reselect the command to be executed according to the state, wherein the command type of the appointed command corresponding to the reselected state of the read-write state machine is different from the command type of the command continuously selecting the second number of commands to be executed.
5. The data processing method of claim 3, wherein the command type comprises a read type or a write type, the method further comprising:
and responding to a power-on instruction of the state machine, and setting the state of the state machine to be a state corresponding to the read type.
6. The data processing method according to claim 1, wherein before acquiring the designated command corresponding to the state selected by the double data rate synchronous dynamic random access memory in the commands to be selected, the method comprises:
and selecting a designated command corresponding to the state of the state machine from the commands to be selected stored in the command group corresponding to the state of the state machine by adopting a polling scheduling method.
7. The data processing method of claim 6, wherein after selecting a specified command corresponding to the state of the state machine, the method comprises:
and deleting the specified command corresponding to the state of the state machine from the command group corresponding to the state of the state machine.
8. The data processing method of claim 6, wherein prior to selecting the specified command corresponding to the state of the state machine, the method comprises:
acquiring a control command;
analyzing the control command to obtain the command to be selected;
and storing the commands to be selected corresponding to the same state in the same command group.
9. The data processing method according to claim 8, wherein the control command includes a control command type and an address targeted by the control command, and the analyzing the control command to obtain the command to be selected includes:
determining a block to which the control command is directed as a block to which the command to be selected is directed based on the address;
taking the control command type as the command type of the command to be selected;
and combining the block to which the command to be selected is directed and the command type of the command to be selected to obtain the command to be selected.
10. A data processing apparatus, comprising:
the state acquisition module is configured to acquire the state of a read-write state machine in the double-rate synchronous dynamic random access memory;
a command acquisition module configured to acquire a designated command corresponding to the state selected by the double-rate synchronous dynamic random access memory in a command to be selected, wherein the designated command indicates a target block in the double-rate synchronous dynamic random access memory to which the designated command is directed;
the selecting module is configured to select a command to be executed for the target block from commands to be selected except the specified command;
and the execution module is configured to execute the command to be executed so as to process the data in the target block.
CN202110623389.5A 2021-06-04 2021-06-04 Data processing method and device Pending CN113076070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110623389.5A CN113076070A (en) 2021-06-04 2021-06-04 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110623389.5A CN113076070A (en) 2021-06-04 2021-06-04 Data processing method and device

Publications (1)

Publication Number Publication Date
CN113076070A true CN113076070A (en) 2021-07-06

Family

ID=76616988

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110623389.5A Pending CN113076070A (en) 2021-06-04 2021-06-04 Data processing method and device

Country Status (1)

Country Link
CN (1) CN113076070A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225477A (en) * 2022-07-19 2022-10-21 北京天融信网络安全技术有限公司 Configuration maintenance method and device for frame type equipment, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040123056A1 (en) * 2002-12-23 2004-06-24 Intel Corporation Interleaving memory access
CN1961302A (en) * 2004-04-28 2007-05-09 英特尔公司 Memory controller with command look-ahead
CN101694610A (en) * 2009-10-16 2010-04-14 成都市华为赛门铁克科技有限公司 Command processing method, device and memory device
CN111949578A (en) * 2020-08-04 2020-11-17 西安电子科技大学 DDR3 controller based on DFI standard

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040123056A1 (en) * 2002-12-23 2004-06-24 Intel Corporation Interleaving memory access
CN1961302A (en) * 2004-04-28 2007-05-09 英特尔公司 Memory controller with command look-ahead
CN101694610A (en) * 2009-10-16 2010-04-14 成都市华为赛门铁克科技有限公司 Command processing method, device and memory device
CN111949578A (en) * 2020-08-04 2020-11-17 西安电子科技大学 DDR3 controller based on DFI standard

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225477A (en) * 2022-07-19 2022-10-21 北京天融信网络安全技术有限公司 Configuration maintenance method and device for frame type equipment, electronic equipment and storage medium
CN115225477B (en) * 2022-07-19 2023-12-01 北京天融信网络安全技术有限公司 Configuration maintenance method and device for frame type equipment, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11199996B2 (en) Method of scheduling requests to banks in a flash controller
US8996824B2 (en) Memory reorder queue biasing preceding high latency operations
CN103218310B (en) The method of buffer storage, communication facilities and reading cache data
US20170364280A1 (en) Object storage device and an operating method thereof
CN101271435B (en) Method for access to external memory
CN111143257A (en) DDR arbitration controller, video cache device and video processing system
CN103345368B (en) Data caching method in buffer storage
CN110941395B (en) Dynamic random access memory, memory management method, system and storage medium
US10908839B2 (en) Storage device throttling amount of communicated data depending on suspension frequency of operation
CN111198715A (en) Out-of-order high-performance core-oriented memory controller command scheduling method and device
CN107274926A (en) DRAM controller with adaptive precharge strategy
US11256621B2 (en) Dual controller cache optimization in a deterministic data storage system
CN113076070A (en) Data processing method and device
CN112039999A (en) Method and system for accessing distributed block storage system in kernel mode
CN115357377A (en) Memory control scheduling method and device, computer equipment and storage medium
CN111966607A (en) Double-rate memory access method and system
CN116841458A (en) Memory read-write control method, system, terminal and storage medium
US9336163B2 (en) Precharge control for memory bank commands
CN105183398A (en) Storage device, electronic device and data processing method
US8484411B1 (en) System and method for improving access efficiency to a dynamic random access memory
CN105612505A (en) Method and apparatus for scheduling CPU
CN112445412B (en) Data storage method and device
CN112631757A (en) DDR4 multi-user access scheduling method and device
CN105573920A (en) Storage space management method and device
CN102073604A (en) Method, device and system for controlling read and write of synchronous dynamic memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination