A method, device, terminal and storage medium for testing image cloud storage performance
By performing multi-threaded concurrent image writing, reading and deletion operations in cloud storage, and calculating operation timeout error rate, the problem that traditional tools cannot truly test cloud storage's image processing capabilities, achieving more efficient performance testing.
Patent Information
- Application Number
- CN202110956185.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-19
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-08-19
AI Technical Summary
Traditional storage performance testing tools cannot truly and effectively test the ability of cloud storage to process images, especially under massive image data.
Provide a method for testing the performance of the image cloud storage. By setting configuration parameters for write, read and delete operations, using multi-threaded concurrency to write, read and delete images to cloud storage, calculate operation timeout error rate to evaluate performance.
This method can more realistically and effectively detect the reading, writing and deletion capabilities of cloud storage on pictures, and test them according to the specified image source, avoiding the limitations of file formats and binary files in traditional tools.
Smart Images

Figure CN113806192B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image cloud storage performance testing, and in particular to an image cloud storage performance testing method, device, terminal and storage medium. Background Art
[0002] Cameras are installed at every intersection, parking lot or community, and the massive amount of image data generated every day is stored on the hard disk of the cloud storage system. For various reasons, administrators will write, read, and delete these image data at any time. The image information generated in a single-user scenario is relatively small, and has little impact on performance; the amount of image data generated in public places is usually massive, and the requirements for image reading, writing, and deleting performance will be relatively high, which is actually a requirement for storage performance.
[0003] Traditional storage performance testing tools include vdbench, IOMeter, and IOZone. They can specify file size, number of files, number of working threads, block size of transmission, and random or sequential read and write according to user needs, and can effectively test storage performance. However, they all have a common disadvantage, that is, they need to create files based on the tool itself, and the written files are usually binary files, and the file format cannot be specified. The pictures captured by the camera equipment are usually openable files such as jpg, gif, png, etc. The traditional vdbench, IOMeter, and IOZone test tools cannot more realistically and effectively test the storage's ability to process pictures. Summary of the invention
[0004] To solve the above problems, the present invention provides a method, device, terminal and storage medium for testing the performance of image cloud storage, which can perform write, read and delete operations according to the image source, and can more realistically and effectively detect the read, write and delete processing capabilities of cloud storage for images.
[0005] In a first aspect, the technical solution of the present invention provides a method for testing the performance of a picture cloud storage, including a cloud storage write performance test, wherein the cloud storage write performance test includes the following steps:
[0006] Set the write configuration parameters, including the image source path, the number of image sources, the image storage path, the number of write threads, and the number of images written per cycle. The number of images written per cycle refers to the number of images written to the cloud storage by all write threads in each write cycle.
[0007] Execute the write thread and write the image into the cloud storage according to the write configuration parameters;
[0008] During the execution of the write thread, if the actual number of pictures written in a certain write cycle is less than the configured number of pictures written per cycle, a write operation timeout error is recorded;
[0009] After the write test is completed, the total number of write operation timeout errors is counted, and the write operation timeout error rate is calculated using the following formula: Write operation timeout error rate = (total number of write operation timeout errors * 100%) / total write test duration;
[0010] If the write operation timeout error rate exceeds the preset first error threshold, the cloud storage write performance fails; otherwise, it passes.
[0011] Furthermore, the cloud storage write performance test also includes the following steps: during the execution of the write thread, if the time taken for a certain write cycle to write the configured number of pictures per cycle to the cloud storage is t1, and t1<T1, where T1 is the duration of each write cycle; then all write threads sleep for T1-t1 time and then restart.
[0012] Furthermore, the cloud storage write performance test also includes the following steps: recording the number of times the write thread is restarted; if the number of times the write thread is restarted exceeds a first preset number, modifying the write configuration parameters, increasing the number of pictures written per cycle, and re-performing the cloud storage write performance test.
[0013] Furthermore, the cloud storage write performance test further includes the following steps: executing a write thread, and when performing an operation of writing a picture into the cloud storage according to the write configuration parameters, storing the picture storage location information into the picture database;
[0014] The method also includes a cloud storage read performance test, and the cloud storage read performance test includes the following steps:
[0015] Mount the cloud storage directory;
[0016] Set the read configuration parameters, including the image database path, the number of read threads, and the number of images read per cycle. The number of images read per cycle refers to the number of images read by all read threads in each read cycle.
[0017] Execute the read thread and read the image according to the read configuration parameters;
[0018] During the execution of the read thread, if the actual number of pictures read in a certain read cycle is less than the configured number of pictures read per cycle, a read operation timeout error is recorded;
[0019] After the read test is completed, the total number of read operation timeout errors is counted, and the read operation timeout error rate is calculated using the following formula: Read operation timeout error rate = (total number of read operation timeout errors * 100%) / total read test duration;
[0020] If the read operation timeout error rate exceeds the preset second error threshold, the cloud storage read performance fails; otherwise, it passes.
[0021] Furthermore, the cloud storage read performance test also includes the following steps: during the execution of the read thread, if the time taken for a certain read cycle to read the configured number of pictures per cycle is t2, and t2<T2, where T2 is the duration of each read cycle; then all read threads sleep for T2-t2 time and then restart.
[0022] Furthermore, the cloud storage read performance test also includes the following steps: recording the number of times the read thread is restarted; if the number of times the read thread is restarted exceeds a second preset number, modifying the read configuration parameters, increasing the number of pictures read per cycle, and re-performing the cloud storage read performance test.
[0023] Furthermore, the written configuration parameters also include the image saving time;
[0024] The method also includes a cloud storage deletion performance test, and the cloud storage deletion performance test includes the following steps:
[0025] Scanning the image database once at a preset time interval to detect image information that exceeds the image storage time;
[0026] Execute the deletion process to delete the pictures that have exceeded the picture storage time;
[0027] During the deletion process, if the number of pictures actually deleted in a deletion cycle is less than the configured number of pictures written per cycle, a deletion operation timeout error is recorded;
[0028] After the deletion test is completed, the total number of deletion operation timeout errors is counted, and the deletion operation timeout error rate is calculated using the following formula: Deletion operation timeout error rate = (total number of deletion operation timeout errors * 100%) / total write test duration;
[0029] If the deletion operation timeout error rate exceeds the preset third error threshold, the cloud storage deletion performance fails; otherwise, it passes.
[0030] In a second aspect, the technical solution of the present invention provides a picture cloud storage performance test device, including a cloud storage write performance test module, the cloud storage write performance test module includes:
[0031] Write configuration parameter setting unit: Set write configuration parameters, including image source path, number of image sources, image storage path, number of write threads, and number of images written per cycle; the number of images written per cycle refers to the number of images written to cloud storage by all write threads per write cycle;
[0032] Write thread execution unit: executes the write thread and writes the image into the cloud storage according to the write configuration parameters;
[0033] Write operation timeout error recording unit: During the execution of the write thread, if the actual number of pictures written in a certain write cycle is less than the configured number of pictures written per cycle, a write operation timeout error is recorded;
[0034] Write operation timeout error rate calculation unit: after the write test is completed, the total number of write operation timeout errors is counted, and the write operation timeout error rate is calculated by the following formula: Write operation timeout error rate = (total number of write operation timeout errors * 100%) / total write test duration;
[0035] Write performance judgment unit: If the write operation timeout error rate exceeds the preset first error threshold, the cloud storage write performance fails; otherwise, it passes.
[0036] In a third aspect, the technical solution of the present invention provides a terminal, including:
[0037] processor;
[0038] A memory for storing execution instructions of the processor;
[0039] The processor is configured to execute any of the above methods.
[0040] In a fourth aspect, the technical solution of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods described above.
[0041] Compared with the prior art, the present invention provides a method, device, terminal and storage medium for testing the performance of cloud storage of images, which have the following beneficial effects: when performing a write operation performance test, the image is written to the cloud storage through the image source. This process is independent of the format of the image, and the image source can be set as needed. When the image is subsequently read out from the cloud storage for a read operation performance test, the reading is based on the written image, which is also independent of the image format. The deletion operation performance test is based on the image written by the write operation, and the timed-out image is deleted, and the image format does not need to be considered. The image cloud storage performance test of the present invention is tested according to the specified image source, which more realistically and effectively verifies the cloud storage's ability to process images. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A schematic diagram of a cloud storage write performance testing method flow provided in the first embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a cloud storage read performance testing method flow provided in Embodiment 2 of the present invention;
[0045] Figure 3 A schematic diagram of a cloud storage deletion performance testing method flow provided in Embodiment 3 of the present invention;
[0046] Figure 4 A schematic block diagram of the structure of a device for testing the performance of image cloud storage provided by the fourth embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the structure of a terminal provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0049] Traditional storage performance testing tools include vdbench, IOMeter, and IOZone. They can specify file size, number of files, number of working threads, block size of transmission, and random or sequential read and write according to user needs, and can effectively test storage performance. However, they all have a common disadvantage, that is, they need to create files based on the tool itself, and the written files are usually binary files, and the file format cannot be specified. The pictures captured by the camera equipment are usually openable files such as jpg, gif, png, etc. The traditional vdbench, IOMeter, and IOZone test tools cannot more realistically and effectively test the storage's ability to process pictures.
[0050] Therefore, the present invention provides a method for testing the performance of cloud storage of images, including a cloud storage write performance test, a cloud storage read performance test and a cloud storage deletion performance test. Writing, reading and deleting operations are performed according to the image source, which can more realistically and effectively detect the read, write and delete processing capabilities of cloud storage for images.
[0051] Embodiment 1
[0052] The first embodiment of the present invention provides a method for testing the performance of a cloud storage of images, including a cloud storage write performance test, performing a write operation based on an image source, and judging whether the cloud storage write performance passes according to the operation process and results.
[0053] like Figure 1The figure is a schematic diagram of the flow of the cloud storage write performance testing method provided in the first embodiment, which includes the following steps.
[0054] S101, setting write configuration parameters, including image source path, number of image sources, image storage path, number of write threads and number of images written per cycle; wherein the number of images written per cycle refers to the number of images written to the cloud storage by all write threads in each write cycle.
[0055] The image source path refers to the storage location of the image source in the local folder, the number of image sources refers to the number of image sources stored in the local folder, the image storage path refers to the storage location of the image in the cloud storage, and the number of write threads refers to the number of threads that write images to the cloud storage. In this embodiment, the number of write threads is greater than 1, that is, the images are written to the cloud storage in a multi-threaded concurrent manner. In each cycle, these write threads expand the images to the number of images written per cycle based on the image source, and the multi-threaded concurrency writes the number of images written per cycle to the cloud storage.
[0056] The duration of each cycle can be set as needed, for example, set to 1 second.
[0057] The specific implementation method of setting write configuration parameters is as follows:
[0058] 1) Put the image source in the local directory folder: / local / Picture_source / photo-30K;
[0059] 2) Mount the storage system shared directory to the local client directory / mnt / ;
[0060] 3) Modify the write configuration file GSPictureTest_Write / config.ini:
[0061] PICTURE_SOURCE_PATH = / local / Picture_source / photo-30K # Picture source path, that is, the picture source specified by the user, which can be a single picture or multiple pictures;
[0062] PICTURE_SOURCE_NUM = 5 #Number of picture sources;
[0063] PICTURE_STORAGE_PATH = / mnt / picture-001 / photo-30K #Picture storage path, that is, the path where the cloud storage is mounted to the test client to store pictures;
[0064] THREAD_NUM = 16 #Number of write threads;
[0065] FREQUENCY = 100 #The frequency of storing pictures, that is, the number of pictures written to the cloud storage by all threads within 1 second.
[0066] That is, the number of image sources is 5, the size of each image source is 30K (the size of the expanded image is also 30K), the number of writing threads is 16, and the number of images written per cycle is 100. The duration of each cycle is specified as 1s, that is, 16 writing threads should write 100 images to the cloud storage within 1s.
[0067] S102, executing the write thread, and performing an operation of writing the image into the cloud storage according to the write configuration parameters.
[0068] It should be noted that all write threads are executed and multi-threaded concurrently to write images to cloud storage.
[0069] S103, during the execution of the write thread, if the number of pictures actually written in a certain write cycle is less than the configured number of pictures written per cycle, a write operation timeout error is recorded.
[0070] The write operation is performed in a write cycle. For example, according to the write configuration parameters, all write threads should write 100 pictures to the cloud storage in each cycle. If 98 pictures are actually written in a certain write cycle, the write operation times out and a write operation timeout error is recorded.
[0071] During the entire write performance test, all write operation timeout errors are accumulated.
[0072] S104, after the write test is completed, the total number of write operation timeout errors is counted, and the write operation timeout error rate is calculated by the following formula: write operation timeout error rate = (total number of write operation timeout errors * 100%) / total write test duration.
[0073] For example, if the total number of write operation timeout errors is 15 and the total write test duration is 30 minutes, then the write operation timeout error rate = (15*100%) / (30*60) = 0.8%.
[0074] S105, if the write operation timeout error rate exceeds the preset first error threshold, the cloud storage write performance fails; otherwise, it passes.
[0075] A first error threshold is preset, for example, 5%, that is, if the write operation timeout error rate does not exceed 5%, it is considered that the cloud storage write performance is normal.
[0076] The image cloud storage performance test method provided in the first embodiment writes images to cloud storage through an image source when performing a write operation performance test. This process has nothing to do with the format of the image. The image source can be set as needed, so that the image cloud storage performance test is performed according to the specified image source, thereby more realistically and effectively testing the cloud storage's ability to process images.
[0077] In this embodiment, the cloud storage write performance is tested in cycles. If the number of pictures written per cycle is initially set to be low, and the cloud storage write performance is high, for example, the number of pictures written per cycle is set to 100, and the cloud storage can actually write 200 pictures per cycle, then the time to write 100 pictures will be less than the duration of each cycle.
[0078] Based on this, the cloud storage write performance test in this embodiment 1 further includes the following steps:
[0079] S106, during the execution of the write thread, if the time taken for a certain write cycle to write the configured number of pictures per cycle to the cloud storage is t1, and t1<T1, where T1 is the duration of each write cycle; then all write threads sleep for T1-t1 time and then restart.
[0080] Correspondingly, if the write thread is restarted too many times, it means that the number of pictures written per cycle is too small, and the cloud storage write performance cannot be measured. The number of pictures written per cycle should be increased for testing.
[0081] Based on this, the cloud storage write performance test in this embodiment 1 further includes the following steps:
[0082] S107, record the number of restarts of the write thread; if the number of restarts of the write thread exceeds the first preset number, modify the write configuration parameters, increase the number of pictures written per cycle, and re-perform the cloud storage write performance test.
[0083] Embodiment 2
[0084] The second embodiment provides a method for testing the performance of cloud storage of images, including a cloud storage read performance test, reading images written based on a cloud storage write performance test, and judging whether the cloud storage read performance passes according to the operation process and results.
[0085] It should be noted that when the cloud storage write performance test is performed, when the write thread is executed and the image is written to the cloud storage according to the write configuration parameters, the image storage location information is stored in the image database, and then the read operation is performed according to the information in the image database.
[0086] like Figure 2 The flowchart of the cloud storage read performance testing method provided in the second embodiment includes the following steps.
[0087] S201, mount the cloud storage directory.
[0088] It means mounting the physical location of the image so that the image can be read later.
[0089] S202, setting read configuration parameters, including the image database path, the number of read threads, and the number of images read per cycle; wherein the number of images read per cycle refers to the number of images read by all read threads in each read cycle.
[0090] The specific implementation method of setting the read configuration parameters is as follows:
[0091] Modify the read configuration file GSPictureTest_Read / config.ini:
[0092] PICTURE_PATH = / local / GSPictureTest_Read / cheliang #Picture database path
[0093] THREAD_NUM = 5 #Number of read threads
[0094] FREQUENCY = 100 #The frequency of reading pictures, that is, how many times to read pictures per second.
[0095] That is, the number of reading threads is 5, and the number of pictures read per cycle is 100. The duration of each cycle is specified as 1 second, that is, 5 reading threads read 100 pictures from the cloud storage within 1 second. The number of pictures read per cycle is the same as the number of pictures written per cycle, and the duration of each write cycle is the same as that of each read cycle.
[0096] S203, executing the read thread, and performing a picture read operation according to the read configuration parameters.
[0097] The same is true for multi-threaded concurrent reading.
[0098] S204, during the execution of the read thread, if the actual number of pictures read in a certain read cycle is less than the configured number of pictures read per cycle, a read operation timeout error is recorded.
[0099] The read operation is performed in a read cycle. For example, according to the read configuration parameters, all read threads should read 100 pictures in each cycle. If 98 pictures are actually read in a certain read cycle, the read operation times out and a read operation timeout error is recorded.
[0100] During the entire read performance test, all read operation timeout errors are accumulated.
[0101] S205, after the read test is completed, the total number of read operation timeout errors is counted, and the read operation timeout error rate is calculated by the following formula: read operation timeout error rate = (total number of read operation timeout errors * 100%) / total read test duration.
[0102] For example, if the total number of read operation timeout errors is 15 and the total read test duration is 30 minutes, then the read operation timeout error rate = (15*100%) / (30*60) = 0.8%.
[0103] S206, if the read operation timeout error rate exceeds the preset second error threshold, the cloud storage read performance fails; otherwise, it passes.
[0104] A second error threshold is preset, for example, 5%, that is, if the read operation timeout error rate does not exceed 5%, it is considered that the cloud storage read performance is normal.
[0105] The image cloud storage performance test method provided in the second embodiment is based on the data written in the cloud storage write performance test of the first embodiment. When reading images from the cloud storage for the read operation performance test, the images are read based on the written images, which is also independent of the image format. The image cloud storage performance test of the present invention is tested based on the specified image source, which more realistically and effectively verifies the image processing capability of the cloud storage.
[0106] In this embodiment, the cloud storage read performance is tested in cycles. If the number of pictures read per cycle is initially set to be low, and the cloud storage read performance is high, for example, the number of pictures read per cycle is set to 100, and the cloud storage can actually read 200 pictures per cycle, then the time to read 100 pictures will be less than the duration of each cycle.
[0107] Based on this, the cloud storage read performance test in the second embodiment further includes the following steps:
[0108] S207, during the execution of the read thread, if the time taken for a certain read cycle to read the configured number of pictures per cycle is t2, and t2<T2, where T2 is the duration of each read cycle; then all read threads sleep for T2-t2 time and then restart.
[0109] Correspondingly, if the read thread is restarted too many times, it means that the number of images read per cycle is too small, and the cloud storage read performance cannot be measured. The number of images read per cycle should be increased for testing.
[0110] Based on this, the cloud storage read performance test in the second embodiment further includes the following steps:
[0111] S208, record the number of times the read thread is restarted; if the number of times the read thread is restarted exceeds a second preset number, modify the read configuration parameters, increase the number of pictures read per cycle, and then re-perform the cloud storage read performance test.
[0112] Embodiment 3
[0113] The third embodiment provides a method for image cloud storage performance, including a cloud storage deletion performance test, which can be coupled to the cloud storage write performance test based on the first embodiment.
[0114] It should be noted that the write configuration parameters also include the picture saving time. In specific implementation, the configuration script can be: PICTURE_SAVE_TIME = 30, in minutes.
[0115] like Figure 3 The figure is a schematic flow chart of the cloud storage deletion performance testing method provided in the third embodiment, which includes the following steps.
[0116] S301, scanning the image database once at a preset time interval to detect image information that exceeds the image storage time.
[0117] The preset time interval is preset, for example, it can be set to 2s, and detection is performed every 2s.
[0118] S302, executing a deletion process to delete pictures that have exceeded the picture saving time.
[0119] S303, during the deletion process, if the number of pictures actually deleted in a deletion cycle is less than the configured number of pictures written per cycle, a deletion operation timeout error is recorded.
[0120] When performing write operations, the number of expired images that can be scanned each time during the deletion performance test scan should be the number of images written per cycle, so the number of images that should be deleted in each deletion cycle should be the number of images written per cycle. The deletion operation timeout error means that the number of images deleted in a deletion cycle is less than the number of images written per cycle.
[0121] S304, after the deletion test is completed, the total number of deletion operation timeout errors is counted, and the deletion operation timeout error rate is calculated by the following formula: deletion operation timeout error rate = (total number of deletion operation timeout errors * 100%) / total write test duration.
[0122] For example, if the total number of deletion operation timeout errors is 15 and the total write test duration is 30 minutes, then the deletion operation timeout error rate = (15*100%) / (30*60) = 0.8%.
[0123] It should be noted that although the total duration of the write test is 30 minutes, in order to make all pictures expire, the actual writing operation time is longer. For example, the picture storage time is 30 minutes, that is, it expires after 30 minutes from the start of storage, then the actual writing operation time should not be less than 60 minutes.
[0124] S305. If the deletion operation timeout error rate exceeds the preset third error threshold, the cloud storage deletion performance fails; otherwise, it passes.
[0125] A third error threshold is preset, for example, 5%, that is, if the deletion operation timeout error rate does not exceed 5%, it is considered that the cloud storage deletion performance is normal.
[0126] The deletion performance test provided in the third embodiment is based on the pictures written by the write operation, and the timed pictures are deleted, and the picture format does not need to be considered. The picture cloud storage performance test of the present invention is tested according to the specified picture source, which more effectively verifies the processing ability of the cloud storage for pictures.
[0127] Embodiment 4
[0128] The fourth embodiment of the present invention provides a device for testing the performance of a picture cloud storage, which is used to implement the aforementioned method for testing the performance of a picture cloud storage.
[0129] like Figure 4 The figure shows a schematic block diagram of the structure of a picture cloud storage performance test device provided in this embodiment, which includes a cloud storage write performance test module, and a cloud storage read performance test module and a cloud storage deletion performance test module based on the cloud storage write performance test module.
[0130] The cloud storage write performance test module includes:
[0131] Write configuration parameter setting unit: Set write configuration parameters, including image source path, number of image sources, image storage path, number of write threads, and number of images written per cycle; the number of images written per cycle refers to the number of images written to cloud storage by all write threads per write cycle;
[0132] Write thread execution unit: executes the write thread and writes the image into the cloud storage according to the write configuration parameters;
[0133] Write operation timeout error recording unit: During the execution of the write thread, if the actual number of pictures written in a certain write cycle is less than the configured number of pictures written per cycle, a write operation timeout error is recorded;
[0134] Write operation timeout error rate calculation unit: after the write test is completed, the total number of write operation timeout errors is counted, and the write operation timeout error rate is calculated by the following formula: Write operation timeout error rate = (total number of write operation timeout errors * 100%) / total write test duration;
[0135] Write performance judgment unit: If the write operation timeout error rate exceeds the preset first error threshold, the cloud storage write performance fails; otherwise, it passes.
[0136] It should be noted that when the write thread execution unit executes the write thread and performs an operation of writing pictures into the cloud storage according to the write configuration parameters, the picture storage location information is stored in the picture database.
[0137] The cloud storage read performance test modules include:
[0138] Cloud storage directory mounting unit: mounts the cloud storage directory;
[0139] Read configuration parameter setting unit: sets read configuration parameters, including the image database path, the number of read threads, and the number of images read per cycle; the number of images read per cycle refers to the number of images read by all read threads per read cycle;
[0140] Read thread execution unit: executes the read thread and performs image reading operations according to the read configuration parameters;
[0141] Read operation timeout error recording unit: During the execution of the read thread, if the actual number of pictures read in a certain read cycle is less than the configured number of pictures read per cycle, a read operation timeout error is recorded;
[0142] Read operation timeout error rate calculation unit: after the read test is completed, the total number of read operation timeout errors is counted, and the read operation timeout error rate is calculated by the following formula: Read operation timeout error rate = (total number of read operation timeout errors * 100%) / total read test duration;
[0143] Read performance judgment unit: If the read operation timeout error rate exceeds the preset second error threshold, the cloud storage read performance fails; otherwise, it passes.
[0144] It should be noted that the write configuration parameters set by the write configuration parameter setting unit also include the picture saving time.
[0145] The cloud storage deletion performance test modules include:
[0146] Timeout picture detection unit: scans the picture database once at a preset time interval to detect picture information that exceeds the picture storage time;
[0147] Deletion execution unit: executes the deletion process and deletes the pictures that have exceeded the picture storage time;
[0148] Deletion operation timeout error recording unit: During the deletion process, if the actual number of pictures deleted in a deletion cycle is less than the configured number of pictures written per cycle, a deletion operation timeout error is recorded;
[0149] Deletion operation timeout error rate calculation unit: after the deletion test is completed, the total number of deletion operation timeout errors is counted, and the deletion operation timeout error rate is calculated by the following formula: Deletion operation timeout error rate = (total number of deletion operation timeout errors * 100%) / total write test duration;
[0150] Deletion performance judgment unit: If the deletion operation timeout error rate exceeds the preset third error threshold, the cloud storage deletion performance fails; otherwise, it passes.
[0151] The image cloud storage performance testing device of this embodiment is used to implement the aforementioned image cloud storage performance testing method. Therefore, the specific implementation method of the device can be seen in the embodiment part of the image cloud storage performance testing method in the previous text. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part, which will not be introduced in detail here.
[0152] In addition, since the image cloud storage performance testing device of this embodiment is used to implement the aforementioned image cloud storage performance testing method, its function corresponds to that of the aforementioned method and will not be repeated here.
[0153] Embodiment 5
[0154] Figure 5 A schematic diagram of the structure of a terminal device 500 provided in an embodiment of the present invention. The terminal device 500 can be used to execute the image cloud storage performance testing method provided in an embodiment of the present invention.
[0155] The terminal device 500 may include: a processor 510, a memory 520 and a communication unit 530. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0156] The memory 520 can be used to store the execution instructions of the processor 510, and the memory 520 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 520 are executed by the processor 510, the terminal 500 can execute some or all of the steps in the following method embodiments.
[0157] The processor 510 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 520, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 510 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0158] The communication unit 530 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.
[0159] Embodiment 6
[0160] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0161] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0162] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0163] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0164] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0166] The above disclosure is only a preferred embodiment of the present invention, but the present invention is not limited thereto. Any non-creative changes that can be thought of by a person skilled in the art, as well as several improvements and modifications made without departing from the principle of the present invention, should fall within the protection scope of the present invention.
Claims
1. A method for testing the performance of image cloud storage, characterized in that: Including cloud storage write performance test, cloud storage write performance test includes the following steps: Set the write configuration parameters, including the image source path, the number of image sources, the image storage path, the number of write threads, and the number of images written per cycle. The number of images written per cycle refers to the number of images written to the cloud storage by all write threads in each write cycle. Execute the write thread and write the image into the cloud storage according to the write configuration parameters; During the execution of the write thread, if the actual number of pictures written in a certain write cycle is less than the configured number of pictures written per cycle, a write operation timeout error is recorded; After the write test is completed, the total number of write operation timeout errors is counted, and the write operation timeout error rate is calculated using the following formula: Write operation timeout error rate = (total number of write operation timeout errors * 100%) / total write test duration; If the write operation timeout error rate exceeds the preset first error threshold, the cloud storage write performance fails; otherwise, it passes; The cloud storage write performance test also includes the following steps: during the execution of the write thread, if the time taken for a certain write cycle to write the configured number of pictures per cycle to the cloud storage is t1, and t1<T1, where T1 is the duration of each write cycle; then all write threads sleep for T1-t1 time and then restart; The cloud storage write performance test also includes the following steps: recording the number of times the write thread is restarted; if the number of times the write thread is restarted exceeds a first preset number, modifying the write configuration parameters, increasing the number of pictures written per cycle, and re-performing the cloud storage write performance test.
2. The method for testing the performance of image cloud storage according to claim 1, characterized in that: Cloud storage write performance test The method comprises the following steps: executing a write thread, and when performing an operation of writing a picture into a cloud storage according to a write configuration parameter, storing the picture storage location information into a picture database; The method also includes a cloud storage read performance test, and the cloud storage read performance test includes the following steps: Mount the cloud storage directory; Set the read configuration parameters, including the image database path, the number of read threads, and the number of images read per cycle. The number of images read per cycle refers to the number of images read by all read threads in each read cycle. Execute the read thread and read the image according to the read configuration parameters; During the execution of the read thread, if the actual number of images read in a certain read cycle is less than the configured number of images read per cycle, a read operation timeout error is recorded; After the read test is completed, the total number of read operation timeout errors is counted, and the read operation timeout error rate is calculated using the following formula: Read operation timeout error rate = (total number of read operation timeout errors * 100%) / total read test duration; If the read operation timeout error rate exceeds the preset second error threshold, the cloud storage read performance fails; otherwise, it passes.
3. The method for testing the performance of image cloud storage according to claim 2, characterized in that: The cloud storage read performance test also includes the following steps: During the execution of the read thread, if the time taken for a certain read cycle to read the configured number of pictures per cycle is t2, and t2<T2, where T2 is the duration of each read cycle; then all read threads sleep for T2-t2 time and then restart.
4. The method for testing the performance of image cloud storage according to claim 2, characterized in that: The cloud storage read performance test also includes the following steps: recording the number of times the read thread is restarted; if the number of times the read thread is restarted exceeds a second preset number, modifying the read configuration parameters, increasing the number of pictures read per cycle, and re-performing the cloud storage read performance test.
5. The method for testing the performance of image cloud storage according to claim 2, characterized in that: The written configuration parameters also include the image saving time; The method also includes a cloud storage deletion performance test, and the cloud storage deletion performance test includes the following steps: Scanning the image database once at a preset time interval to detect image information that exceeds the image storage time; Execute the deletion process to delete the pictures that have exceeded the picture storage time; During the deletion process, if the number of pictures actually deleted in a deletion cycle is less than the configured number of pictures written per cycle, a deletion operation timeout error is recorded; After the deletion test is completed, the total number of deletion operation timeout errors is counted, and the deletion operation timeout error rate is calculated using the following formula: Deletion operation timeout error rate = (total number of deletion operation timeout errors * 100%) / total write test duration; If the deletion operation timeout error rate exceeds the preset third error threshold, the cloud storage deletion performance fails; otherwise, it passes.
6. A device for testing the performance of image cloud storage, characterized in that: Including cloud storage write performance test module, cloud storage write performance test module includes, Write configuration parameter setting unit: Set write configuration parameters, including image source path, number of image sources, image storage path, number of write threads, and number of images written per cycle; the number of images written per cycle refers to the number of images written to cloud storage by all write threads per write cycle; Write thread execution unit: executes the write thread and writes the image into the cloud storage according to the write configuration parameters; Write operation timeout error recording unit: During the execution of the write thread, if the actual number of pictures written in a certain write cycle is less than the configured number of pictures written per cycle, a write operation timeout error is recorded; Write operation timeout error rate calculation unit: after the write test is completed, the total number of write operation timeout errors is counted, and the write operation timeout error rate is calculated by the following formula: Write operation timeout error rate = (total number of write operation timeout errors * 100%) / total write test duration; Write performance judgment unit: if the write operation timeout error rate exceeds a preset first error threshold, the cloud storage write performance fails; Otherwise pass; The cloud storage write performance test also includes: during the execution of the write thread, if the time taken for a certain write cycle to write the configured number of pictures per cycle to the cloud storage is t1, and t1<T1, where T1 is the duration of each write cycle; then all write threads sleep for T1-t1 time and then restart; The cloud storage write performance test also includes: recording the number of times the write thread is restarted; if the number of times the write thread is restarted exceeds a first preset number, modifying the write configuration parameters, increasing the number of pictures written per cycle, and re-performing the cloud storage write performance test.
7. A terminal, characterized in that: include: processor; A memory for storing execution instructions of the processor; The processor is configured to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Librgw performance test method and device and computer device
CN109976957A