CN110347334B - Solid state disk working method and system, electronic equipment and storage medium - Google Patents

Solid state disk working method and system, electronic equipment and storage medium Download PDF

Info

Publication number
CN110347334B
CN110347334B CN201910458364.7A CN201910458364A CN110347334B CN 110347334 B CN110347334 B CN 110347334B CN 201910458364 A CN201910458364 A CN 201910458364A CN 110347334 B CN110347334 B CN 110347334B
Authority
CN
China
Prior art keywords
read
written
message
flash memory
idle
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
Application number
CN201910458364.7A
Other languages
Chinese (zh)
Other versions
CN110347334A (en
Inventor
李创锋
陈奕任
马健群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tigo Semiconductor Co ltd
Original Assignee
Shenzhen Tigo Semiconductor 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 Shenzhen Tigo Semiconductor Co ltd filed Critical Shenzhen Tigo Semiconductor Co ltd
Priority to CN201910458364.7A priority Critical patent/CN110347334B/en
Publication of CN110347334A publication Critical patent/CN110347334A/en
Application granted granted Critical
Publication of CN110347334B publication Critical patent/CN110347334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy 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)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Memory System (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a working method and system of a solid state disk, electronic equipment and a storage medium. The working method comprises the following steps: acquiring the working state of a corresponding flash memory when a message to be read and written is to be processed; if the flash memory is not in an idle state, the message to be read and written is taken as a delay message to be read and written; and if other flash memories are in an idle state, sending the unprocessed to-be-read-write messages corresponding to the idle flash memories to the corresponding idle flash memories. The embodiment of the invention determines whether the flash memory is in an idle state or not by determining the working state of the corresponding flash memory when the message to be read and written is to be processed, if the flash memory is not in the idle state, whether other flash memories are in the idle state or not is obtained in real time, if other flash memories are in the idle state, the message to be read and written corresponding to the idle flash memory is obtained from the message queue and is sent to the corresponding idle flash memory, the flash memories are ensured to work, so that the working efficiency of the solid state disk is improved, and the problem of the reduction of the working efficiency of the solid state disk caused by the blocking of the queue message is avoided.

Description

Solid state disk working method and system, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of solid state disks, in particular to a solid state disk working method, a solid state disk working system, electronic equipment and a storage medium.
Background
Generally, a solid state disk has a similar structure, and the purpose of the solid state disk is to convert commands into access actions of flash memories, and each command corresponds to a corresponding flash memory to read or write corresponding data, so that each command is sent to the corresponding flash memory.
In the message queue, messages are sent to the corresponding flash memories through the controller according to the principle of first-in first-out, but when one flash memory works according to read-write messages, if the messages for the flash memory appear in the message queue again, the messages can be blocked in the message queue, so that the flash memory controller stops obtaining the messages from the message queue, and the messages in the message queue can not be obtained again until the flash memory finishes the previous message processing.
Disclosure of Invention
In order to solve the problems in the prior art, at least one embodiment of the present invention provides a method, a system, an electronic device, and a storage medium for operating a solid state disk.
In a first aspect, an embodiment of the present invention provides a method for operating a solid state disk, where the method includes:
determining a flash memory for processing each message to be read and written in the message queue;
acquiring the working state of a corresponding flash memory when the message to be read and written is to be processed;
determining whether the flash memory is in an idle state according to the working state;
if the flash memory is not in an idle state, the message to be read and written is used as a delayed message to be read and written; determining whether other flash memories are in an idle state;
if other flash memories are in the idle state, the flash memory in the idle state is used as an idle flash memory, and the unprocessed message to be read and written corresponding to the idle flash memory is sent to the corresponding idle flash memory.
Based on the above technical solutions, the embodiments of the present invention may be further improved as follows.
With reference to the first aspect, in a first embodiment of the first aspect, the method for operating a solid state disk further includes:
acquiring the processing sequence of the messages to be read and written in the message queue;
determining whether two adjacent messages to be read and written are processed by the same flash memory according to the processing sequence of the messages to be read and written;
if two adjacent messages to be read and written are processed by the same flash memory, acquiring a corresponding message to be read and written corresponding to each other flash memory as an adjustment message to be read and written;
and adjusting the processing sequence of the messages to be read and written to be between two adjacent messages to be read and written which are processed by the same flash memory.
With reference to the first aspect, in a second embodiment of the first aspect, the method for operating a solid state disk further includes:
grouping all the messages to be read and written according to the corresponding flash memories to obtain a plurality of groups of message groups to be read and written;
sequencing the message group to be read and written;
executing a loop marking step; the cyclic marking step comprises: according to the sequence of the message group to be read and written, sequentially acquiring one message to be read and written from the message group to be read and written each time, and adding marks until all the messages to be read and written in all the message groups to be read and written are added with marks;
and taking the sequence of the messages to be read and written with the added marks as the processing sequence of the messages to be read and written.
With reference to the first aspect or the first or second embodiment of the first aspect, in a third embodiment of the first aspect, the sending an unprocessed message to be read and written that corresponds to a free flash memory to the corresponding free flash memory includes:
acquiring the time when the delay to-be-read-write message is processed;
acquiring the time when each idle flash memory receives the message to be read and written next time after the message to be read and written is delayed;
respectively calculating to obtain the processing time difference of each idle flash memory according to the time when the message to be read and written is delayed to be processed and the time when each idle flash memory receives the message to be read and written next time;
and sequencing the processing time differences in the order from big to small, and sending unprocessed messages to be read and written corresponding to the idle flash memories to the corresponding idle flash memories in the order of the processing time differences.
In a second aspect, an embodiment of the present invention provides a solid state disk system, where the solid state disk system includes:
the determining unit is used for determining a flash memory for processing each message to be read and written in the message queue;
the first acquisition unit is used for acquiring the working state of the corresponding flash memory when the message to be read and written is to be processed;
the first judgment unit is used for determining whether the flash memory is in an idle state or not according to the working state;
the first processing unit is used for taking the message to be read and written as a delayed message to be read and written if the flash memory is not in an idle state; determining whether other flash memories are in an idle state;
and the second processing unit is used for taking the flash memory in the idle state as an idle flash memory if other flash memories are in the idle state, and sending the unprocessed message to be read and written corresponding to the idle flash memory to the corresponding idle flash memory.
With reference to the second aspect, in a first embodiment of the second aspect, the operating the solid state disk further includes:
the second obtaining unit is used for obtaining the processing sequence of the messages to be read and written in the message queue;
the second judgment unit is used for determining whether two adjacent messages to be read and written are processed by the same flash memory according to the processing sequence of the messages to be read and written;
a third processing unit, configured to, if there are two adjacent messages to be read and written that are processed by the same flash memory, obtain a corresponding message to be read and written corresponding to each other flash memory, and use the corresponding message as an adjustment message to be read and written;
and the fourth processing unit is configured to adjust the processing order of the messages to be read and written to be between two adjacent messages to be read and written, which are processed by the same flash memory.
With reference to the second aspect, in a second embodiment of the second aspect, the solid state disk system further includes:
the fifth processing unit is used for grouping all the messages to be read and written according to the corresponding flash memories to obtain a plurality of groups of message groups to be read and written;
the sequencing unit is used for sequencing the message group to be read and written;
a marking unit for performing a loop marking step; the cyclic marking step comprises: according to the sequence of the message group to be read and written, one message adding mark to be read and written is taken from the message group to be read and written in sequence until all the messages to be read and written in all the message groups to be read and written are added with marks;
and the sixth processing unit is used for taking the sequence of the messages to be read and written, which are added with the marks, as the processing sequence of the messages to be read and written.
With reference to the second aspect or the first or second embodiment of the second aspect, in a third embodiment of the second aspect, the second processing unit includes:
a third obtaining unit, configured to obtain a time at which the delayed to-be-read-write message is processed;
a fourth obtaining unit, configured to obtain a time when each idle flash memory receives the message to be read and written next time after the message to be read and written is delayed;
the computing unit is used for respectively computing to obtain the processing time difference of each idle flash memory according to the time when the message to be read and written is delayed to be processed and the time when each idle flash memory receives the message to be read and written next time;
and the seventh processing unit is used for sequencing the processing time differences in sequence from big to small, and sending unprocessed messages to be read and written corresponding to the idle flash memories to the corresponding idle flash memories in sequence of the processing time differences.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the working method according to any one of the embodiments of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the working method described in any one of the embodiments of the first aspect.
Compared with the prior art, the technical scheme of the invention has the following advantages: the embodiment of the invention determines whether the flash memory is in an idle state or not by determining the working state of the corresponding flash memory when the message to be read and written is to be processed, if the flash memory is not in the idle state, the flash memory is in working, whether other flash memories are in the idle state or not is obtained in real time, if other flash memories are in the idle state, the message to be read and written corresponding to the idle flash memory is obtained from the message queue and is sent to the corresponding idle flash memory, the flash memories are ensured to be in working, so that the working efficiency of the solid state disk is improved, and the problem of the reduction of the working efficiency of the solid state disk caused by the blocking of the queue message is avoided.
Drawings
Fig. 1 is an application environment diagram of a method for operating a solid state disk according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a working method of a solid state disk according to another embodiment of the present invention;
fig. 3 is a first flowchart of a solid state disk operating method according to another embodiment of the present invention;
fig. 4 is a schematic flow chart of a solid state disk operating method according to another embodiment of the present invention;
fig. 5 is a third schematic flowchart of a solid state disk operating method according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a solid state disk system according to yet another embodiment of the present invention;
fig. 7 is an internal structural diagram of a computer device according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
Fig. 1 is a diagram of an application environment of a working method of a solid state disk in an embodiment. Referring to fig. 1, the working method of the solid state disk is applied to a solid state disk system. The solid state disk system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 may be a desktop terminal or a mobile terminal, and the mobile terminal may be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 120 may be implemented as a stand-alone server or a server cluster comprising a plurality of servers.
In one embodiment, as shown in fig. 2, a method for operating a solid state disk is provided. The embodiment is mainly illustrated by applying the method to the terminal 110 (or the server 120) in fig. 1. Referring to fig. 2, the working method of the solid state disk specifically includes the following steps:
s11, determining a flash memory for processing each message to be read and written in the message queue.
In this embodiment, a message queue stores control instructions to be processed, a flash memory performs data read operation or data write operation according to the control instructions, that is, a message to be read and written in the present embodiment, a flash memory controller obtains the control instructions in the message queue and sends the control instructions to a corresponding flash memory to perform data read and write operation, because the data storage locations are different, each control instruction can only be sent to the corresponding flash memory to perform processing, when a certain control instruction is to be sent to the flash memory through the flash memory controller, if the flash memory is in a busy state, that is, when the flash memory is performing read and write operation, the flash memory controller cannot send the control instructions to the flash memory, which may cause subsequent control instruction blocking, in this step, a flash memory corresponding to each message to be read and written in the message queue is determined, a flash memory corresponding to the message to be read and written can be obtained before the message to be read and written enters the message queue, the message to be read and written in the message queue can also be transferred to another message queue, and the flash memory corresponding to be read and written in the message queue can be determined by the above manner no longer processed in this embodiment.
And S12, acquiring the working state of the corresponding flash memory when the message to be read and written is to be processed.
In this embodiment, when the message to be read and written is to be processed, the working state of the flash memory corresponding to the message to be read and written is obtained, that is, the working state of the flash memory performing the data reading operation and the data writing operation according to the message to be read and written is confirmed, if the flash memory is in a busy state, the message to be read and written to be processed in this step is also stopped to be obtained due to blockage, and if the flash memory is in an idle state, the message to be read and written can be directly obtained by the flash memory controller and sent to the corresponding flash memory.
In this embodiment, the working state of the flash memory corresponding to the time when the message to be read and written is to be processed may be the working state of the flash memory corresponding to the time when the message to be read and written is processed within the preset interval time.
And S13, determining whether the flash memory is in an idle state or not according to the working state.
In this embodiment, whether the flash memory is in the idle state is determined according to the working state information about the flash memory obtained in the above steps, for example, whether the flash memory is in the idle state is determined by obtaining data read-write operation information of the flash memory, that is, whether the flash memory is in the idle state is determined according to whether the flash memory performs data read-write operation, and whether the flash memory is in the idle state may be determined according to whether the flash memory receives data from the flash memory controller.
S14, if the flash memory is not in an idle state, taking the message to be read and written as a delayed message to be read and written; and determines whether there is another flash memory in an idle state.
In this embodiment, if the flash memory is not in the idle state, the message to be read and written may be sent to the flash memory to perform a corresponding data reading or data storage operation, and if the flash memory is not in the idle state, the message to be read and written may be marked at this time.
And S15, if other flash memories are in an idle state, taking the flash memory in the idle state as an idle flash memory, and sending the unprocessed message to be read and written corresponding to the idle flash memory to the corresponding idle flash memory.
In this embodiment, if there are other flash memories in an idle state, the flash memory in the idle state is marked as an idle flash memory, and the to-be-read and write message that is not processed except the delayed to-be-read and write message in the message queue is sent to the corresponding idle flash memory, that is, the to-be-read and write message after the delayed to-be-read and write message is obtained from the message queue is sent to the corresponding idle flash memory, for example, the to-be-read and write message corresponding to the idle flash memory is determined, one to-be-read and write message corresponding to each idle flash memory is obtained from the message queue, and is sent to the corresponding idle flash memory, so that all the idle flash memories can process the corresponding to-be-read and write message, and certainly, there may be a case that there is no to-be-read and write message corresponding to the idle flash memory in the message queue, which indicates that the idle flash memory has processed all the corresponding to-be-read and write messages.
The method includes the steps of obtaining a message to be read and written after delaying the message to be read and written from a message queue, obtaining a message to be read and written corresponding to a free flash memory according to a proximity principle, and obtaining the message to be read and written corresponding to the free flash memory according to the emergency degree of each message to be read and written, wherein the emergency degree of the message to be read and written can be set by a user before the message to be read and written is input into the message queue, for example, the user sets an emergency degree value aiming at a certain read-write operation, after the read-write operation is converted into a read-write instruction, a mark is added in the read-write instruction and corresponds to the emergency degree value, when the flash memories are blocked, a message to be read and written corresponding to each free flash memory is obtained according to the emergency degree values of all messages to be read and written corresponding to each free flash memory, and the function of rapidly processing the emergency instruction is achieved.
For example, as shown in fig. 3, in this embodiment, sending an unprocessed message to be read and written corresponding to a free flash memory to the corresponding free flash memory may include the following steps:
and S21, acquiring the time when the delay to-be-read-write message is processed.
In this embodiment, the time when the delayed message to be read and written is processed is obtained, but the delayed message to be read and written is blocked by the previous message to be read and written, so that the delayed message to be read and written is delayed, and only the time when the delayed message to be read and written is processed is obtained in this step.
S22, acquiring the time when each idle flash memory receives the message to be read and written next time after the message to be read and written is delayed.
In this embodiment, after determining the delayed messages to be read and written, the time when each idle flash memory receives the messages to be read and written next time is determined, that is, if there is no delayed message to be read and written, the time when the messages to be read and written corresponding to the idle flash memories in the queue messages are sent to the corresponding idle flash memories.
And S23, respectively calculating to obtain the processing time difference of each idle flash memory according to the time when the to-be-read-write message is delayed to be processed and the time when each idle flash memory receives the to-be-read-write message next time.
In this embodiment, by delaying the time when the message to be read and written is processed and the time when the message to be read and written is received next time by the idle flash memory, a corresponding time difference is obtained through calculation, so that a time difference between the next time when the message to be read and written is processed by each idle flash memory and the current time can be obtained, and the larger the time difference is, the longer the time that the idle flash memory is idle is.
S24, sequencing the processing time differences in sequence from large to small, and sending the unprocessed messages to be read and written corresponding to the idle flash memories to the corresponding idle flash memories in the sequence of the processing time differences.
In this embodiment, the unprocessed messages to be read and written corresponding to the flash memories are sent to the corresponding free flash memories in the order of the time difference.
As shown in fig. 4, in one embodiment, a method for operating a solid state disk is provided. Referring to fig. 4, compared with the solid state disk operating method shown in fig. 2, the difference is that the solid state disk operating method further includes the following steps:
s31, acquiring the processing sequence of the messages to be read and written in the message queue.
In this embodiment, the processing order of the messages to be read and written in the message queue is obtained, the sequence of the messages to be read and written can be confirmed according to the first-in first-out principle by marking the messages to be read and written before the messages to be read and written enter the message queue, the messages to be read and written in the message queue can be transferred to another message queue, and the sequence of each message to be read and written can be obtained in the transfer process.
And S32, determining whether two adjacent messages to be read and written are processed by the same flash memory according to the processing sequence of the messages to be read and written.
In this embodiment, whether two messages to be read and written corresponding to the same flash memory are adjacent to each other is determined according to the processing sequence of the messages to be read and written, and if two adjacent messages to be read and written are processed by the same flash memory, the flash memory cannot process a new message to be read and written again because the previous message to be read and written is just sent to the flash memory, and at this time, a jam is easily caused.
And S33, if two adjacent messages to be read and written are processed by the same flash memory, acquiring a corresponding message to be read and written corresponding to each other flash memory as the message to be read and written for adjustment.
In this embodiment, if two adjacent messages to be read and written are processed by the same flash memory, a corresponding message to be read and written is obtained for each flash memory except the flash memory at this time, and the messages to be read and written are used as messages to be read and written for adjustment.
And S34, adjusting the processing sequence of the messages to be read and written to be between two adjacent messages to be read and written which are processed by the same flash memory.
In this embodiment, the adjustment to-be-read-write message obtained in the above step is added between two adjacent to-be-read-write messages processed by the same flash memory, that is, one to-be-read-write message corresponding to another flash memory is added between the to-be-read-write messages processed by the same flash memory, so as to adjust the processing order of the to-be-read-write messages.
As shown in fig. 5, in one embodiment, a method for operating a solid state disk is provided. Referring to fig. 5, compared with the solid state disk operating method shown in fig. 2, the difference is that the solid state disk operating method further includes the following steps:
s41, grouping all the messages to be read and written according to the corresponding flash memories to obtain a plurality of groups of messages to be read and written.
In this embodiment, all messages to be read and written are grouped according to the corresponding flash memories, and the messages to be read and written in each group of message groups to be read and written correspond to the same flash memory.
And S42, sequencing the message group to be read and written.
In this embodiment, only the message groups to be read and written are sorted, the message groups to be read and written may be sorted according to the arrangement order of the flash memory, or the message groups to be read and written may be sequentially marked according to any order, and the marked order is used as the order of the message groups to be read and written.
S43, executing a loop marking step; the cyclic marking step comprises: and according to the sequence of the message groups to be read and written, sequentially acquiring one message to be read and written from the message groups to be read and written each time, and adding marks until marks are added to all messages to be read and written in all the message groups to be read and written.
In this embodiment, a cyclic mark is executed, one message to be read and written is sequentially acquired from the message group to be read and written in sequence, a mark is added when the message to be read and written is acquired, and the mark is added to all the messages to be read and written in all the message groups to be read and written.
And S44, taking the sequence of the added marks of the messages to be read and written as the processing sequence of the messages to be read and written.
In this embodiment, the order in which the tag is added to the message to be read and written is used as the processing order of the message to be read and written, and the message queue is regenerated according to the processing order, so as to improve the initial processing efficiency of the message queue.
As shown in fig. 6, an embodiment of the present invention provides a solid state disk system, where the solid state disk system includes: the device comprises a determining unit, a first acquiring unit, a first judging unit, a first processing unit and a second processing unit.
In this embodiment, the determining unit is configured to determine a flash memory for processing each message to be read and written in the message queue.
In this embodiment, a message queue stores control instructions to be processed, a flash memory performs data read operation or data write operation according to the control instructions, that is, a message to be read and written in the present embodiment, and a flash memory controller obtains the control instructions in the message queue and sends the control instructions to a corresponding flash memory to perform data read and write operations.
In this embodiment, the first obtaining unit is configured to obtain an operating state of a corresponding flash memory when the message to be read and written is to be processed.
In this embodiment, when the message to be read and written is to be processed, the working state of the flash memory corresponding to the message to be read and written is obtained, that is, the working state of the flash memory performing the data reading operation and the data writing operation according to the message to be read and written is confirmed, if the flash memory is in a busy state, the message to be read and written to be processed in this step is also stopped to be obtained due to blockage, and if the flash memory is in an idle state, the message to be read and written can be directly obtained by the flash memory controller and sent to the corresponding flash memory.
In this embodiment, the first determining unit is configured to determine whether the flash memory is in an idle state according to the operating state.
In this embodiment, whether the flash memory is in the idle state is determined according to the working state information about the flash memory obtained in the above steps, for example, whether the flash memory is in the idle state is determined by obtaining data read-write operation information of the flash memory, that is, whether the flash memory is in the idle state is determined according to whether the flash memory performs data read-write operation, and whether the flash memory is in the idle state may be determined according to whether the flash memory receives data from the flash memory controller.
In this embodiment, the first processing unit is configured to, if the flash memory is not in an idle state, take the message to be read and written as a delayed message to be read and written; and determines whether there is another flash memory in an idle state.
In this embodiment, if the flash memory is not in the idle state, the message to be read and written may be sent to the flash memory to perform a corresponding data reading or data storage operation, and if the flash memory is not in the idle state, the message to be read and written may be marked at this time.
In this embodiment, the second processing unit is configured to, if there is another flash memory in an idle state, use the flash memory in the idle state as an idle flash memory, and send the message to be read and written that is not processed except the delayed message to be read and written to the corresponding idle flash memory.
In this embodiment, if there are other flash memories in an idle state, the flash memory in the idle state is marked as an idle flash memory, and a to-be-read/write message that is not processed except the delayed to-be-read/write message in the message queue is sent to the corresponding idle flash memory, that is, the to-be-read/write message after the delayed to-be-read/write message is obtained from the message queue is sent to the corresponding idle flash memory, for example, the to-be-read/write message corresponding to the idle flash memory is determined, one to-be-read/write message corresponding to each idle flash memory is obtained from the message queue and sent to the corresponding idle flash memory, so that all the idle flash memories can process the corresponding to-be-read/write message correspondingly, and certainly, there is a case that there is no to-be-read/write message corresponding to the idle flash memory in the message queue, which indicates that the idle flash memory has processed all the corresponding to-be-read/write messages.
The method comprises the steps of obtaining a message to be read and written after delaying the message to be read and written from a message queue, obtaining a message to be read and written corresponding to a free flash memory according to a principle of proximity, and obtaining the message to be read and written corresponding to the free flash memory according to the emergency degree of each message to be read and written, wherein the emergency degree of the message to be read and written can be set by a user before the message to be read and written is input into the message queue, for example, the user sets an emergency degree value aiming at a certain read-write operation, after the read-write operation is converted into a read-write instruction, a mark is added in the read-write instruction and corresponds to the emergency degree value, when the flash memories are blocked, a message to be read and written corresponding to each free flash memory is obtained according to the emergency degree values of all the messages to be read and written corresponding to each free flash memory, and the function of rapidly processing the emergency instruction is achieved.
For example, in this embodiment, the second processing unit may include: a third obtaining unit, configured to obtain a time when each idle flash memory receives the message to be read and written next time after the message to be read and written is delayed; in this embodiment, the time when the delayed message to be read and written is processed is obtained, but since the delayed message to be read and written is blocked by the previous message to be read and written, the delayed message to be read and written is delayed, and only the time when the delayed message to be read and written is processed is obtained in this step.
In this embodiment, the second processing unit may include: a fourth obtaining unit, configured to obtain a time at which the delay to-be-read-write message is processed; in this embodiment, after determining the delayed messages to be read and written, the time when each idle flash memory receives the messages to be read and written next time is determined, that is, if there is no delayed message to be read and written, the time when the messages to be read and written corresponding to the idle flash memories in the queue messages are sent to the corresponding idle flash memories.
In this embodiment, the second processing unit may include: the computing unit is used for respectively computing the processing time difference of each idle flash memory according to the time of delaying the processing of the message to be read and written and the time of each idle flash memory receiving the message to be read and written next time; in this embodiment, by delaying the time when the message to be read and written is processed and the time when the message to be read and written is received next time by the idle flash memory, the corresponding time difference is obtained through calculation, so that the time difference between the next processing of the message to be read and written by each idle flash memory and the current time can be obtained, and the larger the time difference is, the longer the idle flash memory is idle.
In this embodiment, the second processing unit may include: the seventh processing unit is used for sequencing the processing time differences in a sequence from large to small, and sending the messages to be read and written which are not processed except the delayed messages to be read and written to the corresponding idle flash memories in the sequence of the processing time differences; in this embodiment, the unprocessed messages to be read and written corresponding to the flash memories are sent to the corresponding idle flash memories in the order of the time difference.
Embodiments of the present invention provide a solid state disk system, which is different from the solid state disk system shown in fig. 6 in that,
the work of the solid state disk further comprises: the second acquisition unit is used for acquiring the processing sequence of the messages to be read and written in the message queue; the processing sequence of the messages to be read and written in the message queue is obtained, the messages to be read and written can be marked before the messages to be read and written enter the message queue, the sequence of the messages to be read and written is confirmed according to the principle of queue first-in first-out, the messages to be read and written in the message queue can be transferred to another message queue, and the sequence of each message to be read and written is obtained in the transferring process.
The work of the solid state disk further comprises: the second judgment unit is used for determining whether two adjacent messages to be read and written are processed by the same flash memory according to the processing sequence of the messages to be read and written; whether two messages to be read and written corresponding to the same flash memory are adjacent is confirmed according to the processing sequence of the messages to be read and written, if two adjacent messages to be read and written are processed by the same flash memory, the flash memory cannot process new messages to be read and written again because the previous messages to be read and written are just sent to the flash memory, and at the moment, blockage is easily caused.
The work of the solid state disk further comprises: the third processing unit is used for acquiring a corresponding message to be read and written corresponding to each other flash memory if two adjacent messages to be read and written are processed by the same flash memory, and taking the corresponding message to be read and written as an adjustment message to be read and written; if two adjacent messages to be read and written are processed by the same flash memory, a corresponding message to be read and written is obtained corresponding to each flash memory except the flash memory, and the messages to be read and written are used as the messages to be read and written for adjustment.
The work of the solid state disk further comprises: the fourth processing unit is used for adjusting the processing sequence of the messages to be read and written to be between two adjacent messages to be read and written which are processed by the same flash memory; the method comprises the steps of adding the adjustment to-be-read and write message acquired in the step between two adjacent to-be-read and write messages processed by the same flash memory, namely adding one to-be-read and write message corresponding to other flash memories between the to-be-read and write messages processed by the same flash memory to realize the adjustment of the processing sequence of the to-be-read and write messages.
Embodiments of the present invention provide a solid state disk system, which is different from the solid state disk system shown in fig. 6 in that,
the solid state disk system further comprises: the fifth processing unit is used for grouping all the messages to be read and written according to the corresponding flash memories to obtain a plurality of groups of message groups to be read and written; and grouping all the messages to be read and written according to the corresponding flash memories, wherein the messages to be read and written in each group of the messages to be read and written correspond to the same flash memory.
The solid state disk system further comprises: the sequencing unit is used for sequencing the read-write message group; the message groups to be read and written are only sorted, the message groups to be read and written can be sorted according to the arrangement sequence of the flash memory, or the message groups to be read and written can be sequentially marked according to any sequence, and the marked sequence is used as the sequence of the message groups to be read and written.
The solid state disk system further comprises: a marking unit for performing a loop marking step; the cyclic marking step comprises: according to the sequence of the message groups to be read and written, sequentially taking a message adding mark to be read and written from the message groups to be read and written until all the messages to be read and written in all the message groups to be read and written are added with marks; and executing a cyclic mark, sequentially acquiring one message to be read and written from the message group to be read and written each time according to the sequence of the message group to be read and written, adding a mark when the message to be read and written is acquired, and adding marks to all messages to be read and written in all the message groups to be read and written.
The solid state disk system further comprises: a sixth processing unit, configured to use an order in which the marks are added to the messages to be read and written as a processing order of the messages to be read and written; and taking the sequence of the added marks of the messages to be read and written as the processing sequence of the messages to be read and written, and regenerating the message queue according to the processing sequence so as to improve the initial processing efficiency of the message queue.
FIG. 7 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be the terminal 110 (or the server 120) in fig. 1. As shown in fig. 7, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. The memory comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, causes the processor to implement the solid state disk operating method. The internal memory may also store a computer program, and when the computer program is executed by the processor, the processor may execute the solid state disk operating method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the solid state disk system provided by the present application may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in fig. 7. The memory of the computer device may store various program modules constituting the solid state disk system, such as the determination unit, the first acquisition unit, the first judgment unit, the first processing unit, and the second processing unit shown in fig. 6. The computer program constituted by the program modules causes the processor to execute the steps in the solid state disk working method according to the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 7 may perform step S11 by the determination unit in the solid state disk system shown in fig. 6, and the computer device may perform step S12 by the first acquisition unit.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
determining a flash memory for processing each message to be read and written in the message queue;
acquiring the working state of a corresponding flash memory when a message to be read and written is to be processed;
determining whether the flash memory is in an idle state according to the working state;
if the flash memory is not in an idle state, the message to be read and written is taken as a delay message to be read and written; determining whether other flash memories are in an idle state;
and if other flash memories are in an idle state, taking the flash memory in the idle state as an idle flash memory, and sending unprocessed messages to be read and written except the delayed messages to be read and written to the corresponding idle flash memories.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, and the program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A working method of a solid state disk is characterized by comprising the following steps:
determining a flash memory for processing each message to be read and written in the message queue;
acquiring the working state of a corresponding flash memory when the message to be read and written is to be processed;
determining whether the flash memory is in an idle state according to the working state;
if the flash memory is not in an idle state, the message to be read and written is used as a delayed message to be read and written; determining whether other flash memories are in an idle state;
if other flash memories are in an idle state, taking the flash memory in the idle state as an idle flash memory, and sending an unprocessed message to be read and written corresponding to the idle flash memory to the corresponding idle flash memory;
the working method of the solid state disk further comprises the following steps:
acquiring the processing sequence of the messages to be read and written in the message queue;
determining whether two adjacent messages to be read and written are processed by the same flash memory according to the processing sequence of the messages to be read and written;
if two adjacent messages to be read and written are processed by the same flash memory, acquiring a corresponding message to be read and written corresponding to each other flash memory as an adjustment message to be read and written;
and adjusting the processing sequence of the messages to be read and written to be between two adjacent messages to be read and written which are processed by the same flash memory.
2. The method for operating the solid state disk according to claim 1, further comprising:
grouping all the messages to be read and written according to the corresponding flash memories to obtain a plurality of groups of message groups to be read and written;
sequencing the message group to be read and written;
executing a loop marking step; the cyclic marking step comprises: according to the sequence of the message group to be read and written, sequentially acquiring one message to be read and written from the message group to be read and written each time, and adding marks until all the messages to be read and written in all the message groups to be read and written are added with marks;
and taking the sequence of the messages to be read and written with the added marks as the processing sequence of the messages to be read and written.
3. The working method of the solid state disk according to any one of claims 1 to 2, wherein the sending the unprocessed message to be read and written corresponding to the free flash memory to the corresponding free flash memory comprises:
acquiring the time when the delay message to be read and written is processed;
acquiring the time when each idle flash memory receives the message to be read and written next time after the message to be read and written is delayed;
respectively calculating the processing time difference of each idle flash memory according to the time of delaying the processing of the message to be read and written and the time of receiving the message to be read and written next time by each idle flash memory;
and sequencing the processing time differences in the order from big to small, and sending unprocessed messages to be read and written corresponding to the idle flash memories to the corresponding idle flash memories in the order of the processing time differences.
4. A solid state disk system, comprising:
the determining unit is used for determining a flash memory for processing each message to be read and written in the message queue;
the first acquisition unit is used for acquiring the working state of the corresponding flash memory when the message to be read and written is to be processed;
the first judgment unit is used for determining whether the flash memory is in an idle state or not according to the working state;
the first processing unit is used for taking the message to be read and written as a delayed message to be read and written if the flash memory is not in an idle state; determining whether other flash memories are in an idle state;
the second processing unit is used for taking the flash memory in the idle state as the idle flash memory if other flash memories are in the idle state, and sending the unprocessed message to be read and written corresponding to the idle flash memory to the corresponding idle flash memory;
the second obtaining unit is used for obtaining the processing sequence of the messages to be read and written in the message queue;
the second judgment unit is used for determining whether two adjacent messages to be read and written are processed by the same flash memory according to the processing sequence of the messages to be read and written;
a third processing unit, configured to, if there are two adjacent messages to be read and written that are processed by the same flash memory, obtain a corresponding message to be read and written corresponding to each of the other flash memories, and use the corresponding message to be read and written as an adjustment message to be read and written;
and the fourth processing unit is used for adjusting the processing sequence of the messages to be read and written to be between two adjacent messages to be read and written which are processed by the same flash memory.
5. The solid state disk system of claim 4, further comprising:
the fifth processing unit is used for grouping all the messages to be read and written according to the corresponding flash memories to obtain a plurality of groups of message groups to be read and written;
the sequencing unit is used for sequencing the message group to be read and written;
a marking unit for performing a loop marking step; the cyclic marking step comprises: according to the sequence of the message group to be read and written, one message adding mark to be read and written is taken from the message group to be read and written in sequence until all the messages to be read and written in all the message groups to be read and written are added with marks;
a sixth processing unit, configured to use an order in which the marks are added to the messages to be read and written as a processing order of the messages to be read and written.
6. The solid state disk system of any one of claims 4 to 5, wherein the second processing unit comprises:
a third obtaining unit, configured to obtain a time when the delay to-be-read-write message is processed;
a fourth obtaining unit, configured to obtain a time when each idle flash memory receives the message to be read and written next time after the message to be read and written is delayed;
the computing unit is used for respectively computing the processing time difference of each idle flash memory according to the time of delaying the processing of the message to be read and written and the time of receiving the message to be read and written next time by each idle flash memory;
and the seventh processing unit is used for sequencing the processing time differences in sequence from big to small, and sending unprocessed messages to be read and written corresponding to the idle flash memories to the corresponding idle flash memories in sequence of the processing time differences.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any one of claims 1 to 3 are implemented when the computer program is executed by the processor.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the operating method of any one of claims 1 to 3.
CN201910458364.7A 2019-05-29 2019-05-29 Solid state disk working method and system, electronic equipment and storage medium Active CN110347334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910458364.7A CN110347334B (en) 2019-05-29 2019-05-29 Solid state disk working method and system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910458364.7A CN110347334B (en) 2019-05-29 2019-05-29 Solid state disk working method and system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110347334A CN110347334A (en) 2019-10-18
CN110347334B true CN110347334B (en) 2023-03-14

Family

ID=68174475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910458364.7A Active CN110347334B (en) 2019-05-29 2019-05-29 Solid state disk working method and system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110347334B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425602A (en) * 2013-08-15 2013-12-04 深圳市江波龙电子有限公司 Data reading and writing method and device for flash memory equipment and host system
CN107391392A (en) * 2017-07-21 2017-11-24 重庆大学 A kind of garbage reclamation optimization method based on flash memory device Concurrent Feature
CN107943715A (en) * 2017-10-12 2018-04-20 记忆科技(深圳)有限公司 A kind of method of lifting NVMe solid state hard discs read buffer hit

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10073626B2 (en) * 2013-03-15 2018-09-11 Virident Systems, Llc Managing the write performance of an asymmetric memory system
US10970204B2 (en) * 2017-08-29 2021-04-06 Samsung Electronics Co., Ltd. Reducing read-write interference by adaptive scheduling in NAND flash SSDs

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425602A (en) * 2013-08-15 2013-12-04 深圳市江波龙电子有限公司 Data reading and writing method and device for flash memory equipment and host system
CN107391392A (en) * 2017-07-21 2017-11-24 重庆大学 A kind of garbage reclamation optimization method based on flash memory device Concurrent Feature
CN107943715A (en) * 2017-10-12 2018-04-20 记忆科技(深圳)有限公司 A kind of method of lifting NVMe solid state hard discs read buffer hit

Also Published As

Publication number Publication date
CN110347334A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
CN111176560B (en) Cache management method and device, computer equipment and storage medium
CN108959117B (en) H2D write operation acceleration method and device, computer equipment and storage medium
US11144330B2 (en) Algorithm program loading method and related apparatus
US10116746B2 (en) Data storage method and network interface card
WO2021055035A1 (en) Incrementally updating recovery map data for a memory system
US20200394085A1 (en) Smart contract information redirect to updated version of smart contract
CN107277022B (en) Process marking method and device
CN111444670B (en) Document annotation method, device, computer equipment and storage medium
US9304711B2 (en) Latency reduction in read operations from data storage in a host device
US9377966B2 (en) Method and apparatus for efficiently processing storage commands
CN105068875A (en) Intelligence data processing method and apparatus
US20170235781A1 (en) Method, server and computer program stored in computer readable medium for managing log data in database
CN110347334B (en) Solid state disk working method and system, electronic equipment and storage medium
CN109976920A (en) A kind of implementation method and device of the concurrent type frog control for educating operating system
US20180024723A1 (en) Synchronizing user input with a user interface
CN108287793B (en) Response message buffering method and server
WO2023071101A1 (en) Io task processing method and apparatus, and computer device and storage medium
US9501414B2 (en) Storage control device and storage control method for cache processing according to time zones
US11443191B2 (en) Computing device and parameter synchronization method implemented by computing device
CN113157738B (en) In-heap data cache synchronization method and device, computer equipment and storage medium
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
CN112463037B (en) Metadata storage method, device, equipment and product
CN115168307A (en) Data synchronization method, system, equipment and storage medium supporting breakpoint continuous transmission
CN110879757B (en) Restarting method and device for abnormal operation of client and computer equipment
CN113138718A (en) Storage method, apparatus, system, and medium for distributed block storage system

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
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A solid-state drive working method, system, electronic device, and storage medium

Granted publication date: 20230314

Pledgee: Guangdong Guangdong Bank Shenzhen branch of Limited by Share Ltd.

Pledgor: SHENZHEN TIGO SEMICONDUCTOR Co.,Ltd.

Registration number: Y2024980022389

PE01 Entry into force of the registration of the contract for pledge of patent right