CN112000480A - Method, device, equipment and medium for improving SSD full-disk scanning efficiency - Google Patents
Method, device, equipment and medium for improving SSD full-disk scanning efficiency Download PDFInfo
- Publication number
- CN112000480A CN112000480A CN202010863452.8A CN202010863452A CN112000480A CN 112000480 A CN112000480 A CN 112000480A CN 202010863452 A CN202010863452 A CN 202010863452A CN 112000480 A CN112000480 A CN 112000480A
- Authority
- CN
- China
- Prior art keywords
- overlapped
- resources
- idle
- resource
- unit
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000006870 function Effects 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 abstract description 11
- 238000011161 development Methods 0.000 abstract description 4
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 238000012360 testing method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/221—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
- G06F11/3419—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a method, a device, equipment and a medium for improving the full-disk scanning efficiency of an SSD, wherein the method comprises the following steps of defining a plurality of Overlapped resources; initializing overlappled resources; judging whether a read command is to be sent or not; if yes, judging whether an idle Overlapped resource exists in the Overlapped resources; if yes, sending a read command through the idle overlappled resource; and waiting for the idle Overlapped resource after sending the read command. The invention replaces the multithreading function, the overlappedI/O model is that OS (operating System) transmits data to the user, completes context switching, and informs the user after the processing is finished. The processing in the program is processing of the OS, and the processing is also internally performed by a thread. The method can greatly reduce the development difficulty, improve the development efficiency and reduce the software maintenance cost.
Description
Technical Field
The invention relates to a solid state disk, in particular to a method, a device, equipment and a medium for improving the full-disk scanning efficiency of an SSD.
Background
In recent years, SSD (Solid State Disk) products have been developed unprecedentedly due to their high-speed read/write performance, and many manufacturers invest a lot of manpower and energy to make SSD products, and have higher and higher performance requirements for SSD, and need to undergo a series of tests and verifications in order to ensure the quality of the products. The full disk scan or the scan of the disk by the designated storage range is one of the tests, and usually requires a certain test time.
The implementation of full-disk scanning on the SSD is not complicated, and only NVMe (Non-Volatile Memory express) read commands are sent according to a protocol, but generally, due to the requirement for test time, it takes too long to send read commands by a single thread, and the performance of the SSD is not brought into full play. The use of multiple threads is feasible, but cumbersome, multiple threads involve synchronization mechanisms, error handling, and in thousands of thread I/os, thread context switching is a significant CPU resource consuming task.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a method, a device, equipment and a medium for improving the full-disk scanning efficiency of an SSD.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, a method for improving SSD full disk scan efficiency, the method comprising:
defining a plurality of Overlapped resources;
initializing overlappled resources;
judging whether a read command is to be sent or not;
if yes, judging whether an idle Overlapped resource exists in the Overlapped resources;
if yes, sending a read command through the idle overlappled resource;
and waiting for the idle Overlapped resource after sending the read command.
The further technical scheme is as follows: after the step of judging whether the read command is to be sent, the method further comprises the following steps:
if not, releasing all overlappled resources.
The further technical scheme is as follows: the step of judging whether there is an idle Overlapped resource in the Overlapped resources includes the following steps:
judging whether the number of idle Overlapped resources in a plurality of defined Overlapped resources is larger than zero or not;
if yes, sequentially indexing a plurality of defined Overlapped resources;
judging whether the event kernel object member in the overlappled resource of the current index is an illegal handle or not;
if yes, an event handle is created for the current Overlapped resource through the CreateEvent function, and the number of idle Overlapped resources in the defined Overlapped resources is reduced by one correspondingly.
The further technical scheme is as follows: in the step of waiting for an idle Overlapped resource after sending the read command, waiting for release of the idle Overlapped resource specifically includes the following steps:
sequentially indexing a plurality of defined Overlapped resources from the zeroth position;
checking the result of the currently indexed Overlapped resource through a GetOverlappedresult () function, and judging whether the command is sent completely;
if yes, releasing the current Overlapped resource as an idle Overlapped resource, and correspondingly increasing one idle Overlapped resource in the defined plurality of Overlapped resources.
In a second aspect, an apparatus for improving the full-disc scanning efficiency of an SSD includes a defining unit, an initializing unit, a first determining unit, a second determining unit, a read command sending unit, and a waiting unit;
the defining unit is used for defining a plurality of Overlapped resources;
the initialization unit is used for initializing overlappled resources;
the first judging unit is used for judging whether a read command is to be sent or not;
the second judging unit is used for judging whether an idle Overlapped resource exists in the Overlapped resources;
the read command sending unit is used for sending a read command through an idle overlappled resource;
and the waiting unit is used for waiting for the idle Overlapped resource after the read command is sent.
The further technical scheme is as follows: also includes a release unit;
the release unit is used for releasing all Overlapped resources.
The further technical scheme is as follows: the second judgment unit comprises a first judgment module, a first index module, a second judgment module and an event handle creation module;
the first judging module is used for judging whether the number of idle Overlapped resources in the defined Overlapped resources is greater than zero or not;
the first indexing module is used for sequentially indexing a plurality of defined Overlapped resources;
the second judging module is used for judging whether the event kernel object member in the Overlapped resource of the current index is an illegal handle or not;
the event handle creating module is used for creating an event handle for the current Overlapped resource through the CreateEvent function, and correspondingly, the number of idle Overlapped resources in the defined Overlapped resources is reduced by one.
The further technical scheme is as follows: the waiting unit comprises a second indexing module, a third judging module and a releasing module;
the second indexing module is used for sequentially indexing a plurality of defined Overlapped resources from the zeroth index;
the third judging module is used for checking the result of the currently indexed overlappsed resource through a GetOverlappedresult () function and judging whether the command is sent completely;
the releasing module is configured to release that the current Overlapped resource is an idle Overlapped resource, and one idle Overlapped resource is added to the correspondingly defined multiple Overlapped resources.
In a third aspect, a computer device comprises a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method steps for improving the SSD full disk scan efficiency as described above.
In a fourth aspect, a storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method steps as described above to improve SSD full disk scan efficiency.
Compared with the prior art, the invention has the beneficial effects that: the invention replaces the multithreading function, the Overlapped I/O model is OS (operating System) which transmits data for the user, completes context switching and informs the user after processing. The processing in the program is processing of the OS, and the processing is also internally performed by a thread. The method can greatly reduce the development difficulty, improve the development efficiency and reduce the software maintenance cost.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented according to the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more apparent, the following detailed description will be given of preferred embodiments.
Drawings
FIG. 1 is a diagram illustrating a prior art single-thread manner of sending a read command;
FIG. 2 is a schematic diagram illustrating the use of Overlapped I/O to send read commands in accordance with the present invention;
FIG. 3 is a first flowchart of a method for improving the full-disc scan efficiency of an SSD according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a second embodiment of a method for improving the full-disc scan efficiency of an SSD according to the present invention;
FIG. 5 is a flowchart illustrating a third exemplary embodiment of a method for improving the full-disc scan efficiency of an SSD according to the present invention;
FIG. 6 is a first schematic block diagram of an embodiment of an apparatus for improving SSD full scan efficiency according to the present invention;
FIG. 7 is a second schematic block diagram of an embodiment of an apparatus for improving SSD full scan efficiency according to the present invention;
FIG. 8 is a third schematic block diagram of an embodiment of an apparatus for improving SSD full scan efficiency according to the present invention;
FIG. 9 is a schematic block diagram of a computer device of the present invention.
Detailed Description
In order to more fully understand the technical content of the present invention, the technical solution of the present invention will be further described and illustrated with reference to the following specific embodiments, but not limited thereto.
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, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In the existing single-thread mode, referring to fig. 1, Host sends a read command to SSD in a single channel, and then sends the read command, and this mode can ensure sequential execution of the read command, but does not bring performance of NVMe into play, and the command queue supported by NVMe can reach 64K. The present invention sends the read command through the Overlapped I/O mode, referring to fig. 2, Overlapped is an asynchronous I/O model. Asynchronous I/O is different from synchronous I/O, in which a program is suspended until the I/O is processed, and the program cannot obtain control. Asynchronous I/O, calling a function to tell the OS to perform I/O operation, returning immediately after I/O is finished, continuing the program, and sending a notification message after the operating system completes I/O. The Overlapped I/O replaces the multi-threaded function, and the OS passes data, completes context switching, and notifies after processing. The data structure of Overlapped is as follows:
typedef struct_OVERLAPPED{
DWORD Internal;
DWORD InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
}OVERLAPPED,*LPOVERLAPPED;
by sending a plurality of Overlapped requests, each Overlapped process independent request operation, and for the same file Handle, when the system has a plurality of asynchronous operations, the event kernel object can be identified through an hEvent in the Overlapped. The CreateEvent creates an event for each request, initializes the hEvent member of each request, binds an event object to each operation of a plurality of read-write requests of the same file, and calls GetOverlappdesult to wait for one (or all) of the requests to be completed.
Referring to fig. 3, the method for improving the full-disc scanning efficiency of SSD according to the present invention includes the following steps:
s10, defining a plurality of Overlapped resources, and executing S20;
s20, initializing Overlapped resources, and executing S30;
s30, judging whether a read command is to be sent, if so, executing a step S40, otherwise, executing a step S70;
s40, judging whether the Overlapped resources have idle Overlapped resources or not, if yes, executing a step S50, and if not, executing a step S60;
s50, sending a read command through the idle Overlapped resource, and executing S60;
s60, after sending the read command, waiting for the idle Overlapped resource.
S70, releasing all Overlapped resources.
Specifically, a macro is defined first to identify how many Overlapped resources need to be opened, N resources are defined, initialization is performed, if a read command to be sent exists, whether an idle OVP (Overlapped abbreviation) resource exists is searched, if so, the read command is sent through the OVP, that is, the last parameter Overlapped in deviceilocontrol is assigned as the acquired idle OVP resource. And after the sending is finished, waiting for the release of the idle OVP resources, continuously sending the read command when the idle OVP resources are available, and continuously waiting if the idle OVP resources are unavailable, and circulating the steps until all the read commands to be sent are sent.
Referring to fig. 4, the step of determining whether there is an idle Overlapped resource in the Overlapped resources includes the following steps:
s401, judging whether the number of idle Overlapped resources in a plurality of defined Overlapped resources is larger than zero, if so, executing a step S402, otherwise, ending the whole process;
s402, sequentially indexing a plurality of defined Overlapped resources, and executing S403;
s403, judging whether the event kernel object member in the Overlapped resource of the current index is an illegal handle, if so, executing the step S404, and if not, ending the whole process;
s404, an event handle is created for the current Overlapped resource through the createEvent function, and the number of idle Overlapped resources in the defined plurality of Overlapped resources is reduced by one correspondingly.
Specifically, if there are idle resources, the N OVPs are indexed, and from 0 th, whether the event member in the OVP is an INVALID handle is determined, and the entry member is initialized to the INVALID handle to identify an idle state. If the handle is a non-legal handle, an event handle is created through a CreateEvent function, the event handle is assigned to an hEvent member of the OVP, the number of corresponding OVP idle resources is reduced by 1, and the OVP resources are returned.
Referring to fig. 5, in the step of waiting for the idle Overlapped resource after sending the read command, the step of waiting for releasing the idle Overlapped resource specifically includes the following steps:
s601, sequentially indexing a plurality of defined Overlapped resources from the zeroth, and executing S602;
s602, checking the result of the currently indexed Overlapped resource through a GetOverlappedresult () function, judging whether the command is sent completely, if so, executing a step S603, and if not, executing a step S604;
s603, releasing the current Overlapped resource as an idle Overlapped resource, and correspondingly increasing one idle Overlapped resource in the defined Overlapped resources;
s604, judging whether the resource is the last Overlapped resource, if so, ending the whole process, and if not, entering the step S601.
Specifically, the N OVPs are indexed first, and from the 0 th, the OVP result is checked through a GetOverlappedresult () function, and the last parameter bWait is set to False, which means that asynchronous operation is performed without waiting for the completion of I/O execution. And if the result is completion, releasing the current OVP resource, adding 1 to the number of the OVP idle resources, and setting the event handle of the hEvent member as an illegal handle to indicate the idle resources. If the idle resources are not waited for all the time, directly returning the result, continuously calling the module in the main program, and continuously waiting for the idle resources.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Corresponding to the method for improving the SSD full-disk scanning efficiency, the invention also provides a device for improving the SSD full-disk scanning efficiency. Referring to fig. 6, the apparatus includes a defining unit 1, an initializing unit 2, a first judging unit 3, a second judging unit 4, a read command sending unit 5, a waiting unit 6, and a releasing unit 7;
a defining unit 1, configured to define a plurality of Overlapped resources;
an initialization unit 2, configured to initialize an overlappled resource;
a first judging unit 3, configured to judge whether a read command is to be sent;
a second judging unit 4, configured to judge whether there is an idle Overlapped resource in the Overlapped resources;
a read command sending unit 5, configured to send a read command through an idle Overlapped resource;
a waiting unit 6, configured to wait for an idle Overlapped resource after sending the read command;
and the releasing unit 7 is used for releasing all Overlapped resources.
Further, referring to fig. 7, the second determination unit 4 includes a first determination module 41, a first indexing module 42, a second determination module 43, and an event handler creating module 44;
a first determining module 41, configured to determine whether the number of idle Overlapped resources in the defined number of Overlapped resources is greater than zero;
a first indexing module 42, configured to sequentially index a plurality of defined Overlapped resources;
a second judging module 43, configured to judge whether an event kernel object member in the Overlapped resource of the current index is an illegal handle;
the event handle creating module 44 is configured to create an event handle for the current Overlapped resource through the CreateEvent function, and correspondingly, decrease one idle Overlapped resource from the defined multiple Overlapped resources.
Further, referring to fig. 8, the waiting unit 6 includes a second indexing module 61, a third determining module 62 and a releasing module 63;
a second indexing module 61, configured to index a plurality of Overlapped resources defined in sequence from the zeroth index;
a third judging module 62, configured to check the result of the overlappsed resource of the current index through the getoverlappredresult () function, and judge whether the command is sent completely;
a releasing module 63, configured to release the current Overlapped resource as an idle Overlapped resource, and correspondingly, one more idle Overlapped resource is added from the defined multiple Overlapped resources.
As shown in fig. 9, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method steps for improving the SSD full disk scanning efficiency are implemented.
The computer device 700 may be a terminal or a server. The computer device 700 includes a processor 720, memory, and a network interface 750, which are connected by a system bus 710, where the memory may include non-volatile storage media 730 and internal memory 740.
The non-volatile storage medium 730 may store an operating system 731 and computer programs 732. The computer program 732, when executed, may cause the processor 720 to perform any of a number of methods for improving SSD full disk scan efficiency.
The processor 720 is used to provide computing and control capabilities, supporting the operation of the overall computer device 700.
The internal memory 740 provides an environment for the running of the computer program 732 in the non-volatile storage medium 730, and when the computer program 732 is executed by the processor 720, the processor 720 can be enabled to perform any method for improving the efficiency of the SSD full disk scan.
The network interface 750 is used for network communication such as sending assigned tasks and the like. Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration relevant to the present teachings and is not intended to limit the computing device 700 to which the present teachings may be applied, and that a particular computing device 700 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components. Wherein the processor 720 is configured to execute the program code stored in the memory to perform the following steps:
defining a plurality of Overlapped resources;
initializing overlappled resources;
judging whether a read command is to be sent or not;
if yes, judging whether an idle Overlapped resource exists in the Overlapped resources;
if yes, sending a read command through the idle overlappled resource;
and waiting for the idle Overlapped resource after sending the read command.
The further technical scheme is as follows: after the step of judging whether the read command is to be sent, the method further comprises the following steps:
if not, releasing all overlappled resources.
The further technical scheme is as follows: the step of judging whether there is an idle Overlapped resource in the Overlapped resources includes the following steps:
judging whether the number of idle Overlapped resources in a plurality of defined Overlapped resources is larger than zero or not;
if yes, sequentially indexing a plurality of defined Overlapped resources;
judging whether the event kernel object member in the overlappled resource of the current index is an illegal handle or not;
if yes, an event handle is created for the current Overlapped resource through the CreateEvent function, and the number of idle Overlapped resources in the defined Overlapped resources is reduced by one correspondingly.
The further technical scheme is as follows: in the step of waiting for an idle Overlapped resource after sending the read command, waiting for release of the idle Overlapped resource specifically includes the following steps:
sequentially indexing a plurality of defined Overlapped resources from the zeroth position;
checking the result of the currently indexed Overlapped resource through a GetOverlappedresult () function, and judging whether the command is sent completely;
if yes, releasing the current Overlapped resource as an idle Overlapped resource, and correspondingly increasing one idle Overlapped resource in the defined plurality of Overlapped resources.
It should be understood that, in the embodiment of the present Application, the Processor 720 may be a Central Processing Unit (CPU), and the Processor 720 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that the configuration of computer device 700 depicted in FIG. 9 is not intended to be limiting of computer device 700 and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be implemented in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The technical contents of the present invention are further illustrated by the examples only for the convenience of the reader, but the embodiments of the present invention are not limited thereto, and any technical extension or re-creation based on the present invention is protected by the present invention. The protection scope of the invention is subject to the claims.
Claims (10)
1. A method for improving SSD full-disk scanning efficiency is characterized by comprising the following steps:
defining a plurality of Overlapped resources;
initializing overlappled resources;
judging whether a read command is to be sent or not;
if yes, judging whether an idle Overlapped resource exists in the Overlapped resources;
if yes, sending a read command through the idle overlappled resource;
and waiting for the idle Overlapped resource after sending the read command.
2. The method for improving the full-disk scanning efficiency of the SSD according to claim 1, wherein the step of determining whether there is a read command to be sent is followed by the steps of:
if not, releasing all overlappled resources.
3. The method of claim 1, wherein the determining whether there is an idle Overlapped resource among the Overlapped resources includes the following specific steps:
judging whether the number of idle Overlapped resources in a plurality of defined Overlapped resources is larger than zero or not;
if yes, sequentially indexing a plurality of defined Overlapped resources;
judging whether the event kernel object member in the overlappled resource of the current index is an illegal handle or not;
if yes, an event handle is created for the current Overlapped resource through the CreateEvent function, and the number of idle Overlapped resources in the defined Overlapped resources is reduced by one correspondingly.
4. The method according to claim 1, wherein in the step of waiting for an idle Overlapped resource after sending the read command, the step of waiting for release of the idle Overlapped resource specifically includes the steps of:
sequentially indexing a plurality of defined Overlapped resources from the zeroth position;
checking the result of the currently indexed Overlapped resource through a GetOverlappedresult () function, and judging whether the command is sent completely;
if yes, releasing the current Overlapped resource as an idle Overlapped resource, and correspondingly increasing one idle Overlapped resource in the defined plurality of Overlapped resources.
5. The device for improving the full-disk scanning efficiency of the SSD is characterized by comprising a defining unit, an initializing unit, a first judging unit, a second judging unit, a read command sending unit and a waiting unit;
the defining unit is used for defining a plurality of Overlapped resources;
the initialization unit is used for initializing overlappled resources;
the first judging unit is used for judging whether a read command is to be sent or not;
the second judging unit is used for judging whether an idle Overlapped resource exists in the Overlapped resources;
the read command sending unit is used for sending a read command through an idle overlappled resource;
and the waiting unit is used for waiting for the idle Overlapped resource after the read command is sent.
6. The apparatus for improving the full-disc scanning efficiency of SSD of claim 5, further comprising a release unit;
the release unit is used for releasing all Overlapped resources.
7. The apparatus of claim 5, wherein the second determining unit includes a first determining module, a first indexing module, a second determining module, and an event handler creating module;
the first judging module is used for judging whether the number of idle Overlapped resources in the defined Overlapped resources is greater than zero or not;
the first indexing module is used for sequentially indexing a plurality of defined Overlapped resources;
the second judging module is used for judging whether the event kernel object member in the Overlapped resource of the current index is an illegal handle or not;
the event handle creating module is used for creating an event handle for the current Overlapped resource through the CreateEvent function, and correspondingly, the number of idle Overlapped resources in the defined Overlapped resources is reduced by one.
8. The apparatus of claim 5, wherein the waiting unit includes a second indexing module, a third determining module, and a releasing module;
the second indexing module is used for sequentially indexing a plurality of defined Overlapped resources from the zeroth index;
the third judging module is used for checking the result of the currently indexed overlappsed resource through a GetOverlappedresult () function and judging whether the command is sent completely;
the releasing module is configured to release that the current Overlapped resource is an idle Overlapped resource, and one idle Overlapped resource is added to the correspondingly defined multiple Overlapped resources.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method steps of improving SSD full-disk scanning efficiency as claimed in any one of claims 1 to 4 when executing the computer program.
10. A storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method steps of any of claims 1 to 4 for improving SSD full disk scan efficiency.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010863452.8A CN112000480B (en) | 2020-08-25 | 2020-08-25 | Method, device, equipment and medium for improving SSD full-disk scanning efficiency |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010863452.8A CN112000480B (en) | 2020-08-25 | 2020-08-25 | Method, device, equipment and medium for improving SSD full-disk scanning efficiency |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112000480A true CN112000480A (en) | 2020-11-27 |
CN112000480B CN112000480B (en) | 2023-12-05 |
Family
ID=73470817
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010863452.8A Active CN112000480B (en) | 2020-08-25 | 2020-08-25 | Method, device, equipment and medium for improving SSD full-disk scanning efficiency |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112000480B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050179936A1 (en) * | 2004-02-13 | 2005-08-18 | Microsoft Corporation | Scalable print spooler |
CN101158912A (en) * | 2006-10-08 | 2008-04-09 | 上海科泰世纪科技有限公司 | Asynchronous output incoming signal processing method |
CN101609420A (en) * | 2009-07-17 | 2009-12-23 | 杭州华三通信技术有限公司 | Realize method and the redundant arrays of inexpensive disks and the controller thereof of rebuilding of disc redundant array |
CN104932942A (en) * | 2015-05-29 | 2015-09-23 | 华为技术有限公司 | Buffer resource allocation method and device |
WO2016145904A1 (en) * | 2015-09-10 | 2016-09-22 | 中兴通讯股份有限公司 | Resource management method, device and system |
CN109901785A (en) * | 2017-12-08 | 2019-06-18 | 西安华为技术有限公司 | Order sort method reduces and reads time delay method and solid-state hard disk SSD controller |
US10445239B1 (en) * | 2013-03-15 | 2019-10-15 | Bitmicro Llc | Write buffering |
-
2020
- 2020-08-25 CN CN202010863452.8A patent/CN112000480B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050179936A1 (en) * | 2004-02-13 | 2005-08-18 | Microsoft Corporation | Scalable print spooler |
CN101158912A (en) * | 2006-10-08 | 2008-04-09 | 上海科泰世纪科技有限公司 | Asynchronous output incoming signal processing method |
CN101609420A (en) * | 2009-07-17 | 2009-12-23 | 杭州华三通信技术有限公司 | Realize method and the redundant arrays of inexpensive disks and the controller thereof of rebuilding of disc redundant array |
US10445239B1 (en) * | 2013-03-15 | 2019-10-15 | Bitmicro Llc | Write buffering |
US20200151098A1 (en) * | 2013-03-15 | 2020-05-14 | Bitmicro Llc | Write buffering |
CN104932942A (en) * | 2015-05-29 | 2015-09-23 | 华为技术有限公司 | Buffer resource allocation method and device |
WO2016145904A1 (en) * | 2015-09-10 | 2016-09-22 | 中兴通讯股份有限公司 | Resource management method, device and system |
CN109901785A (en) * | 2017-12-08 | 2019-06-18 | 西安华为技术有限公司 | Order sort method reduces and reads time delay method and solid-state hard disk SSD controller |
Non-Patent Citations (6)
Title |
---|
XIONGLI54: ""异步套接字编程之重叠I/O模型"", 《WWW.BLOG.CSDN.NET/XIONGLI54/ARTICLE/DETAILS/45646109》 * |
唐佳佳: "一种基于PC机的网络监控及计费软件", 苏州科技学院学报(工程技术版), no. 02 * |
殷鹏: ""通信机房动力与环境监控系统实现和研究"", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》 * |
王健: ""基于IOCP的MMO服务器设计与实现"", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》 * |
紫殿: ""Overlapped I/O模型深入分析"", 《WWW.360DOC.COM/CONTENT/11/0924/15/7023119_150875729.SHTML》 * |
赵鲲;王宝生;: "基于异步I/O模型的双机TCP代理的研究与实现", 电脑知识与技术, no. 33 * |
Also Published As
Publication number | Publication date |
---|---|
CN112000480B (en) | 2023-12-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7823131B2 (en) | Debugger for a hardware-implemented operating system | |
US6539500B1 (en) | System and method for tracing | |
US6125401A (en) | Server detection of client process termination | |
WO2019161619A1 (en) | Automatic interface test method and apparatus, and device and computer-readable storage medium | |
JPS58142458A (en) | Detection control circuit utilizing common bus and detection control method utilizing common bus | |
CN108508874B (en) | Method and device for monitoring equipment fault | |
US8429454B2 (en) | Coordination of error reporting among multiple managed runtimes in the same process | |
EP4318211A1 (en) | Method for inspecting code under weak memory order architecture, and corresponding device | |
CN113190427B (en) | Method and device for monitoring blocking, electronic equipment and storage medium | |
KR900004291B1 (en) | A method and apparatus for coordinating exceution of an instruction by a processor | |
CN103034577A (en) | Method and device for positioning slow shutdown | |
US7685381B2 (en) | Employing a data structure of readily accessible units of memory to facilitate memory access | |
US20090055807A1 (en) | Fast image loading mechanism in cell spu | |
US8346975B2 (en) | Serialized access to an I/O adapter through atomic operation | |
CN112000480A (en) | Method, device, equipment and medium for improving SSD full-disk scanning efficiency | |
WO2009009090A1 (en) | Exception-based error handling in an array-based language | |
CN114416317B (en) | Inter-core interrupt execution method, inter-core interrupt processing device, inter-core interrupt equipment and storage medium | |
CN112415307B (en) | ATS instrument resource control method for parallel test | |
US8090991B2 (en) | Information processing apparatus, method, and computer program product for self-diagnosis for utilizing multiple diagnostic devices, each having exclusive access to a resource | |
US12007936B2 (en) | Power efficient memory value updates for arm architectures | |
CN116841697B (en) | Method for processing MMIO request, electronic device and storage medium | |
CN110955507B (en) | Method for multitask access to same IIC bus based on vxWorks system | |
US7305508B2 (en) | Semaphoring system between system firmware and hardware manipulation subsystem | |
JP2006185365A (en) | Semiconductor device and debugging method | |
CN114003534A (en) | Method, device, terminal and storage medium for reporting PCIE (peripheral component interface express) equipment information to BMC (baseboard management controller) |
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 |