Method, device, equipment and storage medium for testing storage service interface

By determining the target file name and sending a service test request, combined with the preset test unit evaluation return parameters, the problem of single test dimension and poor accuracy in the existing technology is solved, and multi-dimensional testing of the storage service interface is achieved and the accuracy of the results is improved. .

CN111858223BActive Publication Date: 2024-10-11BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010598628.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-28
Publication Date
2024-10-11
Estimated Expiration
2040-06-28

AI Technical Summary

Technical Problem

When the existing technology tests the object storage service interface, the test dimension is single, the result accuracy is poor, and the robustness of the interface cannot be fully evaluated.

Method used

By determining the target file name, send a service test request based on the target file name and the service interface of the storage service, and evaluate the returned service parameters through the preset test unit to obtain the test results of the storage service interface, adding semantic correctness testing , enriching the dimensions of robustness and improving the accuracy of test results.

Benefits of technology

Implemented multi-dimensional testing of storage service interfaces, improved the accuracy and comprehensiveness of test results, and ensured the robustness and reliability of the interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111858223B_ABST
    Figure CN111858223B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for testing a storage service interface. The method includes: determining a target file name, determining a service test request according to the target file name and the service interface of the storage service, sending the service test request to the storage service, receiving service parameters returned by the service interface of the storage service, and evaluating the service parameters through a corresponding preset test unit according to the type of the service test request to obtain a test result of the storage service interface. Through the above method, the dimensions of testing the robustness of the storage service interface can be effectively enriched, and the accuracy of the test results can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and more specifically, to a method for testing a storage service interface, a device for testing a storage service interface, an electronic device, and a computer-readable storage medium. Background Art

[0002] Object storage service is a low-cost cloud storage service that can provide massive, secure and highly reliable storage services. Currently, in order to ensure that the object storage service can provide users with stable and high-quality storage services, it is usually necessary to test the robustness of the object storage service interface.

[0003] In the related art, when testing the robustness of the interface of the object storage service, the HTTP request is usually encapsulated through the curl command or the postman command, and then the robustness of the interface of the object storage service is evaluated through the response information of the HTTP request to complete the test.

[0004] However, currently, when testing the robustness of the interface of the object storage service, the test dimension is single and the test results are inaccurate. Summary of the invention

[0005] An object of the present invention is to provide a new technical solution for testing a storage service interface.

[0006] According to a first aspect of the present invention, a method for testing a storage service interface is provided, the method comprising:

[0007] Determine the target file name;

[0008] Determine a service test request based on the target file name and the service interface of the storage service;

[0009] Receive the service parameters returned by the service interface of the storage service in response to the service test request;

[0010] According to the type of the service test request, the service parameters are evaluated by a corresponding preset test unit to obtain a test result of the storage service interface.

[0011] Optionally, specify the target file name, including:

[0012] Obtaining a pre-stored test character set, wherein the test character set includes characters of multiple character types;

[0013] Extracting N characters from the test character set and combining them to obtain at least one character string, where N is a positive integer;

[0014] The at least one character string is determined as a target file name.

[0015] Optionally, the method further includes:

[0016] The target file name is written into a test queue, so that the target file name is obtained from the test queue before a service test request is determined based on the target file name and a service interface of a storage service.

[0017] Optionally, determining a service test request based on the target file name and a service interface of the storage service includes:

[0018] Determine a service test request of a write type based on the target file name and a write interface of the storage service; and / or

[0019] Determine a service test request of a read type based on the target file name and a read interface of the storage service; and / or

[0020] Based on the target file name and the deletion interface of the storage service, a service test request of the deletion type is determined.

[0021] Optionally, the method further includes:

[0022] A write-type service test request, a read-type service test request, and / or a delete-type service test request is written to the service test request queue.

[0023] Optionally, the type of the service test request is a write type, and the service parameter is a first return code;

[0024] According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including:

[0025] Determine the number of first return codes containing an indication that the write interface is available;

[0026] Whether the write interface is available is determined according to the number of first return codes containing a write interface available identifier and the number of target file names.

[0027] Optionally, the type of the service test request is a read type, and the service parameter is a second return code;

[0028] According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including:

[0029] Determine the number of second return codes containing available identification of the read interface;

[0030] Determine the number of target file names corresponding to the first return code containing the write interface available identifier;

[0031] Whether the read interface is available is determined according to the number of second return codes containing the read interface available identifier and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0032] Optionally, the service parameter is a first return value;

[0033] According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including:

[0034] Determine the number of first return bodies containing valid data;

[0035] Determine the number of target file names corresponding to the first return code containing the write interface available identifier;

[0036] Whether the semantics of the write interface is correct is determined according to the number of the first return bodies containing valid data and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0037] Optionally, according to the type of the service test request, evaluating the service parameter by a corresponding preset test unit to obtain a test result of the storage service interface includes:

[0038] Determine the number of first returned bodies containing correct valid data;

[0039] Determine the number of target file names corresponding to the first return code containing the write interface available identifier;

[0040] Whether the write interface is reliable is determined based on the number of first return bodies containing correct and valid data and the number of target file names corresponding to the first return codes containing write interface available identifiers, wherein the correct and valid data are consistent with the data of the corresponding target files.

[0041] Optionally, determining the first return body containing correct and valid data includes:

[0042] Determine a hash value of the valid data according to the valid data carried in the first return body;

[0043] Determine a hash value of the target file data according to the target file data corresponding to the first return body;

[0044] When the hash value of the valid data is consistent with the hash value of the data of the target file, it is determined that the first returned body contains correct valid data.

[0045] Optionally, the type of the service test request is a deletion type, and the service parameter is a third return code;

[0046] According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including:

[0047] Determine the number of third return codes containing a delete interface available flag;

[0048] Determine the number of target file names corresponding to the first return code containing the write interface available identifier;

[0049] Whether the deletion interface is available is determined according to the number of the third return codes containing the deletion interface available identifier and the number of the target file names corresponding to the first return codes containing the write interface available identifier.

[0050] Optionally, the service parameter is a second return object;

[0051] According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including:

[0052] Determine the number of the second return body indicating that the target file to be deleted does not exist;

[0053] Determine the number of target file names corresponding to the first return code containing the write interface available identifier;

[0054] Whether the semantics of the deletion interface is correct is determined based on the number of second return bodies indicating that the target files to be deleted do not exist and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0055] According to a second aspect of the present invention, there is provided a device for testing a storage service interface, the device comprising:

[0056] A first determination module, used to determine a target file name;

[0057] A second determination module is used to determine a service test request based on the target file name and a service interface of the storage service;

[0058] A receiving module, configured to receive service parameters returned by the service interface of the storage service in response to the service test request;

[0059] The test module is used to evaluate the service parameters through the corresponding preset test unit according to the type of the service test request to obtain the test result of the storage service interface.

[0060] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising the apparatus according to the second aspect; or,

[0061] The system comprises a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method as described in any one of the first aspects.

[0062] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of the first aspects when executed by a processor.

[0063] In this embodiment, by determining the target file name, determining the service test request according to the target file name and the service interface of the storage service, and sending the service test request to the storage service, receiving the service parameters returned by the service interface of the storage service, and evaluating the service parameters according to the type of the service test request through the corresponding preset test unit to obtain the test result of the storage service interface. In this way, compared with the traditional technology, the method for testing the storage service interface provided by this embodiment adds the test of the semantic correctness of the storage service interface, enriches the dimension of testing the robustness of the storage service interface, and improves the accuracy of the test results.

[0064] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0066] Figure 1 It is a block diagram of the hardware configuration of an electronic device for implementing a method for testing a storage service interface provided by an embodiment of the present invention;

[0067] Figure 2 is a flow chart of a method for testing a storage service interface provided by an embodiment of the present invention;

[0068] Figure 3 is a flow chart of a method for determining a target file name provided by an embodiment of the present invention;

[0069] Figure 4 is a flow chart of testing the availability of a write interface provided by an embodiment of the present invention;

[0070] Figure 5 This is a flow chart of testing the semantic correctness of a write interface provided by an embodiment of the present invention;

[0071] Figure 6 is a flow chart of testing the reliability of a write interface provided by an embodiment of the present invention;

[0072] Figure 7 is a flow chart of testing read interface availability provided by an embodiment of the present invention;

[0073] Figure 8 It is a flow chart of testing the availability of a deletion interface provided by an embodiment of the present invention;

[0074] Fig. 9 This is a flow chart of testing the semantic correctness of a deletion interface provided by an embodiment of the present invention;

[0075] Fig.10 is a schematic diagram of another method for testing a storage service interface provided by an embodiment of the present invention;

[0076] Fig.11 It is a structural diagram of a device for testing a storage service interface provided by an embodiment of the present invention;

[0077] Fig.12 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0078] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.

[0079] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0080] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0081] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0082] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0083] At present, users usually pay to purchase or use storage services provided by cloud service providers. Before using the storage services provided by cloud service providers, users usually test the robustness of the storage service interfaces provided by cloud service providers to determine whether the storage service interfaces provided by cloud service providers meet the needs of users or are consistent with the performance of the storage service interfaces promised by cloud service providers. Based on this, this embodiment proposes a method for testing storage service interfaces in a higher dimension.

[0084] <Hardware Configuration>

[0085] Figure 1 It is a block diagram of the hardware configuration of an electronic device for implementing a method for testing a storage service interface provided by an embodiment of the present invention.

[0086] The electronic device 1000 may generally be a portable computer, a desktop computer, a tablet computer, etc.

[0087] The electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, and the like. The memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, and the like. The interface device 1300 may include, for example, a USB interface, an earphone interface, and the like. The communication device 1400 may, for example, be capable of wired or wireless communication. The display device 1500 may be, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1600 may include, for example, a touch screen, a keyboard, and the like. The user may input / output voice information through the speaker 1700 and the microphone 1800.

[0088] Despite Figure 1 In the figure, multiple devices are shown for the electronic device 1000, but the present invention may only involve some of the devices, for example, the electronic device 1000 only involves the memory 1200 and the processor 1100.

[0089] In the embodiment of the present invention, the memory 1200 of the electronic device 1000 is used to store instructions, and the instructions are used to control the processor 1100 to execute the method for testing the storage service interface provided by the embodiment of the present invention.

[0090] In the above description, a technician can design instructions according to the scheme disclosed in the present invention. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.

[0091] <Method Example>

[0092] This embodiment provides a method for testing a storage service interface. Figure 2 As shown, the method comprises the following steps:

[0093] S201: Determine the target file name.

[0094] In this embodiment, since the present invention needs to test the robustness of the storage service interface, it is necessary to create a target file for testing the storage service interface.

[0095] It should be noted here that the target file name is the file name of the target file.

[0096] S202: Determine a service test request based on the target file name and the service interface of the storage service.

[0097] In this embodiment, since the service interfaces of the storage service involve multiple types, different types of service interfaces can only receive specific types of service test requests. In other words, different types of service interfaces can receive different types of service test requests. For example, a write-type service interface receives a write-type service test request. Therefore, in the process of testing the robustness of the storage service interface, it is necessary to determine the service test requests that the service interface of the storage service can receive, that is, determine the service test request based on the target file name and the service interface of the storage service.

[0098] S203: Receive service parameters returned by the service interface of the storage service in response to the service test request.

[0099] In this implementation, after the service test request is determined, the determined service test request is sent to the service interface of the storage service, and the service interface responds to the service test request, generates service parameters corresponding to the service test request, and returns the service parameters to the electronic device.

[0100] It should be noted that the returned service parameters are different for different service interface types. The service parameters can reflect the robustness of the service interface of the storage service and are used to evaluate the robustness of the service interface of the storage service.

[0101] S204: According to the type of the service test request, the service parameters are evaluated by a corresponding preset test unit to obtain a test result of the storage service interface.

[0102] In this embodiment, the types of service test requests can be write-type service test requests, read-type service test requests, and delete-type service test requests. For different types of service test requests and their corresponding service parameters, corresponding preset test units are determined, and the service parameters are evaluated through the corresponding preset test units to obtain the test results of the robustness of the storage service interface.

[0103] Through the above method, the method for testing the storage service interface provided by this embodiment adds the test of the semantic correctness of the storage service interface, enriches the dimension of testing the robustness of the storage service interface, and improves the accuracy of the test results.

[0104] Based on the above embodiment, the method for testing the storage service interface provided in this embodiment further includes the step of determining the target file name, such as Figure 3 As shown, the step includes:

[0105] S301: Obtain a pre-stored test character set.

[0106] The test character set includes characters of various character types. Specifically, the test character set includes a symbol character subset, a digit and letter character subset, a coded character subset, and a custom character subset.

[0107] In this embodiment, the characters included in the symbol character subset may be exemplified as: “!”, “@”, “#”, “$”, “&”, “%”, “^”, “*”, etc.

[0108] Examples of characters in the alphanumeric character subset include: "1", "2", "3", "a", "b", "c", "D", etc.

[0109] The characters included in the coded character subset may be exemplarily coded characters obtained by a coding algorithm, wherein the coding algorithm may be Base 64.

[0110] The characters included in the customized character subset may be illustratively user-defined characters, such as customized patterns and the like.

[0111] S302: Extract N characters from the test character set and combine them to obtain at least one character string, where N is a positive integer.

[0112] S303: Determine the at least one character string as a target file name.

[0113] In this embodiment, each of the at least one character string obtained based on the above S302 is used as the name of each unnamed target file in the at least one unnamed target file set, wherein the unnamed target file may be a picture, a word document, an audio, a video, and the like.

[0114] In one embodiment, the above S302 may be specifically implemented by randomly extracting characters from the test character set and performing random combinations to obtain at least one character string within a preset length range.

[0115] In addition, the method for testing the storage service interface provided in this embodiment can also process unnamed target files. Exemplarily, the processing can be specifically: when the unnamed target file is a picture, a watermark can be added to the picture, the size of the picture can be adjusted, etc. When the unnamed target file is a word document, audio, video, etc., the word document, audio, video, etc. can be compressed, etc.

[0116] In this embodiment, since the names of the target files used to test the storage service interface are all obtained by randomly extracting characters from the test character set and randomly combining them, the naming of the target files is standardized or not. In this way, the storage service interface can be tested using target files with diverse naming, which makes the final test results more global.

[0117] In addition, the electronic device 1000 also obtains a key test character set, which includes characters that are most likely to be used by the user when naming files when using the storage service. In this way, the storage service interface can be tested using a target file with targeted naming, which makes the final test result targeted.

[0118] Furthermore, after determining the target file name, this embodiment can write the determined target file name into a test queue so as to obtain the target file name from the test queue before executing step S202 to determine the service test request step based on the target file name and the service interface of the storage service.

[0119] In step S202, a service test request is determined based on the target file name and the service interface of the storage service. Specifically, the following three types of service test requests may be determined according to the actual service interface type:

[0120] Based on the target file name and the write interface of the storage service, determine a write type service test request; and / or based on the target file name and the read interface of the storage service, determine a read type service test request; and / or based on the target file name and the delete interface of the storage service, determine a delete type service test request.

[0121] It should be noted here that after determining the above three types of test service requests, this embodiment writes write type service test requests, read type service test requests and / or delete type service test requests into the service test request queue, and subsequently, the service test requests can be responded to in the order of arrangement from the service test request queue.

[0122] In step S204, this embodiment provides a method for testing the robustness of each type of service interface for three types of service interfaces.

[0123] Test the robustness of the storage service's write interface, such as Figure 4 As shown:

[0124] S401: Determine a write-type service test request based on the target file name and the write interface of the storage service.

[0125] The electronic device 1000 generates a service test request of a corresponding write type according to the file name and file content of each target file in the target file set and the write request format defined in accordance with the storage service write interface, and inputs the generated service test request of the write type into the write interface of the storage service in sequence, so that the storage service can write to each target file in the target file set.

[0126] S402: Receive service parameters returned by the write interface of the storage service in response to a write-type service test request.

[0127] The service parameters include a first return code.

[0128] In this embodiment, after the storage service receives a write-type service test request through the write interface, it performs a write operation on the target file corresponding to the write-type service test request and outputs the corresponding service parameters through the write interface. Among them, one service parameter includes one return code. In this embodiment, in order to make a clear distinction, the return code included in the service parameter is referred to as the first return code.

[0129] In this embodiment, the storage service defines the first return code returned by the write interface so that the first return code can reflect whether the write interface of the storage service is available for a write-type service test request, that is, the first return code can reflect whether the write interface of the storage service writes the target file corresponding to the write-type service test request.

[0130] In one embodiment, the storage service defines the first return code of the write interface specifically as follows: when the first return code starts with "5", it means that the write interface of the storage service is unavailable for the service test request of the write type input, that is, it means that the write interface of the storage service cannot write the target file corresponding to the service test request of the write type input. When the first return code does not start with "5", it means that the service test request of the write type input by the storage service is available, that is, it means that the write interface of the storage service can write the target file corresponding to the service test request of the write type input. From the above, it can be seen that the first return code starting with "5" indicates that the write interface is available, and the first return code not starting with "5" indicates that the write interface is unavailable.

[0131] Based on the above content, it can be determined whether the first return code of each service parameter belongs to the first return code of the available type defined in the write interface according to the specific manifestation of the first return code. Specifically, when the first return code starts with "5", it means that the first return code belongs to the first return code of the unavailable type defined in the write interface. When the first return code does not start with "5", it means that the first return code belongs to the first return code of the available type defined in the write interface. It can be seen that the number "5" at the beginning of the first return code is the available identifier of the write interface, and the number other than "5" is the unavailable identifier of the write interface.

[0132] S403: Determine the number of first return codes containing the write interface available identifier, and determine whether the write interface is available according to the number of first return codes containing the write interface available identifier and the number of target file names.

[0133] In this embodiment, step S403 is specifically implemented as follows: determining the number of first return codes containing the write interface available identifier, and determining whether the write interface is available based on the relationship between the number of first return codes containing the write interface available identifier and the number of target file names and a first preset value. Specifically, when the ratio between the number of first return codes containing the write interface available identifier and the number of target file names is less than the first preset value, it is determined that the write interface is unavailable. When the ratio between the number of first return codes containing the write interface available identifier and the number of target file names is greater than or equal to the first preset value, it is determined that the write interface is available.

[0134] The first preset value is a decimal less than 1 and close to 1. For example, the first preset value is 0.999. In this embodiment, the first preset value may be an expected value of the user for the availability of the write interface of the storage service, or a committed value of the storage service provider for the availability of the write interface of the storage service.

[0135] In addition, when determining that the write interface is unavailable, the electronic device 1000 may issue a corresponding warning message to prompt the user that the write interface is unavailable. In this way, the user can know which target files the write interface is unavailable for, and then analyze the reasons for the unavailability, such as the unavailability caused by the naming of the target file.

[0136] Based on the above description of the first return code, it can be known that the target file corresponding to the first return code of the available type defined by the write interface is written into the storage service through the write interface of the storage service.

[0137] The above method can be used to test the robustness of the storage service's write interface. Specifically, the robustness of the write interface includes the availability. Whether the semantics of the write interface included in the robustness of the write interface is correct needs to be tested through the following methods: Figure 5 Steps shown.

[0138] S501: Determine a service test request of a read type based on the target file name and a read interface of the storage service.

[0139] A read request for reading each target file in the target file set is input to a read interface of the storage service so that the storage service reads each target file.

[0140] The target file set includes multiple target files, and each target file is written into the storage service in advance through the write interface of the storage service.

[0141] In one embodiment, the storage service may be an object storage service, or other storage services, such as a block storage service.

[0142] S502: Receive service parameters returned by the read interface of the storage service in response to a read-type service test request.

[0143] The service parameters include the first return body.

[0144] In this embodiment, after the read interface receives a service test request of the read type, the storage service performs a read operation on the target file corresponding to the service test request of the read type, and outputs the corresponding service parameters through the read interface. Among them, one service parameter includes a return body. In this embodiment, in order to make a clear distinction, the return body included in the service parameter output through the read interface is called the first return body.

[0145] S503: Determine the number of first return bodies containing valid data.

[0146] The first return body is used to reflect the specific content read out by the storage service when reading out the target file corresponding to the read type service test request, that is, the valid data read out. It should be noted that there is a field corresponding to the valid data in the first return body. If there is data in the field, it means that there is valid data in the return body. Correspondingly, if there is no data in the field, it means that there is no valid data in the return body. From the above, it can be seen that valid data refers to whether there is data in the field, and does not pay attention to the correctness of the data in the field.

[0147] S504: Determine the number of target file names corresponding to the first return code containing the write interface available identifier.

[0148] In this implementation, the number of target file names corresponding to the first return code containing the write interface available identifier refers to the number of target files that are actually successfully written to the storage service during the process of writing the target files to the storage service. If the target files are not successfully written to the storage service, the service parameter returned by the storage service is the first return code containing the write interface unavailable identifier.

[0149] S505: Determine whether the semantics of the write interface are correct according to the number of the first return bodies containing valid data and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0150] In this embodiment, the specific implementation of the above S504 is: according to the ratio between the number of first return bodies containing valid data and the number of target file names corresponding to the first return code containing the write interface available identifier, and the second preset value, determine whether the semantics of the write interface are correct. Specifically: when the ratio between the number of first return bodies containing valid data and the number of target file names corresponding to the first return code containing the write interface available identifier is less than the second preset value, it is determined that the semantics of the write interface are incorrect. When the ratio between the number of first return bodies containing valid data and the number of target file names corresponding to the first return code containing the write interface available identifier is greater than or equal to the second preset value, it is determined that the semantics of the write interface are correct.

[0151] The second preset value is a decimal less than 1 and close to 1. For example, the first preset value is 0.999. In this embodiment, the second preset value may be a user's expectation of the semantics of the write interface of the storage service.

[0152] In addition, when it is determined that the semantics of the write interface are incorrect, the electronic device 1000 may issue a corresponding warning message to prompt the user that the semantics of the write interface are incorrect.

[0153] The above method can be used to test the robustness of the storage service's write interface. Specifically, it is used to test whether the semantics of the write interface included in the write interface robustness are correct. The reliability of the write interface included in the write interface robustness needs to be tested through Figure 6 Steps shown.

[0154] S601: Determine a service test request of a read type based on the target file name and the read interface of the storage service.

[0155] S602: Receive service parameters returned by the read interface of the storage service in response to a read-type service test request.

[0156] The service parameters include the first return body.

[0157] S603: Determine the number of first return bodies containing correct and valid data.

[0158] The correct and valid data are valid data that are consistent with the data of the corresponding target file, that is, the correct and valid data are consistent with the data of the corresponding target file.

[0159] From the above, it can be seen that, unlike the valid data in step S503, the correct valid data in this step not only refers to whether there is data in the field, but also that the data in the field needs to be consistent with the data of the corresponding target file.

[0160] S604: Determine the number of target file names corresponding to the first return code containing the write interface available identifier.

[0161] In this implementation, the number of target file names corresponding to the first return code containing the write interface available identifier refers to the number of target files that are actually successfully written to the storage service during the process of writing the target files to the storage service. If the target files are not successfully written to the storage service, the service parameter returned by the storage service is the first return code containing the write interface unavailable identifier.

[0162] S605: Determine whether the write interface is reliable according to the number of the first return bodies containing correct and valid data and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0163] In this embodiment, the above S605 is specifically implemented as follows: according to the ratio between the number of first return bodies containing correct and valid data and the number of target file names corresponding to the first return code containing the write interface available identifier, and the third preset value, determine whether the write interface is reliable. Specifically, when the ratio between the number of first return bodies containing correct and valid data and the number of target file names corresponding to the first return code containing the write interface available identifier is less than the third preset value, it is determined that the write interface is unreliable. When the ratio between the number of first return bodies containing correct and valid data and the number of target file names corresponding to the first return code containing the write interface available identifier is greater than or equal to the third preset value, it is determined that the write interface is unreliable.

[0164] The third preset value is a decimal less than 1 and close to 1. For example, the third preset value is 0.999. In this embodiment, the third preset value may be an expected value of the reliability of the write interface of the storage service by the user, or a committed value of the reliability of the write interface of the storage service by the storage service provider.

[0165] It should be noted that this embodiment provides an implementation method for determining the first return body containing correct and valid data, which is as follows:

[0166] Based on the valid data carried in the first return body, determine the hash value of the valid data; based on the data of the target file corresponding to the first return body, determine the hash value of the data of the target file; when the hash value of the valid data is consistent with the hash value of the data of the target file, determine that the first return body contains correct valid data.

[0167] In this embodiment, the electronic device 1000 performs an md5 operation on the valid data in each first return body to obtain the md5 value of the valid data in the corresponding first return body. At the same time, an md5 operation is performed on the data of the target file corresponding to each first return body to obtain the md5 value of the data of the corresponding target file. Then, the md5 value corresponding to each first return body is compared with the md5 value of the matching target file to determine whether the two are the same. If they are the same, it is determined that the corresponding first return body contains correct valid data.

[0168] In this embodiment, the first return body containing correct and valid data is determined by comparing the md5 values, which can reduce the amount of data to be calculated and thus improve the calculation speed.

[0169] In addition, the specific implementation method of the above-mentioned step of determining the first return body containing correct and valid data can also be: performing a hash operation on the valid data in each first return body to determine the hash value of the valid data in the corresponding first return body; performing a hash operation on the data of the target file corresponding to each first return body to determine the hash value of the data of the corresponding target file; when the hash value of the valid data in the corresponding first return body is the same as the hash value of the data of the corresponding target file, determining that the corresponding first return body is a return body containing correct and valid data.

[0170] It should be noted that the specific implementation method of the step of determining the first return body containing correct and valid data is not limited.

[0171] Through the above method, the robustness of the write interface of the storage service can be tested, specifically, whether the write interface included in the robustness of the write interface is reliable.

[0172] Test the robustness of the storage service's read interface, such as Figure 7 As shown:

[0173] S701: Determine a service test request of a read type based on the target file name and the read interface of the storage service.

[0174] A read request for reading each target file in the target file set is input to a read interface of the storage service so that the storage service reads each target file.

[0175] The target file set includes multiple target files, and each target file is written into the storage service in advance through the write interface of the storage service.

[0176] In one embodiment, the storage service may be an object storage service, or other storage services, such as a block storage service.

[0177] S702: Receive service parameters returned by the read interface of the storage service in response to a read-type service test request.

[0178] The service parameters include a second return code.

[0179] In this embodiment, after the storage service receives the service test request of the read type through the read interface, it performs a read operation on the target file corresponding to the service test request of the read type, and outputs the corresponding service parameters through the read interface. Among them, one service parameter includes one return code. In this embodiment, in order to make a clear distinction, the return code included in the service parameter output through the read interface is referred to as the second return code.

[0180] In one embodiment, the storage service defines the second return code of the read interface specifically as follows: When the second return code starts with "5", it means that the read interface of the storage service is unavailable for the service test request of the read type input, that is, it means that the target file corresponding to the service test request of the read type input by the read interface of the storage service cannot be read. When the second return code does not start with "5", it means that the service test request of the read type input by the read interface of the storage service is available, that is, it means that the target file corresponding to the service test request of the read type input by the read interface of the storage service can be read.

[0181] Based on the above content, it can be determined whether the second return code in each service parameter belongs to the second return code of the available type defined by the read interface according to the specific content of the second return code. Specifically, when the second return code starts with "5", it means that the second return code belongs to the second return code of the available type defined by the read interface. When the second return code does not start with "5", it means that the second return code belongs to the first return code of the unavailable type defined by the read interface. It can be seen that the number "5" at the beginning of the second return code is the available identification of the read interface, and the number other than "5" is the unavailable identification of the read interface.

[0182] S703: Determine the number of second return codes containing the available identifier of the read interface.

[0183] S704: Determine the number of target file names corresponding to the first return code containing the write interface available identifier.

[0184] In this implementation, the number of target file names corresponding to the first return code containing the write interface available identifier refers to the number of target files that are actually successfully written to the storage service during the process of writing the target files to the storage service. If the target files are not successfully written to the storage service, the service parameter returned by the storage service is the first return code containing the write interface unavailable identifier.

[0185] S705: Determine whether the read interface is available according to the number of second return codes containing the read interface available identifier and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0186] In this embodiment, the above S705 is specifically implemented as follows: according to the ratio between the number of the second return code containing the read interface available identifier and the number of target file names corresponding to the first return code containing the write interface available identifier, and the fourth preset value, determine whether the read interface is available. Specifically, if the ratio between the number of the second return code containing the read interface available identifier and the number of target file names corresponding to the first return code containing the write interface available identifier is less than the fourth preset value, it is determined that the read interface is unavailable. If the ratio between the number of the second return code containing the read interface available identifier and the number of target file names corresponding to the first return code containing the write interface available identifier is greater than or equal to the fourth preset value, it is determined that the read interface is available.

[0187] The fourth preset value is a decimal less than 1 and close to 1. For example, the fourth preset value is 0.999. In this embodiment, the fourth preset value may be an expected value of the user for the availability of the read interface of the storage service, or a committed value of the storage service provider for the availability of the read interface of the storage service.

[0188] Through the above method, the robustness of the read interface of the storage service can be tested, specifically, whether the read interface included in the robustness of the read interface is available can be tested.

[0189] Test the robustness of the storage service's deletion interface, such as Figure 8 As shown:

[0190] S801: Determine a service test request of a deletion type based on the target file name and the deletion interface of the storage service.

[0191] In this embodiment, the electronic device 1000 generates a corresponding deletion type service test request according to the file name of each target file in the target file set and the deletion request format defined in the storage service deletion interface, and inputs the generated deletion type service test request into the deletion interface of the storage service in sequence, so that the storage service can delete each target file in the target file set.

[0192] S802: Receive service parameters returned by the deletion interface of the storage service in response to a service test request of the deletion type.

[0193] The service parameters include a third return code.

[0194] In this embodiment, after the deletion interface receives a service test request of the deletion type, the storage service performs a deletion operation on the target file corresponding to the service test request of the deletion type, and outputs the corresponding service parameters through the deletion interface. Among them, a service parameter includes a return code. In this embodiment, in order to make a clear distinction, the return code included in the service parameter returned in response to the service test request of the deletion type is referred to as the third return code.

[0195] S803: Determine the number of third return codes containing the available identifier of the deleted interface.

[0196] In this embodiment, the storage service defines the third return code returned by the deletion interface, so that the third return code can reflect whether the deletion interface of the storage service is available for the service test request of the deletion type, that is, the third return code can reflect whether the target file corresponding to the deletion interface of the storage service is deleted for the service test request of the deletion type.

[0197] In one embodiment, the storage service may define the third return code of the deletion interface specifically as follows: When the second return code begins with "5", it means that the deletion interface of the storage service is unavailable for the service test request of the deletion type input, that is, it means that the target file corresponding to the service test request of the deletion type input by the deletion interface of the storage service cannot be deleted. When the third return code does not begin with "5", it means that the service test request of the deletion type input by the deletion interface of the storage service is available, that is, it means that the target file corresponding to the service test request of the deletion type input by the deletion interface of the storage service can be deleted.

[0198] Based on the above content, it can be determined whether the third return code in each service parameter belongs to the third return code of the available type for deleting the interface definition according to the specific content of the third return code. Specifically, when the third return code starts with "5", it means that the third return code belongs to the third return code of the available type for deleting the interface definition. When the third return code does not start with "5", it means that the third return code belongs to the third return code of the unavailable type for deleting the interface definition. It can be seen that the number "5" at the beginning of the third return code is the available identifier for deleting the interface, and the number other than "5" is the unavailable identifier for deleting the interface.

[0199] S804: Determine the number of target file names corresponding to the first return code containing the write interface available identifier.

[0200] In this implementation, the number of target file names corresponding to the first return code containing the write interface available identifier refers to the number of target files that are actually successfully written to the storage service during the process of writing the target files to the storage service. If the target files are not successfully written to the storage service, the service parameter returned by the storage service is the first return code containing the write interface unavailable identifier.

[0201] S805: Determine whether the deletion interface is available according to the number of third return codes containing the deletion interface available identifier and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0202] In this embodiment, the above S805 is specifically implemented as follows: according to the ratio between the number of the third return code containing the delete interface available identifier and the number of target file names corresponding to the first return code containing the write interface available identifier, and the fifth preset value, determine whether the delete interface is available. Specifically, when the ratio between the number of the third return code containing the delete interface available identifier and the number of target file names corresponding to the first return code containing the write interface available identifier is less than the fifth preset value, it is determined that the delete interface is unavailable. When the ratio between the number of the third return code containing the delete interface available identifier and the number of target file names corresponding to the first return code containing the write interface available identifier is greater than or equal to the fifth preset value, it is determined that the delete interface is available.

[0203] The fifth preset value is a decimal less than 1 and close to 1. For example, the fifth preset value is 0.999. In this embodiment, the fifth preset value may be an expected value of the user for the availability of the deletion interface of the storage service, or a committed value of the storage service provider for the availability of the deletion interface of the storage service.

[0204] The above method can test the robustness of the deletion interface of the storage service, specifically, whether the deletion interface included in the robustness of the deletion interface is available. Whether the semantics of the deletion interface included in the robustness of the deletion interface is correct needs to be tested as follows: Fig. 9 Steps shown.

[0205] S901: Determine a service test request of a deletion type based on the target file name and the deletion interface of the storage service.

[0206] In this embodiment, the electronic device 1000 generates a corresponding deletion type service test request according to the file name of each target file in the target file set and the deletion request format defined in the storage service deletion interface, and inputs the generated deletion type service test request into the deletion interface of the storage service in sequence, so that the storage service can delete each target file in the target file set.

[0207] S902: Receive service parameters returned by the deletion interface of the storage service in response to a service test request of the deletion type.

[0208] The service parameters include the second return body.

[0209] In this embodiment, the second return body is used to reflect the situation in which the deletion interface of the storage service deletes the target file corresponding to the service test request of the deletion type, and the specific deletion result.

[0210] S903: Determine the number of second returned bodies indicating that the target file to be deleted does not exist.

[0211] In this embodiment, there is a field corresponding to the deletion result in the second return body. If the data in the field indicates that the target file corresponding to the service test request of the deletion type does not exist, it means that the deletion interface has correctly deleted the target file. If the data in the field indicates that the target file corresponding to the service test request of the deletion type has been deleted, it means that the deletion interface has not correctly deleted the target file.

[0212] S904: Determine the number of target file names corresponding to the first return code containing the write interface available identifier.

[0213] In this implementation, the number of target file names corresponding to the first return code containing the write interface available identifier refers to the number of target files that are actually successfully written to the storage service during the process of writing the target files to the storage service. If the target files are not successfully written to the storage service, the service parameter returned by the storage service is the first return code containing the write interface unavailable identifier.

[0214] S905: Determine whether the semantics of the deletion interface is correct according to the number of second return bodies indicating that the target files to be deleted do not exist and the number of target file names corresponding to the first return code containing the write interface available identifier.

[0215] In this embodiment, the specific implementation of the above S905 can be: according to the ratio between the number of second return bodies indicating that the target files to be deleted do not exist and the number of target file names corresponding to the first return code containing the write interface available identifier, and the sixth preset value, determine whether the semantics of the deletion interface are correct. Specifically: when the ratio between the number of second return bodies indicating that the target files to be deleted do not exist and the number of target file names corresponding to the first return code containing the write interface available identifier is less than the sixth preset value, it is determined that the semantics of the deletion interface is incorrect. When the ratio between the number of second return bodies indicating that the target files to be deleted do not exist and the number of target file names corresponding to the first return code containing the write interface available identifier is greater than or equal to the sixth preset value, it is determined that the semantics of the deletion interface is correct.

[0216] The sixth preset value is a decimal less than 1 and close to 1. For example, the sixth preset value is 0.999. In this embodiment, the sixth preset value may be the user's expectation of the semantics of the deletion interface of the storage service, or may be the storage service provider's commitment value of the semantic correctness of the deletion interface of the storage service.

[0217] Through the above method, the robustness of the deletion interface of the storage service can be tested, specifically, whether the semantics of the deletion interface included in the robustness of the deletion interface is correct.

[0218] Based on the above, if Fig.10 As shown, a method for testing a storage service interface provided by an embodiment of the present invention includes:

[0219] The electronic device generates a target file set according to a test character set and an unnamed target file; the test character set includes: a symbol character subset, a numeric and alphanumeric character subset, a coded character subset, and a custom character subset;

[0220] The electronic device receives the target file set and processes the target file, such as adding a watermark to the image, adjusting the size of the image, etc., using the image interface of the electronic device, and compressing the word document, audio, and video;

[0221] The electronic device uses the processed target file to call the write interface, read interface, and delete interface of the object storage service.

[0222] The object storage service performs write processing on each target file and returns the write result to the electronic device through the write interface; performs read processing on the target file and returns the read result to the electronic device through the write interface; performs delete processing on the target file and returns the delete result to the electronic device through the write interface.

[0223] Based on the writing results, reading results, and deleting results, the electronic device determines the availability, reliability, and semantic correctness of the write interface of the object storage server, determines the availability of the read interface, and determines the availability and semantic correctness of the delete interface. Reliability refers to whether it is available, reliability refers to whether it is reliable, and semantic correctness refers to whether the semantics are correct.

[0224] <Device Example>

[0225] like Fig.11 As shown, this embodiment provides a device 11 for testing a storage service interface, and the device 11 includes:

[0226] The first determining module 1101 is used to determine the target file name;

[0227] A second determining module 1102 is used to determine a service test request based on the target file name and a service interface of the storage service;

[0228] A receiving module 1103 is used to receive the service parameters returned by the service interface of the storage service in response to the service test request;

[0229] The testing module 1104 is used to evaluate the service parameters through the corresponding preset testing unit according to the type of the service test request to obtain the test result of the storage service interface.

[0230] In one embodiment, the first determination module 1101 is specifically used to obtain a pre-stored test character set, wherein the test character set includes characters of multiple character types; extract N characters from the test character set and combine them to obtain at least one character string, wherein N is a positive integer; and determine the at least one character string as a target file name.

[0231] In one embodiment, the apparatus further comprises:

[0232] The queue module 1105 is used to write the determined target file name into the test queue, so as to obtain the target file name from the test queue before the second determination module 1102 determines the service test request step based on the target file name and the service interface of the storage service.

[0233] In one embodiment, the second determination module 1102 is specifically used to determine a write type service test request based on the target file name and the write interface of the storage service; and / or determine a read type service test request based on the target file name and the read interface of the storage service; and / or determine a delete type service test request based on the target file name and the delete interface of the storage service.

[0234] In one embodiment, the queue module 1105 is further used to write a write-type service test request, a read-type service test request and / or a delete-type service test request into the service test request queue.

[0235] In one embodiment, the type of the service test request is a write type, and the service parameter is a first return code; the test module 1104 is specifically used to determine the number of first return codes containing a write interface available identifier; and determine whether the write interface is available based on the number of first return codes containing a write interface available identifier and the number of target file names.

[0236] In one embodiment, the type of the service test request is a read type, and the service parameter is a second return code; the test module 1104 is specifically used to determine the number of second return codes containing a read interface available identifier; determine the number of target file names corresponding to the first return code containing a write interface available identifier; and determine whether the read interface is available based on the number of second return codes containing a read interface available identifier and the number of target file names corresponding to the first return code containing a write interface available identifier.

[0237] In one embodiment, the service parameter is the first return body; the test module 1104 is specifically used to determine the number of first return bodies containing valid data; determine the number of target file names corresponding to the first return codes containing the write interface available identifier; and determine whether the semantics of the write interface are correct based on the number of first return bodies containing valid data and the number of target file names corresponding to the first return codes containing the write interface available identifier.

[0238] In one embodiment, the test module 1104 is specifically used to determine the number of first return bodies containing correct and valid data; determine the number of target file names corresponding to the first return codes containing the write interface available identifier; and determine whether the write interface is reliable based on the number of first return bodies containing correct and valid data and the number of target file names corresponding to the first return codes containing the write interface available identifier, wherein the correct and valid data is consistent with the data of the corresponding target file.

[0239] In one embodiment, the test module 1104 is specifically used to determine the hash value of the valid data based on the valid data carried in the first return body; determine the hash value of the data of the target file based on the data of the target file corresponding to the first return body; and determine that the first return body contains correct valid data when the hash value of the valid data is consistent with the hash value of the data of the target file.

[0240] In one embodiment, the type of the service test request is a deletion type, and the service parameter is a third return code; the number of third return codes containing a deletion interface available identifier is determined; the test module 1104 is specifically used to determine the number of target file names corresponding to the first return code containing a write interface available identifier; based on the number of third return codes containing a deletion interface available identifier and the number of target file names corresponding to the first return code containing a write interface available identifier, determine whether the deletion interface is available.

[0241] In one embodiment, the service parameter is a second return body; the test module 1104 is specifically used to determine the number of second return bodies indicating that the target file to be deleted does not exist; determine the number of target file names corresponding to the first return code containing the write interface available identifier; and determine whether the semantics of the deletion interface are correct based on the number of second return bodies indicating that the target file to be deleted does not exist and the number of target file names corresponding to the first return code containing the write interface available identifier.

[0242] <Electronic equipment>

[0243] like Fig.12 As shown, this embodiment provides an electronic device 12, the electronic device 12 includes Fig.11 The device 11 for testing the storage service interface shown may include a memory 1201 and a processor 1202. The memory 1201 is used to store computer instructions, and the processor 1202 is used to call the computer instructions from the memory 1201 to execute any one of the methods in the above method embodiments.

[0244] <Storage Medium Embodiment>

[0245] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the above method embodiments is implemented.

[0246] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0247] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0248] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0249] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.

[0250] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.

[0251] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0252] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0253] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.

[0254] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A method for testing a storage service interface, characterized in that: The method comprises: Determine the target file name; Determine a service test request based on the target file name and the service interface of the storage service; Receive the service parameters returned by the service interface of the storage service in response to the service test request; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface; The determining of the service test request based on the target file name and the service interface of the storage service includes: Determine a service test request of a write type based on the target file name and a write interface of the storage service; and / or Determine a service test request of a read type based on the target file name and a read interface of the storage service; and / or Determine a service test request of a deletion type based on the target file name and a deletion interface of the storage service; The type of the service test request is a write type, and the service parameter is a first return code; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of first return codes containing an indication that the write interface is available; Determining whether the write interface is available according to the number of first return codes containing a write interface available identifier and the number of target file names; The type of the service test request is a read type, and the service parameter is a second return code; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of second return codes containing available identification of the read interface; Determine the number of target file names corresponding to the first return code containing the write interface available identifier; Whether the read interface is available is determined according to the number of second return codes containing the read interface available identifier and the number of target file names corresponding to the first return codes containing the write interface available identifier.

2. The method according to claim 1, characterized in that Determine the target file name, including: Obtaining a pre-stored test character set, wherein the test character set includes characters of multiple character types; Extracting N characters from the test character set and combining them to obtain at least one character string, where N is a positive integer; The at least one character string is determined as a target file name.

3. The method according to claim 2, characterized in that The method further comprises: The target file name is written into a test queue, so that the target file name is obtained from the test queue before a service test request is determined based on the target file name and a service interface of a storage service.

4. The method according to claim 1, characterized in that The method further comprises: A write-type service test request, a read-type service test request, and / or a delete-type service test request is written to the service test request queue.

5. The method according to claim 1, characterized in that The service parameter is the first return object; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of first return bodies containing valid data; Determine the number of target file names corresponding to the first return code containing the write interface available identifier; Whether the semantics of the write interface is correct is determined according to the number of the first return bodies containing valid data and the number of target file names corresponding to the first return codes containing the write interface available identifier.

6. The method according to claim 5, characterized in that According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of first returned bodies containing correct valid data; Determine the number of target file names corresponding to the first return code containing the write interface available identifier; Whether the write interface is reliable is determined based on the number of first return bodies containing correct and valid data and the number of target file names corresponding to the first return codes containing write interface available identifiers, wherein the correct and valid data are consistent with the data of the corresponding target files.

7. The method according to claim 6, characterized in that Determine the first return body that contains correct and valid data, including: Determine a hash value of the valid data according to the valid data carried in the first return body; Determine a hash value of the target file data according to the target file data corresponding to the first return body; When the hash value of the valid data is consistent with the hash value of the data of the target file, it is determined that the first returned body contains correct valid data.

8. The method according to claim 1, characterized in that The type of the service test request is a deletion type, and the service parameter is a third return code; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of third return codes containing a delete interface available flag; Determine the number of target file names corresponding to the first return code containing the write interface available identifier; Whether the deletion interface is available is determined according to the number of the third return codes containing the deletion interface available identifier and the number of the target file names corresponding to the first return codes containing the write interface available identifier.

9. The method according to claim 8, characterized in that The service parameter is the second return object; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of the second return body indicating that the target file to be deleted does not exist; Determine the number of target file names corresponding to the first return code containing the write interface available identifier; Whether the semantics of the deletion interface is correct is determined based on the number of second return bodies indicating that the target files to be deleted do not exist and the number of target file names corresponding to the first return codes containing the write interface available identifier.

10. A device for testing a storage service interface, characterized in that: The device comprises: A first determination module, used to determine a target file name; A second determination module is used to determine a service test request based on the target file name and a service interface of the storage service; A receiving module, configured to receive service parameters returned by the service interface of the storage service in response to the service test request; A test module, configured to evaluate the service parameters through a corresponding preset test unit according to the type of the service test request, so as to obtain a test result of the storage service interface; The determining of the service test request based on the target file name and the service interface of the storage service includes: Determine a service test request of a write type based on the target file name and a write interface of the storage service; and / or Determine a service test request of a read type based on the target file name and a read interface of the storage service; and / or Determine a service test request of a deletion type based on the target file name and a deletion interface of the storage service; The type of the service test request is a write type, and the service parameter is a first return code; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of first return codes containing an indication that the write interface is available; Determining whether the write interface is available according to the number of first return codes containing a write interface available identifier and the number of target file names; The type of the service test request is a read type, and the service parameter is a second return code; According to the type of the service test request, the service parameter is evaluated by a corresponding preset test unit to obtain a test result of the storage service interface, including: Determine the number of second return codes containing available identification of the read interface; Determine the number of target file names corresponding to the first return code containing the write interface available identifier; Whether the read interface is available is determined according to the number of second return codes containing the read interface available identifier and the number of target file names corresponding to the first return codes containing the write interface available identifier.

11. An electronic device, characterized in that: The electronic device comprises the apparatus as claimed in claim 10; or, The system comprises a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, which implements the method according to any one of claims 1 to 9 when executed by a processor.