CN107943676A - The performance test data treating method and apparatus of application operating nonvolatile memory - Google Patents
The performance test data treating method and apparatus of application operating nonvolatile memory Download PDFInfo
- Publication number
- CN107943676A CN107943676A CN201610891321.4A CN201610891321A CN107943676A CN 107943676 A CN107943676 A CN 107943676A CN 201610891321 A CN201610891321 A CN 201610891321A CN 107943676 A CN107943676 A CN 107943676A
- Authority
- CN
- China
- Prior art keywords
- nonvolatile memory
- function
- tested
- performance
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3034—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3452—Performance evaluation by statistical analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Probability & Statistics with Applications (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention relates to a kind of performance test data treating method and apparatus of application operating nonvolatile memory, this method includes:The system function for being used to operate nonvolatile memory that hook operating system provides so that calling of the triggering to custom function when system function is by being tested using input parameter and calling;By custom function and according to parameter manipulation nonvolatile memory;By performance test data caused by custom function acquisition operations nonvolatile memory, and the performance test data of collection is recorded in journal file;Performance test data in journal file is used for the performance indicator for analyzing tested application operating nonvolatile memory according to this.The performance test data treating method and apparatus of application operating nonvolatile memory provided by the invention, performance test data in daily record can express the actual performance of tested application operating nonvolatile memory, and the performance indicator of nonvolatile memory described in application operating is tested available for subsequent analysis.
Description
Technical field
The present invention relates to nonvolatile memory technical field of measurement and test, is deposited more particularly to a kind of application operating is non-volatile
The performance test data treating method and apparatus of reservoir.
Background technology
In computer configuation general at present, the volatile memory as built-in storage and the outer storage of conduct are generally comprised
The nonvolatile memory of device.Volatile memory can temporarily, efficiently store data, but data need to finally write it is non-volatile
Preserved for a long time in property memory.Nonvolatile memory generally includes magnetic memory and semiconductor memory, and magnetic memory again may be used
With including core memory, magnetic drum memory and magnetic disk storage.
Test to nonvolatile memory at present mainly tests merely non-volatile memories using dedicated testing tool
The performance indicator such as the reading of device and writing speed, it is difficult to which the actual performance when operating nonvolatile memory is applied in reflection.
The content of the invention
Based on this, it is necessary to it is non-volatile using practical operation to be difficult to reflection for the test at present to nonvolatile memory
The problem of performance of property memory, there is provided the performance test data processing method and dress of a kind of application operating nonvolatile memory
Put.
A kind of performance test data processing method of application operating nonvolatile memory, including:
What hook operating system provided is used to operate the system function of nonvolatile memory so that the system function by
The tested calling triggered using input parameter and when calling to custom function;
Pass through the custom function and the nonvolatile memory according to the parameter manipulation;
By performance test data caused by nonvolatile memory described in the custom function acquisition operations, and will
The performance test data of collection is recorded in journal file;Performance test data in the journal file is used to analyze institute according to this
State the performance indicator of nonvolatile memory described in tested application operating.
A kind of performance test data processing unit of application operating nonvolatile memory, including:
Hooking module, for linking up with the system function for being used to operate nonvolatile memory of operating system offer so that
Calling of the triggering to custom function when the system function is by being tested using input parameter and calling;
Custom function execution module, for non-volatile by the custom function and according to the parameter manipulation
Property memory;By performance test data caused by nonvolatile memory described in the custom function acquisition operations, and
The performance test data of collection is recorded in journal file;Performance test data in the journal file is used to analyze according to this
The performance indicator of nonvolatile memory described in the tested application operating.
Above application operates the performance test data treating method and apparatus of nonvolatile memory, and hook is used to operate non-
The system function of volatile memory, system function can be adjusted back custom function during tested application call, so that by certainly
Defined function operates nonvolatile memory, and the performance test data for operating generation is recorded in journal file, the daily record
Performance test data in file can be used to analyze the performance indicator of nonvolatile memory described in tested application operating.It is tested to answer
With in the process of running, if operating non-volatile memory medium, the respective performances test data of generation can be recorded in daily record
In, the performance test data in the daily record can express the actual performance of tested application operating nonvolatile memory, after can be used for
The performance indicator of nonvolatile memory described in the continuous tested application operating of analysis.
Brief description of the drawings
Fig. 1 is that application operating performance of non-volatile memory tests systematic difference environment map in one embodiment;
Fig. 2 is the internal structure schematic diagram for the electronic equipment that can be used as terminal and server in one embodiment;
Fig. 3 is that the flow of the performance test data processing method of application operating nonvolatile memory in one embodiment is shown
It is intended to;
Fig. 4 is the step of being tested in one embodiment according to log file analysis using with the presence or absence of efficiency is read or write
Flow diagram;
Fig. 5 is to carry out automation scrnario testing using test case in one embodiment and control hook to open and cancel
The flow diagram of step;
Fig. 6 is the flow of the performance test data processing method of application operating nonvolatile memory in another embodiment
Schematic diagram;
Fig. 7 is realized by the performance test data processing method of application operating nonvolatile memory in one embodiment
Each functional schematic;
Fig. 8 is to operate nonvolatile memory during single file operation by custom function in one embodiment
The schematic diagram of middle file;
Fig. 9 is the structural frames of the performance test data processing unit of application operating nonvolatile memory in one embodiment
Figure;
Figure 10 is the knot of the performance test data processing unit of application operating nonvolatile memory in another embodiment
Structure block diagram;
Figure 11 is the knot of the performance test data processing unit of application operating nonvolatile memory in another embodiment
Structure block diagram.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, it is right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
Fig. 1 is that application operating performance of non-volatile memory tests systematic difference environment map in one embodiment.Reference
Fig. 1, application operating performance of non-volatile memory test system include terminal 110 and server 120.Run in terminal 110
There is tested application.Terminal 110 can be used for hook terminal 110 on operating system provide be used for operate nonvolatile memory be
System function so that calling of the triggering to custom function when system function is by being tested using input parameter and calling.Terminal 110 can
For by custom function and according to parameter manipulation nonvolatile memory.Terminal 110 can be used for adopting by custom function
Performance test data caused by collection operation nonvolatile memory, and the performance test data of collection is recorded in journal file
In.Terminal 110 can be used for outputting log file to server 120;Performance test data in journal file is used to analyze according to this
The performance indicator of tested application operating nonvolatile memory.Server 120 can be used for the performance test in journal file
Data analysis is tested the performance indicator of application operating nonvolatile memory.Server 120 can be replaced personal computer, terminal
110 and the function of server 120 can be realized on same electronic equipment.
Fig. 2 is the internal structure schematic diagram for the electronic equipment that can be used as terminal and server in one embodiment.Such as Fig. 2 institutes
Show, which includes connecing by processor, non-volatile memory medium, built-in storage and the network that system bus connects
Mouthful.Wherein, the non-volatile memory medium of electronic equipment is stored with operating system, further includes that a kind of application operating is non-volatile to be deposited
The performance test data processing unit of reservoir, the performance test data processing unit of the application operating nonvolatile memory are used for
Realize a kind of performance test data processing method of application operating nonvolatile memory.The processor, which is used to provide, to be calculated and controls
Ability processed, supports the operation of whole electronic equipment.Built-in storage in electronic equipment is the application in non-volatile memory medium
The operation for operating the performance test data processing unit of nonvolatile memory provides environment, and meter can be stored in the built-in storage
Calculation machine readable instruction, when which is executed by processor, it is non-easily to may be such that processor performs a kind of application operating
The performance test data processing method of the property lost memory.Network interface is used to carry out network service with outside, such as exports or receives
Daily record.The electronic equipment can be mobile terminal, personal computer or server, mobile terminal such as mobile phone, tablet computer,
Personal digital assistant or Wearable etc..It will be understood by those skilled in the art that structure shown in Figure 2, only with this
The block diagram of the relevant part-structure of application scheme, does not form the limit for the electronic equipment being applied thereon to application scheme
Fixed, specific electronic equipment can include, than more or fewer components shown in figure, either combining some components or having
Different component arrangements.
Fig. 3 is that the flow of the performance test data processing method of application operating nonvolatile memory in one embodiment is shown
It is intended to.The present embodiment is mainly applied to the application operating performance of non-volatile memory test system in above-mentioned Fig. 1 in this way
In terminal 110 be illustrated.With reference to Fig. 3, this method specifically comprises the following steps:
S302, the system function for being used to operate nonvolatile memory that hook operating system provides so that system function
Calling of the triggering to custom function during by being tested using input parameter and call.
Wherein, hook (hook) is also referred to as hook, and program can link up with specified event, when the event linked up with
During generation, the program linked up with to the event can be notified, so as to be responded to the event.Non-volatile memories
Device is referred to as non-volatile memory medium, can include magnetic memory and semiconductor memory, and magnetic memory can wrap again
Include core memory, magnetic drum memory and magnetic disk storage.
Operation to non-volatile memory medium includes opening file, reads data, writes data and close in file at least
It is a kind of.System function for operating nonvolatile memory is provided by operating system, can be by being tested application call.For operating
The system function of nonvolatile memory, is the system for being used for I/O (Iinput/output, i.e. input or output port) operation
Function.
System function for operating nonvolatile memory is such as used for the system for obtaining data from file by byte
Function FileInputStream, or the system function FileOutputStream by byte to file write data, by character
The system function FileReader of data is read from file, writes the system function of data into file by character
FileWriter etc..The parameter of input system function such as writes data or reads the filec descriptor that data act on file, writes number
According to or read the initial positions of data, the size of data for reading data or the data content of writing data etc..
Terminal can link up with the system function for being used to operate nonvolatile memory that operating system provides by tested application.
Specifically, terminal can be hung by being tested the SDK (Software Development Kit, Software Development Kit) of application integration
The system function for being used to operate nonvolatile memory that hook operating system provides, terminal can also be by tested applications to system
Function carries out Remote thread injecting to realize hook system function.
Further, the function address of system function can be replaced with custom function by terminal in hook system function
Function address applied so that tested when being called to system function input parameter, it is straight according to replaced function address
Connect and parameter is inputted into custom function to call the custom function.
S304, by custom function and according to parameter manipulation nonvolatile memory.
Specifically, custom function includes the code of system function, then terminal can by calling custom function, according to
The parameter manipulation nonvolatile memory of tested application input, is realized with system function according to parameter manipulation nonvolatile memory
Identical function.Once-through operation to nonvolatile memory generally includes a series of child-operations, such as opens file, reading according to this
And file is closed, or as opened file, writing data and closing file.
S306, by performance test data caused by custom function acquisition operations nonvolatile memory, and will adopt
The performance test data of collection is recorded in journal file.Performance test data in journal file is used for the tested application of analysis according to this
Operate the performance indicator of nonvolatile memory.
Wherein, performance test data is the data of the tested application operating performance of non-volatile memory of reflection.Performance test
Data specifically can include being tested applying used process name, thread name, single file when operating nonvolatile memory
The number and tested apply read or write during the total amount of data that is read or write in operating process, single file operation is transported in single
One or more of combinations during row in operated nonvolatile memory in the filename of file.
Journal file can be recorded as CSV (Comma-Separated Values, comma separated value file form) form
Or txt forms.Performance test data caused by operation nonvolatile memory is recorded as one in journal file every time
Record.Performance indicator refers to that quantization means are tested the dimension of the performance of application operating nonvolatile memory, such as whether existing logical
The performance issue of main thread operation nonvolatile memory is crossed, reads or writes efficiency, if there are repetitive operation file problem,
Time-consuming length of operation etc..
Specifically, custom function not only includes the code of system function, further includes custom code.Terminal is being called certainly
During defined function, by performing the custom code in the custom function, by produced by this operation nonvolatile memory
Performance test data be recorded in journal file.Terminal, can be from the parameter of input and by making by oneself by custom function
Acquisition performance test data in the value that adopted function operation nonvolatile memory is returned, custom function can also be collected actively
With this operation the relevant performance test data of nonvolatile memory, as this operation nonvolatile memory process name and
Thread name.
Further, terminal can send journal file to server, be surveyed by performance of the server in journal file
Examination data analysis is tested the performance indicator of application operating nonvolatile memory.Terminal can also export journal file, such as lead
Go out into flash disk, imported journal file in personal computer by flash disk, by property of the personal computer in journal file
Energy test data analysis is tested the performance indicator of application operating nonvolatile memory.Terminal can also be by daily record with visual form
Displaying, to realize outputting log file.
Above application operates the performance test data processing method of nonvolatile memory, and hook is used to operate non-volatile
The system function of memory, system function can be adjusted back custom function during tested application call, so as to pass through self-defined letter
Number operation nonvolatile memory, and the performance test data for operating generation is recorded in journal file, in the journal file
Performance test data can be used to analyze the performance indicator of tested application operating nonvolatile memory.Tested apply was being run
Cheng Zhong, if operating non-volatile memory medium, the respective performances test data of generation can be recorded in daily record, in the daily record
Performance test data can express the actual performance of tested application operating nonvolatile memory, being tested available for subsequent analysis should
With the performance indicator for operating the nonvolatile memory.
In one embodiment, the performance test data based on the application operating nonvolatile memory in above-described embodiment
Processing method, operating system are Android operation system;System function is in the BlockGuardOS.java class of Android operation system
Open () function, Close (), one or more of combinations in Read () function and Write () function.
Specifically, Android (Android) operating system is a kind of operating system of the open source code based on Linux.Peace
Tall and erect operating system supports to include a variety of system functions for operating nonvolatile memory, as FileInputStream,
FileOutputStream, FileReader and FileWriter etc..If to being useful for operation nonvolatile memory
System function is linked up with, and workload is bigger, and is easily omitted.And it is used to operate non-volatile deposit in Android operation system
The system function of reservoir, eventually calls Open () function, Close (), Read () letter in BlockGuardOS.java classes
One or more of combinations in number and Write () function.Therefore the function in BlockGuardOS.java classes is linked directly,
It is more convenient and comprehensive.
Wherein, Open () function is used to open the file in nonvolatile memory, and Close () is used to close non-volatile
Property memory in file, Read () function is used to read data in the file opened from nonvolatile memory, Write
() function is used for the file write data opened into nonvolatile memory.
In one embodiment, step S306 includes:Tested application operating volatile storage is gathered by custom function
The thread name of device is simultaneously recorded in journal file.The performance test data processing method of the application operating nonvolatile memory is also
Including:When, there are during main thread name, output represents that tested application exists and operates non-volatile deposit by main thread in journal file
The results of performance analysis of the performance issue of reservoir.
Specifically, being tested application may include one or more processes, and a process may include one or more threads, be tested
The calling to system function is initiated using a thread in a process by the tested application, and then is triggered to self-defined
The calling of function, and the thread name for the thread for initiating this calling to system function is recorded in daily record text by custom function
In a record in part, the process name of the affiliated process of the thread can also be recorded in this record.
Further, server is according to journal file when being analyzed, the tested application that can be recorded in journal file
Main thread name is searched in used thread name when operating the nonvolatile memory, if finding, output represents quilt
Survey the results of performance analysis that application has the performance issue that nonvolatile memory is operated by main thread.Results of performance analysis can
To be exported with visual form, can also be output in specified file.Wherein, one can be created by operating system by being tested when application starts
A process, while a thread in the process also begins to run, which is the main thread of tested application, is created by the main thread
The thread built is the sub-line journey of the main thread.Main thread name is generally main.
In the present embodiment, since the function that main thread is responsible for is more, if directly operating nonvolatile memory by main thread,
Influence whether the function of main thread.Therefore, when there are during main thread name, position to be tested to apply to exist to pass through main line in journal file
Journey operates the performance issue of nonvolatile memory, so that it is non-easy to guide developer to overcome tested application to be operated by main thread
The performance issue of the property lost memory, to lift the performance of tested application.
In one embodiment, when there are during main thread name, export to represent to be tested to apply to exist to pass through master in journal file
The step of results of performance analysis of the performance issue of threading operation nonvolatile memory, can be specifically to work as to deposit in journal file
In the entitled foreground process of process belonging to main thread name and the main thread name, output represents tested and passes through main thread using existing
Operate the results of performance analysis of the performance issue of nonvolatile memory.
Wherein, refer to can be directly in response to the process of user's operation for foreground process.Terminal specifically can determine whether belonging to main thread name
Whether process name is consistent with the bag name of tested application installation package, if then can determine that the process name is main process name.Performance evaluation
As a result it can be exported, can also be output in specified file with visual form.
In the present embodiment, foreground process has the function of to respond user's operation, if the main thread created by foreground process is grasped
Make nonvolatile memory, influence whether the function of foreground process and main thread, influence user experience.Therefore, main thread name
And during the entitled foreground process of process belonging to the main thread name, output represent it is tested using exist operated by main thread it is non-volatile
Property memory performance issue results of performance analysis, operated so as to guide developer to overcome by the main thread of foreground process
The performance issue of nonvolatile memory, to lift the performance of tested application.
In one embodiment, step S306 includes:By custom function collection it is tested apply operate it is non-volatile
The total amount of data and single file operation process read or write during memory during used thread name, single file operation
In the number that reads or writes, and by the total amount of data and single that are read or write during the thread name of collection, single file operation text
The number corresponding record read or write in part operating process is in journal file.
In one embodiment, the performance test data processing method of the application operating nonvolatile memory further includes root
The step of being tested according to log file analysis using with the presence or absence of efficiency is read or write.With reference to Fig. 4, this is according to log file analysis
Tested application specifically comprises the following steps with the presence or absence of the step of reading or writing efficiency:
S402, when there are during sub-line journey name, obtaining single file operation process corresponding with sub-line journey name in journal file
In the total amount of data that reads or writes and the number read or write during single file operation.
Wherein, single file operation process refers to the process of, from file is opened to file is closed, such as open file, from opening
File in reading according to this and close file, also such as open file, write into the file of opening data and close file.Single
File operation can be associated and identified by identical filec descriptor.During single file operation, it can occur repeatedly
Read or write.The total amount of data read or write during single file operation refers to during single file operation from file is opened to pass
Closed file reads or writes the total amount of data, can be weighed with byte number.The number read or write during single file operation is then
Refer to the number read or write during single file operation from opening file to closing file.
S404, reads or writes the total amount of data read or write during single file operation divided by during single file operation
Number obtain single and read or write data volume average.
Wherein, single reads or writes the average data that data volume average represents to read or write every time during single file operation
Amount, can reflect tested application reads or writes efficiency.If single reads or writes data volume, average is bigger, represents that tested application reads or writes
Efficiency is higher;If single reads or writes data volume, average is smaller, and it is lower to represent that tested application reads or writes efficiency.
S406, when single, which reads or writes data volume average, is less than preset value, output represents the sub-line represented by sub-line journey name
There is the results of performance analysis for reading or writing efficiency in journey.
Wherein, preset value is to judge that single reads or writes data volume average height, that is, judges reading or writing for tested application
The threshold value of efficiency.Preset value can be chosen as needed, can such as select 8KB (kilobytes).
Specifically, when single, which reads or writes data volume average, is less than preset value, represent tested low using efficiency is read or write, make
Into the wasting of resources, there is the performance point for reading or writing efficiency in the exportable sub-line journey represented represented by sub-line journey name of server
Analyse result.When single, which reads or writes data volume average, is more than or equal to preset value, then it represents that it is tested efficient using reading or writing, do not deposit
Reading or writing efficiency.
In the present embodiment, single, which reads or writes data volume average, can reflect that tested application reads or writes the height of efficiency, work as quilt
Survey using when reading or writing less efficient, output represents that the sub-line journey represented by sub-line journey name has the performance for reading or writing efficiency
Analysis result, realizes the precise positioning for reading or writing efficiency, be conducive to guide developer overcome the sub-line journey reading or
Write efficiency.
In one embodiment, step S306 includes:Applied by the way that custom function collection is tested in single operational process
In in operated nonvolatile memory file filename, and the filename of collection is recorded in journal file.It should answer
Further included with the performance test data processing method of operation nonvolatile memory:When the text that there is repetition record in journal file
During part name, output represents results of performance analysis of the tested application there are repetitive operation file problem.
Specifically, it is the single operational process of tested application to be tested application from opening to closing.In the single of tested application
In operational process, the filename of file operated by tested application is recorded in journal file by terminal by custom function, day
Every record records the filename of operation file in will file.Terminal is sent to server by journal file, can be by
Filename in journal file is compared server, searches whether that more than one same file name is present in daily record text
In part, to judge in journal file with the presence or absence of the filename for repeating record.Filename can be inquired about by filec descriptor
Arrive.
In the present embodiment, when exist repeat record filename when, illustrate be tested apply it is right in its single operational process
Same file has carried out multiple reading or has write, and efficiency is low, and output represents performance of the tested application there are repetitive operation file problem
The problem of analysis result can guide developer to overcome repetitive operation file.
In one embodiment, the performance test data processing method of the application operating nonvolatile memory further includes profit
The step of automation scrnario testing being carried out with test case and controlling hook to open and cancel.With reference to Fig. 5, this utilizes test case
Carry out automation scrnario testing and specifically comprise the following steps the step of controlling hook to open and cancel:
S502, obtains test case and performs.
Wherein, test case (Test Case) is the one group of test input worked out for specified test target, performs bar
Part and expected results, so that whether test program meets the code of target requirement.Terminal can download test case from server
And perform.Terminal can also obtain the test case importeding into terminal and execution.
S504, during implementation of test cases, calls hook to open interface to perform step S302.
S506, the scrnario testing code in implementation of test cases after calling hook to open interface.
S508, after performing scrnario testing the code ends, calls hook to stop interface to cancel step S302.
Specifically, test case includes scrnario testing code, which is used for test test quilt upon execution
Survey the performance applied and nonvolatile memory is operated under given scenario.Terminal is surveyed in implementation of test cases performing scene
Try code before, call hook open interface Start () perform step S302, with link up with operating system offer be used for operate
The system function of nonvolatile memory, and then can will perform the execution scrnario testing code when performing scrnario testing code
When operate nonvolatile memory caused by performance test data be recorded in journal file.Terminal is performing scrnario testing generation
After code, recall hook and stop interface Stop (), to cancel the hook to system function, stop recording daily record.Scene is surveyed
Examination code such as can be the code for testing specific function, or test a series of code of combination functions.
In the present embodiment, when carrying out automatic test using test case, it can be stopped by linking up with unlatching interface and hook
Only Interface Controller hook is opened and cancelled, so that it is non-easily to record tested application operating under given scenario in journal file exactly
The property lost performance test data caused by memory, is realized to the tested property for applying operation nonvolatile memory under special scenes
Can test.
Fig. 6 is the flow of the performance test data processing method of application operating nonvolatile memory in another embodiment
Schematic diagram.Fig. 7 is realized by the performance test data processing method of application operating nonvolatile memory in one embodiment
Each functional schematic.Fig. 8 be operated in one embodiment by custom function during single file operation it is non-volatile
The schematic diagram of file in property memory.With reference to Fig. 6 to Fig. 8, this method specifically comprises the following steps:
S602, the system function for being used to operate nonvolatile memory that hook Android operation system provides so that system
Calling of the triggering to custom function when function is by being tested using input parameter and calling.System function is Android operation system
Open () function, Close (), Read () function and Write () function in BlockGuardOS.java classes.
S604, by custom function and according to parameter manipulation nonvolatile memory.
S606, operated nonvolatile memory in single operational process is applied by the way that custom function collection is tested
Read or write during the filename of middle file, the thread name of tested application operating nonvolatile memory, single file operation
The number read or write during total amount of data and single file operation, and the filename of collection, thread name, single file are grasped
The total amount of data read or write during work and the number corresponding record that is read or write during single file operation are in journal file
In.
Specifically, terminal can apply file in operated nonvolatile memory in single operational process by tested
The total amount of data read or write during filename, the thread name of tested application operating nonvolatile memory, single file operation
And the number read or write during single file operation is recorded in the same record in journal file, so that these be counted
According to being accordingly recorded in journal file.
S608, when, there are during main thread name, output represents tested using non-in the presence of being operated by main thread in journal file
The results of performance analysis of the performance issue of volatile memory.
S610, when there are during sub-line journey name, obtaining single file operation process corresponding with sub-line journey name in journal file
In the total amount of data that reads or writes and the number read or write during single file operation.
S612, reads or writes the total amount of data read or write during single file operation divided by during single file operation
Number obtain single and read or write data volume average.
S614, when single, which reads or writes data volume average, is less than preset value, output represents the sub-line represented by sub-line journey name
There is the results of performance analysis for reading or writing efficiency in journey.
S616, when there is the filename for repeating record in journal file, output represents tested application, and there are repetitive operation
The results of performance analysis of file problem.
In the present embodiment, application is tested in the process of running, if operating non-volatile memory medium, the correspondence of generation
Can test data can be recorded in daily record, the performance test data in the daily record can express that tested application operating is non-volatile to be deposited
The actual performance of reservoir, the performance indicator of nonvolatile memory described in application operating is tested available for subsequent analysis.By dividing
Journal file is analysed, tested application can be analyzed and there is performance issue, the sub-line that nonvolatile memory is operated by main thread
The problem of reading or writing efficiency and repetitive operation file of journey.
In one embodiment, in step S606, single file operation can also be taken and stack information is recorded in
In journal file.Specifically, terminal can be preserved by the corresponding custom function of Open () function starts the first of operation file
Timestamp passes through the second timestamp of the corresponding custom function preservation end operation file of Close () function to journal file
To journal file, the difference of the second timestamp of calculating and first time stamp obtains single file operation and takes.Pass through single file
The time-consuming efficiency that can also be found out during single file operation of operation, such as when single file operation is taken more than presetting
When long, output represents the results of performance analysis of the performance issue there are file operation time-out.Stack information can describe to ask
Site environment during topic, solves the problems, such as to be found various available for assistance developer.
Fig. 9 is the knot of the performance test data processing unit 900 of application operating nonvolatile memory in one embodiment
Structure block diagram.With reference to Fig. 9, the performance test data processing unit 900 of application operating nonvolatile memory includes:Hooking module
901 and custom function execution module 902.
Hooking module 901, for linking up with the system function for being used to operate nonvolatile memory of operating system offer, makes
Calling of the triggering to custom function when obtaining system function by being tested using input parameter and calling.
Custom function execution module 902, for by custom function and according to parameter manipulation nonvolatile memory;
By performance test data caused by custom function acquisition operations nonvolatile memory, and by the performance test number of collection
According to being recorded in journal file;Performance test data in journal file is used for analysis according to this, and tested application operating is non-volatile deposits
The performance indicator of reservoir.
Above application operates the performance test data processing unit of nonvolatile memory, and hook is used to operate non-volatile
The system function of memory, system function can be adjusted back custom function during tested application call, so as to pass through self-defined letter
Number operation nonvolatile memory, and the performance test data for operating generation is recorded in journal file, in the journal file
Performance test data can be used to analyze the performance indicator of tested application operating nonvolatile memory.Tested apply was being run
Cheng Zhong, if operating non-volatile memory medium, the respective performances test data of generation can be recorded in daily record, in the daily record
Performance test data can express the actual performance of tested application operating nonvolatile memory, being tested available for subsequent analysis should
With the performance indicator for operating the nonvolatile memory.
In one embodiment, operating system is Android operation system;System function is Android operation system
Open () function, Close (), Read () function in BlockGuardOS.java classes and one kind in Write () function or
Several combinations.
Specifically, Android (English is Android) operating system is a kind of operation system of the open source code based on Linux
System.Android operation system support includes a variety of system functions for being used to operate nonvolatile memory, such as
FileInputStream, FileOutputStream, FileReader and FileWriter etc..If to being useful for operating
The system function of nonvolatile memory is linked up with, and workload is bigger, and is easily omitted.And used in Android operation system
In operation nonvolatile memory system function, eventually call BlockGuardOS.java classes in Open () function,
One or more of combinations in Close (), Read () function and Write () function.Therefore link directly
Function in BlockGuardOS.java classes, is more convenient and comprehensive.
Figure 10 is the performance test data processing unit 900 of application operating nonvolatile memory in another embodiment
Structure diagram.With reference to Figure 10, the performance test data processing unit 900 of application operating nonvolatile memory further includes:Performance
Analysis module 903.
In one embodiment, custom function execution module 902 is additionally operable to gather tested application by custom function
Operate the thread name of volatile memory and be recorded in journal file.
Performance evaluation module 903 is used for when, there are during main thread name, it is logical that output represents that tested application exists in journal file
Cross the results of performance analysis of the performance issue of main thread operation nonvolatile memory.
In the present embodiment, since the function that main thread is responsible for is more, if directly operating nonvolatile memory by main thread,
Influence whether the function of main thread.Therefore, when there are during main thread name, position to be tested to apply to exist to pass through main line in journal file
Journey operates the performance issue of nonvolatile memory, so that it is non-easy to guide developer to overcome tested application to be operated by main thread
The performance issue of the property lost memory, to lift the performance of tested application.
In one embodiment, custom function execution module 902 is additionally operable to gather tested application by custom function
The total amount of data and list read or write when operating nonvolatile memory during used thread name, single file operation
The number read or write during secondary file operation, and corresponding record is in journal file.
Performance evaluation module 903 is used for when there are during sub-line journey name, obtaining list corresponding with sub-line journey name in journal file
The total amount of data read or write during secondary file operation and the number read or write during single file operation;By single file
The total amount of data read or write in operating process divided by the number read or write during single file operation obtain single and read or write number
According to amount average;When single, which reads or writes data volume average, is less than preset value, output represents that the sub-line journey represented by sub-line journey name is deposited
Reading or writing the results of performance analysis of efficiency.
In the present embodiment, single, which reads or writes data volume average, can reflect that tested application reads or writes the height of efficiency, work as quilt
Survey using when reading or writing less efficient, output represents that the sub-line journey represented by sub-line journey name has the performance for reading or writing efficiency
Analysis result, realizes the precise positioning for reading or writing efficiency, be conducive to guide developer overcome the sub-line journey reading or
Write efficiency.
In one embodiment, custom function execution module 902 is additionally operable to gather tested application by custom function
The filename of file in nonvolatile memory operated by single operational process, and the filename of collection is recorded in day
In will file.
Performance evaluation module 903 is used for when there is the filename of repetition record in journal file, and output represents tested and answers
With there are the results of performance analysis of repetitive operation file problem.
In the present embodiment, when exist repeat record filename when, illustrate be tested apply it is right in its single operational process
Same file has carried out multiple reading or has write, and efficiency is low, and output represents performance of the tested application there are repetitive operation file problem
The problem of analysis result can guide developer to overcome repetitive operation file.
Figure 11 is the performance test data processing unit 900 of application operating nonvolatile memory in another embodiment
Structure diagram.With reference to Figure 11, the performance test data processing unit 900 of application operating nonvolatile memory further includes:Automatically
Change test module 904, for obtaining test case and performing;During implementation of test cases, hook is called to open interface to link up with behaviour
The system function for being used to operate nonvolatile memory of system offer is provided;The implementation of test cases after calling hook to open interface
In scrnario testing code;After performing scrnario testing the code ends, call hook to stop interface and carried with cancelling hook operating system
What is supplied is used to operate the system function of nonvolatile memory.
In the present embodiment, when carrying out automatic test using test case, it can be stopped by linking up with unlatching interface and hook
Only Interface Controller hook is opened and cancelled, so that it is non-easily to record tested application operating under given scenario in journal file exactly
The property lost performance test data caused by memory, is realized to the tested property for applying operation nonvolatile memory under special scenes
Can test.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, which can be stored in a non-volatile computer and storage can be read
In device, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, which can be magnetic disc, light
Disk, read-only memory (Read-Only Memory, ROM) etc..
Each technical characteristic of above example can be combined arbitrarily, to make description succinct, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, lance is not present in the combination of these technical characteristics
Shield, is all considered to be the scope of this specification record.
Above example only expresses the several embodiments of the present invention, its description is more specific and detailed, but can not
Therefore it is construed as limiting the scope of the patent.It should be pointed out that for those of ordinary skill in the art,
On the premise of not departing from present inventive concept, various modifications and improvements can be made, these belong to protection scope of the present invention.
Therefore, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (14)
1. a kind of performance test data processing method of application operating nonvolatile memory, including:
The system function for being used to operate nonvolatile memory that hook operating system provides so that the system function is by being tested
Calling of the triggering to custom function when using input parameter and calling;
Pass through the custom function and the nonvolatile memory according to the parameter manipulation;
By performance test data caused by nonvolatile memory described in the custom function acquisition operations, and will collection
Performance test data be recorded in journal file;Performance test data in the journal file is used to analyze the quilt according to this
Survey the performance indicator of nonvolatile memory described in application operating.
2. according to the method described in claim 1, it is characterized in that, the operating system is Android operation system;The system
Function is Open () function in the BlockGuardOS.java classes of the Android operation system, Close () function, Read
One or more of combinations in () function and Write () function.
3. according to the method described in claim 1, it is characterized in that, the performance test data is being grasped including tested apply
The data read or write when making the nonvolatile memory during used process name, thread name, single file operation are total
Amount, the number read or write during single file operation and it is described it is tested apply it is operated in single operational process described in
One or more of combinations in nonvolatile memory in the filename of file.
It is 4. according to the method described in claim 1, it is characterized in that, described by non-described in the custom function acquisition operations
Performance test data caused by volatile memory, and the performance test data of collection is recorded in the step in journal file
Including:
Described be tested is gathered by the custom function and applies the used thread when operating the nonvolatile memory
Name, and the thread name of collection is recorded in journal file;
The method further includes:
When, there are during main thread name, output represents that the tested application is non-easy in the presence of being operated by main thread in the journal file
The results of performance analysis of the performance issue of the property lost memory.
It is 5. according to the method described in claim 1, it is characterized in that, described by non-described in the custom function acquisition operations
Performance test data caused by volatile memory, and the performance test data of collection is recorded in the step in journal file
Including:
Described be tested is gathered by the custom function and applies the used thread when operating the nonvolatile memory
The total amount of data read or write during name, single file operation and the number read or write during single file operation, and will
The total amount of data read or write during the thread name of collection, single file operation and read or write during single file operation
Number corresponding record is in journal file;
The method further includes:
During single file operation corresponding with the sub-line journey name there are during sub-line journey name, is obtained in the journal file
The total amount of data read or write and the number read or write during single file operation;
Read or write the total amount of data read or write during the single file operation divided by during the single file operation
Number obtain single and read or write data volume average;
When the single, which reads or writes data volume average, is less than preset value, output represents the sub-line journey represented by the sub-line journey name
In the presence of the results of performance analysis for reading or writing efficiency.
It is 6. according to the method described in claim 1, it is characterized in that, described by non-described in the custom function acquisition operations
Performance test data caused by volatile memory, and the performance test data of collection is recorded in the step in journal file
Including:
Gathered by the custom function and described tested apply operated in single operational process described non-volatile deposit
The filename of file in reservoir, and the filename of collection is recorded in journal file;
The method further includes:
When there is the filename for repeating record in the journal file, output represents the tested application, and there are repetitive operation text
The results of performance analysis of part problem.
7. according to the method described in claim 1, it is characterized in that, the method further includes:
Obtain test case and perform;
When performing the test case, calling hook opens interface to perform the non-for operating of the hook operating system offer
The step of system function of volatile memory;
Scrnario testing code in the test case is performed after calling hook to open interface;
After performing the scrnario testing the code ends, call hook to stop interface and provided with cancelling the hook operating system
Be used for operate nonvolatile memory system function the step of.
A kind of 8. performance test data processing unit of application operating nonvolatile memory, it is characterised in that including:
Hooking module, for linking up with the system function for being used to operate nonvolatile memory of operating system offer so that described
Calling of the triggering to custom function when system function is by being tested using input parameter and calling;
Custom function execution module, for by the custom function and non-volatile according to the parameter manipulation depositing
Reservoir;By performance test data caused by nonvolatile memory described in the custom function acquisition operations, and will adopt
The performance test data of collection is recorded in journal file;Performance test data in the journal file is used for described in analysis according to this
The performance indicator of nonvolatile memory described in tested application operating.
9. device according to claim 8, it is characterised in that the operating system is Android operation system;The system
Function is Open () function in the BlockGuardOS.java classes of the Android operation system, Close (), Read () letter
One or more of combinations in number and Write () function.
10. device according to claim 8, it is characterised in that the performance test data includes described be tested and applies
The data read or write when operating the nonvolatile memory during used process name, thread name, single file operation
The number and described be tested read or write during total amount, single file operation applies operated institute in single operational process
State one or more of combinations in the filename of file in nonvolatile memory.
11. device according to claim 8, it is characterised in that the custom function execution module is additionally operable to pass through institute
State described be tested of custom function collection and apply the used thread name when operating the nonvolatile memory, and will collection
Thread name be recorded in journal file;
Described device further includes:
Performance evaluation module, for when, there are during main thread name, output represents that the tested application exists in the journal file
The results of performance analysis of the performance issue of nonvolatile memory is operated by main thread.
12. device according to claim 8, it is characterised in that the custom function execution module is additionally operable to pass through institute
State described be tested of custom function collection and apply used thread name, single file when operating the nonvolatile memory
The total amount of data read or write in operating process and the number read or write during single file operation, and by the thread of collection
The total amount of data read or write during name, single file operation and the number read or write during single file operation correspond to note
Record is in journal file;
Described device further includes:
Performance evaluation module, for when, there are during sub-line journey name, acquisition is corresponding with the sub-line journey name in the journal file
The total amount of data read or write during single file operation and the number read or write during single file operation;By the list
The total amount of data read or write during secondary file operation divided by the number read or write during the single file operation obtain list
It is secondary to read or write data volume average;When the single, which reads or writes data volume average, is less than preset value, output represents the sub-line journey
There is the results of performance analysis for reading or writing efficiency in the sub-line journey represented by name.
13. device according to claim 8, it is characterised in that the custom function execution module is additionally operable to pass through institute
State described be tested of custom function collection and apply file in the operated nonvolatile memory in single operational process
Filename, and the filename of collection is recorded in journal file;
Described device further includes:
Performance evaluation module, for when there is the filename for repeating record in the journal file, output to represent described tested
Using there are the results of performance analysis of repetitive operation file problem.
14. device according to claim 8, it is characterised in that described device further includes:
Automatic test module, for obtaining test case and performing;When performing the test case, hook is called to open interface
To link up with the system function for being used to operate nonvolatile memory of operating system offer;Performed after calling hook to open interface
Scrnario testing code in the test case;After performing the scrnario testing the code ends, hook is called to stop interface to take
The system function for being used to operate nonvolatile memory that the hook operating system that disappears provides.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610891321.4A CN107943676B (en) | 2016-10-12 | 2016-10-12 | Performance test data processing method and device for operating nonvolatile memory by application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610891321.4A CN107943676B (en) | 2016-10-12 | 2016-10-12 | Performance test data processing method and device for operating nonvolatile memory by application |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107943676A true CN107943676A (en) | 2018-04-20 |
CN107943676B CN107943676B (en) | 2020-10-30 |
Family
ID=61928767
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610891321.4A Active CN107943676B (en) | 2016-10-12 | 2016-10-12 | Performance test data processing method and device for operating nonvolatile memory by application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107943676B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110078507A1 (en) * | 2009-09-29 | 2011-03-31 | Hyundai Motor Company | Operational system test method |
CN102621432A (en) * | 2012-04-11 | 2012-08-01 | 北京四方继保自动化股份有限公司 | Method for automatically testing single board of protective relay device |
CN104077110A (en) * | 2014-07-09 | 2014-10-01 | 肖龙旭 | File scheduling method based on system behaviors |
CN104200161A (en) * | 2014-08-05 | 2014-12-10 | 杭州安恒信息技术有限公司 | Method for achieving intelligent sandbox file detection and intelligent sandbox detection system based on method |
US20150363297A1 (en) * | 2014-06-13 | 2015-12-17 | International Business Machines Corporation | Performance testing of software applications |
CN105426310A (en) * | 2015-11-27 | 2016-03-23 | 北京奇虎科技有限公司 | Method and apparatus for detecting performance of target process |
CN105550104A (en) * | 2015-12-08 | 2016-05-04 | 北京奇虎科技有限公司 | Application program performance test method and device |
-
2016
- 2016-10-12 CN CN201610891321.4A patent/CN107943676B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110078507A1 (en) * | 2009-09-29 | 2011-03-31 | Hyundai Motor Company | Operational system test method |
CN102621432A (en) * | 2012-04-11 | 2012-08-01 | 北京四方继保自动化股份有限公司 | Method for automatically testing single board of protective relay device |
US20150363297A1 (en) * | 2014-06-13 | 2015-12-17 | International Business Machines Corporation | Performance testing of software applications |
CN104077110A (en) * | 2014-07-09 | 2014-10-01 | 肖龙旭 | File scheduling method based on system behaviors |
CN104200161A (en) * | 2014-08-05 | 2014-12-10 | 杭州安恒信息技术有限公司 | Method for achieving intelligent sandbox file detection and intelligent sandbox detection system based on method |
CN105426310A (en) * | 2015-11-27 | 2016-03-23 | 北京奇虎科技有限公司 | Method and apparatus for detecting performance of target process |
CN105550104A (en) * | 2015-12-08 | 2016-05-04 | 北京奇虎科技有限公司 | Application program performance test method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107943676B (en) | 2020-10-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111506498B (en) | Automatic generation method and device of test case, computer equipment and storage medium | |
CN109302522B (en) | Test method, test device, computer system, and computer medium | |
CN107102947B (en) | ATM transaction flow testing device and method | |
CN105426310B (en) | A kind of method and apparatus for the performance for detecting target process | |
CN107622014A (en) | Test report generation method, device, readable storage medium storing program for executing and computer equipment | |
CN109871326A (en) | A kind of method and apparatus that script is recorded | |
CN109491860A (en) | Method for detecting abnormality, terminal device and the medium of application program | |
CN110457211A (en) | Script performance test methods, device and equipment and computer storage medium | |
CN113778898B (en) | User interface automatic test method and device, electronic equipment and storage medium | |
CN109783365A (en) | Automated testing method, device, computer equipment and storage medium | |
CN110287696A (en) | A kind of detection method, device and the equipment of the shell process that rebounds | |
CN105405221A (en) | Method and device for automated test | |
CN108415826A (en) | Test method, terminal device and the computer readable storage medium of application | |
CN109240936A (en) | Compatibility test method, terminal device and the medium of application program | |
CN106528429A (en) | UI testing method and device | |
CN113672520A (en) | Test case generation method and device, electronic equipment and storage medium | |
CN113778890B (en) | Code testing method and device, electronic equipment and storage medium | |
CN110275820B (en) | Page compatibility testing method, system and equipment | |
CN113836014A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN109766327A (en) | The analysis method and device of database access request | |
CN111666201A (en) | Regression testing method, device, medium and electronic equipment | |
CN107943676A (en) | The performance test data treating method and apparatus of application operating nonvolatile memory | |
CN109828901A (en) | Build method and device, Linux server and readable storage medium storing program for executing that pressure surveys environment | |
CN109522217A (en) | The internal storage testing method and terminal device of application program | |
CN115309661A (en) | Application testing method and device, electronic equipment and readable storage medium |
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 |