Storage capacity testing method, device and electronic equipment

The server records the type and amount of data operations and calculates storage changes, which solves the problem that existing technology cannot verify the accuracy of storage measurement under concurrency pressure, enables continuous testing without clearing the storage space, and ensures storage Measurement accuracy and test continuity.

CN114048078BActive Publication Date: 2024-08-30BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111319741.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-09
Publication Date
2024-08-30
Estimated Expiration
2041-11-09

AI Technical Summary

Technical Problem

Existing storage testing methods cannot verify the accuracy of storage measurement in the storage space under concurrency pressure, and need to clear the storage space before testing, which lacks the ability to continuously test.

Method used

The server records the client's data operation type and data volume on the target storage space, calculates the storage change, and compares it with the initial and terminated storage volume to determine the accuracy of the storage volume measurement. Use the traffic replication tool to record concurrent data operations to achieve Continuous testing without clearing storage space.

Benefits of technology

It effectively verifies the accuracy of storage measurement in storage space under concurrency pressure, and has the ability to continuously test, avoiding the defect of needing to clear data for each test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048078B
    Figure CN114048078B
Patent Text Reader

Abstract

The present invention provides a storage capacity testing method, device and electronic device. The method is applied to a server, and the server is connected to a client in communication; the method includes: obtaining a first storage capacity in a target storage space in the server; recording the type and amount of data operations performed by the client on the target storage space; wherein the type of data operations includes upload operations and delete operations; determining the storage change amount of the target storage space based on the type and amount of data operations; obtaining a second storage capacity in the target storage space in the server; and determining whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity, the storage change amount and the second storage capacity. In this method, the server records the type and amount of data operations, so the accuracy of the storage capacity measurement in the storage space under concurrent pressure can be verified; the test does not need to clear the data in the storage space, so it can have the ability of continuous testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of object storage technology, and in particular to a storage capacity testing method, device and electronic equipment. Background Art

[0002] As an important storage type in public cloud, object storage provides users with data storage functions such as writing, reading, and deleting. Therefore, the storage capacity of object storage is an important charging item. Object storage providers can charge corresponding service fees based on the amount of data stored by users and the corresponding storage time.

[0003] The storage capacity testing method commonly used at present is relatively simple. During the test, the data in the storage space needs to be cleared first, and the user's client records the amount of data uploaded and deleted each time. Then, the storage capacity measurement in the storage space is determined to be accurate based on the amount of data recorded by the client and the amount of data stored in the storage space.

[0004] However, the above storage capacity testing method records the amount of data uploaded and deleted each time by the user's client, and cannot verify the accuracy of storage capacity measurement in the storage space under concurrent pressure; and each test requires clearing the data in the storage space first, resulting in its inability to conduct continuous testing. Summary of the invention

[0005] In view of this, the object of the present invention is to provide a storage capacity testing method, device and electronic device to verify the accuracy of storage capacity measurement in a storage space under concurrent pressure, and have the ability of continuous testing.

[0006] In a first aspect, an embodiment of the present invention provides a storage capacity testing method, which is applied to a server, and the server is communicatively connected with a client; the method includes: obtaining a first storage capacity in a target storage space in the server; recording the type and amount of data operations performed by the client on the target storage space; wherein the type of data operations includes upload operations and deletion operations; determining a storage change amount of the target storage space based on the type and amount of data operations; obtaining a second storage capacity in the target storage space in the server; and determining whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity, the storage change amount, and the second storage capacity.

[0007] In a preferred embodiment of the present invention, the above-mentioned step of recording the type and amount of data operations performed by the client on the target storage space includes: recording the return code and amount of data operations performed by the client on the target storage space through a traffic replication tool; wherein the return code represents the type of data operation and whether the data operation is successful.

[0008] In a preferred embodiment of the present invention, the above-mentioned server is communicatively connected with at least one client; the above-mentioned recording of the return code and data volume of the client's data operations on the target storage space through the traffic replication tool includes: recording the return code and data volume of multiple data operations of at least one client concurrently on the target storage space through the traffic replication tool.

[0009] In a preferred embodiment of the present invention, the above-mentioned step of determining the storage change amount of the target storage space based on the type and data amount of the data operation includes: determining the first data operation representing the success of the upload operation and the second data operation representing the success of the deletion operation based on the return code of the data operation; determining the data amount of the first data operation and the data amount of the second data operation; and taking the difference between the data amount of the first data operation and the data amount of the second data operation as the storage change amount of the target storage space.

[0010] In a preferred embodiment of the present invention, the above-mentioned step of determining whether the storage quantity measurement in the target storage space is accurate based on the first storage quantity, the storage change quantity and the second storage quantity includes: judging whether the sum of the first storage quantity and the storage change quantity is equal to the second storage quantity; if so, the storage quantity measurement in the target storage space is accurate; if not, the storage quantity measurement in the target storage space is inaccurate.

[0011] In a preferred embodiment of the present invention, after the above step of determining whether the storage measurement in the target storage space is accurate based on the first storage amount, the storage change amount and the second storage amount, the method further includes: generating a test result and sending the test result to the client.

[0012] In a preferred embodiment of the present invention, after the above step of determining whether the storage measurement in the target storage space is accurate based on the first storage amount, the storage change amount and the second storage amount, the method also includes: if the storage measurement in the target storage space is inaccurate, sending an alarm message to the client.

[0013] In a preferred embodiment of the present invention, the above method also includes: recording other data of the client's data operations on the target storage space through a traffic replication tool; wherein the other data includes traffic, number of operations or number of tags; and determining whether the measurement of other data in the target storage space is accurate based on the recorded other data.

[0014] In a second aspect, an embodiment of the present invention further provides a storage capacity testing device, which is applied to a server, and the server is communicatively connected with a client; the device includes: a first storage capacity acquisition module, used to acquire a first storage capacity in a target storage space in the server; a data operation recording module, used to record the type and amount of data operations performed by the client on the target storage space; wherein the types of data operations include upload operations and deletion operations; a storage change determination module, used to determine the storage change of the target storage space based on the type and amount of data operations; a second storage capacity acquisition module, used to acquire a second storage capacity in the target storage space in the server; and a storage capacity testing module, used to determine whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity, the storage change capacity, and the second storage capacity.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the above-mentioned storage capacity testing method.

[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the above-mentioned storage capacity testing method.

[0017] The embodiments of the present invention bring the following beneficial effects:

[0018] The embodiments of the present invention provide a storage capacity testing method, device and electronic device, in which a server records the type and amount of data operation, determines the storage change amount of the target storage space according to the type and amount of data operation, and determines whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity in the target storage space obtained before the data operation, the second storage capacity in the target storage space obtained after the data operation, and the storage change amount. In this method, the server records the type and amount of data operation, so the accuracy of the storage capacity measurement in the storage space under concurrent pressure can be verified; the test does not need to clear the data in the storage space, so it can have the ability of continuous testing.

[0019] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.

[0020] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A flow chart of a storage capacity testing method provided by an embodiment of the present invention;

[0023] Figure 2 A flowchart of another storage capacity testing method provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of a storage capacity testing method provided by an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of the structure of a storage capacity testing device provided by an embodiment of the present invention;

[0026] Figure 5 A schematic diagram of the structure of another storage capacity testing device provided by an embodiment of the present invention;

[0027] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] At present, the commonly used storage capacity testing method is relatively simple, and the usual testing steps are: clear the data in the storage space (Bucket, also called bucket); the client single-threadedly initiates upload and deletion operations for the specified storage space, and the client records the amount of data uploaded and deleted each time; after a period of time, the client's upload and deletion operations are stopped, and the total amount of existing data in the specified storage space is counted and recorded as size; the total amount of data recorded by the client is calculated as sum = the amount of data uploaded - the amount of data deleted; compare whether sum is equal to size, if yes, the storage capacity measurement of the specified storage space is correct, if not, the storage capacity measurement of the specified storage space is incorrect.

[0030] As can be seen from the above, the above storage capacity test method requires the client to record the amount of data uploaded and deleted each time; for the concurrent pressure of multiple clients uploading and deleting at the same time or a single client uploading and deleting in multiple threads, the above storage capacity test method cannot record and cannot verify the accuracy of storage capacity measurement in the storage space under concurrent pressure. In addition, the above storage capacity test method needs to clear the data in the bucket every time it is tested, so it does not have the ability of continuous testing.

[0031] Based on this, the embodiments of the present invention provide a storage capacity testing method, device and electronic device, which specifically relates to a storage capacity measurement testing method for object storage. This technology can be applied to a variety of devices such as physical servers, cloud servers, mobile phones, tablet computers, and computers. This technology can be implemented using corresponding software and hardware. The embodiments of the present invention are described in detail below.

[0032] To facilitate understanding of this embodiment, a storage capacity testing method disclosed in an embodiment of the present invention is first introduced in detail.

[0033] This embodiment provides a storage capacity testing method, which is applied to a server, where the server is connected to a client for communication; see Figure 1 A flow chart of a storage capacity testing method is shown, and the storage capacity testing method comprises the following steps:

[0034] Step S100, obtaining a first storage capacity in a target storage space in a server.

[0035] The method provided in this embodiment is applied to a server, wherein the server in this embodiment may be a physical server or a cloud server, which is not limited in this embodiment. The server in this embodiment is connected to a client in communication, wherein the number of clients connected to the same server is not limited in this embodiment. That is, a server may be connected to one client in communication, or may be connected to multiple clients in communication.

[0036] The server in this embodiment stores data through storage space, which is called Bucket, and data is called Object (object, file). Bucket is a container for storing Objects, and all Objects must be stored in a specific Bucket. A server can contain multiple Buckets, and the Bucket for storage capacity testing can be called the target storage space.

[0037] When performing a storage capacity test on a target storage space, it is necessary to obtain the current storage capacity in the target storage space, which is called the first storage capacity. That is, when performing a storage capacity test, the target storage space may store some data in advance, and the storage capacity of these data may be recorded as the first storage capacity.

[0038] Step S102, recording the type and amount of data operations performed by the client on the target storage space; wherein the type of data operations includes upload operations and delete operations.

[0039] In order to test the storage capacity of the target storage space, the client needs to perform data operations such as upload and delete operations on the target storage space. In this embodiment, the server records the type and amount of data operations performed by the client on the target storage space.

[0040] The server of this embodiment can record data operations of different clients, and can also record data operations of different threads of the same client, that is, the server of this embodiment can record concurrent data operations.

[0041] For example, if client A uploads 100mb of data to the server, the server can record the data operation type as uploading data and the data volume as 100mb. For another example, if client A uploads data while client B is deleting data and deletes 40mb of data, the server can record the data operation type as deleting data and the data volume as 40mb.

[0042] It should be noted that the data operation of the client may fail due to various reasons. The server in this embodiment can record the data operation that succeeded; for the data operation that failed, it can be recorded or not. Among them, the reasons for the operation failure may be: the communication between the client and the server is not smooth, the server has an abnormality and cannot process the data operation, the client cancels the data operation, the client does not have the authority to operate the data, etc. This embodiment does not limit this.

[0043] Step S104: determining the storage change amount of the target storage space based on the type of data operation and the data amount.

[0044] The server can determine the storage change amount of the target storage space according to the type and amount of data recorded. Generally, the difference between the amount of data of type upload data and the amount of data of type delete data is used as the storage change amount of the target storage space. For example, the server records 3 data operations of type upload operation, with data amounts of 20mb, 50mb, and 300mb respectively; and 2 data operations of type delete operation, with data amounts of 100mb and 60mb respectively. Then the storage change amount = 20 + 50 + 300 - 100 - 60 = 210mb.

[0045] As can be seen from the above, the storage change amount of the target storage space is calculated based on the data operation of the client and has nothing to do with the change of the storage amount of the storage space itself.

[0046] Step S106, obtaining a second storage capacity in the target storage space in the server.

[0047] After the data operation of the client is completed, the server can determine the current storage capacity in the target storage space in the server as the second storage capacity.

[0048] Step S108, determining whether the storage volume measurement in the target storage space is accurate based on the first storage volume, the storage change volume, and the second storage volume.

[0049] The change of the first storage amount and the second storage amount is related to the change of the storage amount of the storage space itself. The storage change amount is calculated based on the data operation of the client and has nothing to do with the change of the storage amount of the storage space itself. If the storage amount measurement in the target storage space is correct, the difference between the second storage amount and the first storage amount should be equal to the storage change amount; if the difference between the second storage amount and the first storage amount is not equal to the storage change amount, it means that the storage amount measurement in the target storage space is inaccurate.

[0050] For example, before the client performs data operations, the target storage space stores 20mb of data, and the first storage capacity is 20mb; the data operations performed by the client are recorded by the server, and the storage change amount is determined to be 30mb based on the type and amount of the recorded data operations; after the data operations, the target storage space stores 50mb of data, and the second storage capacity is 50mb; the second storage capacity 50mb-the second storage capacity 20mb=the storage change amount 30mb, it can be considered that the storage capacity measurement in the target storage space is correct.

[0051] An embodiment of the present invention provides a storage capacity testing method, in which a server records the type and amount of data operations, determines the storage change amount of a target storage space according to the type and amount of data operations, and determines whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity in the target storage space obtained before the data operation, the second storage capacity in the target storage space obtained after the data operation, and the storage change amount. In this method, the server records the type and amount of data operations, so the accuracy of the storage capacity measurement in the storage space under concurrent pressure can be verified; the test does not need to clear the data in the storage space, so it can have the ability of continuous testing.

[0052] This embodiment provides another storage capacity test method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of recording the type and amount of data operations performed by the client on the target storage space. Figure 2 The flowchart of another storage capacity testing method is shown in FIG. 1 . The storage capacity testing method in this embodiment includes the following steps:

[0053] Step S200, obtaining a first storage capacity in a target storage space in a server.

[0054] In order to perform a storage capacity test on the target storage space without clearing the data in the target storage space, this embodiment may first record the current first storage capacity in the target storage space during the storage capacity test, and may record the first storage capacity of the data retained in the target storage space as old_sum.

[0055] Step S202, recording the return code and data volume of the client's data operation on the target storage space through the traffic replication tool; wherein the return code represents the type of data operation and whether the data operation is successful.

[0056] See also Figure 3 A schematic diagram of a storage capacity testing method is shown. The traffic replication tool in this embodiment can be Goreplay or Tcpdump. In this embodiment, the above-mentioned traffic replication tool can be run on the server. The traffic replication tool can be used to record the client's upload, read, delete and other traffic in real time. The recorded content includes the return code and data volume, and a local traffic file of the server is generated.

[0057] like Figure 3 As shown, the traffic replication tool of this embodiment can record concurrent situations, for example: the traffic replication tool records the return code and data volume of multiple data operations of at least one client concurrently on the target storage space.

[0058] It should be noted here that concurrency can be a client concurrently uploading, reading, deleting and other data operations, or multiple clients concurrently uploading, reading, deleting and other data operations. As long as the number of data operations performed by the server at the same time is greater than one, it can be considered as a concurrency situation. Clients can initiate concurrent uploads, reads, deletes and other data operations on the target storage space, and the concurrency pressure can last for a period of time.

[0059] Specifically, the storage change amount of the target storage space can be determined by the following steps: determining the first data operation representing a successful upload operation and the second data operation representing a successful deletion operation based on the return code of the data operation; determining the data volume of the first data operation and the data volume of the second data operation; and taking the difference between the data volume of the first data operation and the data volume of the second data operation as the storage change amount of the target storage space.

[0060] Step S204: determining the storage change amount of the target storage space based on the type of data operation and the data amount.

[0061] After the client stops uploading, reading, deleting and other data operations, the server can execute the above steps to determine the storage change amount of the target storage space, and analyze and process the traffic file generated by the server's traffic replication tool. For example, the traffic file can be parsed through ScanWorker software.

[0062] Specifically, the return code can indicate the type of data operation and whether the data operation is successful. For example, a return code of 200 indicates a successful upload operation for the first data operation, and a return code of 206 indicates a successful delete operation for the second data operation. Figure 3 As shown, the difference between the data volume of the first data operation and the data volume of the second data operation can be used as the storage change amount of the target storage space, for example: storage change amount size = the data volume put of the first data operation with a return code of 200 - the data volume delete of the second data operation.

[0063] Step S206, obtaining a second storage capacity in the target storage space in the server.

[0064] like Figure 3 As shown, after the client stops the pressure of data operations such as uploading, reading, and deleting, the server can determine the storage amount of the current data in the target storage space as the second storage amount new_sum.

[0065] Step S208: determining whether the storage volume measurement in the target storage space is accurate based on the first storage volume, the storage change volume, and the second storage volume.

[0066] Specifically, whether the storage measurement in the target storage space is accurate can be determined by the following steps: determine whether the sum of the first storage amount and the storage change amount is equal to the second storage amount; if so, the storage measurement in the target storage space is accurate; if not, the storage measurement in the target storage space is inaccurate.

[0067] like Figure 3 As shown, it can be determined whether new_sum-old_sum is equal to size. If so, the storage quantity measurement in the target storage space is accurate; if not, the storage quantity measurement in the target storage space is inaccurate.

[0068] After obtaining the test result of whether the storage volume measurement in the target storage space is accurate, the test result may be sent to the client, for example, by generating the test result and sending the test result to the client.

[0069] The test result may be in specific text, or may be represented in the form of English, numbers, symbols, etc., which is not limited in this embodiment. After receiving the test result, the client may display the test result to the tester.

[0070] If the storage volume measurement in the target storage space is inaccurate, the server may alert the tester, for example, if the storage volume measurement in the target storage space is inaccurate, an alert message may be sent to the client.

[0071] The alarm information may include the specific values ​​of the above-mentioned first storage amount, the above-mentioned second storage amount, the above-mentioned storage change amount, and may also include the specific values ​​of the data amount of the above-mentioned first data operation and the data amount of the above-mentioned second data operation. It may also include possible reasons for inaccurate storage quantity measurement. The tester can quickly determine the possible reasons for the inaccurate storage quantity measurement based on the content of the alarm information.

[0072] In summary, the above method provided by the embodiment of the present invention can run traffic replication tools such as Goreplay or Tcpdump on the server to replicate and compile offline asynchronous analysis of concurrent pressure, and can aggregate the concurrent traffic generated by multiple servers through ScanWorker, and parse out the corresponding data volume of successful uploads and deletions. The server records the type and volume of data operations, so the accuracy of storage volume measurement in the storage space under concurrent pressure can be verified; the test does not need to clear the data in the storage space, so it can have the ability to test continuously.

[0073] In addition, the embodiments of this aspect can be further expanded and can subsequently be compatible with billing method tests for traffic, number of operations, and number of tags. For example, other data of the client's data operations on the target storage space can be recorded through a traffic replication tool; wherein the other data includes traffic, number of operations, or number of tags; based on the recorded other data, determine whether the metering of other data in the target storage space is accurate.

[0074] Among them, the method of recording the traffic, number of operations or number of tags and other data of the client's data operations on the target storage space through the traffic replication tool is similar to the method of recording the return code and data volume of the client's data operations on the target storage space through the traffic replication tool provided in the embodiment of the present invention, and this embodiment will not be repeated here.

[0075] Corresponding to the above method embodiment, the embodiment of the present invention provides a storage capacity testing device, which is applied to a server, and the server is connected to a client for communication; see Figure 4 A schematic structural diagram of a storage capacity testing device is shown, the storage capacity testing device comprising:

[0076] A first storage capacity acquisition module 41 is used to acquire a first storage capacity in a target storage space in a server;

[0077] The data operation recording module 42 is used to record the type and amount of data operations performed by the client on the target storage space; wherein the types of data operations include upload operations and delete operations;

[0078] A storage change amount determination module 43, used to determine the storage change amount of the target storage space based on the type and amount of data operation;

[0079] A second storage capacity acquisition module 44 is used to acquire a second storage capacity in a target storage space in the server;

[0080] The storage capacity testing module 45 is used to determine whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity, the storage change amount and the second storage capacity.

[0081] The embodiment of the present invention provides a storage capacity testing device, in which a server records the type and amount of data operations, determines the storage change amount of a target storage space according to the type and amount of data operations, and determines whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity in the target storage space obtained before the data operation, the second storage capacity in the target storage space obtained after the data operation, and the storage change amount. In this method, the server records the type and amount of data operations, so the accuracy of the storage capacity measurement in the storage space under concurrent pressure can be verified; the test does not need to clear the data in the storage space, so it can have the ability of continuous testing.

[0082] The above-mentioned data operation recording module is used to record the return code and data volume of the client's data operation on the target storage space through the traffic replication tool; wherein the return code represents the type of data operation and whether the data operation is successful.

[0083] The server is communicatively connected to at least one client; the data operation recording module is used to record the return codes and data volumes of multiple data operations performed concurrently by at least one client on the target storage space through a traffic replication tool.

[0084] The above-mentioned storage change determination module is used to determine the first data operation representing the success of the upload operation and the second data operation representing the success of the deletion operation based on the return code of the data operation; determine the data volume of the first data operation and the data volume of the second data operation; and use the difference between the data volume of the first data operation and the data volume of the second data operation as the storage change of the target storage space.

[0085] The storage capacity test module is used to determine whether the sum of the first storage capacity and the storage change is equal to the second storage capacity; if so, the storage capacity measurement in the target storage space is accurate; if not, the storage capacity measurement in the target storage space is inaccurate.

[0086] See also Figure 5 The structural diagram of another storage capacity testing device shown in the figure further includes: a test result sending module 46 connected to the storage capacity testing module 45, and the test result sending module 46 is used to generate a test result and send the test result to the client.

[0087] like Figure 5 As shown, the storage capacity testing device further includes: an alarm information sending module 47 connected to the storage capacity testing module 45, and the alarm information sending module 47 is used to send an alarm message to the client if the storage capacity measurement in the target storage space is inaccurate.

[0088] like Figure 5 As shown, the storage capacity testing device also includes: other data recording module 48, connected to the data operation recording module 42, and the other data recording module 48 is also used to record other data of the client's data operation on the target storage space through the traffic replication tool; wherein the other data includes traffic, number of operations or number of tags; based on the recorded other data, determine whether the measurement of other data in the target storage space is accurate.

[0089] The storage capacity testing device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned storage capacity testing method embodiment. For the sake of brief description, for matters not mentioned in the storage capacity testing device embodiment, reference may be made to the corresponding contents in the aforementioned storage capacity testing method embodiment.

[0090] The embodiment of the present invention also provides an electronic device for executing the above storage capacity test method; see Figure 6 A structural schematic diagram of an electronic device is shown, which includes a memory 100 and a processor 101, wherein the memory 100 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 101 to implement the above-mentioned storage capacity testing method.

[0091] Further, Figure 6 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .

[0092] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0093] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.

[0094] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned storage capacity testing method. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0095] The computer program product of the storage capacity testing method, device and electronic device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.

[0096] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0097] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0098] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0099] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0100] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A storage capacity testing method, characterized in that: Applied to a server, the server is in communication connection with a client; the method comprises: Acquire a first storage capacity in a target storage space in the server; Recording the type and amount of data operations performed by the client on the target storage space; wherein the type of data operations includes upload operations and delete operations; Determining a storage change amount of the target storage space based on the type and data amount of the data operation; Acquire a second storage capacity in the target storage space in the server; wherein the second storage capacity is the current storage capacity in the target storage space in the server determined by the server after the data operation on the client is completed; Determine whether the storage volume measurement in the target storage space is accurate based on the first storage volume, the storage change volume, and the second storage volume.

2. The method according to claim 1, characterized in that The step of recording the type and amount of data operations performed by the client on the target storage space includes: The return code and data volume of the data operation of the client on the target storage space are recorded through a traffic replication tool; wherein the return code represents the type of the data operation and whether the data operation is successful.

3. The method according to claim 2, characterized in that The server is communicatively connected to at least one client; The return code and data volume of the data operation of the client on the target storage space are recorded by the traffic replication tool, including: The return code and data volume of multiple data operations concurrently performed by at least one of the clients on the target storage space are recorded through a traffic replication tool.

4. The method according to claim 2, characterized in that: The step of determining the storage change amount of the target storage space based on the type and data amount of the data operation includes: Determine, based on the return code of the data operation, a first data operation indicating that the upload operation is successful and a second data operation indicating that the delete operation is successful; determining a data volume of the first data operation and a data volume of the second data operation; The difference between the data volume of the first data operation and the data volume of the second data operation is used as the storage change amount of the target storage space.

5. The method according to claim 1, characterized in that The step of determining whether the storage volume measurement in the target storage space is accurate based on the first storage volume, the storage change volume, and the second storage volume comprises: Determining whether the sum of the first storage amount and the storage change amount is equal to the second storage amount; If yes, the storage volume in the target storage space is accurately measured; If not, the storage measurement in the target storage space is inaccurate.

6. The method according to claim 1, characterized in that After the step of determining whether the storage volume measurement in the target storage space is accurate based on the first storage volume, the storage change volume, and the second storage volume, the method further includes: Generate a test result, and send the test result to the client.

7. The method according to claim 1, characterized in that After the step of determining whether the storage volume measurement in the target storage space is accurate based on the first storage volume, the storage change volume, and the second storage volume, the method further includes: If the storage volume measurement in the target storage space is inaccurate, an alarm message is sent to the client.

8. The method according to claim 2, characterized in that: The method further comprises: Recording other data of the data operation of the client on the target storage space through the traffic replication tool; wherein the other data includes traffic, operation quantity or label quantity; Based on the recorded other data, it is determined whether the measurement of the other data in the target storage space is accurate.

9. A storage capacity testing device, characterized in that: Applied to a server, the server is connected to a client for communication; the device comprises: A first storage capacity acquisition module, used to acquire a first storage capacity in a target storage space in the server; A data operation recording module, used to record the type and amount of data operations performed by the client on the target storage space; wherein the type of data operations includes upload operations and delete operations; A storage change amount determination module, used to determine the storage change amount of the target storage space based on the type and data amount of the data operation; A second storage capacity acquisition module, used to acquire a second storage capacity in the target storage space in the server; wherein the second storage capacity is the current storage capacity in the target storage space in the server determined by the server after the data operation on the client is completed; A storage capacity testing module is used to determine whether the storage capacity measurement in the target storage space is accurate based on the first storage capacity, the storage change amount and the second storage capacity.

10. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the storage capacity testing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the storage capacity testing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Storage capacity updating method and device

    CN112860720A

  • Metering storage usage

    US20170222886A1