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

Capacity expansion detection method and device for memory Download PDF

Info

Publication number
CN112416675A
CN112416675A CN202011296077.XA CN202011296077A CN112416675A CN 112416675 A CN112416675 A CN 112416675A CN 202011296077 A CN202011296077 A CN 202011296077A CN 112416675 A CN112416675 A CN 112416675A
Authority
CN
China
Prior art keywords
data
memory
detected
capacity
verification
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
Application number
CN202011296077.XA
Other languages
Chinese (zh)
Other versions
CN112416675B (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 the nominal capacity aiming at a memory to be detected; writing preset first data in the first storage position according to a first data volume; reading first verification data at the first storage location in the first amount of data; and if the first verification data is detected to be inconsistent with the first data in data content, determining that the to-be-detected memory is subjected to capacity expansion processing.

Description

Capacity expansion detection method and device for memory
Technical Field
The present application relates to the field of storage technologies, and in particular, to a method and an apparatus for capacity expansion detection of a memory.
Background
Memories have become essential tools in work and life, and particularly, removable memories, such as a flash disk (USB flash drive), a Portable storage device (Portable storage device), a Secure Digital Card (SD), a mini Digital Card (Micro SD Card, Trans-flash Card), a mini SD Card, or a TF Card, are commonly referred to as a USB disk, a mobile hard disk, or a Secure Digital Card. With the rapid upgrade of digital products, the storage capacity of the digital products already has original MB units, and spans to GB and TB units, and the popularization rate is extremely high.
However, with the advance of storage technology, a method for expanding the capacity of a memory (called capacity expansion for short) has appeared, and this capacity expansion method can mark the effect that the storage capacity is greater than its actual capacity by changing the master information on the memory, so that in a computer, the result that the storage capacity is greater than its actual storage capacity is displayed, and the storage capacity recognized by the computer can be called the nominal capacity.
For example, after a usb disk with an actual capacity of 4GB is expanded, the nominal capacity can reach 8GB or even 16GB, but since the actual capacity is only 4GB, a lot of inconvenience is caused in the using process. Therefore, it is desirable to provide a solution that can detect whether the memory is subjected to the capacity expansion processing.
Disclosure of Invention
The embodiment of the application provides a method for detecting capacity expansion of a memory, which can detect whether the memory is subjected to capacity expansion processing.
The embodiment of the present application provides a capacity expansion detection apparatus for a memory, which can detect whether capacity expansion processing is executed on the memory.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
the embodiment of the application adopts the following technical scheme:
a capacity expansion detection method for a memory is characterized by comprising the following steps:
determining a first storage position from the nominal capacity aiming at a memory to be detected;
writing preset first data in the first storage position according to a first data volume;
reading first verification data at the first storage location in the first amount of data;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the to-be-detected memory is subjected to capacity expansion processing.
An expansion detection device for a memory, comprising: a position determination unit, a data writing unit, a data reading unit, and an expansion detection 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 in a first data volume from the first storage position;
the data reading unit is used for reading first verification data by the first data quantity from the first storage position;
the capacity expansion detection unit is configured to determine that the to-be-detected memory is subjected to capacity expansion processing if it is detected that the first verification data is inconsistent with the first data in data content.
As can be seen from the technical solutions provided in the above embodiments, for a memory that needs to be subjected to capacity expansion detection, a first storage location may be determined from a nominal capacity, then a preset first data is written in the first storage location by a first data amount, then a first verification data is read from the first storage location by 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 has been subjected to capacity expansion processing.
That is, if the memory is subjected to the expansion processing, there is a possibility that data cannot be normally written from a certain storage location, and even if the display writing is successful, there is a high possibility that the data is written in a false manner, and the read data is different from the written data. In the memory in which the expansion processing is not performed, the data contents are consistent regardless of the storage location in which the data is written and read. Therefore, by using this point, it is possible to detect whether the memory has been subjected to the over-capacity processing in the above manner.
Drawings
In order to more clearly illustrate the embodiments or prior art solutions of the present application, the drawings needed for describing the embodiments or prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and that other drawings can be obtained by those skilled in the art without inventive exercise.
Fig. 1 is a schematic flowchart of a capacity expansion detection method for a memory according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a capacity expansion detection method for a memory according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a capacity expansion detection method for a memory according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a capacity expansion detection method for a memory according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a capacity expansion detection apparatus for a memory according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following embodiments and accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
The present embodiment provides a method for detecting capacity expansion of a memory, which can detect whether capacity expansion processing is performed on the memory.
It is assumed that the execution subject may be an electronic device such as a computer, a camera, etc. connected to the memory, for example, a desktop computer or a mobile computer (notebook computer), etc.; the memory may be a U disk or a removable hard disk as described above, or other types of memory; the connection mode may be connected through USB (Universal Serial Bus) or SDIO (Secure Digital Input and Output card), or may be different types such as Type-A, Type-B, Type-c in USB in practical applications, and may also be connected through other modes, such as wireless connection.
A specific flowchart of the method provided in this embodiment is shown in fig. 1, and includes:
step 102: for the memory to be detected, a first memory location is determined from the nominal capacity.
It has been mentioned above that the nominal capacity may refer to the storage capacity that is recognized by the computer after the storage device is connected to the computer. For example, the actual capacity of a certain usb flash disk is 4GB, but after the capacity expansion process, the capacity of the certain usb flash disk can be recognized by the computer as 8GB, then 4GB is the actual capacity of the certain usb flash disk, and 8GB is the nominal capacity of the certain usb flash disk, and in practice, the certain usb flash disk is usually sold at the nominal capacity through the memory subjected to the capacity expansion process.
Since the actual capacity of the flash disk (abbreviated as "capacity expansion disk") after capacity expansion processing does not change, only data not larger than the actual capacity can be written when data is written, and the storage location is at each location of the actual capacity. For example, in a 4GB usb disk, the actual storage location includes an initial location to a 4GB end location, and even if the storage location is subjected to capacity expansion processing to 8GB, the storage locations from 4GB to 8GB are obtained virtually by a capacity expansion technique and belong to a virtual storage location.
Therefore, based on the above characteristics of the flash disk at the storage location, this step can find a location that may be a storage location other than the actual capacity. For example, there may be one-quarter of the storage locations, one-half of the storage locations, three-quarters of the storage locations, three-fifths of the storage locations, etc.
For example, after the usb disk with an actual capacity of 4GB is expanded to 8GB, in the nominal capacity, only the first half of the storage locations may be used for storing data, and the second half of the storage locations are analog or virtual storage locations. For another example, after a 4GB usb disk is expanded to 16GB, only the first quarter of the storage locations in the nominal capacity are available.
At present, the capacity expansion mode usually expands the nominal capacity to twice or twice the actual capacity, for example, the capacity expansion of 4GB is 8GB or 16GB, and the capacity expansion of 8GB is 16G or 32GB, so after repeated verification, when determining the first storage location, it is more accurate to start detecting at the storage location of half the nominal capacity, and if the capacity expansion of the usb disk of actual capacity 4GB is 8GB or 16GB, the storage location of 4GB or 8GB which reaches the storage location of half the nominal capacity is the "virtual capacity" after expansion, and if the capacity expansion operation is performed, the detection is started at this location, and the effect is more remarkable.
Therefore, in an embodiment, in order to obtain a better detection effect, the step of determining the first storage location from the nominal capacity for the memory to be detected may include: for the memory to be tested, from the nominal capacity, a first memory location is determined which reaches half the nominal capacity. Of course, a first storage location that is up to three-quarters of the nominal capacity will generally also provide better detection. That is, the first storage location may be regarded as a storage location which is not present in the memory after the capacity expansion or is virtualized after the capacity expansion.
Step 104: in the first storage position, preset first data is written in a first data volume.
The memory after the capacity expansion processing usually cannot normally write data in the virtualized storage position, or may temporarily write data into the cache even if normal writing is displayed. As described above, the first storage location may be regarded as a non-existent or capacity-expanded virtual storage location, so in this step, the preset first data may be written in the first storage location by the first data amount.
For example, in a usb disk with 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 format. Then this step can write a 30MB file of a certain format starting from a 4GB storage location.
As described above, in the expansion disc, even if successful writing is indicated, it is highly likely that writing is performed in the cache, so that writing can be performed in a larger amount of data than the cache at the time of writing. Therefore, in an embodiment, before writing the preset first data in the first storage location by the first data amount, the method may further include: the method comprises the steps of obtaining the cache capacity of a memory to be detected, and setting a first data size not smaller than the cache capacity.
Specifically, the cache capacity of the memory may be obtained by obtaining the master control information or actually writing and reading, so that a first data amount not less than the cache capacity may be set. So that whether the expansion disc is used or not can be found in time during the expansion detection.
Since different memories have different qualities, and therefore the writing and reading speed also has a large difference, for example, different read and write speed differences occur due to different versions of USB and different specifications of storage particles, in order to perform capacity expansion detection on the memory quickly, in an embodiment, before writing the preset first data in the first storage location by the first data amount, 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 the preset expected detection time length.
Specifically, data may be written and read from an initial position of the memory, so that a read-write speed per unit time (e.g., per second) may be tested, and a desired detection time period, such as 1 minute, 3 minutes, or the like, may be predetermined, so that it may be determined, according to the read-write speed per unit time, how many times the read-write operation is performed to be controlled within the desired detection time period, and how large a first data amount, such as 10MB, 20MB, 30MB, or the like, may be preset for the memory.
In practical application, the first data specified 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: at the first storage location, first verification data is read in the first amount of data.
Step 108: and 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.
As described above, if the memory is not subjected to the capacity expansion operation, the data with the same content can be read out after the data is written in any storage location, whereas if the data is written in the virtual storage location, the data or other data pre-stored during the capacity expansion may be read out.
So that the first verification data can be read at the first storage location in the previous step by the first data amount written in the previous step. And detecting whether the first verification data is consistent with the first data in data content, and if not, determining that the memory to be detected is subjected to capacity expansion processing.
Fig. 2 is a schematic diagram of a capacity expansion detection method for a memory, where after capacity expansion processing, a nominal capacity is 2 times of an actual capacity, a first storage location may be a location that is 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 not consistent, the capacity expansion operation can be determined to be executed.
In practical applications, it is possible that the first data and the first verification data have a consistent effect on data content in a software virtualization manner due to a relatively excellent capacity expansion technology. Therefore, if the above-described method is performed only once, there is a possibility that the erroneous determination may occur. Therefore, in order to detect the capacity expansion operation more accurately, the method may further include the following steps:
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 by a second data volume, wherein the second storage position can be a position obtained by accumulating the first storage position and the first data volume;
reading second verification data at a second storage location in a second amount of data;
and if the second verification data is detected to be inconsistent with the second data in data content, determining that the memory to be detected is subjected to capacity expansion processing.
Specifically, as shown in fig. 3, which is a schematic diagram of a capacity expansion detection method for a memory, since a first storage location is already occupied by first data, a second storage location may be determined, where the first storage location and a first data amount are accumulated, and as shown in fig. 3, the second storage location may be a location after the first data. Thereafter, similarly to the previous steps, the predetermined second data may be written in the second data amount, and the second verification data may be read out in the second data amount at the second storage location. Accordingly, similar to the foregoing steps, it may be detected whether the second verification data is consistent with the second data in data content, and if not, it may be determined that the memory to be detected has been subjected to capacity expansion processing.
Similarly, in order to further accurately detect the capacity expansion operation, the method may further include the following steps:
if the second verification data and the second data are detected to be consistent in data content, reading third verification data again in the first storage position according to the first data quantity;
and if the third verification data is detected to be inconsistent with the first data in data content, determining that the capacity expansion processing is executed on the memory to be detected.
Specifically, as shown in fig. 3, even with the excellent capacity expansion technique, an error may occur during the repeated reading and writing process in the capacity expansion disk, so that after the first data and the second data are written, the third verification data can be read back in the first storage location again by the first data amount. And matching with the first data, and determining that the memory to be detected is subjected to capacity expansion processing if the third verification data is detected to be inconsistent with the first data in data content through testing.
Similarly, in practical applications, all of the three progressive steps may be performed multiple times, for example, as shown in fig. 4, which is a schematic diagram of a capacity expansion detection method for a memory, the second data may be repeatedly written into the memory by using the second data as a step size, and the memory location may be a memory location accumulated each time, so that the second data may be repeatedly written into and read from the memory location, and multiple detections may be performed.
In practical applications, the data amount written each time may be changed, for example, third data may be written in a third storage location (after the second data is accumulated in the second storage location) in a third data amount, and read, detected, and the like may be performed. And the data volume at each time can be customized, or gradually increased or gradually decreased, etc.
In practical applications, in order to enable the written data to occupy a designated storage location, so as to achieve 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, a single file in a certain format, so that the first data and the second data can occupy a storage location in a certain interval more completely, so as to facilitate overall reading.
As can be seen from the method provided in the above embodiment,
for a memory which needs to be subjected to capacity expansion detection, a first storage position may be determined from a nominal capacity, then a preset first data is written in the first storage position by a first data amount, then a first verification data is read from the first storage position by 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 has been subjected to capacity expansion processing.
That is, if the memory is subjected to the expansion processing, there is a possibility that data cannot be normally written from a certain storage location, and even if the display writing is successful, there is a high possibility that the data is written in a false manner, and the read data is different from the written data. In the memory in which the expansion processing is not performed, the data contents are consistent regardless of the storage location in which the data is written and read. Therefore, by using this point, it is possible to detect whether the memory has been subjected to the over-capacity processing in the above manner.
Example 2
Based on the same concept, embodiments of the present application provide a capacity expansion detection apparatus for a memory, which can detect whether a capacity expansion process is performed on the memory. The schematic structural diagram of the device is shown in fig. 5, and the device comprises: a position determination unit 202, a data writing unit 204, a data reading unit 206, and an expansion detection unit 208, wherein,
a location determining unit 202, configured to determine, for the memory to be detected, a first storage location from the nominal capacity;
a data writing unit 204, which may be 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 amount of data starting from the first storage location;
the capacity expansion detection unit 208 may be configured to determine that the capacity expansion process is performed on the memory to be detected if it is detected that the first verification data is inconsistent with the first data in data content.
In one embodiment of the method of the present invention,
the 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 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 accumulated; and the data writing unit 204 is triggered, and may be configured to write preset second data in a second storage location in a second data size;
a data reading unit 206 operable to read the second verification data at the second storage location in the second data amount;
the expansion detection unit 208 may be configured to determine that the memory to be detected is subjected to expansion processing if it is detected that the second verification data is inconsistent with the second data in data content.
In one embodiment of the method of the present invention,
the expansion detection unit 208 may be configured to trigger the data reading unit 206 if it is detected that the second verification data is consistent with the second data in data content, and may be configured to read the third verification data again in the first data amount at the first storage location;
the expansion detection unit 208 may be configured to determine that the memory to be detected is subjected to expansion processing if it is detected that the third verification data is inconsistent with the first data in data content.
In an embodiment, the position determining unit 202 may be configured to:
for the memory to be tested, from the nominal capacity, a first memory location is determined which reaches half the nominal capacity.
In one embodiment, the apparatus includes a data volume determination unit operable to: before writing the predetermined first data in the first storage location with the first data amount,
and testing the read-write speed of the memory to be detected, and setting a first data volume according to the preset expected detection time length.
In one embodiment, the apparatus includes a data volume determination unit operable to: before writing the predetermined first data in the first storage location with the first data amount,
the method comprises the steps of obtaining the cache capacity of a memory to be detected, and setting a first data size 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 foregoing embodiment, for a memory that needs to be subjected to capacity expansion detection, a first storage location may be determined from a nominal capacity, then a preset first data is written in the first storage location by a first data amount, and then a first verification data is read from the first storage location by 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 has been subjected to capacity expansion processing.
That is, if the memory is subjected to the expansion processing, there is a possibility that data cannot be normally written from a certain storage location, and even if the display writing is successful, there is a high possibility that the data is written in a false manner, and the read data is different from the written data. In the memory in which the expansion processing is not performed, the data contents are consistent regardless of the storage location in which the data is written and read. Therefore, by using this point, it is possible to detect whether the memory has been subjected to the over-capacity processing in the above manner.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. On the hardware level, the electronic device comprises a processor and optionally an internal bus, a network interface and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a 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, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory to 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 program stored in the memory and is specifically used for executing the following operations:
determining a first storage position from the nominal capacity aiming at a memory to be detected;
writing preset first data in the first storage position according to a first data volume;
reading first verification data at the first storage location in the first amount of data;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the to-be-detected memory is subjected to capacity expansion processing.
The method executed by the capacity expansion detection apparatus 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 instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also 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. The various methods, steps, and logic blocks disclosed 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 the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further perform the functions of the capacity expansion detection apparatus for a memory provided in the embodiment shown in fig. 5 in the embodiment shown in fig. 6, which are not described herein again in this embodiment of the present application.
An embodiment of the present application further provides 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 multiple application programs, enable the electronic device to perform the method performed by the capacity expansion detection apparatus for a memory in the embodiment shown in fig. 5, and are specifically configured to perform:
determining a first storage position from the nominal capacity aiming at a memory to be detected;
writing preset first data in the first storage position according to a first data volume;
reading first verification data at the first storage location in the first amount of data;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the to-be-detected memory is subjected to capacity expansion processing.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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 divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media 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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A capacity expansion detection method for a memory is characterized by comprising the following steps:
determining a first storage position from the nominal capacity aiming at a memory to be detected;
writing preset first data in the first storage position according to a first data volume;
reading first verification data at the first storage location in the first amount of data;
and if the first verification data is detected to be inconsistent with the first data in data content, determining that the to-be-detected memory is subjected to capacity expansion processing.
2. The method of claim 1, wherein the method further comprises:
if the first verification data and the first data are detected to be consistent in data content, writing preset second data into a second storage position by a second data volume, wherein the second storage position is a position obtained after the first storage position and the first data volume are accumulated;
reading second verification data at the second storage location in the second amount of data;
and if the second verification data is detected to be inconsistent with the second data in data content, determining that the to-be-detected memory is subjected to capacity expansion processing.
3. The method of claim 1, wherein the method further comprises:
if the second verification data and the second data are detected to be consistent in data content, reading third verification data again in the first data size 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 to-be-detected memory is subjected to capacity expansion processing.
4. The method of claim 1, wherein determining a first storage location from a nominal capacity for the memory to be detected comprises:
for a memory to be tested, a first memory location reaching half the nominal capacity is determined from the nominal capacity.
5. The method of claim 1, wherein before writing the predetermined first data in the first storage location in the first data amount, the method further comprises:
the method comprises the steps of obtaining the cache capacity of a memory to be detected, and setting a first data volume which is not less than the cache capacity.
6. The method of claim 1, wherein before writing the predetermined first data in the first storage location in the first data amount, the method further comprises:
and testing the read-write speed of the memory to be detected, and setting a first data volume according to the preset expected detection time length.
7. The method of claims 1 and 2, wherein the first data and the second data written are a single data.
8. An expansion detection device for a memory, comprising: a position determination unit, a data writing unit, a data reading unit, and an expansion detection 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 in a first data volume from the first storage position;
the data reading unit is used for reading first verification data by the first data quantity from the first storage position;
the capacity expansion detection unit is configured to determine that the to-be-detected memory is subjected to capacity expansion processing if it is detected that the first verification data is inconsistent with the first data in data content.
9. 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 the nominal capacity aiming at a memory to be detected;
writing preset first data in a first data quantity from the first storage position;
reading first verification data in the first amount of data starting from 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 to-be-detected memory is subjected to capacity expansion processing.
10. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
determining a first storage position from the nominal capacity aiming at a memory to be detected;
writing preset first data in a first data quantity from the first storage position;
reading first verification data in the first amount of data starting from 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 to-be-detected memory 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 true CN112416675A (en) 2021-02-26
CN112416675B 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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102969026A (en) * 2012-10-25 2013-03-13 北京奇虎科技有限公司 Mobile storage device detection method and apparatus based on data processing system
CN103116536A (en) * 2013-02-25 2013-05-22 杭州华澜微科技有限公司 Method for detecting capacity of storage device
CN103646669A (en) * 2013-11-29 2014-03-19 北京奇虎科技有限公司 Method and device for detecting reliability of removable storage device
CN104484634A (en) * 2014-12-23 2015-04-01 电子科技大学 Memory card dilation detection method and card reader with dilation detection function
CN110598473A (en) * 2019-09-18 2019-12-20 深圳市网心科技有限公司 Mobile storage medium management method, device and equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102969026A (en) * 2012-10-25 2013-03-13 北京奇虎科技有限公司 Mobile storage device detection method and apparatus based on data processing system
CN103116536A (en) * 2013-02-25 2013-05-22 杭州华澜微科技有限公司 Method for detecting capacity of storage device
CN103646669A (en) * 2013-11-29 2014-03-19 北京奇虎科技有限公司 Method and device for detecting reliability of removable storage device
CN104484634A (en) * 2014-12-23 2015-04-01 电子科技大学 Memory card dilation detection method and card reader with dilation detection function
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
工大无疆: "《扩容盘识别检测与修复》" *

Also Published As

Publication number Publication date
CN112416675B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
US7899967B2 (en) Systems for accessing memory card and methods for accessing memory card by a control unit
KR101395778B1 (en) Memory card and memory system including the same and operating method thereof
CN100458693C (en) BIOS read-write memory SPD based computer system information conservation and read method
TWI483188B (en) Electronic device capable of setting boot parameters and setting method
US20090077436A1 (en) Method for recording memory parameter and method for optimizing memory
KR20160005570A (en) Methods for maunfacturing and operating memory device and method for operating thereof
CN109710286B (en) System upgrading method, device, equipment and storage medium
US20170123881A1 (en) Test method of volatile memory device embedded in electronic device
CN113176859B (en) Data storage method and device
CN111813740A (en) File layered storage method and server
CN111930575B (en) Firmware acquisition method and device and electronic equipment
CN117012268B (en) Method, controller, system and medium for testing maximum performance of UFS
CN112416675A (en) Capacity expansion detection method and device for memory
CN111367710B (en) eMMC problem reduction method and device
CN106202262B (en) Information processing method and electronic equipment
CN111370049B (en) eMMC chip testing method and device
US20140181379A1 (en) File Reading Method, Storage Device And Electronic Device
WO2017076034A1 (en) Method and device for formatting memory of mobile terminal
CN113987378A (en) Page rendering time duration monitoring method and device, electronic equipment and storage medium
CN113948146A (en) Test method and device for solid state disk and electronic equipment
CN102446107A (en) Startup method of computer system
CN110647455A (en) Storage device restart recording method and system
CN117215966B (en) Test method and test device for chip SDK interface and electronic equipment
CN109471777A (en) The method and apparatus for determining operating system collapse
CN113626272B (en) Memory read-write rate testing method, device and system based on mmap system

Legal Events

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