CN112416675B - Capacity expansion detection method and device for memory - Google Patents

Capacity expansion detection method and device for memory Download PDF

Info

Publication number
CN112416675B
CN112416675B CN202011296077.XA CN202011296077A CN112416675B CN 112416675 B CN112416675 B CN 112416675B CN 202011296077 A CN202011296077 A CN 202011296077A CN 112416675 B CN112416675 B CN 112416675B
Authority
CN
China
Prior art keywords
data
detected
memory
determining
storage position
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
CN202011296077.XA
Other languages
Chinese (zh)
Other versions
CN112416675A (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.)
Hangzhou Ezviz Software Co Ltd
Original Assignee
Hangzhou Ezviz Software 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 Hangzhou Ezviz Software Co Ltd filed Critical Hangzhou Ezviz Software Co Ltd
Priority to CN202011296077.XA priority Critical patent/CN112416675B/en
Publication of CN112416675A publication Critical patent/CN112416675A/en
Application granted granted Critical
Publication of CN112416675B publication Critical patent/CN112416675B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
    • 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)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a capacity expansion detection method and device for a memory. The method comprises the following steps: determining a first storage position from a nominal capacity for a memory to be detected; writing preset first data in the first storage position according to a first data quantity; reading first verification data in the first data amount at the first storage location; and if the first verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.

Description

Capacity expansion detection method and device for memory
Technical Field
The present disclosure relates to the field of storage technologies, and in particular, to a method and an apparatus for detecting capacity expansion of a memory.
Background
Memories have become an indispensable tool in work and life, especially removable memories, such as flash drives (USB flash drives) commonly called U-discs, portable storage devices (Portable storage device) commonly called mobile hard disks, secure digital cards (Secure Digital Memory Card/SD Card) commonly called SD cards, mini-digital cards (Micro SD Card), commonly called mini SD cards or TF cards, and the like. With the rapid upgrade of digital products, the storage capacity has been in the original MB units, spanning to GB, and TB units, and has been extremely popular.
However, as storage technology advances, there is a method of expanding a capacity of a memory (simply referred to as expanding a capacity), which can label a storage capacity to be larger than its actual capacity by changing master control information on the memory, so that a result exceeding its actual storage capacity is displayed in a computer, and the storage capacity recognized by the computer can be referred to as a nominal capacity.
For example, after the capacity of a usb disk with an actual capacity of 4GB is expanded, the nominal capacity can reach 8GB, even 16GB, but the actual capacity is only 4GB, which causes a lot of inconveniences in the use process. It follows that there is a need for a scheme that can detect whether a memory has been subjected to a capacity expansion process.
Disclosure of Invention
The embodiment of the application provides a capacity expansion detection method for a memory, which can detect whether the memory is subjected to capacity expansion processing.
The embodiment of the application provides a capacity expansion detection device for a memory, which can detect whether the memory is subjected to capacity expansion processing.
In order to solve the technical problems, the embodiment of the application is realized as follows:
the embodiment of the application adopts the following technical scheme:
a method for detecting expansion of a memory, comprising:
determining a first storage position from a nominal capacity for a memory to be detected;
writing preset first data in the first storage position according to a first data quantity;
reading first verification data in the first data amount at the first storage location;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
A capacity expansion detection device for a memory, comprising: a position determining unit, a data writing unit, a data reading unit, and a capacity expansion detecting unit, wherein,
the position determining unit is used for determining a first storage position from the nominal capacity aiming at the memory to be detected;
the data writing unit is used for writing preset first data with a first data amount from the first storage position;
the data reading unit is used for reading first verification data with the first data amount from the first storage position;
and the capacity expansion detection unit is used for determining that the memory to be detected is subjected to capacity expansion processing if the first verification data and the first data are detected to be inconsistent in data content.
As can be seen from the technical solutions provided in the foregoing embodiments, for a memory that needs to perform capacity expansion detection, a first storage location may be determined from a nominal capacity, then preset first data is written in the first storage location in a first data amount, then first verification data is read out from the first storage location in the written first data amount, and if it is detected that the first verification data is inconsistent with the first data in data content, it may be determined that the memory is subjected to capacity expansion processing.
That is, if the memory is subjected to the expansion processing, there is a possibility that data cannot be written normally from a certain memory location, and even if the writing is shown to be successful, there is a high possibility that the data is written falsely, and the data read out is different from the data written. The memory which has not been subjected to the expansion processing is consistent in data content regardless of the storage location in which the data is written and the data is read. Therefore, by using this, it is possible to realize detection of whether the memory is subjected to the capacity expansion processing in the above manner.
Drawings
In order to more clearly illustrate the embodiments or prior art solutions of the present application, the drawings that are required for the description of the embodiments or prior art will be briefly described below, it being apparent that the drawings in the following description are only some of the embodiments described in the present application, and that other drawings may be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a flow chart of a method for detecting expansion of a memory according to an embodiment of the present application;
fig. 2 is a schematic diagram of a capacity expansion detection method for a memory according to an embodiment of the present application;
fig. 3 is a schematic diagram of a capacity expansion detection method for a memory according to an embodiment of the present application;
fig. 4 is a schematic diagram of a capacity expansion detection method for a memory according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a capacity expansion detection device for a memory according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments in the present application with reference to the accompanying drawings.
Example 1
The present embodiment provides a capacity expansion detection method for a memory, which can detect whether the memory is subjected to capacity expansion processing.
It is assumed that the execution subject may be an electronic device such as a computer, a camera, or the like connected to the memory, for example, a desktop computer, a mobile computer (notebook computer), or the like; the memory may be a usb disk or a removable hard disk as described above, or other types of memory; the connection mode may be a connection through USB (Universal Serial Bus ), or SDIO (Secure Digital Input and Output, secure digital input output card), but in practical application, the connection may also be different types such as Type-A, type-B, type-c in USB, and may also be a connection through other modes, such as wireless connection.
The specific flow diagram of the method provided in this embodiment is shown in fig. 1, and includes:
step 102: for a memory to be detected, a first memory location is determined from the nominal capacity.
As already mentioned above, nominal capacity may refer to the storage capacity identified by the computer after the memory is connected to the computer. For example, the actual capacity of a certain usb disk is 4GB, but after the capacity expansion process, the actual capacity of the certain usb disk can be identified as 8GB by the computer, so that 4GB is the actual capacity of the certain usb disk, and 8GB is the nominal capacity of the certain usb disk, and in practice, the memory after the capacity expansion process is also usually sold with the nominal capacity.
The actual capacity of the flash disk after the capacity expansion process (simply referred to as "capacity expansion disk") is not changed, so that only data not greater than the actual capacity can be written when data is written, and the storage positions are also at the positions of the actual capacity. For example, a 4GB USB flash disk, the actual storage location includes the initial location to the end location of 4GB, and even if the storage locations are expanded to 8GB, each storage location of 4GB to 8GB is obtained virtually by the expansion technology, and belongs to the virtual storage location.
Therefore, based on the characteristics of the expansion disc at the storage location, this step can find a location that may be a storage location other than the actual capacity. For example, it may be one-fourth of a storage location, one-half (half) of a storage location, three-quarters of a storage location, three-fifths of a storage location, etc.
For example, in the foregoing example, after a usb disk with an actual capacity of 4GB is expanded to 8GB, in the nominal capacity, as long as the first half of the storage locations can be used to store data, the second half of the storage locations are all analog or virtual storage locations. For another example, after a 4GB USB flash disk is expanded to 16GB, only the first quarter of the storage locations may be used in the nominal capacity.
In the current capacity expansion mode, the nominal capacity is usually expanded to be twice or multiple of the actual capacity, for example, the capacity of 4GB is expanded to be 8GB or 16GB, the capacity of 8GB is expanded to be 16G or 32GB, and the like, so that after repeated verification, when the first storage position is determined, the detection is more accurate at the storage position of half the nominal capacity, and compared with the situation that if the capacity of a U disk with the actual capacity of 4GB is expanded to be 8GB or 16GB, the storage position of 4GB or 8GB of the storage position of half the nominal capacity is reached, the virtual capacity after expansion is expanded, and the effect is more remarkable by starting to test whether the capacity expansion operation is executed at the position.
Therefore, in one embodiment, to obtain a better detection effect, the determining, for the memory to be detected, the first storage location from the nominal capacity may include: for a memory to be detected, a first memory location that reaches half of the nominal capacity is determined from the nominal capacity. Of course, a first storage location of three-quarters of nominal capacity is typically achieved. That is, the first storage location may be considered as a storage location where no virtual memory exists or is expanded in the memory after expansion.
Step 104: and writing preset first data in the first storage position according to the first data quantity.
The memory after the expansion processing generally cannot normally write data in the virtual memory location, or may be temporarily written into the cache even if normal writing is displayed. As already described above, the first storage location may be regarded as an absent or virtual storage location, so that in this step, the predetermined first data may be written in the first storage location with the first data amount.
For example, in a usb disk having an actual capacity of 4GB and a nominal capacity of 8GB, the first storage location may be a storage location of 4GB, the first data amount may be assumed to be 30MB, and the first data may be a file in a predetermined certain format. Then this step can start writing a file of a certain format of 30MB from a storage location of 4 GB.
As described above, in the expansion disk, even if successful writing is shown, it is highly likely that writing is performed in the buffer, so that writing can be performed at the time of writing with a larger amount of data than the buffer. In one embodiment, therefore, the method may further comprise, prior to writing the predetermined first data in the first data amount at the first storage location: and obtaining the cache capacity of the memory to be detected, and setting a first data volume not smaller than the cache capacity.
Specifically, the buffer capacity of the memory may be obtained by obtaining the master control information or by actually writing and reading, so that the first data amount not smaller than the buffer capacity may be set. So that when the capacity expansion detection is carried out, whether the capacity expansion disk is the capacity expansion disk can be timely found.
Since different memory qualities are different, there is also a large difference in writing and reading speeds, for example, different reading and writing speeds may occur due to different versions of USB and different specifications of memory granules, so in order to enable faster capacity expansion detection of the memory, in one embodiment, before writing the preset first data in the first data amount in the first storage location, the method may further include: and testing the read-write speed of the memory to be detected, and setting a first data volume according to a preset expected detection duration.
Specifically, data may be written from an initial position of the memory and read, so that a read-write speed per unit time (such as per second) may be tested, and a desired detection duration may be predetermined, such as 1 minute, or 3 minutes, so that it may be determined, according to the read-write speed per unit time, how large a first data amount, such as 10mb,20mb,30mb, etc., may be preset for the memory, where the read-write operation is performed several times within the desired detection duration.
In practical application, the first data designated by the user can be received in advance, so that capacity expansion detection can be performed according to the user requirement. For example, a single video file, or multiple files, etc., specified by the user may be received.
Step 106: and reading the first verification data in the first data amount at the first storage position.
Step 108: if the first verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
As described above, if the memory is not subjected to the capacity expansion operation, the data with consistent content can be read after the data is written in any storage location, otherwise, if the data is written in the virtual storage location, the data pre-stored during capacity expansion, or other data, may be read.
Therefore, the first verification data can be read out from the first storage location in the previous step according to the first data amount written in the previous step. And detecting whether the first verification data and the first data are consistent in data content, and if not, determining that the memory to be detected is subjected to capacity expansion processing.
As shown in fig. 2, a schematic diagram of a capacity expansion detection method for a memory is shown, where after a capacity expansion process, a nominal capacity is 2 times an actual capacity, a first storage location may be a location reaching half of the nominal capacity, first data is written into the memory from the first storage location, and then first verification data is read from the first storage location. Accordingly, whether the first data and the first verification data are consistent in data content or not can be detected, and if the first data and the first verification data are inconsistent, the executed capacity expansion operation can be determined.
In practical application, the first data and the first verification data have the same effect on the data content possibly due to the excellent capacity expansion technology in a software virtual mode. Therefore, if the above-described method is performed only once, erroneous judgment may occur. So in order to be able to detect the expansion operation more accurately, the method may further comprise the steps of:
if the first verification data and the first data are detected to be consistent in data content, writing preset second data in a second storage position according to second data quantity, wherein the second storage position can be a position formed by accumulating the first storage position and the first data quantity;
reading the second verification data in a second amount of data at a second storage location;
if the second verification data and the second data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing.
Specifically, as shown in fig. 3, a schematic diagram of a method for detecting the capacity expansion of the memory is shown, since the first storage location is already occupied by the first data, a second storage location may be determined, where the first storage location and the first data amount are integrated, and as shown in fig. 3, the second storage location may be a location after the first data. Thereafter, similar to the previous steps, the preset second data may be written in a second data amount, and the second verification data may be read out in the second data amount at the second storage location. Accordingly, it is possible to detect whether the second verification data and the second data are consistent in data content, similarly to the foregoing steps, and if not, it is possible to determine that the memory to be detected is subjected to the capacity expansion processing.
Similarly, to enable an accurate detection of the expansion operation even further, the method may further comprise the steps of:
if the second verification data is detected to be consistent with the second data in data content, reading the third verification data again by the first data amount at the first storage position;
if the third verification data is detected to be inconsistent with the first data in data content, the memory to be detected is determined to be subjected to capacity expansion processing.
Specifically, as shown in fig. 3, even if the capacity expansion technology is excellent, errors may occur in the repeated reading and writing process, so after the first data and the second data are written, the first data may be returned, and the third verification data may be read again in the first data amount at the first storage location. And matching the first data, and if the test detects that the third verification data is inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
Similarly, in practical applications, all the above three progressive steps may be performed multiple times, for example, as shown in fig. 4, the method is a schematic diagram of a capacity expansion detection method for a memory, the second data may be written multiple times with a step size of the second data, and the storage location may be a storage location after each accumulation, so that multiple times of detection may be performed by repeatedly writing and reading the second data.
In practical applications, the data amount written each time may be changed, for example, the third data is written in the third storage location (after the second storage location accumulates the second data) by the third data amount, and reading, detecting, etc. may be performed. And the data volume of each time can be customized, gradually increased, gradually reduced and the like.
In practical applications, in order to enable the written data to occupy a designated storage location, so as to enable better reading and detection, in an embodiment, the first data and the second data written in the foregoing steps may be both single data, for example, may be a single file in a certain format, so that the written data may occupy a storage location of a certain section more completely, so as to facilitate reading as a whole.
As can be seen from the methods provided by the above examples,
for the memory which needs to perform capacity expansion detection, a first storage position can be determined from a nominal capacity, preset first data is written in the first storage position according to a first data amount, then first verification data is read out from the first storage position according to the written first data amount, and if the fact that the first verification data is inconsistent with the first data in data content is detected, the memory can be determined to perform capacity expansion processing.
That is, if the memory is subjected to the expansion processing, there is a possibility that data cannot be written normally from a certain memory location, and even if the writing is shown to be successful, there is a high possibility that the data is written falsely, and the data read out is different from the data written. The memory which has not been subjected to the expansion processing is consistent in data content regardless of the storage location in which the data is written and the data is read. Therefore, by using this, it is possible to realize detection of whether the memory is subjected to the capacity expansion processing in the above manner.
Example 2
Based on the same conception, the embodiments of the present application provide a capacity expansion detection device for a memory, which can detect whether the memory is subjected to capacity expansion processing. The structure of the device is schematically shown in fig. 5, and the device comprises: a position determining unit 202, a data writing unit 204, a data reading unit 206, and a capacity expansion detecting unit 208, wherein,
the location determining unit 202 may be configured to determine, for a memory to be detected, a first storage location from a nominal capacity;
a data writing unit 204, configured to write preset first data in a first data amount from a first storage location;
a data reading unit 206 operable to read the first verification data in a first data amount from the first storage location;
the capacity expansion detection unit 208 may be configured to determine that the memory to be detected is subjected to capacity expansion processing if it is detected that the first verification data and the first data are inconsistent in data content.
In one embodiment of the present invention, in one embodiment,
the capacity expansion detection unit 208 may be configured to trigger the position determination unit 202 if it is detected that the first verification data is consistent with the first data in terms of data content, and may be configured to determine a second storage position, where the second storage position is a position where the first storage position and the first data amount are integrated; and triggers the data writing unit 204, which may be configured to write preset second data in a second data amount in a second storage location;
a data reading unit 206 operable to read the second verification data in the second data amount at the second storage location;
the capacity expansion detection unit 208 may be configured to determine that the memory to be detected is subjected to capacity expansion processing if it is detected that the second verification data and the second data are inconsistent in data content.
In one embodiment of the present invention, in one embodiment,
the capacity expansion detection unit 208 may be configured to trigger the data reading unit 206 to read the third verification data again with the first data amount at the first storage location if the second verification data is detected to be consistent with the second data in data content;
the capacity expansion detection unit 208 may be configured to determine that the memory to be detected is subjected to capacity expansion processing if it is detected that the third verification data is inconsistent with the first data in data content.
In one embodiment, the location determination unit 202 may be configured to:
for a memory to be detected, a first memory location that reaches half of the nominal capacity is determined from the nominal capacity.
In an embodiment, the apparatus comprises a data amount determining unit operable to: before writing a first data amount into a first storage location, the first storage location is written with a first data amount,
and testing the read-write speed of the memory to be detected, and setting a first data volume according to a preset expected detection duration.
In an embodiment, the apparatus comprises a data amount determining unit operable to: before writing a first data amount into a first storage location, the first storage location is written with a first data amount,
and obtaining the cache capacity of the memory to be detected, and setting a first data volume not smaller than the cache capacity.
In one embodiment, the first data and the second data written may each be a single data.
As can be seen from the method provided in the above embodiment, for a memory that needs to perform capacity expansion detection, a first storage location may be determined from a nominal capacity, then preset first data is written in the first storage location in a first data amount, then first verification data is read out from the first storage location in the written first data amount, and if it is detected that the first verification data is inconsistent with the first data in data content, it may be determined that the memory is subjected to capacity expansion processing.
That is, if the memory is subjected to the expansion processing, there is a possibility that data cannot be written normally from a certain memory location, and even if the writing is shown to be successful, there is a high possibility that the data is written falsely, and the data read out is different from the data written. The memory which has not been subjected to the expansion processing is consistent in data content regardless of the storage location in which the data is written and the data is read. Therefore, by using this, it is possible to realize detection of whether the memory is subjected to the capacity expansion processing in the above manner.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. At the hardware level, the electronic device comprises a processor, optionally an internal bus, a network interface, a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 6, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program, and a capacity expansion detection device for the memory is formed on a logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
determining a first storage position from a nominal capacity for a memory to be detected;
writing preset first data in the first storage position according to a first data quantity;
reading first verification data in the first data amount at the first storage location;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
The method executed by the capacity expansion detection device for a memory according to the embodiment shown in fig. 5 of the present application may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may also execute the function of the embodiment shown in fig. 6 of the capacity expansion detection device for a memory provided in the embodiment shown in fig. 5, which is not described herein again.
The embodiments of the present application also provide a computer readable storage medium storing one or more programs, where the one or more programs include instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform a method performed by the expansion detection apparatus for a memory in the embodiment shown in fig. 5, and specifically is configured to perform:
determining a first storage position from a nominal capacity for a memory to be detected;
writing preset first data in the first storage position according to a first data quantity;
reading first verification data in the first data amount at the first storage location;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (8)

1. A method for detecting expansion of a memory, comprising:
determining a first storage position from a nominal capacity for a memory to be detected;
writing preset first data in the first storage position according to a first data quantity;
reading first verification data in the first data amount at the first storage location;
if the first verification data and the first data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
the determining, for the memory to be detected, a first storage location from the nominal capacity includes:
determining a first storage position reaching or exceeding half of a nominal capacity from the nominal capacity aiming at a memory to be detected;
the method further comprises the steps of:
if the first verification data and the first data are detected to be consistent in data content, writing preset second data in a second storage position according to a second data quantity, wherein the second storage position is a position formed by accumulating the first storage position and the first data quantity;
reading second verification data at the second storage location in the second data amount;
if the second verification data and the second data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
the method further comprises the steps of:
if the second verification data and the second data are detected to be consistent in data content, reading third verification data again by the first data amount at the first storage position;
and if the third verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
2. The method of claim 1, wherein determining a first storage location from a nominal capacity for a memory to be detected comprises:
for a memory to be detected, a first memory location that reaches half of the nominal capacity is determined from the nominal capacity.
3. The method of claim 1, wherein prior to writing the preset first data in the first data amount at the first storage location, the method further comprises:
and obtaining the cache capacity of the memory to be detected, and setting a first data volume not smaller than the cache capacity.
4. The method of claim 1, wherein prior to writing the preset first data in the first data amount at the first storage location, the method further comprises:
and testing the read-write speed of the memory to be detected, and setting a first data volume according to a preset expected detection duration.
5. The method of claim 1, wherein the first data and the second data written are a single data.
6. A capacity expansion detection device for a memory, comprising: a position determining unit, a data writing unit, a data reading unit, and a capacity expansion detecting unit, wherein,
the position determining unit is used for determining a first storage position from the nominal capacity aiming at the memory to be detected;
the data writing unit is used for writing preset first data with a first data amount from the first storage position;
the data reading unit is used for reading first verification data with the first data amount from the first storage position;
the capacity expansion detection unit is used for determining that the memory to be detected is subjected to capacity expansion processing if the first verification data and the first data are detected to be inconsistent in data content;
the position determining unit is used for determining a first storage position reaching or exceeding half of the nominal capacity from the nominal capacity aiming at the memory to be detected;
the data writing unit is used for writing preset second data in a second storage position according to a second data amount if the first verification data are detected to be consistent with the first data in data content, wherein the second storage position is a position formed by accumulating the first storage position and the first data amount;
reading second verification data at the second storage location in the second data amount;
if the second verification data and the second data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
if the second verification data and the second data are detected to be consistent in data content, reading third verification data again by the first data amount at the first storage position;
and if the third verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
7. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
determining a first storage position from a nominal capacity for a memory to be detected;
writing preset first data in a first data amount from the first storage position;
reading first verification data in the first data amount from the first storage location;
if the first verification data and the first data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
the determining, for the memory to be detected, a first storage location from the nominal capacity includes:
determining a first storage position reaching or exceeding half of a nominal capacity from the nominal capacity aiming at a memory to be detected;
if the first verification data and the first data are detected to be consistent in data content, writing preset second data in a second storage position according to a second data quantity, wherein the second storage position is a position formed by accumulating the first storage position and the first data quantity;
reading second verification data at the second storage location in the second data amount;
if the second verification data and the second data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
if the second verification data and the second data are detected to be consistent in data content, reading third verification data again by the first data amount at the first storage position;
and if the third verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
8. A computer-readable storage medium storing one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to:
determining a first storage position from a nominal capacity for a memory to be detected;
writing preset first data in a first data amount from the first storage position;
reading first verification data in the first data amount from the first storage location;
if the first verification data and the first data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
the determining, for the memory to be detected, a first storage location from the nominal capacity includes:
determining a first storage position reaching or exceeding half of a nominal capacity from the nominal capacity aiming at a memory to be detected;
if the first verification data and the first data are detected to be consistent in data content, writing preset second data in a second storage position according to a second data quantity, wherein the second storage position is a position formed by accumulating the first storage position and the first data quantity;
reading second verification data at the second storage location in the second data amount;
if the second verification data and the second data are detected to be inconsistent in data content, determining that the memory to be detected is subjected to capacity expansion processing;
if the second verification data and the second data are detected to be consistent in data content, reading third verification data again by the first data amount at the first storage position;
and if the third verification data is detected to be inconsistent with the first data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
CN202011296077.XA 2020-11-18 2020-11-18 Capacity expansion detection method and device for memory Active CN112416675B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011296077.XA CN112416675B (en) 2020-11-18 2020-11-18 Capacity expansion detection method and device for memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011296077.XA CN112416675B (en) 2020-11-18 2020-11-18 Capacity expansion detection method and device for memory

Publications (2)

Publication Number Publication Date
CN112416675A CN112416675A (en) 2021-02-26
CN112416675B true CN112416675B (en) 2023-05-02

Family

ID=74773414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011296077.XA Active CN112416675B (en) 2020-11-18 2020-11-18 Capacity expansion detection method and device for memory

Country Status (1)

Country Link
CN (1) CN112416675B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110598473A (en) * 2019-09-18 2019-12-20 深圳市网心科技有限公司 Mobile storage medium management method, device and equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102969026B (en) * 2012-10-25 2015-09-30 北京奇虎科技有限公司 Based on movable storage device detection method and the device of data handling system
CN103116536B (en) * 2013-02-25 2016-02-24 杭州华澜微电子股份有限公司 The capacity check method of memory storage
CN103646669B (en) * 2013-11-29 2016-08-24 北京奇虎科技有限公司 The reliability checking method of a kind of movable storage device and device
CN104484634B (en) * 2014-12-23 2017-06-09 电子科技大学 The dilatation detection method of RAM card and the card reader with dilatation detection function

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110598473A (en) * 2019-09-18 2019-12-20 深圳市网心科技有限公司 Mobile storage medium management method, device and equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
工大无疆.《扩容盘识别检测与修复》.《网友世界》.2011,全文. *

Also Published As

Publication number Publication date
CN112416675A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
US10853238B2 (en) Unaligned data coalescing
US7899967B2 (en) Systems for accessing memory card and methods for accessing memory card by a control unit
US8370611B2 (en) Memory card, memory system including the same, and operating method thereof
US8281072B2 (en) Data processing system, controller, and method thereof for searching for specific memory area
US20130117507A1 (en) Memory storage apparatus, memory controller, and method for transmitting and identifying data stream
EP2973572B1 (en) System and method of reading data from memory concurrently with sending write data to the memory
KR101566849B1 (en) Method for managing memory apparatus, associated memory apparatus thereof and associated controller thereof
US20090077436A1 (en) Method for recording memory parameter and method for optimizing memory
US20120246384A1 (en) Flash memory and flash memory accessing method
US20140372831A1 (en) Memory controller operating method for read operations in system having nonvolatile memory device
US9384125B2 (en) Method for accessing flash memory having pages used for data backup and associated memory device
KR20160005570A (en) Methods for maunfacturing and operating memory device and method for operating thereof
US20170160938A1 (en) Data storage device and mode-detection method thereof
KR20170130402A (en) Systems and methods for refreshing storage elements
CN113176859B (en) Data storage method and device
US11036493B2 (en) Memory system and operating method thereof
US20150186257A1 (en) Managing a transfer buffer for a non-volatile memory
CN112416675B (en) Capacity expansion detection method and device for memory
CN117012268B (en) Method, controller, system and medium for testing maximum performance of UFS
CN108614664B (en) Read error processing method and device based on NAND flash
CN108628752B (en) Data storage method and device
CN108628538B (en) Data storage method and device in NAND Flash
US20190155543A1 (en) Data storage device, operating method thereof and method for operating nonvolatile memory device
CN112684981B (en) Method, system and device for recording read operation of solid state disk and readable storage medium
US6742073B1 (en) Bus controller technique to control N buses

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