CN117409841A - Memory testing method, device, electronic equipment and storage medium - Google Patents

Memory testing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117409841A
CN117409841A CN202310036681.6A CN202310036681A CN117409841A CN 117409841 A CN117409841 A CN 117409841A CN 202310036681 A CN202310036681 A CN 202310036681A CN 117409841 A CN117409841 A CN 117409841A
Authority
CN
China
Prior art keywords
test
memory
test task
task
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310036681.6A
Other languages
Chinese (zh)
Inventor
沈小康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202310036681.6A priority Critical patent/CN117409841A/en
Publication of CN117409841A publication Critical patent/CN117409841A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C29/00Checking stores for correct operation ; Subsequent repair; Testing stores during standby or offline operation
    • 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

Abstract

The embodiment of the application discloses a memory testing method, a memory testing device, electronic equipment and a storage medium; the method includes displaying candidate test tasks; determining a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks; according to the input basic test parameters, a preset dynamic library is called to execute a target test task on the memory, wherein the preset dynamic library comprises test operations indicated by the target test task; and displaying the test process information corresponding to the target test task in the process of executing the target test task. The test operation is packaged in the preset dynamic library, so that the test time can be shortened, and the corresponding test process information can be displayed, so that a user can grasp and know the corresponding test process, the test operation is more convenient and visual, time-saving and labor-saving, and the test efficiency can be effectively improved.

Description

Memory testing method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of testing technologies, and in particular, to a method and apparatus for testing a memory, an electronic device, and a storage medium.
Background
The memory is a memory device in the electronic device, which can be used for storing programs and data, and is an indispensable device for manufacturing consumer electronics. When manufacturing consumer electronic products of the same model, memories with relatively similar performances manufactured by different manufacturers may be used, and in order to ensure that the performances of the memories manufactured by different manufacturers on the consumer electronic products of the same model are basically the same, corresponding tests need to be performed on the memories.
At present, a more common test mode is to manually run a test script by a person to test a memory, but the mode is time-consuming and labor-consuming, so that the test efficiency is low.
Disclosure of Invention
The embodiment of the application provides a memory testing method, a memory testing device, electronic equipment and a storage medium, which can improve testing efficiency.
The embodiment of the application provides a memory testing method, which comprises the following steps:
displaying candidate test tasks;
determining a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks;
according to the input basic test parameters, a preset dynamic library is called to execute the target test task on a memory, and the preset dynamic library comprises test operations indicated by the target test task;
and displaying the test process information corresponding to the target test task in the process of executing the target test task.
The embodiment of the application also provides a memory testing device, which comprises:
the first display module is used for displaying candidate test tasks;
the determining module is used for determining a target test task from the candidate test tasks in response to the selection operation of the candidate test tasks;
The test module is used for calling a preset dynamic library to execute the target test task on the memory according to the input basic test parameters, and the preset dynamic library comprises test operations indicated by the target test task;
and the second display module is used for displaying the test process information corresponding to the target test task in the process of executing the target test task.
The embodiment of the application also provides electronic equipment, which comprises a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to perform steps in any of the memory testing methods provided by the embodiments of the present application.
Embodiments of the present application also provide a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform steps in any of the memory testing methods provided by the embodiments of the present application.
The method and the device can display candidate test tasks, and determine target test tasks from the candidate test tasks based on selection operation so as to automatically call a preset dynamic library to execute the target test tasks on the memory according to the input basic test parameters; the test operation indicated by the target test task is packaged in the preset dynamic library, so that the test time can be shortened, and corresponding test progress information is displayed in the process of executing the target test task, so that a user can grasp and understand the corresponding test process, the test operation is more convenient and visual, time-saving and labor-saving, and the test efficiency can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of a memory test method provided in an embodiment of the present application;
FIG. 2 is a flow chart of a memory testing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic representation of the meaning of different lifetime values provided by embodiments of the present application;
FIG. 4 is a schematic diagram of an overall framework of a memory testing method according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of a method for testing a memory according to another embodiment of the present application;
FIG. 6 is a schematic overall flow chart of a memory testing method according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a memory test device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides a memory test method, a memory test device, electronic equipment and a storage medium.
The memory testing device can be integrated in an electronic device, and the electronic device can be a terminal, a server and other devices. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer (Personal Computer, PC) or the like; the server may be a single server or a server cluster composed of a plurality of servers.
In some embodiments, the memory testing apparatus may also be integrated in a plurality of electronic devices, for example, the memory testing apparatus may be integrated in a plurality of servers, and the memory testing method of the present application is implemented by the plurality of servers.
In some embodiments, the server may also be implemented in the form of a terminal.
For example, referring to fig. 1, an application scenario diagram of a memory test method is shown. The scenario may include terminal device 1000, server 2000, database 3000, and network 4000. Terminal 1000 in the possession of a user can be connected to server 2000 via network 4000. Wherein terminal device 1000 is any device having computing hardware capable of supporting and executing software products corresponding to tests; the server 2000 may be a single server, or may be a server cluster; the network 4000 may be a wireless network or a wired network, such as a Wireless Local Area Network (WLAN), a Local Area Network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, the different terminal apparatuses 1000 may be connected to other terminals or to the server 2000 using their own bluetooth network or hotspot network. The database 3000 is used for storing data generated when a user performs virtual object control using the terminal device 1000.
The terminal device 1000 may be provided with a test application program related to the test, and after the test application program is started, a candidate test task may be displayed by using a graphical user interface of the terminal device 1000; determining a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks; according to the input basic test parameters, a preset dynamic library is called to execute the target test task on a memory, and the preset dynamic library comprises test operations indicated by the target test task; and displaying the test process information corresponding to the target test task in the process of executing the target test task.
The following will describe in detail.
In this embodiment, a memory test method is provided, as shown in fig. 2, and the specific flow of the memory test method may be as follows:
s110, displaying candidate test tasks.
A test-related application may be installed on the terminal that a user may launch to display candidate test tasks on a graphical user interface provided by the terminal. Wherein, the candidate test tasks refer to alternative test tasks. The number and display modes of the candidate test tasks can be set according to actual requirements, and are not particularly limited herein. For example, the candidate test tasks may be displayed as controls in a graphical user interface, or the candidate test tasks may be displayed as icons, or the candidate test tasks may be displayed as a combination of icons and controls.
S120, determining a target test task from the candidate test tasks in response to the selection operation for the candidate test tasks.
After displaying the candidate test tasks on the graphical user interface of the application, a target test task may be determined from the candidate test tasks in response to a selection operation for the candidate test tasks.
The selection operation may include operations such as touching, sliding, pressing, long pressing, short pressing, double clicking, and ending sliding. For example, in some embodiments, the selection operation may be a short press operation; in some embodiments, the selection operation may be a long press operation; in some embodiments, the selection operation may be a sliding operation.
In some embodiments, the selection operation may also be a combination operation, for example, a combination operation of a long press operation plus a slide operation, a combination operation of a click operation plus a click operation, or the like.
As one implementation, after displaying the candidate test tasks on the graphical user interface, the user may click on a certain candidate test task to implement a selection operation for the candidate test task.
As another embodiment, the correspondence between the shortcut key and the candidate test task may be preset, and the player may control the shortcut key to perform the aiming operation. For example, the "1" key is preset as a shortcut key corresponding to the selection operation of the test task a, and the user can click on the "1" key to implement the selection operation of the test task a.
The target test task refers to a candidate test task acted by the selection operation, for example, the displayed candidate test tasks comprise a test task A, a test task B and a test task C; if the operation is selected to act on the test task A, the test task A is a target test task; if the selection operation acts on test task A, then test task A may be determined to be the target test task.
S130, according to the input basic test parameters, calling a preset dynamic library to execute the target test task on the memory, wherein the preset dynamic library comprises test operations indicated by the target test task.
The basic test parameters refer to parameters set by a user and related to testing, and in the embodiment of the application, when testing the memory, writing and reading of data and reading of a lifetime value of the memory are generally involved, so that the basic test parameters may be parameters related to testing the memory. For example, the lifetime value of the memory may be measured once after writing how much data, the time interval for writing data to the memory, the time interval for reading data from the memory, and the like, and the setting may be specifically performed according to actual needs without specific limitation.
The preset dynamic library includes test operations indicated by the target test task, that is, some test operations are encapsulated in the preset dynamic library, and the test operations are test operations to be performed for executing the target test task, for example, may be operations of writing data into a memory, operations of reading data from the memory, operations of checking data, and the like. The test operations are packaged in a preset dynamic library, so that the test time can be shortened, and the test efficiency can be improved.
In some embodiments, according to the input basic test parameters, invoking a preset dynamic library to perform the target test task on the memory may be obtaining the input basic test parameters; invoking a Java local interface through a sub-thread, and invoking the preset dynamic library by utilizing the Java local interface; and executing the test operation indicated by the target test task according to the basic test parameters by using the preset dynamic library.
The basic test parameters may be input by a user, and in some embodiments, after determining the target test task, a basic test parameter input page may be displayed so that the user may input corresponding data and then take the input data as the basic test parameters.
After the basic test parameters are acquired, java local interfaces (Java Native Interface, JNI) can be called through the sub-threads, and a preset dynamic library is called through the JNI. The JNI is equivalent to a bridge between Java and C, and Java can call C language or C++ code through the JNI, and C can call Java code. And the test operation can be packaged into a preset dynamic library by using a C language or C++, and then the child thread calls the preset dynamic library by calling the JNI and then using the JNI so as to execute the test operation indicated by the target test task according to the basic test parameters.
In some embodiments, the basic test parameters may include a write parameter and a preset interval, the target test task may include a life test task, and when a test operation indicated by the target test task is performed according to the basic test parameters using a preset dynamic library, the method may include: writing data into the memory according to the preset interval through the preset dynamic library, and acquiring accumulated written data quantity of the memory; if the accumulated written data amount is matched with the writing parameters, reading the service life value of the memory; and if the service life value is a preset value, determining that the service life test task is finished.
The life test task is to test all the data writing quantity in the range of the life value appointed by the memory. The lifetime value of the memory may be obtained by parsing a corresponding field, for example, the memory is exemplified as an embedded multimedia card (Embedded Multi Media Card, EMMC), where EMMC is an embedded memory and is generally applied to consumer electronic products with high requirements on storage capacity, such as a mobile phone, a tablet computer, and the like. The extended state register of the EMMC can be obtained through a linux device node/sys/kernel/debug/mmc 0/mmc0:0001/ext_csd, the obtained string is the character string, and the character string can be analyzed into a corresponding service life value through a standard protocol. Wherein different lifetime values have different meanings. For example, referring to fig. 3, a schematic diagram of the meaning of different lifetime values is shown, where when the lifetime value of the EMMC is gradually changed from 0x00 to 0x0A in the case of continuous writing of data, once the lifetime value is changed to 0x0b, the correctness of the data of the EMMC is not guaranteed, that is, when the written data is read again, an error may occur, and the lifetime of the EMMC may be considered to be exhausted. The life test task is to test all the data writing amount when the life value of the EMMC is changed from 0x00 to 0x 0A.
The write parameter is a data amount corresponding to data written into the memory, and can be used for indicating a time for acquiring the lifetime value of the memory. In some embodiments, the write parameter may be a plurality of data values, that is, when the amount of data corresponding to the data written to the memory is equal to the write parameter, the lifetime value of the memory is obtained. In some embodiments, the write parameter may be a data value, i.e., a lifetime value of the memory may be obtained once each time data corresponding to the amount of data is written to the memory. When the write parameter is a data amount, it may be converted into a set of data values for later use, for example, when the data amount is 3, it is converted into a set of data amounts of 3, 6, and 9, … …, and when the number of accumulated write memories and any one of the data values are equal, the lifetime value of the memory may be obtained.
The preset interval refers to a time interval for writing data into the memory, for example, after writing data into the memory, the preset interval needs to be waited for, and then the data is written into the memory.
Through the preset dynamic library, data can be written into the memory according to preset intervals, and the accumulated written data quantity of the memory, namely the total quantity of the data written into the memory currently, is obtained. When the accumulated write data amount and the write parameter are equal, it can be determined that the write data amount and the write parameter match, and the lifetime value of the memory can be read. When the read lifetime value is a preset value, the lifetime of the memory may be considered to be exhausted, for example, when the lifetime value is 0x0A, it may be determined that the lifetime test task is performed.
In some embodiments, the basic test parameters may include a write parameter, a read parameter, and a preset interval, the target test task includes a read-write performance test task, and when the test operation indicated by the target test task is executed according to the basic test parameters by using the preset dynamic library, the method may include: writing data into the memory according to the preset interval through the preset dynamic library, and acquiring a corresponding writing speed; reading data from the memory according to the preset interval through the preset dynamic library, and acquiring a corresponding reading speed; if the written data quantity corresponding to the written data is matched with the written parameter, or the read data quantity corresponding to the read data is matched with the read parameter, reading the service life value of the memory; and if the life value is a preset value, or the writing speed is smaller than a preset writing speed, or the reading speed is smaller than a preset reading speed, determining that the read-write performance test task is finished.
The read-write performance test task is to test the maximum speed of the read-write of the memory within the effective life value of the memory, namely, the maximum read-write speed is tested within the period of time when the life value of the memory changes from 0x00 to 0x 0A. The read parameter refers to the amount of data corresponding to the data read from the server, and may be used to indicate the timing of acquiring the lifetime value of the memory.
In some embodiments, the read parameter may be a plurality of data values, that is, when the amount of data corresponding to the data read from the memory is equal to the read parameter, the lifetime value of the memory is obtained. In some embodiments, the read parameter may be a data value, i.e., a lifetime value of the memory may be obtained once each time data corresponding to the amount of data is read from the memory. When the read parameter is a data amount, it may be converted into a set of data amounts for later use, for example, the data value is 4, and then converted into a plurality of values of 8, 12, 16 and … ….
Through a preset dynamic library, data can be written into a memory according to a preset interval, and a corresponding writing speed is obtained; and reading data from the memory, and acquiring a corresponding reading speed.
When the written data quantity corresponding to the written data is equal to the written parameter, the written data quantity and the written parameter can be considered to be matched; when the read data amount corresponding to the read data and the read parameter are equal, the two can be considered to be matched. When the written data amount is matched with the writing parameters or the read data amount is matched with the read parameters, the service life value of the memory can be read.
It should be noted that, as the lifetime value of the memory decays, the read-write speed of the memory decays to a certain extent, and when the read-write speed is decayed to a certain extent, for example, the read speed is smaller than the preset read speed, or the write speed is smaller than the preset write speed, serious clamping may be caused, and even if the lifetime value is not reached, the memory may be considered to be scrapped. The preset read speed and the preset write speed may thus be considered as a minimum read speed and a minimum write speed when the memory is operating normally.
Therefore, when the service life value is a preset value, or the reading speed is smaller than the preset reading speed, or the writing speed is smaller than the preset writing speed, the completion of the execution of the read-write performance test task can be determined.
In some embodiments, the basic test parameters may include a write parameter and a preset interval, the target test task may include a stability test task, and when a test operation indicated by the target test task is performed according to the basic test parameters using a preset dynamic library, the method may include: writing data into the memory according to the preset interval through the preset dynamic library, and then reading the data from the memory; calculating a data difference between the read data and the written data; if the written data quantity corresponding to the written data is matched with the written parameters, reading the service life value of the memory; and if the life value is a preset value or the data difference is a preset difference, determining that the stability test task is finished.
The stability test task may also be referred to as a consistency test task, which is to test the consistency of the written data and the read data in the effective lifetime value of the memory, that is, to test whether the written data and the read data are the same in the period of time when the lifetime value of the memory changes from 0x00 to 0x 0A.
The data can be written into the memory according to preset intervals through the preset dynamic library, and the data can be read from the memory after the data is written into the memory. Recalculating the data difference between the read data and the written data, for example, may be directly comparing the read data and the written data; if the two are consistent, the data difference can be determined to be a first preset value; if the two are inconsistent, the data difference can be determined as a second preset value.
And when the written data quantity corresponding to the written data is matched with the writing parameters, reading the service life value of the memory.
It should be noted that, as the lifetime value of the memory is reduced, errors may occur in data consistency, and when the lifetime value is reduced to a certain level, errors in writing and reading of data may occur, and even if the lifetime value is not reached to the end, the memory may be considered to be discarded.
Therefore, if the life value is a preset value or the data difference is a preset difference, the completion of the execution of the stability test task is determined. The preset difference may be a preset data difference, and in this embodiment of the present application, the preset difference may be set to be a corresponding data difference, for example, a second data difference, when there is a difference between the written data and the read data.
And S140, displaying the test process information corresponding to the target test task in the process of executing the target test task.
In the process of executing the target test task, the test process information corresponding to the target test task can be displayed. As in the previous embodiment, the target test task is executed by the sub-thread, so that this step may include: in the process of executing the target test task, acquiring test process information corresponding to the target test task through a sub-thread; returning the test process information corresponding to the target test task to the main thread through the sub thread, and writing the test process information corresponding to the target test task into a designated file; and displaying the test process information corresponding to the target test task through the main thread.
The test process information corresponding to different target test tasks can be different, and the sub-thread can acquire the corresponding test process information in the process of executing the target test tasks.
In some embodiments, if the target test task includes a lifetime test task, the test progress information that the sub-thread may obtain may include a lifetime value and a cumulative amount of write data of the memory.
In some embodiments, if the target test task includes a read-write performance test task, the test process information that the sub-thread may obtain may include a lifetime value of the memory, a maximum write speed of the memory, and a maximum read speed of the memory.
The maximum writing speed may be the target writing speed after the writing speed is obtained for the first time; when the writing speed is obtained again, comparing with the target writing speed; if the currently acquired writing speed is greater than the target writing speed, recording the currently acquired writing speed as the target writing speed; and if the currently acquired writing speed is smaller than the target writing speed, keeping the target writing speed unchanged.
Similarly, the maximum reading speed may be the target reading speed after the first reading speed is obtained; when the reading speed is obtained again, comparing with the target reading speed; if the currently acquired reading speed is greater than the target reading speed, the currently acquired reading speed is recorded as the target reading speed; and if the currently acquired reading speed is smaller than the target reading speed, keeping the target reading speed unchanged.
In some embodiments, if the target test task includes a stability test task, the test progress information that the child thread may obtain may include a lifetime value of the memory, and a data difference between the written data and the read data.
After the child thread acquires the test process information, the child thread can transmit the test process information back to the main thread and write the test process information into the designated file so as to check the whole test process later. For example, a specified file may be created in a specified folder, and the text format of the specified file may be txt, and test progress information may be written in the txt text.
The main thread may be responsible for displaying the page so that the main thread may display the acquired test progress information on the graphical user interface. In some embodiments, if the target test task includes a life test task, the life value of the memory and the accumulated write data amount of the memory may be displayed; if the target test task comprises a read-write performance test task, the service life value of the memory, the maximum writing speed and the maximum reading speed of the memory can be displayed; if the target test task includes a stability test task, the lifetime value of the memory and the data difference between the data written in the memory and the data read may be displayed.
It should be noted that the specific content of the displayed test progress information may be set according to actual needs, and is not specifically limited herein.
In some embodiments, if an exception occurs during the execution of the target test task, for example, the permission of reading the data is insufficient, the data writing fails, etc., which may cause the test to be suspended, the sub-thread may also transmit the corresponding exception information back to the main thread for display. Of course, when the target test task is executed, a corresponding prompt message may be displayed, and the setting may be specifically performed according to the actual requirement, which is not limited herein.
For a more clear illustration of the solution of the embodiments of the present application, reference may be made to fig. 4, which shows a schematic overall framework of a memory test method. The method comprises the steps that candidate test tasks can be displayed on a graphical user interface through a main thread, and test parameters are set to determine target test tasks from the candidate test tasks to execute. The main thread can perform basic logic processing, and the sub thread can call a corresponding preset dynamic library through the JNI to execute the test operation indicated by the target test task. For example, in fig. 4, in order to execute the life test task, the read-write performance test task and the stability test task, the sub-thread invokes a preset dynamic library in c++ through JNI to complete the corresponding test task. During execution of the test task, the child thread may send test process information to the main thread so that the main thread displays it on the graphical user interface.
The memory test scheme provided by the embodiment of the application can be applied to various scenes for testing the memory. For example, taking EMMC testing as an example, the solution provided by the embodiment of the application can more intuitively display candidate test tasks on the graphical user interface, and determine target test tasks according to user operation, so as to automatically execute corresponding test tasks, and in the process of executing the test tasks, corresponding test process information can be displayed, so that a user can grasp a specific test process conveniently, and the method is more convenient, visual, time-saving and labor-saving, and can effectively improve test efficiency.
The method provided by the embodiment of the application can display candidate test tasks, and determines target test tasks from the candidate test tasks based on selection operation, so that a preset dynamic library is automatically called to execute the target test tasks on the memory according to the input basic test parameters; and corresponding test process information is displayed in the process of executing the target test task, so that a user can grasp and understand the corresponding test process, the method is more convenient and visual, time-saving and labor-saving, and the test efficiency can be effectively improved.
The method described in the above embodiments will be described in further detail below.
In this embodiment, a method according to an embodiment of the present application will be described in detail using EMMC as an example of a memory.
As shown in fig. 5, a specific flow of a memory testing method is as follows:
s210, displaying candidate test tasks.
S220, determining a target test task from the candidate test tasks in response to the selection operation for the candidate test tasks, and acquiring basic test parameters.
S230, calling a Java local interface through a sub-thread, and calling a preset dynamic library by using the Java local interface.
S240, executing the test operation indicated by the target test task on the EMMC according to the basic test parameters by utilizing the preset dynamic library.
S250, in the process of executing the target test task, the test process information corresponding to the target test task is returned to the main thread through the sub-thread, and the test process information corresponding to the target test task is written into the designated file.
And S260, displaying the test process information corresponding to the target test task through the main thread.
The steps described above can be referred to in the foregoing embodiments, and also referring to fig. 6, an overall flow chart of the memory testing method is shown. After the user starts the corresponding application program, candidate test tasks may be displayed on a graphical user interface of the terminal, and the candidate test tasks may include a life test task, a performance test task, and a stability test task.
The user can select one of the test tasks as a target test task, and input corresponding basic test parameters, so that the EMMC can be automatically tested. When the automatic test is carried out, the child thread can call a Java local interface and call a preset dynamic library by utilizing the Java local interface. The package in the preset dynamic library is used for writing data into the EMMC, reading data from the EMMC, checking the data and the like, which are time-consuming, and the package in the preset dynamic library can shorten the test time and improve the test efficiency.
After the preset dynamic library is called, the test operation indicated by the target test task can be executed on the EMMC according to the basic test parameters by using the preset dynamic library. The sub-thread can transmit the test process information back to the main thread and write the test process information into the designated file for subsequent viewing.
The main thread may display test progress information on the graphical user interface so that the user knows about the specific test progress.
For example, taking a life test task as an example, data can be written into the EMMC at preset intervals, and the accumulated written data amount of the EMMC can be obtained; when the written data quantity corresponding to the written data is equal to the written parameter, the life value of the EMMC can be obtained until the life value is a preset value, and the life test task is ended. The display may be accumulated with the amount of data written and the lifetime value during execution of the lifetime test task.
For another example, taking a read-write performance test task as an example, data can be written into the EMMC at preset intervals, and a corresponding writing speed can be obtained; reading data from the memory at preset intervals; when the written data amount corresponding to the written data is equal to the written parameter or the read data amount corresponding to the read data is equal to the read parameter, the life value of the EMMC can be obtained. And then ending the read-write performance test task when the life value is a preset value, or the writing speed is smaller than the preset writing speed, or the reading speed is smaller than the preset reading speed. In the process of performing the read-write performance test task, the maximum read speed, the maximum write speed, and the lifetime value may be displayed.
For another example, taking a stability test task as an example, data may be written into the EMMC at a preset interval, then the data is read from the EMMC, and then a data difference between the written data and the read data is compared; when the written data quantity corresponding to the written data is equal to the written parameter, acquiring the service life value of the EMMC; and when the life value is a preset value or the data difference between the written data and the read data is a preset data difference, namely, the written data and the read data are inconsistent, ending the stability test task. During performance of the stability test tasks, lifetime and data differences may be displayed, although cumulative amounts of written data may also be displayed, etc.
As can be seen from the above, the embodiments of the present application may display candidate test tasks, determine a target test task from the candidate test tasks based on a selection operation, so as to automatically call a preset dynamic library to execute the target test task on the memory according to the input basic test parameters; the test operation indicated by the target test task is packaged in the preset dynamic library, so that the test time can be shortened, and corresponding test progress information is displayed in the process of executing the target test task, so that a user can grasp and understand the corresponding test process, the test operation is more convenient and visual, time-saving and labor-saving, and the test efficiency can be effectively improved.
In order to better implement the method, the embodiment of the application also provides a memory testing device, which can be integrated in an electronic device, and the electronic device can be a terminal, a server and other devices. The terminal can be a mobile phone, a tablet personal computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
For example, in the present embodiment, a method of the embodiment of the present application will be described in detail by taking a specific integration of the memory test device in the terminal as an example.
For example, as shown in fig. 7, the memory test apparatus 300 may include a first display module 310, a determination module 320, a test module 330, and a second display module 340.
A first display module 310 for displaying candidate test tasks;
a determining module 320, configured to determine a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks;
the test module 330 is configured to invoke a preset dynamic library to execute the target test task on the memory according to the input basic test parameters, where the preset dynamic library includes a test operation indicated by the target test task;
and the second display module 340 is configured to display test progress information corresponding to the target test task during the process of executing the target test task.
In some embodiments, the test module 330 further comprises:
the acquisition unit is used for acquiring the input basic test parameters;
the calling unit is used for calling a Java local interface through a sub-thread and calling the preset dynamic library by utilizing the Java local interface;
and the execution unit is used for executing the test operation indicated by the target test task according to the basic test parameters by utilizing the preset dynamic library.
In some embodiments, the basic test parameters include a write parameter and a preset interval, the target test task includes a life test task, and the execution unit is further configured to:
writing data into the memory according to the preset interval through the preset dynamic library, and acquiring accumulated written data quantity of the memory;
if the accumulated written data amount is matched with the writing parameters, reading the service life value of the memory;
and if the service life value is a preset value, determining that the service life test task is finished.
In some embodiments, the basic test parameters include a write parameter, a read parameter, and a preset interval, the target test task includes a read-write performance test task, and the execution unit is further configured to:
writing data into the memory according to the preset interval through the preset dynamic library, and acquiring a corresponding writing speed;
reading data from the memory according to the preset interval through the preset dynamic library, and acquiring a corresponding reading speed;
if the written data quantity corresponding to the written data is matched with the written parameter, or the read data quantity corresponding to the read data is matched with the read parameter, reading the service life value of the memory;
And if the life value is a preset value, or the writing speed is smaller than a preset writing speed, or the reading speed is smaller than a preset reading speed, determining that the read-write performance test task is finished.
In some embodiments, the basic test parameters include a write parameter and a preset interval, the target test task includes a stability test task, and the execution unit is further configured to:
writing data into the memory according to the preset interval through the preset dynamic library, and then reading the data from the memory;
calculating a data difference between the read data and the written data;
if the written data quantity corresponding to the written data is matched with the written parameters, reading the service life value of the memory;
and if the life value is a preset value or the data difference is a preset difference, determining that the stability test task is finished.
In some embodiments, the second display module 340 further comprises:
the information acquisition unit is used for acquiring test process information corresponding to the target test task through a sub-thread in the process of executing the target test task;
the feedback unit is used for returning the test process information corresponding to the target test task to the main thread through the sub thread and writing the test process information corresponding to the target test task into the designated file;
And the display unit is used for displaying the test process information corresponding to the target test task through the main thread.
In some embodiments, the display unit is further configured to:
if the target test task comprises a life test task, displaying a life value of the memory and accumulated written data quantity of the memory;
if the target test task comprises a read-write performance test task, displaying the service life value of the memory, the maximum writing speed of the memory and the maximum reading speed of the memory;
and if the target test task comprises a stability test task, displaying the service life value of the memory and the data difference between the data written in the memory and the data read in the memory.
In the implementation, each module or unit may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each module or unit may be referred to the foregoing method embodiments and will not be repeated herein.
As can be seen from the above, the memory test device of the present embodiment may display candidate test tasks, and determine a target test task from the candidate test tasks based on a selection operation, so as to automatically invoke a preset dynamic library to execute the target test task on the memory according to the input basic test parameters; the test operation indicated by the target test task is packaged in the preset dynamic library, so that the test time can be shortened, and corresponding test progress information is displayed in the process of executing the target test task, so that a user can grasp and understand the corresponding test process, the test operation is more convenient and visual, time-saving and labor-saving, and the test efficiency can be effectively improved.
Correspondingly, the embodiment of the application also provides electronic equipment which can be a terminal or a server, wherein the terminal can be terminal equipment such as a smart phone, a tablet personal computer, a notebook computer, a touch screen, a game machine, a personal computer, a personal digital assistant (Personal Digital Assistant, PDA) and the like.
As shown in fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer readable storage media, and a computer program stored in the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. It will be appreciated by those skilled in the art that the electronic device structure shown in the figures is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 401 is a control center of the electronic device 400, connects various parts of the entire electronic device 400 using various interfaces and lines, and performs various functions of the electronic device 400 and processes data by running or loading software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device 400.
In the embodiment of the present application, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 executes the application programs stored in the memory 402, so as to implement various functions:
displaying candidate test tasks;
determining a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks;
according to the input basic test parameters, a preset dynamic library is called to execute the target test task on a memory, and the preset dynamic library comprises test operations indicated by the target test task;
and displaying the test process information corresponding to the target test task in the process of executing the target test task.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 8, the electronic device 400 further includes: a touch display 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch display 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 8 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The touch display 403 may be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as operations on or near the touch panel by the user using any suitable object or accessory such as a finger, stylus, etc.), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 401, and can receive and execute commands sent from the processor 401. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is passed to the processor 401 to determine the type of touch event, and the processor 401 then provides a corresponding visual output on the display panel in accordance with the type of touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 403 to implement the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch-sensitive display 403 may also implement an input function as part of the input unit 406.
In the embodiment of the application, the processor 401 executes the test application program to generate a graphical user interface on the touch display screen 403, and the candidate test task is displayed on the graphical user interface. The touch display 403 is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface.
The radio frequency circuitry 404 may be used to transceive radio frequency signals to establish wireless communication with a network device or other electronic device via wireless communication.
The audio circuitry 405 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone. The audio circuit 405 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 405 and converted into audio data, which are processed by the audio data output processor 401 and sent via the radio frequency circuit 404 to e.g. another electronic device, or which are output to the memory 402 for further processing. The audio circuit 405 may also include an ear bud jack to provide communication of the peripheral headphones with the electronic device.
The input unit 406 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 407 is used to power the various components of the electronic device 400. Alternatively, the power supply 407 may be logically connected to the processor 401 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 407 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 8, the electronic device 400 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
As can be seen from the above, the electronic device provided in this embodiment may display candidate test tasks, determine a target test task from the candidate test tasks based on a selection operation, so as to automatically invoke a preset dynamic library to execute the target test task on the memory according to the input basic test parameters; the test operation indicated by the target test task is packaged in the preset dynamic library, so that the test time can be shortened, and corresponding test progress information is displayed in the process of executing the target test task, so that a user can grasp and understand the corresponding test process, the test operation is more convenient and visual, time-saving and labor-saving, and the test efficiency can be effectively improved.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform steps in any of the memory testing methods provided by embodiments of the present application. For example, the computer program may perform the steps of:
displaying candidate test tasks;
determining a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks;
according to the input basic test parameters, a preset dynamic library is called to execute the target test task on a memory, and the preset dynamic library comprises test operations indicated by the target test task;
and displaying the test process information corresponding to the target test task in the process of executing the target test task.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any memory testing method provided in the embodiments of the present application may be executed by the computer program stored in the storage medium, so that the beneficial effects that any memory testing method provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not repeated herein.
The foregoing describes in detail a memory testing method, apparatus, electronic device and storage medium provided in the embodiments of the present application, and specific examples are applied to illustrate the principles and implementations of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of testing a memory, the method comprising:
Displaying candidate test tasks;
determining a target test task from the candidate test tasks in response to a selection operation for the candidate test tasks;
according to the input basic test parameters, a preset dynamic library is called to execute the target test task on a memory, and the preset dynamic library comprises test operations indicated by the target test task;
and displaying the test process information corresponding to the target test task in the process of executing the target test task.
2. The method of claim 1, wherein invoking a preset dynamic library to perform the target test task on memory based on the entered basic test parameters comprises:
acquiring input basic test parameters;
invoking a Java local interface through a sub-thread, and invoking the preset dynamic library by utilizing the Java local interface;
and executing the test operation indicated by the target test task according to the basic test parameters by using the preset dynamic library.
3. The method of claim 2, wherein the basic test parameters include write parameters and preset intervals, the target test tasks include life test tasks, and the performing test operations indicated by the target test tasks according to the basic test parameters using the preset dynamic library includes:
Writing data into the memory according to the preset interval through the preset dynamic library, and acquiring accumulated written data quantity of the memory;
if the accumulated written data amount is matched with the writing parameters, reading the service life value of the memory;
and if the service life value is a preset value, determining that the service life test task is finished.
4. The method of claim 2, wherein the basic test parameters include a write parameter, a read parameter, and a preset interval, the target test task includes a read-write performance test task, and the performing a test operation indicated by the target test task according to the basic test parameters using the preset dynamic library includes:
writing data into the memory according to the preset interval through the preset dynamic library, and acquiring a corresponding writing speed;
reading data from the memory according to the preset interval through the preset dynamic library, and acquiring a corresponding reading speed;
if the written data quantity corresponding to the written data is matched with the written parameter, or the read data quantity corresponding to the read data is matched with the read parameter, reading the service life value of the memory;
And if the life value is a preset value, or the writing speed is smaller than a preset writing speed, or the reading speed is smaller than a preset reading speed, determining that the read-write performance test task is finished.
5. The method of claim 2, wherein the basic test parameters include a write parameter and a preset interval, the target test task includes a stability test task, and the performing a test operation indicated by the target test task according to the basic test parameters using the preset dynamic library includes:
writing data into the memory according to the preset interval through the preset dynamic library, and then reading the data from the memory;
calculating a data difference between the read data and the written data;
if the written data quantity corresponding to the written data is matched with the written parameters, reading the service life value of the memory;
and if the life value is a preset value or the data difference is a preset difference, determining that the stability test task is finished.
6. The method according to claim 1, wherein displaying test progress information corresponding to the target test task during the execution of the target test task includes:
In the process of executing the target test task, acquiring test process information corresponding to the target test task through a sub-thread;
returning the test process information corresponding to the target test task to the main thread through the sub thread, and writing the test process information corresponding to the target test task into a designated file;
and displaying the test process information corresponding to the target test task through the main thread.
7. The method of claim 6, wherein displaying, by the main thread, test progress information corresponding to the target test task, comprises:
if the target test task comprises a life test task, displaying a life value of the memory and accumulated written data quantity of the memory;
if the target test task comprises a read-write performance test task, displaying the service life value of the memory, the maximum writing speed of the memory and the maximum reading speed of the memory;
and if the target test task comprises a stability test task, displaying the service life value of the memory and the data difference between the data written in the memory and the data read in the memory.
8. A memory test apparatus, the apparatus comprising:
The first display module is used for displaying candidate test tasks;
the determining module is used for determining a target test task from the candidate test tasks in response to the selection operation of the candidate test tasks;
the test module is used for calling a preset dynamic library to execute the target test task on the memory according to the input basic test parameters, and the preset dynamic library comprises test operations indicated by the target test task;
and the second display module is used for displaying the test process information corresponding to the target test task in the process of executing the target test task.
9. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps in the memory testing method according to any of claims 1-7.
10. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the memory testing method of any of claims 1-7.
CN202310036681.6A 2023-01-10 2023-01-10 Memory testing method, device, electronic equipment and storage medium Pending CN117409841A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310036681.6A CN117409841A (en) 2023-01-10 2023-01-10 Memory testing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310036681.6A CN117409841A (en) 2023-01-10 2023-01-10 Memory testing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117409841A true CN117409841A (en) 2024-01-16

Family

ID=89498816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310036681.6A Pending CN117409841A (en) 2023-01-10 2023-01-10 Memory testing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117409841A (en)

Similar Documents

Publication Publication Date Title
CN107734616B (en) Application program closing method and device, storage medium and electronic equipment
CN110968508B (en) Method, device, terminal and storage medium for determining loading time of applet
CN109901881B (en) Plug-in loading method and device of application program, computer equipment and storage medium
CN106649010B (en) terminal equipment test method and terminal equipment
CN109359020A (en) Start time test method and device, computer installation and storage medium
KR20200015000A (en) Method for memory leak detection and electronic device thereof
CN111858112B (en) Method, client and server for detecting memory leakage
CN111966491B (en) Method for counting occupied memory and terminal equipment
CN110046497B (en) Function hook realization method, device and storage medium
CN108984374B (en) Method and system for testing database performance
CN107734618B (en) Application program closing method and device, storage medium and electronic equipment
CN113933581A (en) Power consumption testing method of mobile equipment and mobile equipment
CN107025173B (en) Method and device for testing function execution time
CN107341094B (en) Method and device for measuring time consumed by starting item
CN108874653B (en) Task testing method, tester, shared server and readable storage medium
CN115656788B (en) Chip testing system, method, equipment and storage medium
CN117409841A (en) Memory testing method, device, electronic equipment and storage medium
CN108269223B (en) Webpage graph drawing method and terminal
CN113439263A (en) Application cleaning method and device, storage medium and electronic equipment
CN112463626B (en) Memory leakage positioning method and device, computer equipment and storage medium
CN115098468A (en) Flexible data migration method and device, storage medium and electronic equipment
CN116627521A (en) Service module preloading method, skipping method, device and storage medium
CN109710521B (en) Multimedia application performance test method and device, computer equipment and storage medium
CN108279937B (en) Parameter calling method and device, storage medium and electronic equipment
CN109308164B (en) System migration method and device

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