CN114253476B - Storage space expansion method, device, equipment and computer readable storage medium - Google Patents
Storage space expansion method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN114253476B CN114253476B CN202111537072.6A CN202111537072A CN114253476B CN 114253476 B CN114253476 B CN 114253476B CN 202111537072 A CN202111537072 A CN 202111537072A CN 114253476 B CN114253476 B CN 114253476B
- Authority
- CN
- China
- Prior art keywords
- data block
- target data
- storage space
- expanded
- size
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 124
- 230000008569 process Effects 0.000 claims description 75
- 238000012545 processing Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 16
- 238000001514 detection method Methods 0.000 claims 2
- 238000012423 maintenance Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 10
- 230000003287 optical effect Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present disclosure relates to a storage space expansion method, apparatus, device, and computer-readable storage medium. The method and the device determine whether the storage space needs to be expanded according to the instruction, and if the storage space needs to be expanded, further determine the size of the storage space which needs to be expanded for the target data block. The method has the advantages that the executed instructions are different, the size of the expanded storage space is different, the method is flexible, the size of the storage space which needs to be expanded can be determined, and the problem that the prior art cannot estimate the expansion of the storage space well is solved. Moreover, the embodiment of the disclosure does not need manual operation, and compared with the mode that the prior art needs manual operation through a time window, the embodiment of the disclosure can automatically expand the storage space, save human resources, enable expanding the storage space to be simpler and more convenient, and reduce maintenance cost.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a storage space expansion method, apparatus, device, and computer readable storage medium.
Background
With the continuous development of computer technology, databases are increasingly widely used, so that the importance of database performance is also becoming more prominent. Hardware such as a central processing unit (Central Processing Unit, CPU), input and Output (IO), memory and the like are important bases for database performance, and since IO is located at the bottommost end of a multi-layer buffer architecture of a computer, IO becomes an important influencing factor for database performance.
In general, in the On-line transaction process (On-Line Transaction Processing, OLTP) scenario of a database, operations such as adding, deleting, changing, etc. need to expand the data block storage space by randomly writing IOs.
However, how much the memory space of the data block is extended is suitable, and is affected by the operations specifically performed on the data block, and cannot be well estimated in place.
Disclosure of Invention
In order to solve the above technical problems, the present disclosure provides a storage space expansion method, apparatus, device and computer readable storage medium, so as to determine how much storage space to expand according to instructions.
In a first aspect, an embodiment of the present disclosure provides a storage space expansion method, including:
Receiving an instruction sent by a terminal, wherein the instruction is processed by a first process, and the instruction comprises identification information of a target data block and an operation executed on the target data block;
determining whether the vacant storage space of the target data block is larger than a threshold value according to the instruction;
If the free storage space of the target data block is smaller than a threshold value, determining the size of the storage space required to be expanded by the target data block;
And expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
In a second aspect, an embodiment of the present disclosure provides a storage space expansion apparatus, including:
The receiving module is used for receiving an instruction sent by the terminal, wherein the instruction is processed by the first process and comprises identification information of a target data block and an operation executed on the target data block;
The first determining module is used for determining whether the vacant storage space of the target data block is larger than a threshold value according to the instruction;
a second determining module, configured to determine a size of a storage space that needs to be expanded for the target data block when the available storage space for the target data block is less than a threshold;
and the expansion module is used for expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
In a third aspect, embodiments of the present disclosure provide a server, comprising:
A memory;
A processor; and
A computer program;
Wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method according to the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored thereon a computer program for execution by a processor to implement the method of the first aspect.
In a fifth aspect, the disclosed embodiments also provide a computer program product comprising a computer program or instructions which, when executed by a processor, implements a storage space expansion method as described above.
According to the storage space expansion method, the storage space expansion device, the storage space expansion equipment and the computer readable storage medium, the instruction sent by the terminal is received and processed by the first process, the instruction comprises identification information of a target data block and an operation executed on the target data block, whether the spare storage space of the target data block is larger than a threshold value is determined according to the instruction, and if the spare storage space of the target data block is smaller than the threshold value, the size of the storage space required to be expanded by the target data block is determined. Further, the storage space of the target data block is expanded according to the size of the storage space required to be expanded by the target data block. Since whether the storage space needs to be expanded is determined according to the instruction, if the storage space needs to be expanded, the size of the storage space which needs to be expanded for the target data block is further determined. The method has the advantages that the executed instructions are different, the size of the expanded storage space is different, the method is flexible, the size of the storage space which needs to be expanded can be determined, and the problem that the prior art cannot estimate the expansion of the storage space well is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a method for expanding a storage space according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a locking process provided by an embodiment of the present disclosure;
FIG. 4 is a flowchart of a method for expanding a storage space according to another embodiment of the present disclosure;
FIG. 5 is a flowchart of a method for expanding a storage space according to another embodiment of the present disclosure;
Fig. 6 is a schematic structural diagram of a storage space expansion device according to an embodiment of the present disclosure;
Fig. 7 is a schematic structural diagram of a server according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure. The specific embodiments described herein are to be considered in an illustrative rather than a restrictive sense. All other embodiments, which are obtained by a person skilled in the art based on the described embodiments of the invention, fall within the scope of protection of the invention.
With the continuous development of computer technology, databases are increasingly widely used, so that the importance of database performance is also becoming more prominent. Hardware such as a central processing unit (Central Processing Unit, CPU), input and Output (IO), memory and the like are important bases for database performance, and since IO is located at the bottommost end of a multi-layer buffer architecture of a computer, IO becomes an important influencing factor for database performance.
In general, in the On-line transaction process (On-Line Transaction Processing, OLTP) scenario of a database, operations such as adding, deleting, changing, etc. need to expand the data block storage space by randomly writing IOs.
However, how much the memory space of the data block is extended is suitable, and is affected by the operations specifically performed on the data block, and cannot be well estimated in place. In view of this problem, embodiments of the present disclosure provide a storage space expansion method, which is described below with reference to specific embodiments.
Fig. 1 is a flowchart of a method for expanding a storage space according to an embodiment of the present disclosure. The method can be applied to an application scenario shown in fig. 2, where the application scenario includes a server 21 and a terminal 22, and the terminal 22 may specifically be a terminal, for example, a smart phone, a palm computer, a tablet computer, a wearable device with a display screen, a desktop computer, a notebook computer, an integrated machine, an intelligent home device, and the like. It can be appreciated that the storage space expansion method provided by the embodiment of the present disclosure may also be applied in other scenarios.
The storage space expansion method shown in fig. 1 is described below in conjunction with the application scenario shown in fig. 2, and the method includes the following specific steps:
S101, receiving an instruction sent by a terminal, wherein the instruction is processed by a first process, and the instruction comprises identification information of a target data block and an operation executed on the target data block.
The terminal 22 sends instructions to the server 21 as shown in fig. 2, for example inserting a tuple or several tuples in the target data block. The server 21 receives an instruction sent by the terminal 22, wherein the instruction includes identification information of a target data block and an operation performed on the target data block, and the instruction is processed by a first process.
S102, determining whether the free storage space of the target data block is larger than a threshold value according to the instruction.
After receiving the instruction sent by the terminal 22, the server 21 determines whether the free storage space of the target data block is greater than a threshold value when the instruction includes an operation of insert (insert) and update (update), so as to ensure that the target data block has storage space to perform the operation.
And S103, if the free storage space of the target data block is smaller than a threshold value, determining the size of the storage space required to be expanded by the target data block.
If the server 21 determines that the free storage space of the target data block is smaller than the threshold value, the storage space size of the target data block to be expanded is determined.
S104, expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
After determining the size of the storage space required to be expanded for the target data block, the server 21 expands the storage space of the target data block according to the size of the storage space required to be expanded for the target data block.
According to the embodiment of the disclosure, an instruction sent by a terminal is received, the instruction is processed by a first process, the instruction comprises identification information of a target data block and an operation performed on the target data block, whether the spare storage space of the target data block is larger than a threshold value is determined according to the instruction, and if the spare storage space of the target data block is smaller than the threshold value, the size of the storage space of the target data block which needs to be expanded is determined. Further, the storage space of the target data block is expanded according to the size of the storage space required to be expanded by the target data block. Since whether the storage space needs to be expanded is determined according to the instruction, if the storage space needs to be expanded, the size of the storage space which needs to be expanded for the target data block is further determined. The method has the advantages that the executed instructions are different, the size of the expanded storage space is different, the method is flexible, the size of the storage space which needs to be expanded can be determined, and the problem that the prior art cannot estimate the expansion of the storage space well is solved.
In addition, the embodiment of the disclosure does not need manual operation, and compared with the mode that a time window is needed to be manually passed in the prior art, the embodiment of the disclosure can automatically expand the storage space, save manpower resources, enable expanding the storage space to be simpler and more convenient, and reduce maintenance cost.
Fig. 4 is a flowchart of a method for expanding a storage space according to another embodiment of the present disclosure, as shown in fig. 4, the method includes the following steps:
s401, receiving an instruction sent by a terminal, wherein the instruction is processed by a first process, and the instruction comprises identification information of a target data block and an operation executed on the target data block.
Specifically, the implementation process and principle of S401 and S101 are identical, and will not be described herein.
S402, determining the threshold according to the instruction.
After receiving the instruction sent by the terminal 22, the server 21 determines the threshold according to the specific operation performed on the target data block, and the instruction includes the identification information of the target data block. For example, a tuple is inserted in the target data block, the threshold being the size of a tuple. If two tuples are inserted, the threshold is the size of the two tuples.
S403, determining whether the storage space of the target data block is larger than a threshold based on the threshold and the storage space of the target data block, if so, executing S409, otherwise, executing S404.
The server 21 obtains the size of the free storage space of the target data block and then determines whether the free storage space of the target data block is greater than a threshold based on the threshold and the size of the free storage space of the target data block. If the free storage space of the target data block is greater than the threshold, executing step S409; if the free memory space of the target data block is smaller than the threshold value, the following steps S406 and steps following S406 are performed.
S404, locking the target data block accessed by the instruction, so that after the locking is successful, a second process after the first process in the waiting queue cannot execute operation on the target data block.
As shown in fig. 3, if the free storage space of the target data block is smaller than a threshold, the first process of the server 21 performs locking processing on the target data block accessed by the instruction, so that after the locking is successful, the second process after the first process in the waiting queue cannot perform an operation on the target data block.
For example, the first process locks the target data block, and adds a wait number of 1 to the shared memory. If there are other processes to access the target data block, each process adds 1 to the wait number, and the waiting background process maintains a wait queue to identify the order. When the first process releases the lock, the waiting number is reduced by 1, and the second process can lock the target data block according to the sequence.
S405, detecting whether a third process has expanded the target data block, if so, executing S409, otherwise, executing S406.
After locking the target data block accessed by the instruction, the server 21 detects whether a third process has expanded the target data block, and if so, step S409 is executed; if not, the following steps S406 and steps following S406 are performed.
S406, determining the size of the storage space of the expansion needed by the target data block.
If the target data block is not expanded by the third process, the server 21 determines the storage space size of the target data block to be expanded.
S407, expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
Specifically, the implementation process and principle of S407 and S104 are consistent, and will not be described here again.
S408, unlocking the target data block accessed by the instruction.
After expanding the memory space of the target data block is completed, the server 21 performs unlocking processing on the target data block accessed by the instruction.
S409, expansion is ended.
When the free storage space of the target data block is greater than the threshold value, or the third process has already expanded the target data block, or the expansion of the storage space of the target data block is completed, after the server 21 performs unlocking processing on the target data block accessed by the instruction, the expansion of the storage space is completed.
The method and the device for processing the data block comprise the steps of receiving an instruction sent by a terminal, processing the instruction by a first process, wherein the instruction comprises identification information of a target data block, and an operation executed on the target data block, and determining the threshold according to the instruction. And then, based on the threshold value and the storage space of the vacant target data block, determining whether the storage space of the vacant target data block is larger than the threshold value, and if the storage space of the vacant target data block is smaller than the threshold value, locking the target data block accessed by the instruction. Further, whether the target data block is expanded by a third process is detected, if the target data block is not expanded by the third process, the size of a storage space required to be expanded by the target data block is determined, the storage space of the target data block is expanded according to the size of the storage space required to be expanded by the target data block, and locking processing is performed on the target data block accessed by the instruction. Because the target data block accessed by the instruction is locked, after the locking is successful, a second process after a first process in a waiting queue cannot execute operation on the target data block, and when the storage space is expanded in the prior art, random write IO operated by a plurality of processes simultaneously is changed into sequential write IO operated by a single process. Because the performance of sequential write IO on the storage device is less than the performance of random write IO on the storage device, the disclosed embodiments can significantly improve the performance of the server when expanding the storage space.
Fig. 5 is a flowchart of a method for expanding a storage space according to another embodiment of the present disclosure, as shown in fig. 5, the method includes the following steps:
s501, receiving an instruction sent by a terminal, wherein the instruction is processed by a first process, and the instruction comprises identification information of a target data block and an operation executed on the target data block.
Specifically, the implementation process and principle of S501 and S101 are identical, and will not be described herein.
S502, determining whether the free storage space of the target data block is larger than a threshold value according to the instruction.
Specifically, the implementation process and principle of S502 and S102 are consistent, and will not be described herein.
S503, if the free storage space of the target data block is smaller than a threshold value, predicting the size of the storage space required to be expanded by the target data block according to the number of process waiting in a waiting queue, wherein the number of process waiting in the waiting queue is read from a shared memory.
If the server 21 determines that the free storage space of the target data block is smaller than the threshold value, predicting the storage space size of the target data block to be expanded according to the waiting number of processes in the waiting queue, wherein the waiting number of processes in the waiting queue is read from the shared memory.
As shown in fig. 3, there are 5 processes in the waiting queue, the number of the process waiting is 5, the size of the memory space required to be expanded for the target data block is predicted by "the number of the process waiting is a preset base number, and in general, one data block is about 8KB, the preset base number is 10, and the size of the memory space required to be expanded for the target data block is currently predicted is 400KB.
S504, comparing the predicted storage space size of the target data block required to be expanded with the upper limit value of the expansion storage space, and taking the smaller value of the predicted storage space size of the target data block required to be expanded and the upper limit value of the expansion storage space as the storage space size of the target data block required to be expanded.
The server 21 shown in fig. 2 compares the predicted storage space size of the expansion required for the target data block and the upper limit value of the expansion storage space, and takes the smaller value of the predicted storage space size of the expansion required for the target data block and the upper limit value of the expansion storage space as the storage space size of the expansion required for the target data block.
Alternatively, the upper limit value of the extended storage space may be 8MB. The memory space is too large to expand, so that temporary IO jitter is brought to the IO system, and 8MB is selected as an upper limit value.
S505, expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
Specifically, the implementation process and principle of S505 and S104 are consistent, and will not be described herein.
According to the embodiment of the disclosure, an instruction sent by a terminal is received, the instruction is processed by a first process, the instruction comprises identification information of a target data block and an operation executed on the target data block, and whether the spare storage space of the target data block is larger than a threshold value is determined according to the instruction. And if the vacant storage space of the target data block is smaller than the threshold value, predicting the size of the storage space which needs to be expanded by the target data block according to the process waiting number in the waiting queue, wherein the process waiting number in the waiting queue is read from the shared memory. And then, comparing the predicted storage space size of the target data block required to be expanded with the upper limit value of the expansion storage space, and taking the smaller value of the predicted storage space size of the target data block required to be expanded and the upper limit value of the expansion storage space as the storage space size of the target data block required to be expanded. Further, the storage space of the target data block is expanded according to the size of the storage space required to be expanded by the target data block. Because the upper limit value of the expansion storage space is set, the server compares the predicted size of the storage space required to be expanded by the target data block with the upper limit value of the expansion storage space, and takes the smaller value of the predicted size of the storage space required to be expanded by the target data block and the upper limit value of the expansion storage space as the size of the storage space required to be expanded by the target data block, the temporary IO jitter caused by the too large expansion of the storage space to an IO system can be prevented, and the performance of the server in the expansion of the storage space is further improved.
Fig. 6 is a schematic structural diagram of a storage space expansion device according to an embodiment of the present disclosure. The storage space expansion device may be a server as described in the above embodiments, or the storage space expansion device may be a part or component in the server. The storage space expansion device provided in the embodiment of the present disclosure may execute the processing flow provided in the storage space expansion method embodiment, as shown in fig. 6, the storage space expansion device 60 includes: a receiving module 61, a first determining module 62, a second determining module 63, an expanding module 64; the receiving module 61 is configured to receive an instruction sent by a terminal, where the instruction is processed by a first process, and the instruction includes identification information of a target data block and an operation performed on the target data block; the first determining module 62 is configured to determine, according to the instruction, whether the free storage space of the target data block is greater than a threshold; the second determining module 63 is configured to determine a storage space size of the target data block that needs to be expanded when the free storage space of the target data block is less than a threshold; the expansion module 64 is configured to expand the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
Optionally, when the determining, according to the instruction, whether the free storage space of the target data block is greater than a threshold, the first determining module 62 is specifically configured to: determining the threshold according to the instruction; and determining whether the free storage space of the target data block is greater than a threshold based on the threshold and the free storage space of the target data block.
Optionally, the second determining module 63 includes a processing unit 631, a detecting unit 632, and a determining unit 633; the processing unit 631 is configured to lock the target data block accessed by the instruction when the free storage space of the target data block is smaller than a threshold, so that after the locking is successful, a second process after the first process in the waiting queue cannot perform an operation on the target data block; the detecting unit 632 is configured to detect whether the target data block has been expanded by the third process; the determining unit 633 is configured to determine, when the target data block is not expanded by the third process, a storage space size of the target data block that needs to be expanded.
Optionally, the processing unit 631 is further configured to lock the target data block accessed by the instruction after the expansion module expands the storage space of the target data block according to the storage space size required to be expanded by the target data block.
Optionally, the second determining module 63 is specifically configured to, when determining the storage space size of the extension required by the target data block: predicting the size of a storage space required to be expanded by the process waiting number in a waiting queue, wherein the process waiting number in the waiting queue is read from a shared memory; comparing the predicted storage space size of the target data block required to be expanded with the upper limit value of the expansion storage space, and taking the smaller value of the predicted storage space size of the target data block required to be expanded and the upper limit value of the expansion storage space as the storage space size of the target data block required to be expanded.
The storage space expansion device of the embodiment shown in fig. 6 may be used to implement the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and will not be described herein again.
Fig. 7 is a schematic structural diagram of a server according to an embodiment of the present disclosure. The server may be a server as described in the above embodiments. The server provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the storage space expansion method, as shown in fig. 7, the server 70 includes: memory 71, processor 72, computer programs and communication interface 73; wherein the computer program is stored in the memory 71 and configured to be executed by the processor 72 for performing the memory space expansion method as described above.
In addition, the embodiment of the present disclosure also provides a computer-readable storage medium having stored thereon a computer program that is executed by a processor to implement the storage space expansion method described in the above embodiment.
Furthermore, embodiments of the present disclosure provide a computer program product comprising a computer program or instructions which, when executed by a processor, implement a memory space expansion method as described above.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the server; or may exist alone without being assembled into the server.
The computer readable medium carries one or more programs which, when executed by the server, cause the server to:
Receiving an instruction sent by a terminal, wherein the instruction is processed by a first process, and the instruction comprises identification information of a target data block and an operation executed on the target data block;
determining whether the vacant storage space of the target data block is larger than a threshold value according to the instruction;
If the free storage space of the target data block is smaller than a threshold value, determining the size of the storage space required to be expanded by the target data block;
And expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block.
In addition, the server may perform other steps in the storage space expansion method as described above.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (9)
1. A method of expanding storage space, the method comprising:
Receiving an instruction sent by a terminal, wherein the instruction is processed by a first process, and the instruction comprises identification information of a target data block and an operation executed on the target data block;
determining whether the vacant storage space of the target data block is larger than a threshold value according to the instruction;
If the free storage space of the target data block is smaller than a threshold value, determining the size of the storage space required to be expanded by the target data block;
Expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block;
The determining the storage space size of the expansion required by the target data block includes:
Predicting the size of a storage space required to be expanded by the process waiting number in a waiting queue, wherein the process waiting number in the waiting queue is read from a shared memory;
Comparing the predicted storage space size required to be expanded of the target data block with the upper limit value of the expanded storage space, and taking the smaller value of the predicted storage space size required to be expanded of the target data block and the upper limit value of the expanded storage space as the storage space size required to be expanded of the target data block;
The predicted memory size of the target data block to be expanded is determined based on the product of the process waiting number, the preset base and the size of a data block.
2. The method of claim 1, wherein determining from the instruction whether the free memory space of the target data block is greater than a threshold comprises:
determining the threshold according to the instruction;
and determining whether the free storage space of the target data block is greater than a threshold based on the threshold and the free storage space of the target data block.
3. The method of claim 1, wherein determining the size of the memory space required for the target data block if the free memory space of the target data block is less than a threshold comprises:
If the vacant storage space of the target data block is smaller than a threshold value, locking the target data block accessed by the instruction, so that after locking is successful, a second process after the first process in the waiting queue cannot execute operation on the target data block;
Detecting whether a third process has expanded the target data block;
And if the target data block is not expanded by the third process, determining the storage space size of the target data block which needs to be expanded.
4. A method according to claim 3, wherein said expanding the memory space of said target data block according to the size of the memory space required for said target data block comprises:
and unlocking the target data block accessed by the instruction.
5. A storage space expansion device, comprising:
The receiving module is used for receiving an instruction sent by the terminal, wherein the instruction is processed by the first process and comprises identification information of a target data block and an operation executed on the target data block;
The first determining module is used for determining whether the vacant storage space of the target data block is larger than a threshold value according to the instruction;
a second determining module, configured to determine a size of a storage space that needs to be expanded for the target data block when the available storage space for the target data block is less than a threshold;
the expansion module is used for expanding the storage space of the target data block according to the size of the storage space required to be expanded by the target data block;
The second determining module is specifically configured to, when determining the storage space size of the target data block that needs to be expanded:
Predicting the size of a storage space required to be expanded by the process waiting number in a waiting queue, wherein the process waiting number in the waiting queue is read from a shared memory;
Comparing the predicted storage space size required to be expanded of the target data block with the upper limit value of the expanded storage space, and taking the smaller value of the predicted storage space size required to be expanded of the target data block and the upper limit value of the expanded storage space as the storage space size required to be expanded of the target data block;
The predicted memory size of the target data block to be expanded is determined based on the product of the process waiting number, the preset base and the size of a data block.
6. The apparatus of claim 5, wherein the first determining module is configured to, when the determining, according to the instruction, whether the free storage space of the target data block is greater than a threshold value:
determining the threshold according to the instruction;
and determining whether the free storage space of the target data block is greater than a threshold based on the threshold and the free storage space of the target data block.
7. The apparatus of claim 5, wherein the second determination module comprises a processing unit, a detection unit, and a determination unit;
The processing unit is used for locking the target data block accessed by the instruction when the vacant storage space of the target data block is smaller than a threshold value, so that after the locking is successful, a second process after the first process in the waiting queue cannot execute operation on the target data block;
the detection unit is used for detecting whether a third process expands the target data block;
and the determining unit is used for determining the storage space size of the target data block required to be expanded when the target data block is not expanded by the third process.
8. A server for a server, which comprises a server and a server, characterized by comprising the following steps:
A memory;
A processor; and
A computer program;
Wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-4.
9. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111537072.6A CN114253476B (en) | 2021-12-13 | 2021-12-13 | Storage space expansion method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111537072.6A CN114253476B (en) | 2021-12-13 | 2021-12-13 | Storage space expansion method, device, equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114253476A CN114253476A (en) | 2022-03-29 |
CN114253476B true CN114253476B (en) | 2024-10-29 |
Family
ID=80792487
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111537072.6A Active CN114253476B (en) | 2021-12-13 | 2021-12-13 | Storage space expansion method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114253476B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111880734A (en) * | 2020-07-24 | 2020-11-03 | 北京浪潮数据技术有限公司 | Data processing method, system, electronic equipment and storage medium |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103226518B (en) * | 2012-01-31 | 2016-06-22 | 国际商业机器公司 | A kind of method and apparatus carrying out volume extension in storage management system |
US9128745B2 (en) * | 2012-12-27 | 2015-09-08 | International Business Machines Corporation | Automatically managing the storage of a virtual machine |
US9971525B2 (en) * | 2015-02-26 | 2018-05-15 | Red Hat, Inc. | Peer to peer volume extension in a shared storage environment |
CN106445414B (en) * | 2016-09-20 | 2019-09-03 | 广州视源电子科技股份有限公司 | Method and system for expanding available storage space of terminal equipment |
CN107632791A (en) * | 2017-10-10 | 2018-01-26 | 郑州云海信息技术有限公司 | The distribution method and system of a kind of memory space |
CN110022268B (en) * | 2018-01-09 | 2022-05-03 | 腾讯科技(深圳)有限公司 | Data transmission control method, device and storage medium |
CN111400262A (en) * | 2020-03-16 | 2020-07-10 | 长沙民政职业技术学院 | File storage space intelligent distribution method based on big data |
CN113722245B (en) * | 2021-08-04 | 2023-12-12 | 广州市百果园信息技术有限公司 | Buffer self-adaptive adjustment method, device, equipment and storage medium |
-
2021
- 2021-12-13 CN CN202111537072.6A patent/CN114253476B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111880734A (en) * | 2020-07-24 | 2020-11-03 | 北京浪潮数据技术有限公司 | Data processing method, system, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114253476A (en) | 2022-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP4167102A1 (en) | Method and device for updating reference document, electronic device, and storage medium | |
US10606806B2 (en) | Method and apparatus for storing time series data | |
US10592494B2 (en) | Collection record for overlapping data stream collections | |
CN105095489A (en) | Distributed file deletion method, device and system | |
US20160306839A1 (en) | Latest external dependee entity in transaction record | |
US9766929B2 (en) | Processing of data stream collection record sequence | |
CN112099982B (en) | Crash information positioning method and device, medium and electronic equipment | |
US10102251B2 (en) | Lockless open collection data structure | |
CN114253476B (en) | Storage space expansion method, device, equipment and computer readable storage medium | |
CN108205559B (en) | Data management method and equipment thereof | |
CN108121514B (en) | Meta information updating method and device, computing equipment and computer storage medium | |
CN114449052B (en) | Data compression method and device, electronic equipment and storage medium | |
CN113726885B (en) | Flow quota adjusting method and device | |
CN111209042B (en) | Method, device, medium and electronic equipment for establishing function stack | |
CN112559547B (en) | Method and device for determining consistency among multiple storage object copies | |
CN113177169B (en) | Method, device, equipment and storage medium for acquiring category of network address | |
CN110941683B (en) | Method, device, medium and electronic equipment for acquiring object attribute information in space | |
CN113760876A (en) | Data filtering method and device | |
CN110896391B (en) | Message processing method and device | |
CN112925800A (en) | Data dependency judgment method and device, computer equipment and storage medium | |
CN111538577A (en) | Program execution control device and method, terminal and storage medium | |
US10037242B2 (en) | Failure detection in a processing system | |
WO2017219445A1 (en) | Method of freezing application, and terminal | |
CN111782410B (en) | Lock jam monitoring method and device, electronic equipment and computer readable medium | |
CN114116746B (en) | Multisystem data storage method, multisystem data storage device, medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Country or region after: China Address after: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing Applicant after: China Electronics Technology Group Jincang (Beijing) Technology Co.,Ltd. Address before: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing Applicant before: BEIJING KINGBASE INFORMATION TECHNOLOGIES Inc. Country or region before: China |
|
GR01 | Patent grant |