Storage capacity determination method, device and equipment
By querying the target storage system for the physical page count and capacity of the target storage unit, the problem of inaccurate distinction between different business storage capacity in the database is solved, and efficient and secure storage capacity determination is achieved.
Patent Information
- Application Number
- CN202110319741.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-25
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2041-03-25
AI Technical Summary
The prior art cannot accurately distinguish the storage capacity of different services in the database, resulting in low accuracy of database file capacity and insufficient database stability and security.
By sending a physical page query request to the target storage system, the number of physical pages and physical page capacity of the target storage unit are obtained, and the capacity of the target storage unit is determined based on this information.
It improves the accuracy and efficiency of storage capacity determination and enhances the security and stability of the storage system.
Smart Images

Figure CN113010117B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, and apparatus for determining storage capacity. Background Art
[0002] To meet the storage needs of massive data, sharding is currently used to store the massive amounts of data for different businesses. However, the current solution, which reads the database file capacity from the database's operating system, can only determine the database's storage capacity and cannot distinguish the storage capacity of different businesses in the database. Furthermore, this solution requires logging into the database's operating system, which reduces database stability and security. Furthermore, the accuracy of database file capacity is low, which cannot meet the accuracy requirements for determining database storage capacity. Summary of the Invention
[0003] The present application provides a storage capacity determination method, apparatus, device, and computer-readable storage medium, which can at least greatly improve the accuracy and efficiency of storage capacity determination, and can also improve the stability and security of the storage system.
[0004] In one aspect, the present application provides a method for determining storage capacity, the method comprising:
[0005] Sending a physical page query request of a target storage unit to a target storage system, wherein the physical page query request includes query identification information corresponding to the target storage unit;
[0006] receiving the number of physical pages and the physical page capacity corresponding to the target storage unit determined based on the query identification information and sent by the target storage system;
[0007] The capacity corresponding to the target storage unit is determined according to the number of physical pages corresponding to the target storage unit and the physical page capacity.
[0008] On the other hand, the present application provides another method for determining storage capacity, the method comprising:
[0009] Receive a physical page query request of a target storage unit sent by a client, wherein the physical page query request includes query identification information corresponding to the target storage unit;
[0010] Determining the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit;
[0011] The number of physical pages and the physical page capacity corresponding to the target storage unit are sent to the client, so that the client determines the capacity corresponding to the target storage unit according to the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0012] In another aspect, the present application provides a storage capacity determination device, the device comprising:
[0013] A first receiving module is configured to receive a physical page query request of a target storage unit sent by a client, wherein the physical page query request includes query identification information corresponding to the target storage unit;
[0014] A first determining module, configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit;
[0015] The second sending module is used to send the number of physical pages and the physical page capacity corresponding to the target storage unit to the client, so that the client determines the capacity corresponding to the target storage unit according to the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0016] On the other hand, the present application provides another storage capacity determination device, the device comprising:
[0017] A first receiving module is configured to receive a physical page query request of a target storage unit sent by a client, wherein the physical page query request includes query identification information corresponding to the target storage unit;
[0018] A first determining module, configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit;
[0019] The first sending module is used to send the number of physical pages and the physical page capacity corresponding to the target storage unit to the client, so that the client determines the capacity corresponding to the target storage unit according to the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0020] On the other hand, the present application provides a storage capacity determination device, characterized in that the device includes a processor and a memory, the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the storage capacity determination method as described above.
[0021] On the other hand, the present application provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the storage capacity determination method as described above.
[0022] The storage capacity determination method, apparatus, device, and computer-readable storage medium provided in this application have the following technical effects:
[0023] The present application sends a physical page query request of the target storage unit to the target storage system, and receives the physical page number and physical page capacity corresponding to the target storage unit queried by the target storage system, so that the capacity corresponding to the target storage unit can be accurately determined based on the precise physical page number and physical page capacity. In addition, since the target storage system can quickly query the physical page number and physical page capacity corresponding to the target storage unit, the storage capacity determination method of the present application can improve the efficiency of determining the capacity of the target storage unit. Furthermore, the present application queries the physical page number and physical page capacity corresponding to the target storage unit through the target storage system, and there is no need for a third party to log in to the operating system corresponding to the target storage system to query the capacity of the target storage unit, which can improve the security and stability of the target storage system.
[0024] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 is a schematic diagram of a storage capacity determination system provided in an embodiment of the present application;
[0027] Figure 2 is a schematic diagram of another storage capacity determination system provided in an embodiment of the present application;
[0028] Figure 3 This is a flow chart of a method for determining storage capacity provided in an embodiment of the present application;
[0029] Figure 4 This is a flow chart of a method for sending a physical page query request provided by an embodiment of the present application;
[0030] Figure 5 1 is a flow chart of a method for determining a target storage unit provided in an embodiment of the present application;
[0031] Figure 6 This is a flow chart of a method for identifying abnormal capacity of a target storage system provided by an embodiment of the present application;
[0032] Figure 7 1 is a flow chart of another method for determining storage capacity provided in an embodiment of the present application;
[0033] Figure 8 1 is a flow chart of another method for determining storage capacity provided in an embodiment of the present application;
[0034] Figure 9 Schematic diagram of a storage capacity determination device provided in an embodiment of the present application;
[0035] Figure 10 is a structural diagram of another storage capacity determination device provided in an embodiment of the present application;
[0036] Figure 11 is a structural diagram of another storage capacity determination device provided in an embodiment of the present application;
[0037] Figure 12 This is a hardware structure block diagram of a server for a storage capacity determination method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0040] The storage capacity determination system involved in the embodiments of the present application can be a distributed system formed by connecting a client and multiple nodes (any form of computing device connected to the network, such as a server or user terminal) through network communication. The nodes can be deployed with a storage system, and the storage system can communicate with the client.
[0041] Taking the distributed system as the blockchain system as an example, see Figure 1 , Figure 1This is an optional structural diagram of the distributed system 100 provided in an embodiment of the present application applied to a blockchain system. The system is composed of multiple nodes (any form of computing device connected to the network, such as servers and user terminals) and clients. The nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol that runs on top of the Transmission Control Protocol (TCP). In a distributed system, any machine, such as a server or terminal, can join and become a node. Nodes include hardware layers, middle layers, operating system layers, and application layers.
[0042] See also Figure 1 The functions of each node in the blockchain system shown include:
[0043] 1) Routing: A basic function of a node, used to support communication between nodes.
[0044] In addition to the routing function, nodes can also have the following functions:
[0045] 2) Applications, deployed in the blockchain, implement specific services based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.
[0046] For example, the services implemented by the application include:
[0047] 2.1) Wallet: This provides the functionality for conducting electronic currency transactions, including initiating transactions (i.e., sending the current transaction record to other nodes in the blockchain system. Upon successful verification by other nodes, the transaction record data is stored in a temporary block of the blockchain as a response to acknowledge the transaction's validity). The wallet also supports querying the remaining electronic currency in an electronic currency address.
[0048] 2.2) Shared ledgers are used to store, query, and modify account data. Records of operations on account data are sent to other nodes in the blockchain system. After verification, other nodes acknowledge the validity of the account data by storing the recorded data in a temporary block. They can also send a confirmation to the node that initiated the operation.
[0049] 2.3) Smart contracts are computerized protocols that can enforce the terms of a contract. They are implemented through code deployed on a shared ledger that is executed when certain conditions are met. Based on actual business needs, the code is used to complete automated transactions, such as querying the logistics status of a buyer's purchased goods and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts that process received information.
[0050] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0051] The following describes the storage capacity determination method provided by the present application. The present application provides method operation steps as described in the embodiments or flowcharts, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or server product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment).
[0052] See also Figure 2 , Figure 2 is a schematic diagram of another storage capacity determination system provided by an embodiment of the present application, such as Figure 2 As shown, the system may include a client 01 and a server 02. In the embodiments of this specification, client 01 may be used to provide program processing services to users. Optionally, client 01 may include physical devices such as smartphones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. It may also include software running on the above-mentioned physical devices, such as applications and websites.
[0053] In an embodiment of the present application, the server 02 can be used to receive a physical page query request sent by the client 01, and provide the client 01 with the number of physical pages and the physical page capacity corresponding to the target storage unit required to determine the storage capacity based on the physical page query request. Optionally, the server 02 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Specifically, the server 02 can be a storage system that provides a cloud database.
[0054] The client 01 and the server 02 can be connected directly or indirectly via wired or wireless communication, which is not limited in this application. Figure 2 The corresponding system architecture is only an architecture of a data query system provided in the embodiment of this specification. In actual application, other system architectures may also be included. For example, program processing may also be implemented on the server side.
[0055] In a specific embodiment, Figure 3 As shown, the present application provides a storage capacity determination method, which is applied to a storage capacity determination system, wherein the storage capacity determination system includes a client and at least one storage system; the method includes:
[0056] S301: The client sends a physical page query request of a target storage unit to a target storage system, where the physical page query request includes query identification information corresponding to the target storage unit.
[0057] In an embodiment of the present application, the client may be a client for managing at least one storage system, the at least one storage system may be a server with data storage capabilities, and the target storage system may be a target server with data storage capabilities. Specifically, the at least one storage system may be a relational database, such as a MySQL database. Accordingly, the client may be a MySQL client, the at least one storage system may be a MySQL server, and the target storage system may be a target MySQL server.
[0058] In an embodiment of the present application, the target storage system may include at least one storage unit, and the at least one storage unit includes the target storage unit. If the target storage system is a target server for a database, the at least one storage unit of the target storage system may be at least one database table, and the target storage unit may be a target database table in the at least one database table. Specifically, the at least one database table may include a main database table and an index database table. The main database table is used to store data, and the index database table is used to store at least one index, which is used to query the main database table.
[0059] In the embodiment of the present application, the physical page query request is used to query the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0060] In an embodiment of the present application, the client interacts with the target storage system and sends a physical page query request of the target storage unit to the target storage system, which facilitates the target storage system to manage the access rights of the client and improves the data security and stability of the target storage system.
[0061] In an optional embodiment, the communication security can be improved by encrypting the channel for interaction between the client and the target storage system. Specifically, the channel encryption method can include SSL (Secure Socket Layer) encryption.
[0062] In an optional embodiment, the physical page query request may further include a user identifier and a user password, so that the target storage system can verify the user identifier and user password in the physical query request based on at least one locally stored user identifier and the user password corresponding to the at least one locally stored user identifier, thereby authenticating the client. Specifically, the at least one user identifier may be a user ID (Identity Document, an identity identification number).
[0063] In the embodiment of the present application, the target storage system performs identity authentication on the client, thereby confirming the legitimacy of the client's identity and further improving the data security and stability of the target storage system.
[0064] In an embodiment of the present application, before sending a physical page query request of a target storage unit to a target storage system, the client needs to obtain query identification information and generate a physical page query request of the target storage unit according to the query identification information.
[0065] In an optional embodiment, if Figure 4As shown, in order to obtain the query identification information, before sending the physical page query request of the target storage unit to the target storage system, the method further includes:
[0066] S401: If the client detects a query instruction triggered by preset query operation information, query identification information is extracted from query information corresponding to the preset query operation information.
[0067] In an embodiment of the present application, the client may provide a query operation interface for the user, wherein the user may enter the query information in the query information input area of the query operation interface, and then enter the preset operation query information corresponding to the query information. The preset operation query information entered by the user may trigger the query instruction, so that the client detects the query instruction and extracts the query identification information from the query information corresponding to the preset operation query information.
[0068] In the embodiment of the present application, providing a query operation interface for the user through the client is conducive to obtaining query identification information that matches the user's needs.
[0069] In a specific embodiment, to facilitate the client's extraction of query identification information from the query information corresponding to the preset query operation information, a correspondence between the preset query operation information and the query information input area may be pre-set. When the client detects a query instruction triggered based on the preset query operation information, the client, in response to the query instruction, determines, based on the aforementioned correspondence, that the query information in the query information input area corresponds to the preset query operation information, and extracts the query identification information from the query information.
[0070] In an optional embodiment, the preset query operation information may be a query operation control clicked by the user on the query operation interface, such as a query button control on the query operation interface.
[0071] In an optional embodiment, the preset query operation information may be a query operation module pressed by the user on an input device, such as the “Enter” key on a keyboard.
[0072] In a specific embodiment, the query target of the query information may include the number of physical pages corresponding to the query target storage unit, and may also include the physical page capacity corresponding to the query target storage unit.
[0073] In an optional embodiment, two different query information input areas can be provided on the query operation interface to facilitate inputting query information with different query targets. Specifically, the query information input area can include a first query information input area and a second query information input area, wherein the first query information input area is different from the second query information input area. The first query information input area can be used to input query information where the query target information is the number of physical pages corresponding to the query target storage unit, and the second query information input area can be used to input query information where the query target information is the physical page capacity corresponding to the query target storage unit.
[0074] In an optional embodiment, corresponding preset query operation information can also be set for the above-mentioned first query information input area and the above-mentioned second query information input area respectively, so that the client can identify the query identification information from the corresponding query information based on the query instruction triggered by the corresponding preset query operation information, and generate a physical page query request of the target storage unit according to the query identification information, thereby improving the efficiency of the client in extracting the query identification information.
[0075] In an optional embodiment, the language of the query information may be a MySQL statement, which can be quickly identified by the client.
[0076] Taking query information in which the query target is the number of physical pages corresponding to the query target storage unit as an example, the query information may be "mysql>select '%innob_page_num%' of a from b where database_name='order_db_202009' limit1".
[0077] "mysql" indicates that the target storage system is a MySQL database, "%innob_page_num%" indicates the number of physical pages, and "where database_name = 'order_db_202009'limit1" indicates that the target system's system identifier is 'order_db_202009'limit1." "a" indicates query identification information, and "b" indicates the unit identifier corresponding to the system unit of the target storage system.
[0078] It can be understood that this MySQL statement means: according to the query identification information, the number of physical pages corresponding to the target storage unit is extracted from the system table of the target storage system with the system identifier "'order_db_202009'limit1".
[0079] Generally, the system table of the target storage system with the InnoDB query engine deployed is mysql.innob_table_status, and the system table of the target storage system with a non-InnoDB query engine deployed is information_schema.TABLES.
[0080] Taking the query information of the physical page capacity corresponding to the query target storage unit as an example, the query information may be "show global variables like '%innob_page_size%'".
[0081] In this case, "innob_page_size" is the physical page size. This MySQL statement displays the global parameter "physical page size."
[0082] Generally, the physical page capacity is determined based on the performance of the physical machine where the storage system resides. It is a global parameter set in the storage system and has a high stability. It is understood that the physical page capacity corresponding to the target storage unit is the physical page capacity set in the target storage system where the target storage unit resides.
[0083] In an optional embodiment, the client may further extract query target information from the query information, where the query target information represents the query target of the query information.
[0084] In an optional embodiment, the client may generate a physical page query request of the target storage unit according to the query representation information and the query target information.
[0085] In an optional embodiment, when the query target information indicates that the query target of the query information is to query the number of physical pages corresponding to the target storage unit, the physical page query request is used to request the target storage system to determine the target storage unit based on the query identification information and to query the number of physical pages corresponding to the target storage unit. For example, the query target information is "innob_page_num".
[0086] In an optional embodiment, when the query target information indicates that the query target of the query information is to query the physical page capacity corresponding to the target storage unit, the physical page query request is used to request the target storage system to determine the target storage unit based on the query identification information and to query the physical capacity corresponding to the target storage unit. For example, the query target information is "innob_page_size".
[0087] In an optional embodiment, when the query target information indicates that the query target of the query information is to query the number of physical pages and the physical page capacity corresponding to the target storage unit, the physical page query request is used to request the target storage system to determine the target storage unit based on the query identification information, and to query the number of physical pages and the physical capacity corresponding to the target storage unit. For example, the query target information is "innob_page_num" and "innob_page_size".
[0088] In an optional embodiment, the storage capacity determined by the storage capacity determination system may be the capacity corresponding to the target service. Accordingly, the query identification information may include a service identifier of the target service. Specifically, the service identifier of the target service may include, but is not limited to, a service ID, service name, and service number of the target service. The service identifier of the target service is unique. Accordingly, S403 is executed.
[0089] S403: When the query identification information includes the service identification of the target service, the client determines the target system identification corresponding to the service identification according to preset mapping information, where the preset mapping information represents the correspondence between the service identifications of multiple services and the system identification of at least one storage system.
[0090] In actual applications, when using sharding technology to store massive data from multiple businesses, the massive data of a particular business can be stored in multiple tables in multiple storage systems. Correspondingly, a single storage system can store data from multiple businesses.
[0091] To determine the storage capacity corresponding to a target service, a correspondence between the service identifier of at least one service and the system identifier of at least one storage system can be pre-established to obtain mapping information. Based on the mapping information, a target storage system is determined from the at least one storage system. This facilitates rapid identification of the target storage system when determining the storage capacity corresponding to the target service, thereby improving storage capacity determination efficiency.
[0092] Accordingly, the sending of the physical page query request of the target storage unit to the target storage system includes:
[0093] S405: The client sends a physical page query request of the target storage unit to the target storage system based on the target system identifier.
[0094] In an embodiment of the present application, the client determines a target storage system from at least one storage system based on the target system identifier. The client also generates the physical page query request based on the target system identifier. Then, the client sends the physical page query request to the target storage system.
[0095] In an optional embodiment, the storage capacity determined by the storage capacity determination system may also be the capacity corresponding to the target storage system. Accordingly, the query identification information may include the system identifier of the target storage system. Specifically, the system identifier of the target storage system may include, but is not limited to, the system ID, system name, and system number of the target storage system. The system identifier of the target storage system is unique.
[0096] Accordingly, the sending of the physical page query request of the target storage unit to the target storage system includes:
[0097] S407: When the query identification information includes the system identification of the target storage system, a physical page query request of the target storage unit is sent to the target storage system based on the system identification of the target storage system.
[0098] In an embodiment of the present application, the client determines a target storage system from at least one storage system based on the system identifier of the target storage system. The client also generates the physical page query request based on the system identifier of the target storage system. Furthermore, the client sends the physical page query request to the target storage system.
[0099] In an optional embodiment, the storage capacity determined by the storage capacity determination system may also be the capacity corresponding to the target storage unit. Accordingly, the query identification information may include the system identification of the target storage system and the unit identification of the target storage unit. Specifically, the unit identification of the target storage unit may include, but is not limited to, the unit ID, unit name, and unit number of the target storage unit. The unit identification of the target storage unit is unique. The target storage unit is located in the target storage system.
[0100] Accordingly, the sending of the physical page query request of the target storage unit to the target storage system includes:
[0101] S409: When the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit, a physical page query request of the target storage unit is sent to the target storage system based on the system identification of the target storage system and the unit identification of the target storage unit.
[0102] In an embodiment of the present application, the client determines a target storage system from at least one storage system based on the system identifier of the target storage system. The client also generates the physical page query request based on the system identifier of the target storage system and the unit identifier of the target storage unit. Furthermore, the client sends the physical page query request to the target storage system.
[0103] S303: The target storage system determines the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit.
[0104] In practice, a physical page is a unit of capacity measurement in storage systems, used to measure the disk capacity occupied by each storage unit in the system. Each physical page maps to a fixed disk capacity, determined by the disk performance of the physical server hosting the database server. Typically, the physical page capacity for a MySQL server is 16KB (kilobytes).
[0105] In the embodiment of the present application, the target storage system is queried to obtain the exact number of physical pages and physical page capacity corresponding to the target storage unit, which can provide data support for accurately determining the capacity corresponding to the target storage unit.
[0106] In a specific embodiment, Figure 5 As shown, the target storage system determines the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit, including:
[0107] S501: Determine the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit.
[0108] In an optional embodiment, the target storage system may pre-establish a correspondence between the target storage unit and the query identification information. Accordingly, the target storage system may determine the target storage unit from at least one local storage unit based on the correspondence and the query identification information.
[0109] In an optional embodiment, the target storage system may further add corresponding query identification information to the unit identification of the target storage unit when setting the unit identification of the target storage unit. Accordingly, the target storage system may determine the target storage unit from the at least one local storage unit based on the query identification information corresponding to the target storage unit and the unit identification of the at least one local storage unit.
[0110] The above methods of determining a target storage unit from at least one local storage unit can ensure that the target storage system can quickly determine the target storage unit, thereby improving the query efficiency of the target storage system.
[0111] In an optional embodiment, if the storage capacity determined by the storage capacity determination system is the capacity corresponding to the target service, the query identification information includes a service identification of the target service. Accordingly, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0112] In a case where the query identification information includes a service identifier of a target service, the target storage unit is determined from the at least one local storage unit according to the service identifier of the target service.
[0113] In the embodiment of the present application, the target storage system determines the target storage unit from at least one local storage unit according to the service identifier of the target service, and can simply and quickly determine the target storage unit storing the service data of the target service.
[0114] In an optional embodiment, the target storage system may pre-establish a correspondence between the unit identifier of the target storage unit and the service identifier of the target service, and determine the target storage unit from at least one local storage unit based on the correspondence and the service identifier.
[0115] In an optional embodiment, the target storage system may further set the unit identifier of at least one storage unit to "prefix-establishment date", where the prefix is the business identifier of the business corresponding to the business data stored in the at least one storage unit. For example, if the business identifier of the order business is "order", the prefix of the unit identifier of the storage unit storing the order business data may be set to "order". For example, if the storage unit storing the order business data was established on March 14, 2021, the establishment date may be "20210314".
[0116] Based on this, when determining the target storage unit, the target storage system can identify the service identifier corresponding to the at least one storage unit by identifying the prefix in the unit identifier of the at least one storage unit. The target storage system can determine the target storage unit from the at least one storage unit based on the service identifier of the target service and the service identifier corresponding to the at least one storage unit.
[0117] In practical applications, the prefix can be expressed in English, and the creation date can be expressed in numbers. When the target storage system identifies the prefix in the unit identifier of at least one storage unit, it can replace the numbers in the unit identifier of the at least one storage unit with a # symbol and then delete the # symbol from the replaced unit identifier of the at least one storage unit. This allows the target storage system to quickly identify the prefix in the unit identifier of the at least one storage unit.
[0118] The method for identifying a service identifier in a unit identifier of at least one storage unit provided in the embodiment of the present application is simple and easy to implement, and can further improve the processing efficiency of the target storage system.
[0119] The above embodiment can facilitate accurate determination of the capacity (data volume) corresponding to the target business, and can also facilitate separate statistics of the capacities corresponding to different businesses when there are multiple businesses, and can efficiently and accurately count the capacities corresponding to multiple businesses.
[0120] In an optional embodiment, if the storage capacity determined by the storage capacity determination system is the capacity corresponding to the target storage system, the query identification information includes the system identification of the target storage system. Accordingly, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0121] In a case where the query identification information includes a system identification of a target storage system, the at least one local storage unit is determined to be the target storage unit.
[0122] It can be understood that the capacity corresponding to the target storage system can be obtained by accumulating the capacities corresponding to at least one local storage unit of the target storage system. Therefore, in this case, the target storage unit is at least one local storage unit of the target storage system.
[0123] The above embodiment can facilitate accurate determination of the capacity corresponding to the target storage system.
[0124] In an optional embodiment, if the storage capacity determined by the storage capacity determination system is the capacity corresponding to the target storage unit of the target storage system, the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit. Accordingly, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0125] In a case where the query identification information includes the system identification of the target system and the unit identification of the target storage unit, the target storage unit is determined from the at least one local storage unit according to the unit identification of the target storage unit.
[0126] In the above embodiment, it is possible to facilitate accurate determination of the capacity corresponding to the target storage unit.
[0127] In the embodiment of the present application, when the target storage unit is determined, the target storage system can read the number of physical pages and the physical page capacity corresponding to the target storage unit from the local system unit. Accordingly, S503 is executed.
[0128] S503: Determine the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0129] In a specific embodiment, the system unit includes at least one column field and at least one row field. The position of data in the system unit can be expressed as [column field, row field].
[0130] Wherein, at least one column field includes a unit identifier of at least one storage unit, and at least one row field includes a physical page number. In the embodiment of the present application, the target storage system can read data at a location of [unit identifier of the target unit, physical page number] from the system unit to obtain the physical page number corresponding to the target storage unit.
[0131] Wherein, at least one column field also includes a system identifier of the storage system, and at least one column field also includes a physical page capacity. In the embodiment of the present application, the target storage system can read the data at the location [system identifier of the target system, physical page capacity] from the system unit to obtain the number of physical pages corresponding to the target storage unit.
[0132] Specifically, taking the storage system as a relational database as an example, as shown in Table 1, the embodiment of the present application provides a system unit as follows:
[0133] Table 1 System units
[0134] Variable_names Database_name Table_name1 Table_name2 Table_name3 Innob_index_num - 100 150 90 Innob_index_size 16KB - - -
[0135] Among them, "Variable_names" is the field name; "Database_name" is the database library identifier; "Table_name1" is database table 1; "Table_name2" is database table 2; "Table_name3" is database table 3; "Innob_index_num" is the physical page number; "Innob_index_size" is the physical page capacity.
[0136] It should be noted here that the above-mentioned system units are merely exemplary system units provided in the embodiments of the present application and are not intended to limit the form of the system units.
[0137] S305: The target storage system sends the number of physical pages and the physical page capacity corresponding to the target storage unit to the client.
[0138] S307: The client determines the capacity corresponding to the target storage unit according to the number of physical pages corresponding to the target storage unit and the physical page capacity.
[0139] In the embodiment of the present application, the client can determine the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit. Specifically, the calculation formula for the capacity corresponding to the target storage unit is as follows:
[0140] The capacity corresponding to the target storage unit = the number of physical pages corresponding to the target storage unit × the physical page capacity corresponding to the target storage unit (Formula 1). It can be understood that the unit of physical page capacity is KB, and the unit of the capacity corresponding to the target storage unit is also KB.
[0141] In an optional embodiment, the capacity corresponding to a certain storage unit may be converted into a value having a capacity unit of MB or GB according to a conversion formula between KB, MB (Megabite) and GB (Gigabite).
[0142] In the embodiment of the present application, the number of physical pages and the physical page capacity corresponding to the target storage unit are accurate data. By calculating the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit, the capacity corresponding to the target storage unit that meets the accuracy requirements can be obtained.
[0143] In an embodiment of the present application, the target storage unit is determined by the target storage system based on the query identification information in the physical page query request, which can adapt to the needs of different application scenarios, including accurate determination of the capacity corresponding to the target business, accurate determination of the capacity corresponding to the target storage system, and accurate determination of the capacity corresponding to the target storage unit.
[0144] In an optional embodiment, if Figure 6 As shown, if the storage capacity determined by the storage capacity determination system is the capacity of the target storage system, the above method further includes:
[0145] S601: The client identifies anomalies in the target storage system based on the capacity corresponding to the target storage unit.
[0146] In an embodiment of the present application, the client may accumulate the capacities corresponding to the target storage units to obtain the capacity of the target storage system.
[0147] In an optional embodiment, a capacity availability threshold corresponding to the target storage system is pre-stored in the client. Accordingly, the abnormality identification of the target storage system includes: identifying whether the capacity of the target storage system is greater than or equal to the corresponding capacity availability threshold, and determining that the capacity of the target storage system is abnormal when the capacity of the target storage system is greater than or equal to the corresponding capacity availability threshold.
[0148] In an optional embodiment, the client also pre-stores the maximum capacity growth rate corresponding to the target storage system. Accordingly, the abnormality identification of the target storage system includes: calculating the capacity growth rate corresponding to the target storage system based on the capacity corresponding to the target storage system determined multiple times and the interval time for determining the storage capacity, identifying whether the capacity growth rate corresponding to the target storage system is greater than or equal to the above-mentioned corresponding maximum capacity growth rate, and when the capacity growth rate corresponding to the target storage system is greater than or equal to the above-mentioned corresponding maximum capacity growth rate, determining that the capacity of the target storage system is abnormal.
[0149] S603: When the client identifies that the target storage system is abnormal, the client sends a data query request to the target storage system, where the data query request includes a preset query condition.
[0150] Considering that among the data stored in the target storage system, the more real-time the data is, the more important it is, while the earlier the data is stored, the less important it is.
[0151] In the embodiment of the present application, in order to optimize the capacity of the target storage system, data with low real-time performance and a long storage time are preferentially transferred out of the target storage system.
[0152] In an optional embodiment, the preset query condition may include a data storage time threshold.
[0153] In an optional embodiment, the preset query condition may include a non-real-time type of data.
[0154] S605: The target storage system determines target data from at least one local storage unit based on the preset query condition.
[0155] In an optional embodiment, when the preset query condition includes a data storage time threshold, the target storage system determines, based on the data storage time threshold, from at least one local storage unit that data with a storage time earlier than the data storage time threshold is the target data.
[0156] In an optional embodiment, when the preset query condition includes the non-real-time type of data, the target storage system determines the non-real-time type of data as the target data from at least one local storage unit according to the non-real-time type of the data.
[0157] S607: The target storage system sends the target data to the client.
[0158] S609: The client transfers the target data to a preset data storage platform.
[0159] In the embodiment of the present application, the preset data storage platform may be a big data storage platform.
[0160] In an embodiment of the present application, when the query identification information includes the system identification of the target storage system, the client can accurately determine the capacity corresponding to the target storage system based on the number of physical pages and physical page capacity corresponding to the target storage unit sent by the target storage system. The client can also promptly discover the target storage system with capacity abnormalities based on the capacity corresponding to the target storage system, take timely measures to optimize the target storage system with capacity abnormalities, and improve the storage performance and stability of the target storage system.
[0161] In an embodiment of the present application, by sending a physical page query request of a target storage unit to a target storage system through a client, the number of physical pages and the physical page capacity corresponding to the target storage unit can be obtained through direct interaction between the client and the target storage system without having to operate on the operating system corresponding to the target storage system, thereby improving the security and stability of the target storage system. By having the target storage system determine the target storage unit based on the query identification information in the physical page query request, it can adapt to the needs of different application scenarios, including the accurate determination of the capacity corresponding to the target business, the accurate determination of the capacity corresponding to the target storage system, and the accurate determination of the capacity corresponding to the target storage unit. By having the client calculate the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit, the capacity corresponding to the target storage unit can be accurately calculated based on precise data.
[0162] The embodiment of the present application also provides another method for determining storage capacity, such as Figure 7 As shown, the method includes:
[0163] S701: Send a physical page query request of a target storage unit to a target storage system, where the physical page query request includes query identification information corresponding to the target storage unit.
[0164] In an optional embodiment, before sending the physical page query request of the target storage unit to the target storage system, the method further includes:
[0165] If a query instruction triggered by preset query operation information is detected, query identification information is extracted from the query information corresponding to the preset query operation information;
[0166] In a case where the query identification information includes a service identifier of the target service, determining a target system identifier corresponding to the service identifier according to preset mapping information, wherein the preset mapping information represents a correspondence between service identifiers of multiple services and a system identifier of at least one storage system;
[0167] Accordingly, the sending of the physical page query request of the target storage unit to the target storage system includes:
[0168] Based on the target system identifier, a physical page query request of the target storage unit is sent to the target storage system.
[0169] In an optional embodiment, sending a physical page query request of a target storage unit to a target storage system includes:
[0170] In a case where the query identification information includes the system identification of the target storage system, a physical page query request of the target storage unit is sent to the target storage system based on the system identification of the target storage system.
[0171] In an optional embodiment, sending a physical page query request of a target storage unit to a target storage system includes:
[0172] When the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit, a physical page query request of the target storage unit is sent to the target storage system based on the system identification of the target storage system and the unit identification of the target storage unit.
[0173] S703: Receive the number of physical pages and the physical page capacity corresponding to the target storage unit determined based on the query identification information and sent by the target storage system.
[0174] S705: Determine the capacity corresponding to the target storage unit according to the number of physical pages corresponding to the target storage unit and the physical page capacity.
[0175] In an optional embodiment, the above method further includes:
[0176] Based on the capacity corresponding to the target storage unit, identifying abnormalities in the target storage system;
[0177] When the target storage system is identified as abnormal, a data query request is sent to the target storage system, where the data query request includes a preset query condition;
[0178] Receiving target data determined by the target storage system based on the preset query condition;
[0179] The target data is transferred to a preset data storage platform.
[0180] Specifically, the implementation principles of the above S701 and S705 are similar to the implementation principles of the above S301 and S307, and are not repeated here.
[0181] In an embodiment of the present application, a client sends a physical page query request for a target storage unit to a target storage system. Through direct interaction between the client and the target storage system, the number of physical pages and the physical page capacity corresponding to the target storage unit can be obtained without operating the target storage system's operating system, thereby improving the security and stability of the target storage system. By calculating the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit, the capacity corresponding to the target storage unit can be accurately calculated based on precise data.
[0182] The embodiment of the present application also provides another method for determining storage capacity, such as Figure 8 As shown, the method includes:
[0183] S801: Receive a physical page query request for a target storage unit sent by a client, where the physical page query request includes query identification information corresponding to the target storage unit.
[0184] S803: Determine the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit.
[0185] In an optional embodiment, determining the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit includes:
[0186] Determine the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit;
[0187] The number of physical pages and the physical page capacity corresponding to the target storage unit are determined.
[0188] In an optional embodiment, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0189] In a case where the query identification information includes a service identifier of a target service, the target storage unit is determined from the at least one local storage unit according to the service identifier of the target service.
[0190] In an optional embodiment, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0191] In a case where the query identification information includes a service identifier of a target service, the target storage unit is determined from the at least one local storage unit according to the service identifier of the target service.
[0192] In an optional embodiment, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0193] In a case where the query identification information includes a system identification of a target storage system, the at least one local storage unit is determined to be the target storage unit.
[0194] In an optional embodiment, determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes:
[0195] In a case where the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit, the target storage unit is determined from the at least one local storage unit according to the unit identification of the target storage unit.
[0196] S805: Send the number of physical pages and the physical page capacity corresponding to the target storage unit to the client, so that the client determines the capacity corresponding to the target storage unit according to the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0197] Specifically, the implementation principles of the above S803 and S805 are similar to the implementation principles of the above S303 and S305, and are not repeated here.
[0198] In an optional embodiment, the above method further includes:
[0199] receiving a data query request sent by the client, wherein the data query request includes a preset query condition;
[0200] Based on the preset query condition, determining target data from at least one local storage unit;
[0201] The target data is sent to the client.
[0202] In the embodiment of the present application, the target storage system sends target data that meets the preset query conditions to the client, which is beneficial to optimizing its own storage performance and improving its own stability.
[0203] In an embodiment of the present application, a client sends a physical page query request for a target storage unit to a target storage system. Through direct interaction between the client and the target storage system, the number of physical pages and the physical page capacity corresponding to the target storage unit can be obtained without operating on the target storage system's operating system, thereby improving the security and stability of the target storage system. The target storage system determines the target storage unit based on the query identification information in the physical page query request, thereby adapting to the needs of different application scenarios, including accurately determining the capacity corresponding to the target business, the capacity corresponding to the target storage system, and the capacity corresponding to the target storage unit.
[0204] The embodiment of the present application further provides a storage capacity determination device, which is applied to a storage capacity determination system. The storage capacity determination system includes a client and at least one storage system, such as Figure 9 As shown, the device includes:
[0205] The first sending module 901 is configured to send a physical page query request of a target storage unit by a client to a target storage system, where the physical page query request includes query identification information corresponding to the target storage unit.
[0206] The first determining module 903 is configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit in the target storage system based on the query identification information corresponding to the target storage unit.
[0207] The second sending module 905 is configured to send the target storage system the number of physical pages and the physical page capacity corresponding to the target storage unit to the client.
[0208] The second determining module 907 is configured for the client to determine the capacity corresponding to the target storage unit according to the number of physical pages corresponding to the target storage unit and the physical page capacity.
[0209] In an optional embodiment, the device further comprises:
[0210] The extraction module is configured to extract query identification information from query information corresponding to the preset query operation information if the client detects a query instruction triggered based on the preset query operation information.
[0211] The third determination module is used to determine the target system identifier corresponding to the business identifier according to preset mapping information when the query identification information includes the business identifier of the target business. The preset mapping information represents the correspondence between the business identifiers of multiple businesses and the system identifier of at least one storage system.
[0212] The first sending module 901 is further configured to send, by the client, a physical page query request of the target storage unit to the target storage system based on the target system identifier.
[0213] In an optional embodiment, the first sending module 901 is further configured to send a physical page query request of the target storage unit to the target storage system based on the system identifier of the target storage system when the query identification information includes the system identifier of the target storage system.
[0214] In an optional embodiment, the first sending module 901 is further used to send a physical page query request of the target storage unit to the target storage system based on the system identifier of the target storage system and the unit identifier of the target storage unit, when the query identification information includes the system identifier of the target storage system and the unit identifier of the target storage unit.
[0215] In an optional embodiment, the first determining module 903 includes:
[0216] The first determining unit is configured to determine, by the target storage system, the target storage unit from at least one local storage unit based on query identification information corresponding to the target storage unit.
[0217] The second determining unit is used for the target storage system to determine the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0218] In an optional embodiment, the first determining unit includes:
[0219] The first determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the service identifier of the target service when the query identification information includes the service identifier of the target service.
[0220] In an optional embodiment, the first determining unit further includes:
[0221] The second determining subunit is configured to determine, when the query identification information includes a system identification of a target storage system, that the at least one local storage unit is the target storage unit.
[0222] In an optional embodiment, the first determining unit further includes:
[0223] The third determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the unit identification of the target storage unit when the query identification information includes the system identification of the target system and the unit identification of the target storage unit.
[0224] In an optional embodiment, the device further comprises:
[0225] An identification module, configured for the client to identify anomalies of the target storage system based on the capacity corresponding to the target storage unit;
[0226] A third sending module is configured to, when the client identifies that the target storage system is abnormal, send a data query request to the target storage system, wherein the data query request includes a preset query condition;
[0227] A fourth determination module, configured to determine target data in a target storage system based on the preset query condition;
[0228] A fourth sending module, configured for the target storage system to send the target data to the client;
[0229] The dump module is used for the client to dump the target data to a preset data storage platform.
[0230] The device and method embodiments in the device embodiments are based on the same inventive concept.
[0231] The embodiment of the present application also provides a storage capacity determination device, such as Figure 10 As shown, the device includes:
[0232] A first sending module 1001 is configured to send a physical page query request of a target storage unit to a target storage system, wherein the physical page query request includes query identification information corresponding to the target storage unit;
[0233] A first receiving module 1003 is configured to receive the number of physical pages and the physical page capacity corresponding to the target storage unit determined based on the query identification information and sent by the target storage system;
[0234] The first determining module 1005 is configured to determine the capacity corresponding to the target storage unit according to the number of physical pages corresponding to the target storage unit and the physical page capacity.
[0235] In an optional embodiment, the device further comprises:
[0236] an extraction module configured to extract query identification information from query information corresponding to the preset query operation information if a query instruction triggered by the preset query operation information is detected;
[0237] a second determining module configured to determine, when the query identification information includes a service identifier of the target service, a target system identifier corresponding to the service identifier based on preset mapping information, the preset mapping information representing a correspondence between service identifiers of multiple services and a system identifier of at least one storage system;
[0238] Accordingly, the first sending module 1001 includes:
[0239] The first sending unit is configured to send a physical page query request of the target storage unit to the target storage system based on the target system identifier.
[0240] In an optional embodiment, the first sending module 1001 further includes:
[0241] The second sending unit is configured to send a physical page query request of the target storage unit to the target storage system based on the system identification of the target storage system when the query identification information includes the system identification of the target storage system.
[0242] In an optional embodiment, the first sending module 1001 further includes:
[0243] The third sending unit is used to send a physical page query request of the target storage unit to the target storage system based on the system identifier of the target storage system and the unit identifier of the target storage unit when the query identification information includes the system identifier of the target storage system and the unit identifier of the target storage unit.
[0244] In an optional embodiment, the device further comprises:
[0245] an abnormality identification module, configured to identify abnormalities of the target storage system based on the capacity corresponding to the target storage unit;
[0246] A second sending module is configured to send a data query request to the target storage system when an abnormality in the target storage system is identified, wherein the data query request includes a preset query condition;
[0247] A second receiving module, configured to receive target data determined by the target storage system based on the preset query condition;
[0248] The dump module is used to dump the target data to a preset data storage platform.
[0249] The device and method embodiments in the device embodiments are based on the same inventive concept.
[0250] The embodiment of the present application also provides another storage capacity determination device, such as Figure 11 As shown, the device includes:
[0251] A first receiving module 1101 is configured to receive a physical page query request of a target storage unit sent by a client, wherein the physical page query request includes query identification information corresponding to the target storage unit;
[0252] A first determining module 1103 is configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit;
[0253] The first sending module 1105 is configured to send the number of physical pages and the physical page capacity corresponding to the target storage unit to the client, so that the client can determine the capacity corresponding to the target storage unit according to the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0254] In an optional embodiment, the determining module 1103 includes:
[0255] A first determining unit, configured to determine the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit;
[0256] The second determining unit is configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit.
[0257] In an optional embodiment, the first determining unit includes:
[0258] The first determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the service identifier of the target service when the query identification information includes the service identifier of the target service.
[0259] In an optional embodiment, the first determining unit further includes:
[0260] The second determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the service identifier of the target service when the query identification information includes the service identifier of the target service.
[0261] In an optional embodiment, the first determining unit further includes:
[0262] The third determining subunit is configured to determine, when the query identification information includes a system identification of a target storage system, that the at least one local storage unit is the target storage unit.
[0263] In an optional embodiment, the first determining unit further includes:
[0264] The fourth determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the unit identification of the target storage unit when the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit.
[0265] In an optional embodiment, the above device further includes:
[0266] A second receiving module is configured to receive a data query request sent by the client, wherein the data query request includes a preset query condition;
[0267] A second determining module, configured to determine target data from at least one local storage unit based on the preset query condition;
[0268] The second sending module is used to send the target data to the client.
[0269] The device and method embodiments in the device embodiments are based on the same inventive concept.
[0270] An embodiment of the present application also provides a storage capacity determination device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the storage capacity determination method as described above.
[0271] The device and method embodiments of the device embodiments are based on the same inventive concept.
[0272] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or the at least one program is loaded and executed by a processor to implement the storage capacity determination method as described above.
[0273] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above.
[0274] An embodiment of the present application provides a storage capacity determination server, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the storage capacity determination method provided in the above-mentioned method embodiment.
[0275] The memory can be used to store software programs and modules. The processor executes various functional applications and storage capacity by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for the function, etc.; the data storage area can store data created based on the use of the device, etc. In addition, the memory can include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0276] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Figure 12 This is a hardware structure diagram of a server of a storage capacity determination method provided by an embodiment of the present application. Figure 12 As shown, the server 1200 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1210 (the processor 1210 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1230 for storing data, and one or more storage media 1220 (such as one or more mass storage devices) for storing application programs 1223 or data 1222. Among them, the memory 1230 and the storage medium 1220 can be temporary storage or permanent storage. The program stored in the storage medium 1220 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1210 may be configured to communicate with the storage medium 1220 to execute a series of instruction operations in the storage medium 1220 on the server 1200. The server 1200 may also include one or more power supplies 1260, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1240, and / or one or more operating systems 1221, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, etc.
[0277] The input / output interface 1240 can be used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by the communication provider of the server 1200. In one embodiment, the input / output interface 1240 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one embodiment, the input / output interface 1240 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0278] It can be understood by those skilled in the art that Figure 12 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 12 More or fewer components than shown, or with Figure 12 Different configurations shown.
[0279] An embodiment of the present application also provides a storage medium, which can be set in a server to store at least one instruction, at least one program, code set or instruction set related to a storage capacity determination method in a method embodiment. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the storage capacity determination method provided by the above method embodiment.
[0280] Optionally, in this embodiment, the storage medium may be located in at least one of a plurality of network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0281] It can be seen from the embodiments of the storage capacity determination method, device, server or storage medium provided by the present application that in the present application, by sending a physical page query request of the target storage unit to the target storage system through the client, the number of physical pages and the physical page capacity corresponding to the target storage unit can be obtained through direct interaction between the client and the target storage system without having to operate on the operating system corresponding to the target storage system, thereby improving the security and stability of the target storage system. The target storage unit is determined by the target storage system based on the query identification information in the physical page query request, which can adapt to the needs of different application scenarios, including the accurate determination of the capacity corresponding to the target business, the accurate determination of the capacity corresponding to the target storage system, and the accurate determination of the capacity corresponding to the target storage unit. The client calculates the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit, and the capacity corresponding to the target storage unit can be accurately calculated based on precise data.
[0282] It should be noted that the order of the embodiments of the present application described above is for descriptive purposes only and does not represent the superiority or inferiority of the embodiments. The above description is of specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0283] The various embodiments in this application are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the partial description of the method embodiments.
[0284] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0285] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for determining storage capacity, characterized in that: The method comprises: Sending a physical page query request of a target storage unit to a target storage system, the physical page query request including query identification information corresponding to the target storage unit; the target storage system is a target server of a database, at least one storage unit of the target storage system is at least one database table, and the target storage unit is a target database table in the at least one database table; Receive the number of physical pages and the physical page capacity corresponding to the target storage unit determined based on the query identification information and sent by the target storage system, where a physical page is a capacity measurement unit of the storage system, used to measure the disk capacity occupied by each storage unit in the storage system, and the physical page capacity corresponding to the target storage unit is the physical page capacity set in the target storage system where the target storage unit is located; The capacity corresponding to the target storage unit is determined according to the number of physical pages corresponding to the target storage unit and the physical page capacity, where the capacity corresponding to the target storage unit is the product of the number of physical pages corresponding to the target storage unit and the physical page capacity corresponding to the target storage unit.
2. The method according to claim 1, characterized in that Before sending the physical page query request of the target storage unit to the target storage system, the method further includes: If a query instruction triggered by preset query operation information is detected, query identification information is extracted from the query information corresponding to the preset query operation information; In a case where the query identification information includes a service identifier of a target service, determining a target system identifier corresponding to the service identifier according to preset mapping information, wherein the preset mapping information represents a correspondence between service identifiers of multiple services and a system identifier of at least one storage system; The sending of a physical page query request of a target storage unit to a target storage system includes: Based on the target system identifier, a physical page query request of the target storage unit is sent to the target storage system.
3. The method according to claim 2, characterized in that The sending of a physical page query request of a target storage unit to a target storage system includes: In a case where the query identification information includes the system identification of the target storage system, a physical page query request of the target storage unit is sent to the target storage system based on the system identification of the target storage system.
4. The method according to claim 2, characterized in that The sending of a physical page query request of a target storage unit to the target storage system includes: When the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit, a physical page query request of the target storage unit is sent to the target storage system based on the system identification of the target storage system and the unit identification of the target storage unit.
5. The method according to claim 3, characterized in that The method further comprises: Based on the capacity corresponding to the target storage unit, identifying abnormalities in the target storage system; When the target storage system is identified as abnormal, a data query request is sent to the target storage system, where the data query request includes a preset query condition; Receiving target data determined by the target storage system based on the preset query condition; The target data is transferred to a preset data storage platform.
6. A method for determining storage capacity, applied to a target storage system, characterized in that: The method comprises: receiving a physical page query request for a target storage unit sent by a client, the physical page query request including query identification information corresponding to the target storage unit; the target storage system is a target server of a database, at least one storage unit of the target storage system is at least one database table, and the target storage unit is a target database table in the at least one database table; Determine the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit; a physical page is a capacity measurement unit of the storage system, used to measure the disk capacity occupied by each storage unit in the storage system, and the physical page capacity corresponding to the target storage unit is the physical page capacity set in the target storage system where the target storage unit is located; The number of physical pages and the physical page capacity corresponding to the target storage unit are sent to the client, so that the client determines the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit. The capacity corresponding to the target storage unit is the product of the number of physical pages corresponding to the target storage unit and the physical page capacity corresponding to the target storage unit.
7. The method according to claim 6, characterized in that The determining, based on the query identification information corresponding to the target storage unit, the number of physical pages and the physical page capacity corresponding to the target storage unit includes: Determine the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit; The number of physical pages and the physical page capacity corresponding to the target storage unit are determined.
8. The method according to claim 7, characterized in that The determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes: In a case where the query identification information includes a service identifier of a target service, the target storage unit is determined from the at least one local storage unit according to the service identifier of the target service.
9. The method according to claim 7, characterized in that The determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes: In a case where the query identification information includes a service identifier of a target service, the target storage unit is determined from the at least one local storage unit according to the service identifier of the target service.
10. The method according to claim 7, characterized in that The determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes: In a case where the query identification information includes a system identification of a target storage system, the at least one local storage unit is determined to be the target storage unit.
11. The method according to claim 7, characterized in that The determining the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit includes: In a case where the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit, the target storage unit is determined from the at least one local storage unit according to the unit identification of the target storage unit.
12. The method according to claim 6, characterized in that The method further comprises: receiving a data query request sent by the client, wherein the data query request includes a preset query condition; Based on the preset query condition, determining target data from at least one local storage unit; The target data is sent to the client.
13. A storage capacity determination device, characterized in that: The device comprises: a sending module, configured to send a physical page query request of a target storage unit to a target storage system, wherein the physical page query request includes query identification information corresponding to the target storage unit; the target storage system is a target server of a database, at least one storage unit of the target storage system is at least one database table, and the target storage unit is a target database table in the at least one database table; a receiving module, configured to receive, from the target storage system, the number of physical pages and the physical page capacity corresponding to the target storage unit determined based on the query identification information, where a physical page is a capacity measurement unit of the storage system and is used to measure the disk capacity occupied by each storage unit in the storage system, and the physical page capacity corresponding to the target storage unit is the physical page capacity set in the target storage system where the target storage unit is located; The determination module is used to determine the capacity corresponding to the target storage unit according to the number of physical pages corresponding to the target storage unit and the physical page capacity, wherein the capacity corresponding to the target storage unit is the product of the number of physical pages corresponding to the target storage unit and the physical page capacity corresponding to the target storage unit.
14. The device according to claim 13, characterized in that The device further comprises: an extraction module configured to extract query identification information from query information corresponding to the preset query operation information if a query instruction triggered by the preset query operation information is detected; a second determining module configured to, when the query identification information includes a service identifier of a target service, determine a target system identifier corresponding to the service identifier based on preset mapping information, the preset mapping information representing a correspondence between service identifiers of multiple services and a system identifier of at least one storage system; The first sending module includes a first sending unit, configured to send a physical page query request of the target storage unit to the target storage system based on the target system identifier.
15. The device according to claim 14, characterized in that The first sending module further includes: The second sending unit is configured to send a physical page query request of the target storage unit to the target storage system based on the system identification of the target storage system when the query identification information includes the system identification of the target storage system.
16. The device according to claim 14, characterized in that The first sending module further includes: The third sending unit is used to send a physical page query request of the target storage unit to the target storage system based on the system identifier of the target storage system and the unit identifier of the target storage unit when the query identification information includes the system identifier of the target storage system and the unit identifier of the target storage unit.
17. The device according to claim 15, characterized in that The device further comprises: an abnormality identification module, configured to identify abnormalities of the target storage system based on the capacity corresponding to the target storage unit; A second sending module is configured to send a data query request to the target storage system when an abnormality in the target storage system is identified, wherein the data query request includes a preset query condition; A second receiving module, configured to receive target data determined by the target storage system based on the preset query condition; The dump module is used to dump the target data to a preset data storage platform.
18. A storage capacity determination device, applied to a target storage system, characterized in that: The device comprises: a receiving module, configured to receive a physical page query request for a target storage unit sent by a client, the physical page query request including query identification information corresponding to the target storage unit; the target storage system is a target server of a database, at least one storage unit of the target storage system is at least one database table, and the target storage unit is a target database table in the at least one database table; a determination module, configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit based on the query identification information corresponding to the target storage unit, wherein the physical page is a capacity measurement unit of the storage system and is used to measure the disk capacity occupied by each storage unit in the storage system, and the physical page capacity corresponding to the target storage unit is the physical page capacity set in the target storage system where the target storage unit is located; A sending module is used to send the number of physical pages and the physical page capacity corresponding to the target storage unit to the client, so that the client determines the capacity corresponding to the target storage unit based on the number of physical pages and the physical page capacity corresponding to the target storage unit, and the capacity corresponding to the target storage unit is the product of the number of physical pages corresponding to the target storage unit and the physical page capacity corresponding to the target storage unit.
19. The device according to claim 18, characterized in that The determination module includes: A first determining unit, configured to determine the target storage unit from at least one local storage unit based on the query identification information corresponding to the target storage unit; The second determining unit is configured to determine the number of physical pages and the physical page capacity corresponding to the target storage unit.
20. The device according to claim 19, characterized in that The first determining unit includes: The first determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the service identifier of the target service when the query identification information includes the service identifier of the target service.
21. The device according to claim 19, characterized in that The first determining unit further includes: The second determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the service identifier of the target service when the query identification information includes the service identifier of the target service.
22. The device according to claim 19, characterized in that The first determining unit further includes: The third determining subunit is configured to determine, when the query identification information includes a system identification of a target storage system, that the at least one local storage unit is the target storage unit.
23. The device according to claim 19, characterized in that The first determining unit further includes: The fourth determining subunit is configured to determine the target storage unit from the at least one local storage unit according to the unit identification of the target storage unit when the query identification information includes the system identification of the target storage system and the unit identification of the target storage unit.
24. The device according to claim 18, wherein The device further comprises: A second receiving module is configured to receive a data query request sent by the client, wherein the data query request includes a preset query condition; A second determining module, configured to determine target data from at least one local storage unit based on the preset query condition; The second sending module is used to send the target data to the client.
25. A storage capacity determination device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the storage capacity determination method as described in any one of claims 1 to 12.
26. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the storage capacity determination method according to any one of claims 1 to 12.
27. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the storage capacity determination method as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Data processing method and data processing module
CN102375779A