Performance monitoring data storage method and device, equipment and medium
By modularly processing performance monitoring data and establishing memory space mapping relationships, the problems of low utilization of performance monitoring data storage resources and low query efficiency are solved, and the effect of saving memory and improving query efficiency is achieved.
Patent Information
- Application Number
- CN202510724141.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-12
AI Technical Summary
The storage method of performance monitoring data in the prior art leads to low utilization of data storage resources and low query efficiency, especially the fixed size of array storage leads to memory waste and high query time complexity.
The performance monitoring data is stored in a unit of modular processing, and a first-level memory space is applied for based on the module information, and a second-level memory space is applied based on the offset and data amount of the module information, establish a mapping relationship between the offset and position information, and improve query efficiency.
Through modular storage, memory space is saved, query efficiency is improved, and storage resources are flexibly adjusted and fully utilized.
Smart Images

Figure CN120469649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a method, apparatus, device and medium for storing performance monitoring data. Background Art
[0002] Performance monitoring data is stored in arrays, primarily storing Boolean values. Typically, a Boolean value occupies one byte. If a module contains 30 bus measurement objects, each occupies 30 bytes, consuming a significant amount of memory. Furthermore, the array size is fixed, and if there's too much or too little reserved space, flexibility is limited. Furthermore, querying specific performance data requires traversing the entire array, increasing query time and reducing efficiency.
[0003] Therefore, how to improve the utilization rate of data storage resources and query efficiency is an urgent problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of the present invention is to provide a storage method, device, equipment and medium for performance monitoring data to solve the technical problems of low data storage resource utilization and low query efficiency.
[0005] To solve the above technical problems, the present invention provides a method for storing performance monitoring data, comprising:
[0006] Modularize the performance monitoring data in advance to obtain the corresponding module information;
[0007] Apply for the corresponding first-level memory space in the memory according to the information of each module;
[0008] Applying for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data;
[0009] Among them, one target performance monitoring data occupies one bit in the secondary memory space; in the process of querying the target performance monitoring data, a mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space.
[0010] On the one hand, the module information includes at least the identifier, the number of module objects, the module length and the offset. In the memory, the corresponding first-level memory space is requested according to the information of each module, including:
[0011] Apply for corresponding memory space in bytes according to the identifier, the number of module objects, the module length and the offset;
[0012] The memory space applied for the module information corresponding to a module is used as the primary memory space.
[0013] On the other hand, applying for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data includes:
[0014] Determine the starting position information of the target performance monitoring data according to the offset and the identifier;
[0015] determining a target module length of the target performance monitoring data according to a target data volume of the target performance monitoring data;
[0016] Determine the end position information according to the start position information and the target module length;
[0017] The location information of the target performance monitoring data is determined according to the starting location information and the ending location information, so as to apply for a secondary memory space according to the location information.
[0018] On the other hand, determining the target module length of the target performance monitoring data according to the target data volume of the target performance monitoring data includes:
[0019] Get the ratio between bytes and bits;
[0020] Performing remainder processing according to the target data volume and the ratio to determine a remainder;
[0021] If the remainder is 0, the quotient corresponding to the remainder processing is determined as the number of bytes corresponding to the target module length;
[0022] If the remainder is not 0, the quotient and remainder corresponding to the remainder processing are added together to obtain the number of bytes corresponding to the target module length.
[0023] On the other hand, applying for secondary memory space according to the location information includes:
[0024] Determining measurement attributes of the target performance monitoring data, wherein the measurement attributes include supporting module function attributes and online operation attributes;
[0025] Based on the supporting module function attributes and the online operation attributes, corresponding secondary memory space is applied for the target performance monitoring data according to the location information.
[0026] On the other hand, applying for corresponding secondary memory space for the target performance monitoring data based on the supporting module function attribute and the online operation attribute according to the location information respectively includes:
[0027] Setting the same offset according to the supporting module function attribute and the online operation attribute;
[0028] The position of the target performance monitoring data in the secondary memory space corresponding to the supporting module function attribute and the online operation attribute is determined based on the same offset and the same position information.
[0029] On the other hand, the query process of the target performance monitoring data includes:
[0030] Obtain a target identifier of the module to which the target performance monitoring data belongs;
[0031] Determining whether the target identifier is less than or equal to the total identifier;
[0032] If it is less than or equal to the total identifier, it is determined that the module to which the target performance monitoring data belongs is in the first-level memory space;
[0033] Obtaining, in the primary memory space, a module object position corresponding to the target performance monitoring data in the number of module objects;
[0034] determining a target offset according to the module object position;
[0035] Determine the location information of the secondary memory space according to the target offset;
[0036] determining an actual storage location of the target performance monitoring data according to the location information;
[0037] Determining the supporting module functional attributes corresponding to the actual storage location of the target performance monitoring data;
[0038] If the supporting module function attribute is a supporting attribute, determining a corresponding online operation attribute according to the actual storage location;
[0039] If the online operation attribute is online operation, determining that the target performance monitoring data has been queried;
[0040] If the supporting module function attribute is a non-support attribute or the online operation attribute is not online operation, it is determined that the target performance monitoring data is not found.
[0041] To solve the above technical problems, the present invention further provides a storage device for performance monitoring data, comprising:
[0042] A processing module is used to pre-process the performance monitoring data in a modular manner to obtain corresponding module information;
[0043] The first application module is used to apply for the corresponding primary memory space in the memory according to the information of each module;
[0044] A second application module is used to apply for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data;
[0045] Among them, one target performance monitoring data occupies one bit in the secondary memory space; in the process of querying the target performance monitoring data, a mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space.
[0046] To solve the above technical problems, the present invention further provides a storage device for performance monitoring data, comprising:
[0047] memory for storing computer programs;
[0048] A processor is configured to implement the steps of the method for storing performance monitoring data when executing the computer program.
[0049] To solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the performance monitoring data storage method as described above are implemented.
[0050] The beneficial effects of the present invention are as follows: first, the performance monitoring data is subsequently stored in modules obtained by modular processing, modularized and classified according to different types, and memory space is directly applied for, which limits and reduces the demand for storage space. Second, a primary memory space is applied for based on attribute information such as module information to store attribute information. In the subsequent query process, the actual setting process and the corresponding specific location of the target performance monitoring data can be quickly queried through the attribute information. Third, a secondary memory space is applied for based on the offset and data volume of the module information. In the secondary memory space, one target performance monitoring data corresponds to one bit of storage. Compared with the conventional byte storage method, memory space is saved. In the subsequent query process, since the mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space, the attribute information is found in the primary memory and then directly indexed to the secondary memory through the offset. The indexing method is added to improve the efficiency of the traversal query. At the same time, the corresponding secondary memory space is applied for in real time based on the offset and data volume, which realizes flexible adjustment and makes full use of storage resources.
[0051] In addition, the present invention also provides a storage device, equipment and medium for performance monitoring data, which have the same beneficial effects as the above-mentioned storage method for performance monitoring data. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0053] Figure 1 A flowchart of a method for storing performance monitoring data provided by an embodiment of the present invention;
[0054] Figure 2 A schematic diagram of applying for a first-level memory space provided by an embodiment of the present invention;
[0055] Figure 3 A comprehensive schematic diagram of applying for primary memory space and secondary memory space provided by an embodiment of the present invention;
[0056] Figure 4 A schematic diagram of applying for secondary memory provided by an embodiment of the present invention;
[0057] Figure 5 A flow chart of a method for querying performance monitoring data provided by an embodiment of the present invention;
[0058] Figure 6 A structural diagram of a storage device for performance monitoring data provided by an embodiment of the present invention;
[0059] Figure 7 A structural diagram of a storage device for performance monitoring data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0061] The core of the present invention is to provide a storage method, device, equipment and medium for performance monitoring data to solve the technical problems of low data storage resource utilization and low query efficiency.
[0062] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0063] Data acquisition, storage, and analysis form the core of modern digital systems. Their key role is to enable real-time data storage, dynamic display, and in-depth analysis. These functions are crucial for monitoring system status and managing experimental data. They play an indispensable role in ensuring efficient system operation and effective data utilization.
[0064] Servers are critical infrastructure for enterprise data storage and management. In some large enterprises, the number of servers can be enormous, sometimes even reaching into the millions. A Redundant Array of Independent Disks (RAID) controller is an advanced data management device specifically designed to optimize the operation of hard drives on storage servers. By creating different types of RAID arrays, RAID controllers not only provide powerful data backup solutions but also implement critical fault tolerance, ensuring data integrity and availability in the event of a single hard drive failure. Furthermore, by intelligently distributing data across multiple hard drives in the array, RAID controllers enable parallel data processing, significantly improving data read and write performance.
[0065] Given the critical role of RAID controllers in storage server operations, improving their performance and reliability, and ensuring their long-term stable operation, are crucial for maintaining the integrity and efficiency of enterprise data storage systems. This not only impacts data security and availability but also serves as the foundation for the efficient operation of the entire storage system. Furthermore, the impact of the RAID controller's monitoring system on overall performance cannot be ignored. Performance monitoring helps administrators promptly detect and identify potential performance bottlenecks, which is crucial for timely adjusting resource allocation and optimizing storage system performance. The real-time performance data provided by monitoring tools, including key metrics such as IOPS, throughput, and response time, is crucial for understanding system load and optimizing them.
[0066] Within a controller, there may be hundreds or even thousands of modules or measurement objects available for monitoring. These may be part of the hardware or firmware and possess performance indicators. Therefore, properly managing this data is crucial for accurately managing and optimizing storage resources, ensuring that enterprise data storage systems are not only stable and reliable, but also operate efficiently.
[0067] Typically, performance monitoring data is stored in memory in the form of an array. However, arrays use fixed-size data units (such as integers or floating-point numbers) to store each element, which consumes a lot of memory space when processing large amounts of data. In addition, the size of the array is fixed once initialized and is difficult to dynamically adjust according to actual needs. This may result in excessive reserved space, resulting in memory waste, or insufficient reserved space to meet storage needs. When it is necessary to query the performance data of a specific module, if the index position of the module in the array is unclear, the entire array must be traversed, which undoubtedly increases the time complexity of the query. The storage method for performance monitoring data provided by the present invention can solve the above-mentioned technical problems.
[0068] Figure 1 A flow chart of a method for storing performance monitoring data provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0069] S11: pre-processing the performance monitoring data in a modular manner to obtain corresponding module information;
[0070] S12: Apply for corresponding primary memory space in the memory according to the information of each module;
[0071] S13: applying for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data;
[0072] In the secondary memory space, one target performance monitoring data occupies one bit; in the process of querying the target performance monitoring data, a mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space.
[0073] Specifically, this embodiment stores the performance monitoring data directly into the memory in the form of module classification. The classification here is mainly based on the type function setting of the performance monitoring data, such as corresponding to the bus measurement object, or other port measurement objects. The module information here is not only the status information of setting the performance monitoring data, but also includes the offset involved in the storage process between modules to determine the location information of the performance monitoring data in the module in the memory, so that your memory traversal process can be completed quickly, thereby saving a lot of time.
[0074] The module information in this embodiment includes at least an identifier, the number of module objects, a module length and an offset. The identifier is used to distinguish different modules and is set by a number. The number of module objects corresponds to the number of performance monitoring data that exists in a module. For example, a module includes 30 types of bus measurement objects. The module length corresponds to the length occupied by the performance monitoring data, and can also be the memory space set in the module to store the performance monitoring data. It can be set in bits or bytes. Since 1 byte corresponds to 8 bits, if one performance monitoring data occupies one bit, the number of bytes can also be known. In addition, considering that the size of the module length can be dynamically adjusted, in order to reduce the number of times memory space is applied, the module length here is greater than or equal to the actual occupied length of the performance monitoring data, so that the remaining length can be subsequently expanded. The offset corresponds to the specific position of the performance monitoring data of the module in the memory space, and is used to distinguish the specific position of the performance monitoring data of other modules in the memory space.
[0075] In some embodiments, the performance monitoring data is pre-processed in a modular manner to obtain corresponding module information, including:
[0076] The type of performance monitoring data obtained;
[0077] Treat the same type of performance monitoring data as a module;
[0078] Determine the number of module objects, module length, and offset according to the data volume of performance monitoring data in a module;
[0079] Determine the identifier corresponding to each module;
[0080] The module information includes the identifier, module object number, module length, and offset.
[0081] Specifically, the same type of performance monitoring data is used as a module. When the system is restarted, the first-level memory is initialized according to the set measurement object management information, and memory space is applied for in units of modules, and a certain number of reserved values are applied.
[0082] The number of module objects, module length, and offset are determined based on the amount of performance monitoring data in a module. The identifiers corresponding to each module are also determined, and all are used as module information.
[0083] This embodiment provides modular processing of performance monitoring data to obtain module information. Primary memory space is allocated per module, and each module independently manages its own memory, reducing the coupling between modules. Modules can be easily added or removed without affecting the memory management of other modules.
[0084] Requesting corresponding primary memory space in memory based on each module's information, that is, requesting module information (attribute information) in primary memory space. In some embodiments, module information includes at least an identifier, the number of module objects, module length, and offset. Requesting corresponding primary memory space in memory based on each module's information includes:
[0085] Request the corresponding memory space in bytes according to the identifier, number of module objects, module length and offset;
[0086] The memory space applied for the module information corresponding to a module is used as the primary memory space.
[0087] Specifically, the four module information types are represented in byte format, occupying 4 bytes of memory space as the primary memory space. Note that because the specific data corresponding to each attribute exceeds the single bit representation of "1" and "0" in binary, a byte format is used here to encompass more bits for easier centralized management.
[0088] Figure 2 A schematic diagram of applying for a first-level memory space provided by an embodiment of the present invention is as follows Figure 2 As shown, during the initial module count, primary memory space is allocated per module. After the initial module count, 10 blank spaces are reserved to facilitate the addition of monitoring points as business grows. Each module occupies one double-word of memory, with the identifier, module object number, module length, and offset each occupying one byte. Primary memory space is allocated in a fixed manner and is allocated directly upon system restart based on the module count and the reserved value.
[0089] When the system needs to add a new module monitoring item, it can directly record the module number, the number of monitoring items, the module's Dword length, and the offset value in the corresponding Dword, based on the reserved space in the primary storage space. Afterwards, it only needs to recalculate and update the module information value, overwriting the old value. Because the modification is performed directly on the bit, this process can be completed easily.
[0090] This embodiment provides a method for applying for primary memory based on module attribute information. Memory allocation and release are centralized within the module, reducing the risk of memory leaks and providing a unified memory management mechanism. Furthermore, memory allocation and release logs can be recorded to facilitate debugging and monitoring.
[0091] In step S13, secondary memory space is applied for the target performance monitoring data according to the offset of each module and the data volume of the target performance monitoring data. The offset here is only the distance from the starting position to the target position, which is used to determine the location information of the target performance monitoring data.
[0092] In some embodiments, applying for secondary memory space for target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data includes:
[0093] Determine the starting position information of the target performance monitoring data according to the offset and the identifier;
[0094] determining a target module length of the target performance monitoring data according to a target data volume of the target performance monitoring data;
[0095] Determine the end position information according to the start position information and the target module length;
[0096] The location information of the target performance monitoring data is determined according to the starting location information and the ending location information, so as to apply for the secondary memory space according to the location information.
[0097] Specifically, the starting position information of the target performance monitoring data corresponding to the module can be determined based on the offset and identifier, and the target module length can be determined based on the target data volume. Here, the ending position information is determined based on the starting position information and the target module length, that is, the position information of the target performance monitoring data of the module is determined, and secondary memory space is applied for based on the position information.
[0098] Figure 3 A comprehensive schematic diagram of applying for primary memory space and secondary memory space provided by an embodiment of the present invention, such as Figure 3 As shown, the location information of the target performance monitoring data in the secondary memory can be determined based on the module offset. The location information of the performance monitoring data in multiple modules is combined side by side and distinguished by the offset.
[0099] It should be noted that in this embodiment, the secondary memory space is requested based on the location information. This may only be the location information request corresponding to the target performance monitoring data, regardless of the measurement attributes involved in querying the data, such as whether the module function is supported and whether it is online. Multiple location information requests may also be made corresponding to one or more measurement attributes of the target performance monitoring data during the query process. This is not limited here and can be set according to actual conditions.
[0100] In this embodiment, secondary memory space is applied for according to the offset and module length to store the target performance monitoring data, which will not cause waste of memory space. At the same time, memory space is dynamically applied based on the change in the amount of data of the performance monitoring data in the module, avoiding waste of memory when there is a lot of reserved space, or insufficient reserved space to meet storage requirements. Combining the flexibility of the offset and the accuracy of the data length, it can effectively manage and allocate memory resources, ensure that the allocated memory size just meets the requirements, and reduce the risk of memory overflow.
[0101] It should be noted that, in the secondary memory space, one target performance monitoring data occupies one bit, which saves memory space compared to the conventional technical solution where one target performance monitoring data occupies one byte.
[0102] When querying target performance monitoring data, it is necessary to traverse the primary memory. Using a pre-established mapping between offsets and location information, the location information of the target performance monitoring data can be directly found. This indexing improves query efficiency. Compared to conventional solutions that traverse all performance monitoring data, this embodiment shortens the traversal scope and restricts the traversal to within the module, reducing query time complexity.
[0103] The beneficial effects of the embodiments of the present invention are as follows: first, the performance monitoring data is subsequently stored in modules obtained by modular processing, modularized and classified according to different types, and memory space is directly applied for, which limits and reduces the demand for storage space. Second, a primary memory space is applied for based on attribute information such as module information to store attribute information. In the subsequent query process, the actual setting process and the corresponding specific location of the target performance monitoring data can be quickly queried through the attribute information. Third, a secondary memory space is applied for based on the offset and data volume of the module information. In the secondary memory space, one target performance monitoring data corresponds to one bit of storage. Compared with the conventional byte storage method, memory space is saved. In the subsequent query process, since the mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space, the attribute information is found in the primary memory and then directly indexed to the secondary memory by the offset. The index method is added to improve the efficiency of the traversal query. At the same time, the corresponding secondary memory space is applied for in real time based on the offset and data volume, which realizes flexible adjustment and makes full use of storage resources.
[0104] In some embodiments, determining a target module length of target performance monitoring data according to a target data volume of target performance monitoring data includes:
[0105] Get the ratio between bytes and bits;
[0106] Perform remainder processing based on the target data volume and the ratio to determine the remainder;
[0107] If the remainder is 0, the quotient corresponding to the remainder processing is determined as the number of bytes corresponding to the target module length;
[0108] If the remainder is not 0, the quotient and remainder corresponding to the remainder processing are added together to obtain the number of bytes corresponding to the target module length.
[0109] Specifically, 1 byte is 8 bits. Therefore, when the amount of performance monitoring data of a module is m, the remainder after dividing m by 8 is calculated. If the remainder is 0, it is determined to be divisible, and the quotient after the divisible is applied as the number of bytes, that is, the target module length. If the remainder is not 0, it is determined to be not divisible, and the quotient and remainder need to be added together, that is, (m / 8+1) bytes, as the target module length.
[0110] The target module length determination process provided in this embodiment uses one bit to correspond to one target performance monitoring data, thus saving memory space.
[0111] In some embodiments, considering that the target performance monitoring data needs to correspond to the setting of the measurement attribute during the query process, applying for the secondary memory space according to the location information includes:
[0112] Determine measurement attributes of target performance monitoring data, wherein the measurement attributes include supporting module function attributes and online operation attributes;
[0113] Based on the supporting module function attributes and online operation attributes, the corresponding secondary memory space is applied for the target performance monitoring data according to the location information.
[0114] Specifically, the measurement attributes of the target performance monitoring data include module function support attributes and online operation attributes. The module function support attribute indicates whether the performance monitoring data (measurement object) supports the module function, that is, whether the module function supports monitoring the measurement object. The online operation attribute indicates whether the performance monitoring data (measurement object) is running, that is, whether it is monitoring the measurement object.
[0115] The performance monitoring data under each measurement attribute occupies one bit, and the secondary memory space is applied for according to the two measurement attributes and the position information determined in the above embodiment.
[0116] It should be noted that the location information here can be the same or different under different measurement attributes, without limitation. If the location information is the same, the offset can be used to determine that the location information of the target performance monitoring data under the two measurement attributes is the same. That is, one offset corresponds to the target performance monitoring data being located at the same position under different measurement attributes. If the location information is different, different offsets are required, with one offset determining one measurement attribute. Furthermore, a mapping relationship can be established between the location information under different measurement attributes to facilitate dual determination of the target performance monitoring data.
[0117] Figure 4 A schematic diagram of applying for secondary memory provided by an embodiment of the present invention, such as Figure 4As shown in the figure, a target module length determines the amount of performance monitoring data within a module. For example, module 1 contains 32 performance monitoring data items, and its target module length is 32 bits, or 4 bytes. Offsets start at 0, and the corresponding offset for the next module, 2, is 4. Assuming that module 1 has 15 monitored objects, at least 2 bytes of storage space are required. Therefore, a DWord length should be requested for module 1. Module 1's offset is 0, and the corresponding offset for module 2 is 4. Subsequent modules can be directly requested for DWord lengths in the same manner.
[0118] This embodiment provides a method of applying for secondary memory space according to location information based on the supporting module functional attributes and online operation attributes of target performance monitoring data, so as to implement a monitoring query function for performance monitoring data and improve query efficiency.
[0119] In some embodiments, applying for corresponding secondary memory space for target performance monitoring data based on the supporting module function attributes and the online operation attributes according to the location information includes:
[0120] Set the same offset according to the supported module function attributes and online operation attributes;
[0121] The location of the target performance monitoring data in the secondary memory space corresponding to the supporting module function attributes and the online operation attributes is determined based on the same offset and the same location information.
[0122] Specifically, for the convenience of traversal, such as Figure 4 As shown, the longitudinal positions of the target performance monitoring data under different measurement objects in the secondary memory space are aligned in the same way. For example, taking module 1 as an example, the first position of the first performance monitoring data under the supporting module function attribute corresponds to the first position of the online operation attribute, that is, the same longitudinal position information can be corresponded through the same offset.
[0123] In this embodiment, the spatial length units of different measurement attributes within the module are aligned using Dwords, which facilitates traversal. When data is aligned on 32-bit boundaries in memory, the CPU can read and write data more efficiently, reducing memory access latency. Aligned data access reduces the need for out-of-bounds checks, as aligned data typically does not cross memory page boundaries. This reduces CPU overhead when accessing data.
[0124] In other embodiments, applying for corresponding secondary memory space for target performance monitoring data based on the supporting module function attributes and online operation attributes according to the location information includes:
[0125] The first offset and the second offset are respectively set according to the supporting module function attributes and the online operation attributes;
[0126] Determine first position information and second position information based on the first offset, the second offset, and the target data amount, respectively;
[0127] Apply for corresponding secondary memory space according to the first location information and the second location information respectively.
[0128] It should be noted that, contrary to the DWORD alignment in the above embodiment, in this embodiment, different position information is determined based on different offsets to apply for memory space corresponding to different measurement attributes.
[0129] This embodiment provides different location information determined based on different offsets, so as to improve the diversity and flexibility in the data storage process.
[0130] In some embodiments, the query process of target performance monitoring data includes:
[0131] Obtain the target identifier of the module to which the target performance monitoring data belongs;
[0132] Determine whether the target identifier is less than or equal to the total identifier;
[0133] If it is less than or equal to the total identifier, it is determined that the module to which the target performance monitoring data belongs is in the first-level memory space;
[0134] Obtaining the module object position corresponding to the target performance monitoring data in the module object quantity in the primary memory space;
[0135] Determine the target offset based on the module object position;
[0136] Determine the location information of the secondary memory space according to the target offset;
[0137] determining the actual storage location of the target performance monitoring data based on the location information;
[0138] Determine the functional attributes of the supporting modules corresponding to the actual storage location of the target performance monitoring data;
[0139] If the module function attribute is supported, the corresponding online operation attribute is determined according to the actual storage location;
[0140] If the online running attribute is online running, it is determined that the target performance monitoring data has been queried;
[0141] If the supported module function attribute is not supported or the online operation attribute is not online operation, it is determined that the target performance monitoring data is not queried.
[0142] Specifically, Figure 5 A flow chart of a method for querying performance monitoring data provided by an embodiment of the present invention, such as Figure 5 As shown, the method includes:
[0143] S21: Obtaining the module object position corresponding to the target performance monitoring data in the module object quantity in the first-level memory space;
[0144] S22: determining a target offset according to the module object position;
[0145] S23: Determine the location information of the secondary memory space according to the target offset;
[0146] S24: Determine the actual storage location of the target performance monitoring data according to the location information;
[0147] S25: Determine the supporting module function attribute corresponding to the actual storage location of the target performance monitoring data;
[0148] S26: Determine whether the supporting module function attribute is a supporting attribute, if so, proceed to step S27, if not, proceed to step S28;
[0149] S27: Determine the corresponding online operation attribute according to the actual storage location;
[0150] S29: Determine whether the online operation attribute is online operation. If so, proceed to step S30; if not, return to step S28;
[0151] S30: Determining that the target performance monitoring data has been queried;
[0152] S28: Determine that no target performance monitoring data is found.
[0153] Before querying or setting the monitoring performance monitoring data, it is necessary to first obtain the number of the module to which the performance monitoring data belongs. First, it is necessary to verify whether the module number meets the actual conditions, that is, to ensure that module_no is less than module_cnt, specifically whether the current identifier is less than or equal to the total identifier. If so, it is determined that the module has been stored in the primary memory space. After that, the number of the monitoring object is obtained, and the position of the module where the object is located in the secondary memory is obtained based on the offset of the module in the primary memory. Then, the object is supported based on the bit operation and the monitoring object is set. The bit operation here is determined by a judgment method in this embodiment, that is, if the supporting module function attribute is a supporting attribute, the corresponding online operation attribute is determined according to the actual storage location; if the online operation attribute is online operation, it is determined that the target performance monitoring data has been queried; if the supporting module function attribute is a non-supporting attribute or the online operation attribute is not online operation, it is determined that the target performance monitoring data has not been queried.
[0154] The data query process provided by this embodiment improves data query efficiency while quickly accessing and modifying data through bit operations. Because they are performed directly at the bit level, they have greater performance advantages than other data structures.
[0155] In other embodiments, the query process of target performance monitoring data includes:
[0156] Obtain the target identifier of the module to which the target performance monitoring data belongs;
[0157] Determine whether the target identifier is less than or equal to the total identifier;
[0158] If it is less than or equal to the total identifier, it is determined that the module to which the target performance monitoring data belongs is in the first-level memory space;
[0159] Obtaining the module object position and module length corresponding to the target performance monitoring data in the module object quantity in the primary memory space;
[0160] Determine the target offset based on the module object position;
[0161] Determine the module memory value in the secondary memory based on the module length and target offset;
[0162] After the memory value of the module to which it belongs is shifted, an XOR operation is performed to determine the query status of the target performance monitoring data.
[0163] Specifically, for example, it is necessary to set the monitoring object value of object 4 numbered as module 1, verify that the module number and object number meet the actual conditions, and then calculate and query the location of the object in the secondary memory sup_obj and on_obj.
[0164] Query the first-level memory and get the number of dwords as m and the offset as n;
[0165] Use the memcpy() function to get the module memory value num from the secondary sup_obj;
[0166] Shift the num value: num>>(32*m–4–1);
[0167] Using bitwise operations, we first shift num and then perform an XOR operation to determine whether the object supports monitoring. Similarly, we can use bitwise operations to query or set the object at the corresponding position in on_obj. This allows us to accurately query or set the performance information of the measured object, providing accurate data for querying and tuning other services.
[0168] The above describes in detail various embodiments corresponding to the method for storing performance monitoring data. On this basis, the present invention also discloses a storage device for performance monitoring data corresponding to the above method. Figure 6 This is a structural diagram of a storage device for performance monitoring data provided by an embodiment of the present invention. Figure 6 As shown, the storage device for performance monitoring data includes:
[0169] The processing module 11 is used to pre-process the performance monitoring data in a modular manner to obtain corresponding module information;
[0170] A first application module 12 is used to apply for corresponding primary memory space in the memory according to information of each module;
[0171] A second application module 13 is configured to apply for secondary memory space for target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data;
[0172] In the secondary memory space, one target performance monitoring data occupies one bit; in the process of querying the target performance monitoring data, a mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space.
[0173] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part please refer to the description of the embodiments of the method part, and will not be repeated here.
[0174] For an introduction to a storage device for performance monitoring data provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The device has the same beneficial effects as the above performance monitoring data storage method.
[0175] Figure 7 A structural diagram of a storage device for performance monitoring data provided by an embodiment of the present invention, such as Figure 7 As shown, the device includes:
[0176] Memory 21, for storing computer programs;
[0177] The processor 22 is configured to implement the steps of the method for storing performance monitoring data when executing a computer program.
[0178] The storage device for the performance monitoring data provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0179] The processor 22 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 22 may be implemented in at least one of the following hardware forms: a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array. The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is responsible for processing computing operations related to machine learning.
[0180] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211, wherein, after the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the storage method of performance monitoring data disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include but is not limited to data involved in the storage method of performance monitoring data, etc.
[0181] In some embodiments, the storage device for performance monitoring data may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a power supply 26 , and a communication bus 27 .
[0182] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the storage device for performance monitoring data, and may include more or fewer components than shown in the figure.
[0183] The processor 22 implements the performance monitoring data storage method provided in any of the above embodiments by calling instructions stored in the memory 21.
[0184] For an introduction to a storage device for performance monitoring data provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The device has the same beneficial effects as the above performance monitoring data storage method.
[0185] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 22, the steps of the above-mentioned method for storing performance monitoring data are implemented.
[0186] It is understood that if the methods in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0187] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. It has the same beneficial effects as the above performance monitoring data storage method.
[0188] Furthermore, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the method for storing performance monitoring data when executed by a processor.
[0189] For an introduction to a computer program product provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The computer program product has the same beneficial effects as the above performance monitoring data storage method.
[0190] The above is a detailed introduction to a storage method, device, equipment and medium for performance monitoring data provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.
[0191] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A method for storing performance monitoring data, characterized in that: include: Modularize the performance monitoring data in advance to obtain the corresponding module information; Apply for the corresponding first-level memory space in the memory according to the information of each module; Applying for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data; Among them, one target performance monitoring data occupies one bit in the secondary memory space; in the process of querying the target performance monitoring data, a mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space.
2. The method for storing performance monitoring data according to claim 1, wherein: Module information includes at least the identifier, the number of module objects, the module length, and the offset. In memory, the corresponding first-level memory space is requested based on the information of each module, including: Apply for corresponding memory space in bytes according to the identifier, the number of module objects, the module length and the offset; The memory space applied for the module information corresponding to a module is used as the primary memory space.
3. The method for storing performance monitoring data according to claim 1 or 2, characterized in that: Applying for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data includes: Determine the starting position information of the target performance monitoring data according to the offset and the identifier; determining a target module length of the target performance monitoring data according to a target data volume of the target performance monitoring data; Determine the end position information according to the start position information and the target module length; The location information of the target performance monitoring data is determined according to the starting location information and the ending location information, so as to apply for a secondary memory space according to the location information.
4. The method for storing performance monitoring data according to claim 3, wherein: Determining a target module length of the target performance monitoring data based on the target data volume of the target performance monitoring data includes: Get the ratio between bytes and bits; Performing remainder processing according to the target data volume and the ratio to determine a remainder; If the remainder is 0, the quotient corresponding to the remainder processing is determined as the number of bytes corresponding to the target module length; If the remainder is not 0, the quotient and remainder corresponding to the remainder processing are added together to obtain the number of bytes corresponding to the target module length.
5. The method for storing performance monitoring data according to claim 3, wherein: Applying for secondary memory space according to the location information includes: Determining measurement attributes of the target performance monitoring data, wherein the measurement attributes include supporting module function attributes and online operation attributes; Based on the supporting module function attributes and the online operation attributes, corresponding secondary memory space is applied for the target performance monitoring data according to the location information.
6. The method for storing performance monitoring data according to claim 5, wherein: Applying corresponding secondary memory space for the target performance monitoring data based on the supporting module function attribute and the online operation attribute according to the location information, including: Setting the same offset according to the supporting module function attribute and the online operation attribute; The position of the target performance monitoring data in the secondary memory space corresponding to the supporting module function attribute and the online operation attribute is determined based on the same offset and the same position information.
7. The method for storing performance monitoring data according to claim 6, wherein: The query process of the target performance monitoring data includes: Obtain a target identifier of the module to which the target performance monitoring data belongs; Determining whether the target identifier is less than or equal to the total identifier; If it is less than or equal to the total identifier, it is determined that the module to which the target performance monitoring data belongs is in the first-level memory space; Obtaining, in the primary memory space, a module object position corresponding to the target performance monitoring data in the number of module objects; determining a target offset according to the module object position; Determine the location information of the secondary memory space according to the target offset; determining an actual storage location of the target performance monitoring data according to the location information; Determining the supporting module functional attributes corresponding to the actual storage location of the target performance monitoring data; If the supporting module function attribute is a supporting attribute, determining a corresponding online operation attribute according to the actual storage location; If the online operation attribute is online operation, determining that the target performance monitoring data has been queried; If the supporting module function attribute is a non-support attribute or the online operation attribute is not online operation, it is determined that the target performance monitoring data is not found.
8. A storage device for performance monitoring data, characterized in that: include: A processing module is used to pre-process the performance monitoring data in a modular manner to obtain corresponding module information; The first application module is used to apply for the corresponding primary memory space in the memory according to the information of each module; A second application module is used to apply for secondary memory space for the target performance monitoring data based on the offset of each module information and the data volume of the corresponding target performance monitoring data; Among them, one target performance monitoring data occupies one bit in the secondary memory space; in the process of querying the target performance monitoring data, a mapping relationship between the offset and the location information of the target performance monitoring data is pre-established in the secondary memory space.
9. A storage device for performance monitoring data, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method for storing performance monitoring data according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for storing performance monitoring data according to any one of claims 1 to 7.