Data storage method, computer equipment, storage medium and program product
By directly storing performance data to the target storage device on each node, the performance data loss caused by master node failure is solved and bandwidth resource consumption is reduced.
Patent Information
- Application Number
- CN202411918576.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-12-24
AI Technical Summary
In a storage cluster, when the master node fails, the performance data of other nodes cannot be sent to the master node, resulting in the loss of performance data.
Each node obtains the target timestamp, pointer variable, node identification information and the data start storage location of the target storage device in the current cycle in the current cycle, determines the storage location through this information, and directly stores the performance data of the previous cycle into the target storage device without passing through the master node.
Avoid performance data loss caused by master node failure and reduce bandwidth resource consumption between master node and other nodes.
Smart Images

Figure CN119377017B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a data storage method, a computer device, a storage medium and a program product. Background Art
[0002] In the field of storage technology, in order to analyze the performance of a storage cluster, it is generally necessary to collect performance data of each node in the storage cluster.
[0003] In current storage clusters, generally one node is selected as the master node in the storage cluster, and other nodes send their collected performance data to the master node, which then stores the performance data in a device specifically used to store performance data.
[0004] However, since the master node may fail, during the period when the master node fails and no other node works as the master node, the performance data of other nodes will not be sent by the master node, resulting in performance data loss. Summary of the invention
[0005] In view of this, the present invention provides a data storage method, apparatus, computer equipment, storage medium and program product to solve the problem of performance data loss caused by master node failure.
[0006] In a first aspect, the present invention provides a data storage method, the method comprising:
[0007] In the current cycle, a target timestamp of a previous cycle corresponding to the current cycle, a first pointer variable, identification information of the current node, and a data starting storage position corresponding to the target storage device are obtained, wherein the first pointer variable is a pointer variable corresponding to a storage area included in the memory of the current node;
[0008] Determine the identification information of the previous cycle based on the target timestamp and the preset total acquisition duration;
[0009] Determine a first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node;
[0010] According to the first pointer variable, the target performance data of the current node collected in the previous cycle is read from the storage area included in the memory of the current node;
[0011] The target performance data is stored in the target storage device with the first storage location as the starting storage location.
[0012] A data storage method provided by the present invention has the following advantages:
[0013] This solution predetermines the storage structure of the performance data in the target storage device, so that the target storage device does not need to be managed by the master node, but each node collects its own performance data and stores it in the corresponding storage position of the target device. Specifically, in the current cycle, each node can first obtain the target timestamp of the previous cycle, the first pointer variable, the identification information of the current node, and the data starting storage position corresponding to the target storage device. Then, the current node can determine the identification information corresponding to the previous cycle according to the target timestamp and the preset total collection time. Further, according to the identification information of the previous cycle, the data starting storage position, and the identification information of the current node, the first storage position is determined in the target storage device. Finally, the current node can read the target performance data of the current node collected in the previous cycle from the storage area included in the memory of the current node, and store the target performance data in the target storage device with the calculated first storage position as the starting storage position. In summary, each node can store the collected performance data in the corresponding position in the target storage device without going through the master node. In this way, the problem of performance data loss of all nodes caused by the failure of the master node can be avoided. In addition, if all performance data is collected through the master node, it will greatly occupy the bandwidth resources between the master node and other nodes. In this solution, each node collects its own performance data and stores it in the target storage device, which can avoid the huge bandwidth resource consumption problem between the master node and other nodes.
[0014] In an optional implementation, determining the first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node includes:
[0015] Determine the second storage location according to the data starting storage location, identification information of the previous cycle, and a first preset data volume, wherein the first preset data volume is used to indicate the data volume of the performance data collected from all nodes in one cycle;
[0016] The first storage location is determined in the target storage device according to the second storage location, identification information of the current node, and a second preset data volume, wherein the second preset data volume is used to indicate a data volume of performance data of a node in a cycle.
[0017] Specifically, since the storage structure of the target storage device is fixed, this solution first determines the second storage location corresponding to the current cycle based on the data starting storage location, the identification information of the previous cycle, and the first preset data volume, and then determines the starting storage location (i.e., the first storage location) of the performance data of the current node in the performance data of the current cycle based on the second storage location, the identification information of the current node, and the second preset data volume. In this way, the current node can store its own performance data in the corresponding storage location in the target storage device without going through the master node, which can avoid the problem of performance data loss of all nodes due to the failure of the master node, and also avoid the problem of data interference because each node can read and write data in the target storage device.
[0018] In an optional implementation, according to the first pointer variable, the target performance data of the current node collected in the previous cycle is read from the storage area included in the memory of the current node, including:
[0019] Taking the storage position corresponding to the first pointer variable as the starting reading position, data equal to the second preset data amount is read from the memory, wherein the data equal to the second preset data amount is the target performance data.
[0020] Specifically, since the performance data of a node in a cycle can be stored in the storage area of the memory, in each cycle, the current node only needs to determine the starting storage position of the storage area of the current cycle in the memory according to the first pointer variable, and then directly read the data equal to the second preset data amount with the starting storage position as the starting reading position, and save it to the target storage device. In this way, each node can implement the storage operation of its own performance data without the participation of the master node, which can avoid the problem of performance data loss of all nodes due to failure of the master node.
[0021] In an optional implementation, the memory of the current node further includes a collection area, and the method further includes:
[0022] When receiving a target request, parsing the target request to obtain identification information of the target object and identification information of the target object type to which the target object belongs;
[0023] Acquire performance data corresponding to the target request according to the identification information of the target object and the identification information of the target object type;
[0024] Acquire a second pointer variable, wherein the second pointer variable is a pointer variable corresponding to the acquisition area;
[0025] The performance data corresponding to the target request is recorded in the collection area according to the second pointer variable, the identification information of the target object type and the identification information of the target object.
[0026] Specifically, in each cycle, in addition to storing the performance data of the previous cycle in the target storage device, the current node can collect performance data and store it in the collection area according to the processing of the received request of the current cycle, so that it can be stored in the target storage device in the next cycle. If the performance data corresponding to each request is directly stored in the target storage device after being collected, the complexity of calculating the storage location will be higher, and more computing resources will be occupied. Therefore, the current node can ensure the accuracy of performance data storage and reduce the occupation of computing resources through segmented processing.
[0027] In an optional implementation, recording the performance data corresponding to the target request in the collection area according to the second pointer variable, the identification information of the target object type and the identification information of the target object includes:
[0028] Determine, according to the identification information of the target object type, whether the target object type is an object type ranked first among at least one object type included in the current node;
[0029] When it is determined that the target object type is the first-ranked object type among at least one object type included in the current node, the preset offset is determined as the offset of the target object type;
[0030] Determine the offset of the target object according to the offset of the target object type and the identification information of the target object;
[0031] The performance data corresponding to the target request is recorded in the collection area according to the second pointer variable and the offset of the target object.
[0032] Specifically, since different requests correspond to different objects, a predetermined data structure is preset, and the solution can accurately determine the storage location based on the identification information of the object type corresponding to the request and the identification information of the object. Through such a data organization method, it can be ensured that the performance data can be accurately recorded in the memory, which is convenient for subsequent storage to the target storage device.
[0033] In an optional embodiment, the method further includes:
[0034] When it is determined that the target object type is not the first-ranked object type among the at least one object type included in the current node, obtaining, according to the identification information of the target object type, the offset of the previous object type ranked before the object type and the number of objects included in the previous object type;
[0035] The offset of the target object type is determined according to the offset of the previous object type, the number of objects, and a third preset data volume, wherein the third preset data volume is used to indicate the data volume of performance data of an object in a node within a period.
[0036] Specifically, when the object type is sorted and the sorting is not the first, the offset of the previous object type sorted before the target object type and the number of objects included in the previous object type can be obtained according to the identification information of the target object type; and then the offset of the target object type is determined according to the offset of the previous object type, the number of objects, and the third preset data amount. In this way, it can be ensured that the performance data can be accurately recorded in the memory, which is convenient for subsequent storage in the target storage device.
[0037] In an optional implementation, recording the performance data corresponding to the target request in the collection area according to the second pointer variable and the offset of the target object includes:
[0038] Determine a third storage location in the memory based on the second pointer variable and the offset of the target object;
[0039] The third storage location is used as the starting storage location, and the performance data corresponding to the target request is recorded in the collection area.
[0040] Specifically, the starting storage position (i.e., the third storage position) of the target object in the memory can be determined through the second pointer variable and the offset of the target object. In this way, the current node can record the performance data corresponding to the target request at the corresponding storage position of the target object in the collection area, so as to facilitate subsequent storage to the corresponding storage position of the target storage device.
[0041] In an optional embodiment, at the triggering moment of the current cycle, the indication information of the first pointer variable is modified from the first preset indication information to the second preset indication information, and the indication information of the second pointer variable is modified from the second preset indication information to the first preset indication information, wherein the first preset indication information is used to indicate the starting storage position of the first storage area in the memory, and the second preset indication information is used to indicate the starting storage position of the second storage area in the memory, the first storage area is the acquisition area in the current cycle, and the second storage area is the storage area in the current cycle.
[0042] Specifically, at the triggering moment of each cycle, the indication information of the first pointer variable and the second pointer variable are modified respectively, so that the collection area and the storage area in each cycle can be determined, so that in the current cycle, the collected performance data is recorded in the collection area, and the data in the storage area is written to the target storage device.
[0043] In an optional implementation, receiving a query instruction sent by a client;
[0044] Parse the query instruction to obtain the query target information;
[0045] According to the query target information, obtaining a query rule corresponding to the query target information;
[0046] Reading performance data corresponding to the query target information from the target storage device according to the query target information and the query rule;
[0047] The performance data corresponding to the query target information is sent to the client.
[0048] Specifically, any node can receive a query instruction from the client. After receiving the query instruction, the current node can parse the query target information and read the performance data corresponding to the query target information according to the query rule corresponding to the query target information, and feedback it to the client. This solution can also query performance data through other nodes after a node fails, which can avoid the problem of being unable to query performance data after the main node fails.
[0049] In an optional implementation, the query target information includes time period information, identification information of the query node, identification information of the query object type, and one or more elements of identification information of the query object.
[0050] Specifically, by querying different target information, refined query and diversified query performance data can be achieved, which is more convenient and more flexible.
[0051] In an optional implementation, the query target information is time period information, and the time period information includes a start time and an end time;
[0052] According to the query target information and the query rule, performance data corresponding to the query target information is read from the target storage device, including:
[0053] Determine the start timestamp according to the preset conversion rules and the start time;
[0054] Determine the starting storage position corresponding to the starting timestamp according to the data starting storage position, the starting timestamp, the preset total acquisition time, and the first preset data volume;
[0055] Determine the number of query cycles according to the start time and end time, as well as the preset cycle length;
[0056] Performance data corresponding to the time period information is read from the target storage device according to the number of query cycles, the first preset data volume, and the starting storage position corresponding to the starting timestamp.
[0057] Specifically, when the query target information is time period information, the start time can be converted to obtain a start timestamp, and then, based on the number of query cycles, the first preset data volume, and the starting storage position corresponding to the start timestamp, the corresponding performance data can be queried. In this way, the performance data corresponding to the time period information can be accurately read.
[0058] In an optional implementation, determining the starting storage position corresponding to the starting timestamp according to the data starting storage position, the starting timestamp, the preset total acquisition time, and the first preset data volume includes:
[0059] Determine the identification information of the target period corresponding to the start timestamp according to the start timestamp and the preset total acquisition duration;
[0060] According to the data starting storage position, identification information of the target cycle, and the first preset data volume, a starting storage position corresponding to the starting timestamp is determined.
[0061] Specifically, through the pre-set storage structure, any node can accurately determine the corresponding storage location and read the corresponding performance data when receiving a query instruction. In addition, query instructions can be distributed on various nodes instead of being borne entirely by the master node, which can reduce the load on the master node and achieve node load balancing in the storage cluster.
[0062] In a second aspect, the present invention provides a data storage device, the device comprising:
[0063] An acquisition module, used to acquire, in a current cycle, a target timestamp of a previous cycle corresponding to the current cycle, a first pointer variable, identification information of a current node, and a data starting storage position corresponding to a target storage device, wherein the first pointer variable is a pointer variable corresponding to a storage area included in a memory of the current node;
[0064] A determination module, used to determine the identification information of the previous cycle according to the target timestamp and the preset total acquisition duration; determine the first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node;
[0065] A reading module, used for reading the target performance data of the current node collected in the previous cycle from the storage area included in the memory of the current node according to the first pointer variable;
[0066] The storage module is used to store the target performance data in the target storage device with the first storage location as the starting storage location.
[0067] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data storage method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0068] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data storage method of the first aspect or any corresponding embodiment thereof.
[0069] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data storage method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0071] Figure 1 is a schematic diagram of the architecture of a storage cluster according to an embodiment of the present invention;
[0072] Figure 2 is a schematic diagram of a storage structure of a target storage device according to an embodiment of the present invention;
[0073] Figure 3 is a schematic diagram of a flow chart of a data storage method according to an embodiment of the present invention;
[0074] Figure 4 is a schematic diagram of the actions of collecting and saving data by the current node according to an embodiment of the present invention;
[0075] Figure 5 is a flow chart of another data storage method according to an embodiment of the present invention;
[0076] Figure 6 is a schematic diagram of a storage structure of a memory according to an embodiment of the present invention;
[0077] Figure 7 is a schematic diagram of a data structure of a node in a cycle in a target storage device according to an embodiment of the present invention;
[0078] Figure 8 is a flow chart of a data query method according to an embodiment of the present invention;
[0079] Fig. 9 is a structural block diagram of a data storage device according to an embodiment of the present invention;
[0080] Fig.10 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0082] The present invention can be applied to storage clusters, such as Figure 1 As shown, the storage cluster may include multiple nodes and target storage devices. The client may interact with any node. Each node may interact with the target storage device. For example, the target storage device may be a hard disk. A target storage area may be set in the target storage device for storing performance data, wherein the storage structure of the performance data may be organized in different levels. Figure 2 As shown, the specific hierarchical distribution can be as follows:
[0083] The first level is divided by cycle. This solution can set the preset total collection time corresponding to the data that can be stored in the target storage area, as well as the preset cycle length. Then, the number of cycles can be determined based on the preset total collection time and the preset cycle length. For example, when the preset total collection time is 1 year and the preset cycle length is 5 seconds, the number of cycles can be Each period can correspond to a timestamp (which can be the timestamp corresponding to the triggering moment of the period). Figure 2In the example, "2024-10-30 15:23:40" and "2024-10-30 15:23:45" can be the triggering time of the period, and "1730273025" and "1730273030" can be the timestamps. At the second level, the storage structure of the performance data of each period can be divided according to the nodes. At the third level, the storage structure of the performance data of each node can be divided according to the object type. For example, the object type can be a logical object and a physical object such as a volume, a volume group, a storage pool, a hard disk, and a port. Each object type includes multiple objects. For example, under the volume object type, multiple objects include volume 1, volume 2...volume N. At the fourth level, the performance data of each object can include various performance indicators corresponding to the object, such as bandwidth, latency, queue depth, input / output operations per second (IOPS), etc.
[0084] The memory of each node may include a first storage area and a second storage area. In any cycle, one storage area in the memory is used as a storage area and the other storage area is used as a collection area. Each storage area included in the memory is used to store performance data of a node in a collection cycle.
[0085] The embodiment of the present invention provides a data storage method, whereby each node in a storage cluster can collect its own performance data and save the performance data to a target storage device without forwarding through a master node, thereby reducing the occurrence of performance data loss problems.
[0086] According to an embodiment of the present invention, a data storage method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0087] In this embodiment, a data storage method is provided, which can be executed by any node in the above storage cluster. Figure 3 is a flow chart of a data storage method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0088] Step S301, in the current cycle, obtain the target timestamp of the previous cycle corresponding to the current cycle, the first pointer variable, the identification information of the current node, and the data starting storage position corresponding to the target storage device.
[0089] The first pointer variable is a pointer variable corresponding to a storage area included in the memory of the current node. The data start storage location may be a logical block address (Logical Block Address, LBA).
[0090] Specifically, the current node may be pre-set with a first pointer variable and a second pointer variable. At the triggering moment of the current cycle, the current node may modify the indication information of the first pointer variable from the first preset indication information to the second preset indication information, and modify the indication information of the second pointer variable from the second preset indication information to the first preset indication information. Among them, the second pointer variable is a pointer variable corresponding to the acquisition area, the first preset indication information is used to indicate the starting storage position of the first storage area in the memory, and the second preset indication information is used to indicate the starting storage position of the second storage area in the memory. The first preset indication information and the second preset indication information may both be information such as the starting storage position and a numerical value. The first storage area is the acquisition area in the current cycle and the storage area in the previous cycle, and the second storage area is the storage area in the current cycle and the acquisition area in the previous cycle. In this way, by periodically performing the area switching operation, it can be ensured that when one area can write the new performance data collected, the data in another area is already stable and can be read and saved.
[0091] like Figure 4 As shown, after completing the area switching operation, the current node can obtain the target timestamp of the previous cycle, the first pointer variable, the identification information of the current node, and the starting data storage position corresponding to the target storage device, and based on this information, store the performance data in the storage area in the storage position corresponding to the current cycle and the current node in the target storage device.
[0092] Step S302: Determine identification information of the previous cycle according to the target timestamp and the preset total acquisition duration.
[0093] Specifically, under the above storage structure, in the cycle dimension, the performance data corresponding to each cycle has a corresponding fixed storage location in the target storage device. Therefore, the current node can first determine the starting storage location corresponding to the current cycle in the target storage device. Accordingly, the identification information corresponding to the previous cycle can be calculated according to the target timestamp and the preset total acquisition duration. For example, the following expression can be used:
[0094] Sample-ID=Timestamp % Period
[0095] Among them, Sample-ID is the identification information of the previous period, Timestamp is the target timestamp, and Period is the preset total collection duration.
[0096] Step S303: determining a first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node.
[0097] Specifically, in the node dimension, the performance data of each node in the current cycle has a corresponding fixed storage location in the target storage device. Therefore, the current node can determine the starting storage location corresponding to the current node in the storage device in the current cycle. Accordingly, the specific steps of the above step S303 may include:
[0098] Step 1: Determine the second storage location according to the data starting storage location, identification information of the previous cycle, and the first preset data amount.
[0099] The first preset data volume may be used to indicate the data volume of the performance data of all nodes collected within a period.
[0100] For example, step 1 can be expressed as follows:
[0101] Address(Sample)=Start-Address + Sample-ID×Size_(Sample)
[0102] Wherein, Address(Sample) is the second storage location, Start-Address is the data start storage address, Sample-ID is the identification information of the previous cycle, and Size_(Sample) is the first preset data size.
[0103] Step 2: Determine the first storage location in the target storage device according to the second storage location, identification information of the current node, and the second preset data volume.
[0104] The second preset data volume is used to indicate the data volume of performance data of a node in a period.
[0105] For example, step 2 can use the following expression:
[0106] Address(Node) = Address(Sample) + Node-ID × Size(Node)
[0107] Among them, Address (Node) is the first storage location, Address (Sample) is the second storage location, Node-ID is the identification information of the current node, and Size (Node) is the second preset data size.
[0108] Step S304: read the target performance data of the current node collected in the previous cycle from the storage area included in the memory of the current node according to the first pointer variable.
[0109] Specifically, in the current cycle, the target performance data stored in the storage area of the memory of the current node is collected in the previous cycle, and the current node can use the storage position corresponding to the first pointer variable as the starting reading position to read data equal to the second preset data amount from the memory (that is, read all the performance data in the storage area). Among them, the data equal to the second preset data amount is the target performance data.
[0110] Step S305, taking the first storage location as the starting storage location, storing the target performance data in the target storage device.
[0111] Specifically, the current node may use the first storage location as the starting storage location of the target performance data, and store all the performance data in the storage area in the target storage device.
[0112] The data storage method provided in this embodiment predetermines the storage structure of the performance data in the target storage device, so that the target storage device does not need to be managed by the master node, but each node collects its own performance data and stores it in the corresponding storage position of the target device. Specifically, in the current cycle, each node can first obtain the target timestamp of the previous cycle, the first pointer variable, the identification information of the current node, and the data starting storage position corresponding to the target storage device. Then, the current node can determine the identification information corresponding to the previous cycle according to the target timestamp and the preset total collection time. Further, according to the identification information of the previous cycle, the data starting storage position, and the identification information of the current node, the first storage position is determined in the target storage device. Finally, the current node can read the target performance data of the current node collected in the previous cycle from the storage area included in the memory of the current node, and store the target performance data in the target storage device with the calculated first storage position as the starting storage position. In summary, each node can store the collected performance data in the corresponding position in the target storage device without going through the master node. In this way, the problem of performance data loss of all nodes caused by the failure of the master node can be avoided. In addition, if all performance data is collected through the master node, it will greatly occupy the bandwidth resources between the master node and other nodes. In this solution, each node collects its own performance data and stores it in the target storage device, which can avoid the huge bandwidth resource consumption problem between the master node and other nodes.
[0113] In this embodiment, a data storage method is provided, which can be executed by any node in the above storage cluster. Figure 5is a flow chart of a data storage method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0114] Step S501: when a target request is received, the target request is parsed to obtain identification information of a target object and identification information of a target object type to which the target object belongs.
[0115] The target object is any statistical object in the current node.
[0116] Specifically, Figure 4 As shown, in the current cycle, in addition to saving the performance data of the previous cycle to the target storage device, the current node still needs to continuously collect its own performance data in the current cycle and record it in the collection area of the memory. Each time the current node receives a request, it can parse the request to obtain the object identification information corresponding to the request, the identification information of the target object type to which the object belongs, and the operation instruction information. The current node can perform the read and write operations corresponding to the operation instruction information according to the operation instruction information. The above-mentioned target request is any one of the at least one request received by the current node in the current cycle, and the target request is used as an example for explanation below.
[0117] If the current node does not receive a request in the current cycle, the performance indicators corresponding to all statistical objects corresponding to the current node in the current cycle will be set to zero.
[0118] Step S502: Acquire performance data corresponding to the target request according to the identification information of the target object and the identification information of the target object type.
[0119] Specifically, the current node can determine the performance indicators that need to be recorded for the target object type based on the identification information of the target object type. In the process of performing read and write operations, the current node can record information related to each performance indicator. For example, the current node can determine the size and processing time of the target request, and determine the size and processing time of the target request as the performance data corresponding to the target request.
[0120] Step S503, obtaining a second pointer variable.
[0121] The second pointer variable is a pointer variable corresponding to the acquisition area.
[0122] Step S504: Record the performance data corresponding to the target request in the collection area according to the second pointer variable, the identification information of the object type and the identification information of the target object.
[0123] Specifically, Figure 6As shown, different business modules in the current node are used to collect performance data corresponding to different object types, and record them in the collection area of the memory and the storage location of the object type. The current node can determine the storage location corresponding to the target object according to the following specific steps:
[0124] Step 1: Determine, based on identification information of the target object type, whether the object type is the first-ranked object type among at least one object type included in the current node.
[0125] Step 2: When it is determined that the target object type is the first-ranked object type among at least one object type included in the current node, the preset offset is determined as the offset of the target object type.
[0126] For example, the preset offset may be 0. Figure 7 As shown, object type A is the first-ranked object type. When the target object type is object type A, the preset offset can be determined as the offset of the target object type.
[0127] Step three, when it is determined that the target object type is not the first object type among at least one object type included in the current node, obtain the offset of the previous object type ranked before the target object type and the number of objects included in the previous object type based on the identification information of the target object type.
[0128] Step 4: Determine the offset of the target object type according to the offset of the previous object type, the number of objects, and the third preset data amount.
[0129] The third preset data volume is used to indicate the data volume of performance data of an object in a node within a period.
[0130] For example, step 4 can use the following expression:
[0131] Offset(Object-Type-B) = Offset(Object-Type-A) + Size Of(Object-Type-A) × Max(Object-Type-A)
[0132] Among them, Offset(Object-Type-B) is the offset of the target object type, Offset(Object-Type-A) is the offset of the previous object type, Size Of(Object-Type-A) is the third preset data size, and Max(Object-Type-A) is the number of objects.
[0133] Step 5: Determine the offset of the target object according to the offset of the object type and the identification information of the target object.
[0134] For example, step five can be expressed as follows:
[0135] Offset (Object)=Offset (Object-Type-B) + Object-id
[0136] Among them, Offset(Object) is the offset of the target object, Offset(Object-Type-B) is the offset of the target object type, and Object-id is the identification information of the object.
[0137] Step six: Record the performance data corresponding to the target request in the collection area according to the second pointer variable and the offset of the target object.
[0138] Step 1, determining a third storage location in the memory according to the second pointer variable and the offset of the target object.
[0139] Step 2: Using the third storage location as the starting storage location, the performance data corresponding to the target request is recorded in the collection area.
[0140] Specifically, when the indication information of the second pointer variable is the starting storage position, the current node can determine the sum of the starting storage position of the second pointer variable and the offset of the target object as the third storage position. Alternatively, when the indication information of the second pointer variable is a numerical value, the current node can first determine the starting storage position corresponding to the numerical value based on the numerical value, and then determine the sum of the starting storage position corresponding to the numerical value and the offset of the target object as the third storage position. The current node uses the third storage position as the starting storage position, and stores the identification information and performance data corresponding to all requests related to the target object in the current cycle in the collection area.
[0141] In this way, after the collection operation of the current cycle is completed, the collection area of the current cycle will be switched to the storage area in the next cycle, and the performance data in the collection area of the current cycle will be saved to the target storage device in the next cycle.
[0142] In some optional implementations, after determining the third storage location, if the target request is the first request related to the target object received in the current cycle, the current node may use the third storage location as the starting storage location and store the performance data corresponding to the target request in the collection area. If the target request is the i-th request (i is an integer greater than 1) related to the target object in the current cycle, for any performance indicator corresponding to the target object (referred to as the first performance indicator), the value of the first performance indicator stored in the collection area for the target object in the previous cycle and the value of the first performance indicator of the target request may be superimposed to obtain the latest value of the first performance indicator of the target object.
[0143] In this way, when querying performance data in the future, the performance data can be directly read and fed back, without the need to calculate and then feed back the performance data corresponding to all requests under the target object, which can improve the query efficiency. For example, taking the IOPS performance indicator under the target object as an example, each time a request is processed, the value of the IOPS performance indicator can be directly increased by one, without recording the identification information of the request, and without calculating the number of requests when querying. Taking the bandwidth performance indicator under the target object as an example, each time a request is processed, the size of the request can be added to the value of the bandwidth performance indicator of the previous cycle. In this way, after each collection cycle, the value of the bandwidth performance indicator is the sum of all request sizes in the collection cycle.
[0144] The data storage method provided in this embodiment is that in each cycle, in addition to storing the performance data of the previous cycle in the target storage device, the current node can collect performance data and store it in the collection area according to the processing of the received request of the current cycle, so that it can be stored in the target storage device in the next cycle. If the performance data corresponding to each request is directly stored in the target storage device after being collected, the complexity of calculating the storage location will be higher, and more computing resources will be occupied. Therefore, the current node can ensure the accuracy of performance data storage and reduce the occupation of computing resources through segmented processing.
[0145] Based on the processing flow of the above data storage method, this embodiment provides a data query method, which can be executed by any node in the above storage cluster. Figure 8 is a flow chart of a data query method according to an embodiment of the present invention. Figure 8 As shown, the process includes the following steps:
[0146] Step S801: receiving a query instruction sent by a client.
[0147] Step S802: parse the query instruction to obtain query target information.
[0148] The query target information includes time period information, identification information of the query node, identification information of the query object type, and one or more elements in the identification information of the query object.
[0149] Specifically, the client can send a query instruction to any node. After the current node receives the query instruction, it can parse the query instruction to obtain the query target information.
[0150] Step S803: acquiring query rules corresponding to the query target information according to the query target information.
[0151] Specifically, since the categories of the query target information are different, the corresponding query methods are also different. Therefore, the current node can obtain the query rules corresponding to the query target information according to the query target information.
[0152] Step S804: Read performance data corresponding to the query target information from the target storage device according to the query target information and the query rule.
[0153] Specifically, since there are many combinations of query target information, some cases are taken as examples for description below.
[0154] In case 1, the query target information is time period information, and the time period information may include a start time and an end time. First, the start timestamp is determined according to the preset conversion rule and the start time. Then, the start storage position corresponding to the start timestamp is determined according to the data start storage position, the start timestamp, the preset total acquisition time, and the first preset data volume. And, according to the start time and the end time, and the preset cycle length, the number of query cycles is determined. Finally, according to the number of query cycles, the first preset data volume, and the start storage position corresponding to the start timestamp, the performance data corresponding to the time period information is read from the target storage device.
[0155] Specifically, the start time and end time can be composed of year, month, day, hour, minute, and second. The current node can convert all the start times into seconds (preset conversion rules) to obtain the start timestamp. Figure 2 As shown, the timestamp corresponding to "2024-10-3015:23:40" is "1730273025". Then, the identification information of the target period corresponding to the starting timestamp can be determined according to the starting timestamp and the preset total acquisition duration (similar to the process of calculating the identification information of the previous period, which will not be repeated here). In addition, according to the starting storage position of the data, the identification information of the target period, and the first preset data volume, the starting storage position corresponding to the starting timestamp is determined (similar to the process of calculating the second starting storage position, which will not be repeated here).
[0156] In addition, the current node can use the following expression to calculate the number of query cycles:
[0157] Count-Sample = (Timestamp-End – Timestamp-Start) / Interval
[0158] Among them, Count-Sample is the number of query cycles, Timestamp-End is the end time, Timestamp-Start is the start time, and Interval is the preset cycle length.
[0159] The current node uses the starting storage position corresponding to the starting timestamp to read data equal to the first preset data amount (that is, to read the performance data of the first cycle included in the time period information), and adds one to the value of the pre-constructed counting parameter. Then, the current node can determine the starting storage position corresponding to the second timestamp included in the time period information based on the starting storage position corresponding to the starting timestamp and the first preset data amount, and read data equal to the first preset data amount, and read the performance data of the second cycle, and add one to the value of the pre-constructed counting parameter. Similarly, when the value of the pre-constructed counting parameter is equal to the number of query cycles, it is determined that the performance data corresponding to all cycles included in the time period information are read from the target storage device.
[0160] In some optional implementations, the current node may first determine at least one timestamp based on a preset conversion rule, start time, and end time, and then calculate the starting storage position corresponding to each timestamp (similar to the method of calculating the second storage position, which will not be repeated here), and then, based on the starting storage position corresponding to each timestamp, read the performance data corresponding to each timestamp, that is, read the performance data corresponding to the time period information.
[0161] In case 2, the query target information includes time period information and identification information of the query node.
[0162] Specifically, the current node first needs to calculate the starting storage position corresponding to each timestamp in a manner similar to that in case one, and then, based on each timestamp and the preset total acquisition duration, determine the identification information of the period corresponding to each timestamp (similar to the process of calculating the identification information of the previous period, which will not be repeated here). Taking the first period (the period corresponding to any timestamp) as an example, the current node can determine the fourth storage position corresponding to the query node in the first period in the storage device based on the identification information of the first period, the starting storage position of the data, and the identification information of the query node (similar to the process of calculating the first storage position, which will not be repeated here). Furthermore, the fourth storage position can be used as the starting storage node to read data equal to the second preset data amount from the target storage device (that is, to read the performance data of the query node in the first period). After reading the performance data collected by the query node in the period corresponding to each timestamp, it is determined that the performance data corresponding to the query target information is read.
[0163] Step S805: sending the performance data corresponding to the query target information to the client.
[0164] Specifically, after obtaining the performance data corresponding to the query target information, the current node can directly send the performance data to the client.
[0165] Alternatively, in the above situation, for the performance data of any node in any cycle collected, the current node can first determine at least one object included under the node, and for each object, the object type to which the object belongs can be determined. Then, it is determined whether the object type to which the object belongs is an object type in the preset list. If so, it can be determined that the object type to which the object belongs is an object with node affiliation (for example, a port). If not, it can be determined that the object type to which the object belongs is an object with no node affiliation (for example, a storage pool, a volume). For objects with no node affiliation, for the target performance indicator corresponding to the object (any one of the at least one performance indicator corresponding to the object), the current node can calculate the value of the target performance indicator corresponding to each request related to the object received in the first cycle according to the calculation rule corresponding to the target performance indicator, and obtain the performance data corresponding to the object.
[0166] In this way, after the above processing is performed on all objects, the performance data corresponding to each object in all cycles within the time period information is fed back to the client.
[0167] When the target performance indicator is IOPS, the following expression can be used to calculate the performance data corresponding to the object:
[0168] IOPS (A1)
[0169] Among them, IOPS (A1) is the IOPS indicator value of object 1 under object type A, T is the preset cycle length, n is the identification information of the node, and IO-Count (n) is the number of requests received by the nth node in the first cycle. The number of requests related to object 1 under object type A received in the storage cluster.
[0170] For example, taking the IOPS indicator as an example, the number of requests related to volume 1 (target object) in all nodes in the first cycle of the target storage device is added together to obtain the total IOPS indicator value corresponding to volume 1.
[0171] In the data query method provided by this embodiment, any node can receive a query instruction from a client. After receiving the query instruction, the current node can parse and obtain the query target information, and read the performance data corresponding to the query target information according to the query rule corresponding to the query target information, and feed it back to the client. After a node fails, this solution can also query performance data through other nodes, which can avoid the problem of being unable to query performance data after the main node fails.
[0172] In the present embodiment, a data storage device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0173] This embodiment provides a data storage device, such as Fig. 9 As shown, including:
[0174] The acquisition module 901 is used to acquire, in the current cycle, the target timestamp of the previous cycle corresponding to the current cycle, the first pointer variable, the identification information of the current node, and the data starting storage position corresponding to the target storage device, wherein the first pointer variable is a pointer variable corresponding to the storage area included in the memory of the current node;
[0175] The determination module 902 is used to determine the identification information of the previous cycle according to the target timestamp and the preset total acquisition duration; determine the first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node;
[0176] A reading module 903 is used to read the target performance data of the current node collected in the previous cycle from the storage area included in the memory of the current node according to the first pointer variable;
[0177] The storage module 904 is used to store the target performance data in the target storage device with the first storage location as the starting storage location.
[0178] In some optional implementations, the determination module 902 is specifically configured to:
[0179] Determine the second storage location according to the data starting storage location, identification information of the previous cycle, and a first preset data volume, wherein the first preset data volume is used to indicate the data volume of the performance data collected from all nodes in one cycle;
[0180] The first storage location is determined in the target storage device according to the second storage location, identification information of the current node, and a second preset data volume, wherein the second preset data volume is used to indicate a data volume of performance data of a node in a cycle.
[0181] In some optional implementations, the reading module 903 is specifically configured to:
[0182] Taking the storage position corresponding to the first pointer variable as the starting reading position, data equal to the second preset data amount is read from the memory, wherein the data equal to the second preset data amount is the target performance data.
[0183] In some optional implementations, the memory of the current node further includes a collection area; the device further includes a recording module 905, which is used to:
[0184] When receiving a target request, parsing the target request to obtain identification information of the target object and identification information of the target object type to which the target object belongs;
[0185] Acquire performance data corresponding to the target request according to the identification information of the target object and the identification information of the target object type;
[0186] Acquire a second pointer variable, wherein the second pointer variable is a pointer variable corresponding to the acquisition area;
[0187] The performance data corresponding to the target request is recorded in the collection area according to the second pointer variable, the identification information of the target object type and the identification information of the target object.
[0188] In some optional implementations, the recording module 905 is specifically configured to:
[0189] Determine, according to the identification information of the target object type, whether the target object type is an object type ranked first among at least one object type included in the current node;
[0190] When it is determined that the target object type is the first-ranked object type among at least one object type included in the current node, the preset offset is determined as the offset of the object type;
[0191] Determine the offset of the target object according to the offset of the target object type and the identification information of the target object;
[0192] The performance data corresponding to the target request is recorded in the collection area according to the second pointer variable and the offset of the target object.
[0193] In some optional implementations, the recording module 905 is specifically configured to:
[0194] When it is determined that the target object type is not the first-ranked object type among the at least one object type included in the current node, obtaining, according to the identification information of the target object type, the offset of the previous object type ranked before the target object type and the number of objects included in the previous object type;
[0195] The offset of the target object type is determined according to the offset of the previous object type, the number of objects, and a third preset data volume, wherein the third preset data volume is used to indicate the data volume of performance data of an object in a node within a period.
[0196] In some optional implementations, the recording module 905 is specifically configured to:
[0197] Determine a third storage location in the memory based on the second pointer variable and the offset of the target object;
[0198] The third storage location is used as the starting storage location, and the performance data corresponding to the target request is recorded in the collection area.
[0199] In some optional implementations, the apparatus further includes a modification module 906, configured to:
[0200] At the triggering moment of the current cycle, the indication information of the first pointer variable is modified from the first preset indication information to the second preset indication information, and the indication information of the second pointer variable is modified from the second preset indication information to the first preset indication information, wherein the first preset indication information is used to indicate the starting storage position of the first storage area in the memory, and the second preset indication information is used to indicate the starting storage position of the second storage area in the memory, the first storage area is the acquisition area in the current cycle, and the second storage area is the storage area in the current cycle.
[0201] In some optional implementations, the device further includes a query module 907, which is used to:
[0202] Receive query instructions sent by the client;
[0203] Parse the query instruction to obtain the query target information;
[0204] According to the query target information, obtaining a query rule corresponding to the query target information;
[0205] Reading performance data corresponding to the query target information from the target storage device according to the query target information and the query rule;
[0206] The performance data corresponding to the query target information is sent to the client.
[0207] In some optional implementations, the query target information includes one or more elements of time period information, identification information of the query node, identification information of the query object type, and identification information of the query object.
[0208] In some optional implementations, the query target information is time period information, and the time period information includes a start time and an end time;
[0209] The query module 907 is specifically used for:
[0210] Determine the start timestamp according to the preset conversion rules and the start time;
[0211] Determine the starting storage position corresponding to the starting timestamp according to the data starting storage position, the starting timestamp, the preset total acquisition time, and the first preset data volume;
[0212] Determine the number of query cycles according to the start time and end time, as well as the preset cycle length;
[0213] Performance data corresponding to the time period information is read from the target storage device according to the number of query cycles, the first preset data volume, and the starting storage position corresponding to the starting timestamp.
[0214] In some optional implementations, the query module 907 is specifically configured to:
[0215] Determine the identification information of the target period corresponding to the start timestamp according to the start timestamp and the preset total acquisition duration;
[0216] According to the data starting storage position, identification information of the target cycle, and the first preset data volume, a starting storage position corresponding to the starting timestamp is determined.
[0217] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0218] The data storage device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0219] The embodiment of the present invention also provides a computer device having the above Fig. 9 The data storage device shown.
[0220] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.10 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.
[0221] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0222] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0223] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0224] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0225] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0226] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0227] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0228] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data storage method, characterized in that: The method comprises: In a current cycle, a target timestamp of a previous cycle corresponding to the current cycle, a first pointer variable, identification information of the current node, and a data starting storage position corresponding to a target storage device are obtained, wherein the first pointer variable is a pointer variable corresponding to a storage area included in a memory of the current node; Determine the identification information of the previous cycle according to the target timestamp and the preset total acquisition duration; Determine a first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node; According to the first pointer variable, read the target performance data of the current node collected in the previous cycle from the storage area included in the memory of the current node; The target performance data is stored in the target storage device with the first storage location as the starting storage location.
2. The method according to claim 1, characterized in that: The determining the first storage location in the target storage device according to the identification information of the previous cycle, the data starting storage location, and the identification information of the current node includes: Determine a second storage location according to the data starting storage location, the identification information of the previous cycle, and a first preset data volume, wherein the first preset data volume is used to indicate the data volume of the performance data collected from all nodes in one cycle; The first storage location is determined in the target storage device according to the second storage location, the identification information of the current node, and a second preset data volume, wherein the second preset data volume is used to indicate the data volume of performance data of a node in a cycle.
3. The method according to claim 2, characterized in that The step of reading the target performance data of the current node collected in the previous cycle from a storage area included in the memory of the current node according to the first pointer variable includes: Taking the storage position corresponding to the first pointer variable as the starting reading position, data equal to the second preset data amount is read from the memory, wherein the data equal to the second preset data amount is the target performance data.
4. The method according to claim 3, characterized in that: The memory of the current node also includes a collection area, and the method further includes: When receiving a target request, parsing the target request to obtain identification information of a target object and identification information of a target object type to which the target object belongs; Acquire performance data corresponding to the target request according to the identification information of the target object and the identification information of the target object type; Acquire a second pointer variable, wherein the second pointer variable is a pointer variable corresponding to the acquisition area; The performance data corresponding to the target request is recorded in the collection area according to the second pointer variable, the identification information of the target object type and the identification information of the target object.
5. The method according to claim 4, characterized in that The step of recording the performance data corresponding to the target request in the collection area according to the second pointer variable, the identification information of the target object type and the identification information of the target object comprises: Determining, according to the identification information of the target object type, whether the target object type is an object type ranked first among at least one object type included in the current node; When it is determined that the target object type is the first-ranked object type among the at least one object type included in the current node, determining the preset offset as the offset of the target object type; Determining the offset of the target object according to the offset of the target object type and the identification information of the target object; The performance data corresponding to the target request is recorded in the collection area according to the second pointer variable and the offset of the target object.
6. The method according to claim 5, characterized in that The method further comprises: When it is determined that the object type is not the first-ranked object type among the at least one object type included in the current node, acquiring, according to the identification information of the target object type, an offset of a previous object type ranked before the object type and the number of objects included in the previous object type; The offset of the target object type is determined according to the offset of the previous object type, the number of objects, and a third preset data volume, wherein the third preset data volume is used to indicate the data volume of performance data of an object in a node within a cycle.
7. The method according to claim 5 or 6, characterized in that: The step of recording the performance data corresponding to the target request in the collection area according to the second pointer variable and the offset of the target object includes: determining a third storage location in the memory according to the second pointer variable and the offset of the target object; Taking the third storage location as the starting storage location, the performance data corresponding to the target request is recorded in the collection area.
8. The method according to claim 4, characterized in that The method further comprises: At the triggering moment of the current cycle, the indication information of the first pointer variable is modified from the first preset indication information to the second preset indication information, and the indication information of the second pointer variable is modified from the second preset indication information to the first preset indication information, wherein the first preset indication information is used to indicate the starting storage position of the first storage area in the memory, and the second preset indication information is used to indicate the starting storage position of the second storage area in the memory, the first storage area is the acquisition area in the current cycle, and the second storage area is the storage area in the current cycle.
9. The method according to claim 2, characterized in that: The method further comprises: Receive query instructions sent by the client; Parsing the query instruction to obtain query target information; According to the query target information, obtaining a query rule corresponding to the query target information; According to the query target information and the query rule, reading performance data corresponding to the query target information from the target storage device; The performance data corresponding to the query target information is sent to the client.
10. The method according to claim 9, characterized in that The query target information includes time period information, identification information of the query node, identification information of the query object type, and one or more elements of the identification information of the query object.
11. The method according to claim 10, characterized in that The query target information is time period information, and the time period information includes a start time and an end time; The step of reading performance data corresponding to the query target information from the target storage device according to the query target information and the query rule includes: Determine a start timestamp according to a preset conversion rule and the start time; According to the data starting storage position, the starting timestamp, the preset total acquisition time, and the first preset data volume, determining the starting storage position corresponding to the starting timestamp; Determine the number of query cycles according to the start time and the end time, and a preset cycle length; Performance data corresponding to the time period information is read from the target storage device according to the number of query cycles, the first preset data volume, and a starting storage position corresponding to the starting timestamp.
12. The method according to claim 11, characterized in that The determining, according to the data starting storage position, the starting timestamp, the preset total acquisition duration, and the first preset data volume, a starting storage position corresponding to the starting timestamp includes: Determine identification information of a target period corresponding to the start timestamp according to the start timestamp and the preset total acquisition duration; A starting storage position corresponding to the starting timestamp is determined according to the data starting storage position, the identification information of the target cycle, and the first preset data amount.
13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data storage method according to any one of claims 1 to 12 by executing the computer instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data storage method according to any one of claims 1 to 12.
15. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the data storage method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method and system for storing and positioning frame data, and terminal device
CN102169709A
Data processing method and device
CN111381879A