Data operation performance statistical method, device and equipment and readable storage medium
By using two storage areas in the data operation device to take turns to store and obtain operating parameters, the problem of low statistical efficiency of data operation performance in the prior art is solved, and a more efficient performance statistical process is achieved.
Patent Information
- Application Number
- CN202411214941.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In the prior art, the statistical efficiency of data operation performance is low, resulting in cumbersome statistical process.
By determining two storage areas in the data operation device, storing operation parameters in turn, and obtaining stored operation parameters from the other storage area when one storage area is written, statistical efficiency is improved in an alternate way of writing and obtaining.
Improve the statistical efficiency of data operation performance, simplify the performance statistics process, and reduce resource consumption.
Smart Images

Figure CN119226108A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a data operation performance statistics method, device, electronic equipment and computer-readable storage medium. Background Art
[0002] Statistics on the data operation performance of storage systems are a key means of evaluating and optimizing system efficiency. Through performance statistics, we can fully understand the performance of storage systems under different workloads, so as to make decisions and optimize adjustments.
[0003] Currently, the statistics initiator first sends the statistics task to the data operation device in the storage system. The data operation device performs statistics on its own and then notifies the initiator that the statistics have been completed. Then the statistics initiator collects performance statistics of the data operation device.
[0004] However, in the current solution, the acquisition of performance statistics requires the process of issuing tasks, self-statistics, completion notification, data collection, etc., which is relatively cumbersome and leads to low efficiency of performance statistics. Summary of the invention
[0005] Embodiments of the present invention provide a data operation performance statistics method, device, electronic device and readable storage medium to solve the problem of low performance statistics efficiency caused by complicated statistical process in the prior art.
[0006] In a first aspect, an embodiment of the present invention provides a method for statistically analyzing data operation performance, including:
[0007] Determine a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs the data operation, and the operation parameters are used to describe the execution status of the data operation;
[0008] When starting to write the operating parameters into the first storage area, obtaining the operating parameters stored in the second storage area;
[0009] When starting to write the operating parameters into the second storage area, obtaining the operating parameters stored in the first storage area;
[0010] Based on the stored operating parameters, data operation performance of the data operation device is determined.
[0011] In a second aspect, an embodiment of the present invention provides a data operation performance statistics device, including:
[0012] A storage area module, used to determine a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs the data operation, and the operation parameters are used to describe the execution status of the data operation;
[0013] A first parameter module, configured to obtain the operating parameters stored in the second storage area when starting to write the operating parameters into the first storage area;
[0014] A second parameter module, configured to obtain the operating parameters stored in the first storage area when starting to write the operating parameters into the second storage area;
[0015] The performance statistics module is used to determine the data operation performance of the data operation device based on the stored operation parameters.
[0016] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus; wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0017] Memory, used to store computer programs;
[0018] The processor is used to implement the steps in the data operation performance statistics method described in the first aspect when executing the program stored in the memory.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the data operation performance statistics method described in the first aspect above.
[0020] Compared with the prior art, the present invention has the following advantages:
[0021] In the embodiment of the present invention, by determining a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs data operation, and when the operation parameters start to be written to the first storage area, the operation parameters stored in the second storage area are obtained; or when the operation parameters start to be written to the second storage area, the operation parameters stored in the first storage area are obtained; based on the stored operation parameters, the data operation performance of the data operation device is determined. It is possible to continuously write operation parameters to one storage area and continuously obtain operation parameters in another storage area to determine the data operation performance during the continuous execution of the data operation of the data operation device, and the process of alternating writing and obtaining can improve the statistical efficiency of the data operation performance.
[0022] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for describing the embodiments are briefly introduced below.
[0024] Figure 1 A step diagram of a data operation performance statistics method provided by an embodiment of the present invention;
[0025] Figure 2 A step diagram of another data operation performance statistics method provided by an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of the relationship between storage areas, threads and objects provided in an embodiment of the present invention;
[0027] Figure 4 A schematic diagram of storage area division provided by an embodiment of the present invention;
[0028] Figure 5 A schematic diagram of a data operation performance statistics device provided by an embodiment of the present invention;
[0029] Figure 6 A block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can also be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0031] Figure 1 A data operation performance statistics method provided by an embodiment of the present invention includes:
[0032] Step 101, determine a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when a data operation device performs a data operation, and the operation parameters are used to describe the execution status of the data operation.
[0033] In the disclosed embodiment, the execution subject of the data operation performance statistics method may be a performance statistics module for performing performance statistics. The data operation device is a part of the storage system, and the data operation device may be a volume, a volume group, a host, a host group, a disk, an array virtual storage management device (mdisk), a Fibre Channel card (FC, Fibre Channel Card) for connecting a storage device and a server, a Remote Direct Memory Access (RDMA, Remote Direct Memory Access) card, a Serial Attached SCSI (SAS, Serial Attached SCSI) card for connecting a server motherboard and a hard disk drive, a Non-Volatile Memory Express (NVMe (Non-Volatile Memory Express) card, etc. Data operation may refer to input / output (I / O, Input / Output).
[0034] The performance statistics module can apply for two cache resources, namely the first storage area and the second storage area, for storing performance data, namely operation parameters. The first storage area and the second storage area are used to alternately store the operation parameters, for example, the alternating process of the first storage area, the second storage area, the first storage area, etc. The operation parameters can describe the execution status of the data operation, such as the amount of data transmitted by this data operation, the delay time of this data operation, etc. The operation parameters can be written by the performance statistics module, or the writing step of the operation parameters can be handed over to other business modules for execution.
[0035] Step 102: When starting to write the operating parameters into the first storage area, obtain the operating parameters stored in the second storage area.
[0036] In the embodiment of the present disclosure, as described in step 101, the first storage area and the second storage area are used to alternately store the operating parameters, so at any time, only one storage area is used to write the operating parameters. In the case of starting to write the operating parameters to the first storage area, that is, the first storage area is currently being written. Since it is alternately stored, the second storage area may already have the written operating parameters, so the operating parameters stored in the second storage area can be obtained.
[0037] It is understandable that if the entire operation parameter writing starts from the first storage area, then when the first storage area is first written, the second storage area may not have the operation parameter written in it. If the cycle continues, the second storage area will start to be written, and the operation parameter already in the first storage area can be obtained at this time; if the cycle continues, the first storage area will be written again, and the second storage area will have the operation parameter already written in it at this time.
[0038] Step 103: When starting to write the operating parameters into the second storage area, obtain the operating parameters stored in the first storage area.
[0039] In the embodiment of the present disclosure, the specific content of step 103 is similar to step 102. When starting to write the operating parameters to the second storage area, the operating parameters stored in the first storage area can also be obtained, unless the writing of the operating parameters to the second storage area is the first writing of the entire operating parameter writing, otherwise the stored operating parameters can be obtained in the first storage area.
[0040] Step 104: Determine the data operation performance of the data operation device based on the stored operation parameters.
[0041] In the embodiments of the present disclosure, the operation parameters are used to describe the execution status of the data operation, such as the amount of data operated, the delay time and other parameters. The larger the amount of data, the stronger the data operation performance of the current data operation device, and the smaller the amount of data, the weaker the data operation performance of the current data operation device. The larger the delay time, the weaker the data operation performance of the current data operation device, and the smaller the delay time, the stronger the data operation performance of the current data operation device.
[0042] Mathematical operations can be performed based on the operating parameters to determine the specific data operating performance of the data operating device. The types of operating parameters and how to determine the data operating performance of the data operating device based on the operating parameters are not specifically limited herein.
[0043] In the embodiment of the present invention, by determining a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs data operation, and when the operation parameters start to be written to the first storage area, the operation parameters stored in the second storage area are obtained; or when the operation parameters start to be written to the second storage area, the operation parameters stored in the first storage area are obtained; based on the stored operation parameters, the data operation performance of the data operation device is determined. It is possible to continuously write operation parameters to one storage area and continuously obtain operation parameters in another storage area to determine the data operation performance during the continuous execution of the data operation of the data operation device, and the process of alternating writing and obtaining can improve the statistical efficiency of the data operation performance.
[0044] Figure 2 is a flowchart of another data transmission method provided by an embodiment of the present disclosure;
[0045] Step 201, determining a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs the data operation, and the operation parameters are used to describe the execution status of the data operation;
[0046] Step 202, when starting to write the operating parameters into the first storage area, obtaining the operating parameters stored in the second storage area;
[0047] Step 203, when starting to write the operating parameters into the second storage area, obtaining the operating parameters stored in the first storage area;
[0048] Based on the stored operating parameters, data operation performance of the data operation device is determined.
[0049] For details of the above steps 201-203, please refer to Figure 1 The contents of the embodiments will not be repeated here.
[0050] Optionally, the step 201 of determining the first storage area and the second storage area includes:
[0051] Sub-step 2011, determining a first storage area and a second storage area with the same space size;
[0052] Sub-step 2012, according to the number of threads for performing data operations, determining a plurality of sub-areas corresponding to the number of threads in the first storage area and the second storage area respectively;
[0053] Sub-step 2013, wherein there is a mapping relationship between the sub-regions and the threads, and different sub-regions are used to store operation parameters of data operations executed on different threads.
[0054] In the embodiment of the present disclosure, since the first storage area and the second storage area have the same functions, both of which are used to store operating parameters, and the alternation only occurs during the alternating storage process, the space sizes of the first storage area and the second storage area can be the same.
[0055] According to the number of threads used to perform data operations, multiple sub-areas corresponding to the number of threads can be determined in the first storage area and the second storage area respectively. The data operation device can perform data operations through threads, and the number of threads can be multiple. Multiple data operations of the data operation device can be distributed in different threads for execution. Therefore, there can be a mapping relationship between sub-areas and threads, and different sub-areas are used to store operation parameters of data operations performed on different threads. That is, if several data operations are all performed by the same thread, the operation parameters of the several data operations can be stored in the same sub-area.
[0056] Figure 3 is a schematic diagram of the relationship between storage areas, threads, and objects provided by an embodiment of the present disclosure; Figure 3 The storage device 310 includes a first storage area 311 and a second storage area 312, a plurality of threads 320, and a plurality of data operation devices 330. Each storage area has sub-areas corresponding to a plurality of threads, and the sub-areas corresponding to each thread can be used to store operation parameters corresponding to data operations performed by a plurality of data operation devices.
[0057] In the implementation of the embodiment of the present disclosure, by determining a first storage area and a second storage area of the same size, multiple sub-areas corresponding to the number of threads are determined in the first storage area and the second storage area, respectively, according to the number of threads for performing data operations. An independent storage space is allocated to each thread, which can avoid the problem that multiple threads correspond to the same storage space when more than one data operation device is in a multi-threaded working mode, solve the problem of concurrent statistics of multi-threaded programs, realize lock-free data operations, and improve the clarity and accuracy of the data operation performance statistics process.
[0058] Optionally, the method further includes:
[0059] Step A1, when the data operation device performs data operation, determining a target thread for executing the data operation and a target storage area currently used for writing operation parameters; the target storage area is any one of the first storage area and the second storage area;
[0060] Step A2, determining a target sub-area corresponding to the target thread in the target storage area according to the mapping relationship;
[0061] Step A3, obtaining operation parameters of the data operation, and writing the operation parameters into the target sub-area.
[0062] In the disclosed embodiment, when the data operation device performs data operation, it is necessary to determine the target thread for performing the data operation. The thread in which the data operation is initiated can be determined by checking the code logic and relevant codes. The thread call stack can also be analyzed, and the thread call stack can be checked through a debugging tool to find the thread where the function or method performing the data operation is located. The method of determining the target thread corresponding to the data operation is not specifically limited here.
[0063] It is also necessary to determine which target storage area is currently being written. The target storage area here can be any one of the first storage area and the second storage area. That is, no matter which storage area the target storage area is, it is suitable for the current processing step.
[0064] Then, according to the correspondence between the sub-regions and the threads, the target sub-region corresponding to the target thread is determined, and the operation parameters of the data operation can be written into the target sub-region to perform differentiated storage of the operation parameters.
[0065] In the implementation of the embodiment of the present disclosure, when the data operation device performs data operation, the target thread for performing the data operation and the current target storage area are determined, and the target sub-area corresponding to the target thread is determined according to the mapping relationship; the operation parameters of the data operation are obtained, and the operation parameters are written into the target sub-area. The operation parameters of the data operation performed by different threads can be stored separately and specifically, which improves the clarity of the operation parameter storage, facilitates the subsequent statistics of the operation parameters, and improves the convenience of performance statistics.
[0066] Optionally, there are multiple data operation devices, and each data operation device has a corresponding parameter variable in each sub-area; the method further includes:
[0067] When the data operation device performs data operation, determining a target thread for executing the data operation and a target storage area currently used for writing operation parameters; the target storage area is any one of the first storage area and the second storage area;
[0068] Determine, according to the mapping relationship, a target sub-area corresponding to the target thread in the target storage area;
[0069] Determine a target parameter variable corresponding to the data operation device in the target sub-area;
[0070] Obtain operation parameters of the data operation, and write the operation parameters into the target parameter variable.
[0071] In the embodiment of the present disclosure, there are multiple data operation devices in the storage system, and performance statistics can be performed for each data operation device. One sub-area can be used to store operation parameters of multiple data operation devices, and the implementation method can be that each data operation device has a corresponding parameter variable in each sub-area.
[0072] The process of determining the target thread, current target storage area, and target sub-area of the data operation is not described here. When writing the operation parameters, the target parameter variable corresponding to the current data operation device in the target sub-area can be determined first, and then the operation parameters of the current data operation device are written into the target parameter variable.
[0073] Figure 4 is a schematic diagram of storage area division provided by an embodiment of the present disclosure; Figure 4 It can be the first storage area or the second storage area, the storage area includes a first sub-area 401, a second sub-area 402, a third sub-area 403 and more corresponding to multiple threads respectively, each sub-area includes areas of parameter variables corresponding to multiple data operation devices respectively, the box 404 may contain the parameter variables corresponding to the first data operation device in the multiple sub-areas, and the box 405 may contain the parameter variables corresponding to the second data operation device in the multiple sub-areas.
[0074] In the implementation of the embodiment of the present disclosure, when the data operation device performs data operation, the target thread of the data operation and the current target storage area are determined, and the target sub-area corresponding to the target thread is determined according to the mapping relationship, and the target parameter variable corresponding to the data operation device in the target sub-area is determined; the operation parameter of the data operation is obtained, and the operation parameter is written into the target parameter variable. On the basis of distinguishing the sub-areas corresponding to the threads, the parameter variables of different data operation devices in the same sub-area can be further divided, thereby further clarifying the storage process of the operation parameters, facilitating the subsequent statistics of the operation parameters, and improving the convenience of performance statistics.
[0075] Optionally, the target parameter variables include operation times variables, delay time variables, and data size variables;
[0076] The step of obtaining the operation parameters of the data operation and writing the operation parameters into the target parameter variable comprises:
[0077] Obtaining the number of operations of at least one data operation performed by the data operation device, and writing the number of operations into the number of operations variable;
[0078] Obtaining a delay time of at least one data operation, and writing the delay time into the delay time variable;
[0079] The data amount of at least one data operation is obtained, and the data amount is written into the data size variable.
[0080] In the embodiment of the present disclosure, since the data operation performed by the data operation device may be at least one, obtaining the operation parameters of the data operation may include obtaining the operation number of at least one data operation, the delay time of at least one data operation, and the data volume of at least one data operation.
[0081] The number of operations is the number of at least one data operation, for example, if 5 data operations are performed, the number of operations is 5. In addition, each data operation in the at least one data operation may have a different delay time and data volume.
[0082] Then, the number of operations is written into the operation count variable, the delay time is written into the delay time variable, and the amount of data is written into the data size variable. It is understandable that the process of writing variables can be a dynamic accumulation process. When only one data operation is performed, the operation count variable is 1, the delay time variable also only stores the delay time of this data operation, and the data size variable also only stores the amount of data operated by this data operation. When continuing to perform the second data operation, the operation count variable is accumulated by 1, that is, updated to 2 on the basis of the first data operation, the delay time corresponding to the second data operation is accumulated to the delay time variable, and the amount of data corresponding to the second data operation is accumulated to the data size variable. Every time a new data operation is performed, the operation count variable, the delay time variable and the data size variable need to be cumulatively updated.
[0083] Optionally, the parameter variables corresponding to the data operation device in each sub-area carry device information of the data operation device;
[0084] The step of acquiring the operating parameters stored in the second storage area when starting to write the operating parameters to the first storage area comprises:
[0085] In the case of starting to write the operation parameters into the first storage area, determining a target data operation device for which performance statistics are to be performed, and determining target device information corresponding to the target data operation device;
[0086] According to the target device information, in each sub-area of the second storage area, determining parameter variables corresponding to the target device information one by one, so as to obtain the operation parameters stored in the second storage area from the parameter variables;
[0087] The step of acquiring the operating parameters stored in the first storage area when starting to write the operating parameters to the second storage area includes:
[0088] In the case of starting to write the operation parameters into the second storage area, determining a target data operation device for which performance statistics are to be performed, and determining target device information corresponding to the target data operation device;
[0089] According to the target device information, in each sub-area of the second storage area, parameter variables corresponding to the target device information are determined one by one, so as to obtain the operation parameters stored in the first storage area from the parameter variables.
[0090] In the embodiment of the present disclosure, since each data operation device has a corresponding parameter variable in each sub-area, device information of the corresponding data operation device can be configured for the parameter variable, so that the data operation device corresponding to each parameter variable can be determined. The device information can be a device number, and the device number can be obj1, obj2, etc. The content of the device information used to distinguish the parameter variables is not specifically limited here.
[0091] When writing the operation parameters to the first storage area, a target data operation device for which performance statistics are to be performed can be determined from among the multiple data operation devices, and target device information corresponding to the target data operation device can be determined. According to the target device information and the device information carried by each parameter variable, the parameter variable corresponding to the target device information is traversed and determined in the sub-area corresponding to each thread, and then the operation parameters of the target data operation device stored in the second storage area can be obtained from the parameter variable.
[0092] Similarly, when starting to write operating parameters to the second storage area, the target data operating device for which performance statistics are to be performed is determined, and the target device information corresponding to the target data operating device is determined. Based on the target device information, in each sub-area of the second storage area, the parameter variables corresponding to the target device information are traversed and determined, and the operating parameters stored in the first storage area can be obtained in the parameter variables.
[0093] Optionally, the first storage area and the second storage area are used to store operating parameters in turn based on a preset rotation cycle; the method further includes:
[0094] Determine a target storage area currently used for writing operation parameters;
[0095] When the target storage area is the first storage area, after the preset rotation period, the target storage area is switched to the second storage area to start writing the operation parameters to the second storage area;
[0096] When the target storage area is the second storage area, after the preset rotation period, the target storage area is switched to the first storage area to start writing the operation parameters to the first storage area.
[0097] In the embodiment of the present disclosure, the first storage area and the second storage area are used to store operating parameters in turn based on a preset rotation period. The preset rotation period can be 1 second, 5 seconds, etc. It can be understood that ping-pong cache is implemented based on the first storage area, the second storage area and the preset rotation period.
[0098] At any time, the target storage area currently used to write the operating parameters can be determined. When the target storage area is the first storage area, after a preset rotation period, such as 5 seconds, the target storage area is switched to the second storage area, and then the operating parameters can be started to be written to the second storage area, and the target storage area is switched back to the first storage area again after 5 seconds.
[0099] Similarly, when the target storage area is the second storage area, the target storage area is switched to the first storage area after the preset rotation period, so as to start writing the operating parameters to the first storage area.
[0100] In implementing the embodiments of the present disclosure, by determining the current target storage area and switching between the first storage area and the second storage area based on a preset rotation cycle, the first storage area and the second storage area take turns as the working area (working cache) for writing operation parameters, and the operation parameters in another area of the non-working area can be used for performance statistics, so that the performance statistics process will not interfere with the normal business IO operation of the data operation device.
[0101] Optionally, the step of determining the data operation performance of the data operation device based on the stored operation parameters includes:
[0102] Obtaining the number of operations stored in the operation count variable, the delay time stored in the delay time variable, and the amount of data stored in the data size variable, and obtaining a preset rotation cycle for performing rotation storage;
[0103] Determining the operation execution performance of the data operation device based on the preset rotation cycle and the number of operations;
[0104] Determining the operation delay performance of the data operation device based on the preset rotation cycle and the delay time;
[0105] Based on the preset rotation period and the data volume, an operation bandwidth performance of the data operation device is determined.
[0106] In the embodiment of the present disclosure, since the first storage area and the second storage area are alternately written based on a preset rotation cycle, and multiple data operations can be performed in each cycle, the data operation device can store data in the operation number variable, delay time variable, and data size variable in the first storage area or the second storage area in each cycle, that is, the total number of operations, the total delay time, and the total amount of data.
[0107] Based on the number of operations in each cycle, the operation execution performance of the data operation device can be calculated, that is, the input / output operations performed per second (IOPS). IOPS can measure the number of read and write operations processed by the storage system per second.
[0108] For the delay time within each cycle, the operation delay performance, namely the round-trip time (RTT), can be obtained. RTT can represent the time required for data access operations, including the response time of read and write operations.
[0109] For the amount of data in each cycle, the operation bandwidth performance, namely the bandwidth, can be calculated. The bandwidth can represent the rate at which data is transmitted in the storage system and can be measured in bytes per second.
[0110] By implementing the above method steps, performance statistics of multiple objects in the storage system can be realized. Lock-free processing of object statistics is achieved through ping-pong cache and thread-independent statistics, which improves the execution efficiency of statistics and reduces the resource consumption of the system by the performance statistics business module.
[0111] It is understandable that the above method steps can be applied to multiple data operation devices at the same time, and the current performance of each data operation device can be determined based on the operation parameters stored in the sub-areas corresponding to multiple threads of each data operation device. The health status of each data operation device can be further evaluated based on the current performance of each data operation device and the preset performance of each data operation device. If the current performance is much weaker than the preset performance, it means that the health of the current data operation device is low. According to the health of each data operation device, multiple data operation devices in the storage system can be sorted, and the sorting results can be notified to the management and operation personnel, so as to maintain the storage system in a timely and accurate manner to avoid causing systemic problems.
[0112] Figure 5 Schematic diagram of a data operation performance statistics device provided by an embodiment of the present invention, comprising:
[0113] The storage area module 501 is used to determine a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs the data operation, and the operation parameters are used to describe the execution status of the data operation;
[0114] A first parameter module 502, configured to obtain the operating parameters stored in the second storage area when starting to write the operating parameters to the first storage area;
[0115] A second parameter module 503, configured to obtain the operating parameters stored in the first storage area when starting to write the operating parameters into the second storage area;
[0116] The performance statistics module 504 is used to determine the data operation performance of the data operation device based on the stored operation parameters.
[0117] Optional, storage area module, including:
[0118] A space consistency submodule, used to determine a first storage area and a second storage area with consistent spatial sizes;
[0119] A thread division submodule, configured to determine, according to the number of threads for executing data operations, a plurality of sub-areas corresponding to the number of threads in the first storage area and the second storage area respectively;
[0120] There is a mapping relationship between the sub-areas and the threads, and different sub-areas are used to store operation parameters of data operations executed on different threads.
[0121] Optionally, the device further comprises:
[0122] A first target thread storage module, used for determining, when the data operation device performs data operation, a target thread for executing the data operation and a target storage area currently used for writing operation parameters; the target storage area is any one of the first storage area and the second storage area;
[0123] A first target sub-region module, configured to determine, according to the mapping relationship, a target sub-region corresponding to the target thread in the target storage region;
[0124] The sub-region writing module is used to obtain the operation parameters of the data operation and write the operation parameters into the target sub-region.
[0125] Optionally, there are multiple data operation devices, and each data operation device has a corresponding parameter variable in each sub-area; the apparatus further includes:
[0126] a second target thread storage module, used to determine, when the data operation device performs data operation, a target thread for executing the data operation and a target storage area currently used for writing operation parameters; the target storage area is any one of the first storage area and the second storage area;
[0127] A second target sub-region module, configured to determine, according to the mapping relationship, a target sub-region corresponding to the target thread in the target storage region;
[0128] A target variable module, used to determine a target parameter variable corresponding to the data operation device in the target sub-area;
[0129] The variable writing module is used to obtain the operation parameters of the data operation and write the operation parameters into the target parameter variable.
[0130] Optionally, the target parameter variables include operation times variables, delay time variables, and data size variables;
[0131] Variable writing module, including:
[0132] A times variable submodule, used for obtaining the number of operations of at least one data operation performed by the data operation device, and writing the number of operations into the operation times variable;
[0133] A delay variable submodule, used for obtaining a delay time of at least one data operation, and writing the delay time into the delay time variable;
[0134] The data variable submodule is used to obtain the data amount of at least one data operation and write the data amount into the data size variable.
[0135] Optionally, the parameter variables corresponding to the data operation device in each sub-area carry device information of the data operation device;
[0136] The first parameter module includes:
[0137] A first parameter writing submodule, used for determining a target data operation device for which performance statistics are to be performed, and determining target device information corresponding to the target data operation device, when starting to write operation parameters into the first storage area;
[0138] a first parameter reading submodule, configured to determine, according to the target device information, in each sub-area of the second storage area, parameter variables corresponding to the target device information one by one, so as to obtain the operation parameters stored in the second storage area from the parameter variables;
[0139] The second parameter module includes:
[0140] A second parameter writing submodule is used to determine a target data operation device for which performance statistics are to be performed and determine target device information corresponding to the target data operation device when starting to write the operation parameters to the second storage area;
[0141] The second parameter reading submodule is used to determine, according to the target device information, parameter variables corresponding to the target device information in each sub-area of the second storage area one by one, so as to obtain the operation parameters stored in the first storage area from the parameter variables.
[0142] Optionally, the first storage area and the second storage area are used to store operating parameters in turn based on a preset rotation cycle; the device also includes:
[0143] A current area determination module, used to determine a target storage area currently used to write operation parameters;
[0144] A first rotation module, configured to, when the target storage area is the first storage area, switch the target storage area to the second storage area after the preset rotation period, so as to start writing operation parameters to the second storage area;
[0145] The second rotation module is used for a module, and is used for switching the target storage area to the first storage area after the preset rotation period when the target storage area is the second storage area, so as to start writing operation parameters to the first storage area.
[0146] Optional, performance statistics module, including:
[0147] A multi-variable reading submodule, used to obtain the number of operations stored in the operation number variable, the delay time stored in the delay time variable and the amount of data stored in the data size variable, and to obtain a preset rotation period for performing rotation storage;
[0148] An operation execution performance submodule, used to determine the operation execution performance of the data operation device based on the preset rotation cycle and the number of operations;
[0149] An operation delay performance submodule, configured to determine the operation delay performance of the data operation device based on the preset rotation period and the delay time;
[0150] The operating bandwidth performance submodule is used to determine the operating bandwidth performance of the data operating device based on the preset rotation period and the data volume.
[0151] In summary, in the embodiment of the present invention, by determining a first storage area and a second storage area; the first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs data operation, and when the operation parameters start to be written to the first storage area, the operation parameters stored in the second storage area are obtained; or when the operation parameters start to be written to the second storage area, the operation parameters stored in the first storage area are obtained; based on the stored operation parameters, the data operation performance of the data operation device is determined. It is possible that during the continuous execution of the data operation of the data operation device, the operation parameters can be continuously written to one storage area, and the operation parameters can be continuously obtained in another storage area to determine the data operation performance, and the process of alternating writing and obtaining can improve the statistical efficiency of the data operation performance.
[0152] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601 , a communication interface 602 , a memory 603 and a communication bus 604 , wherein the processor 601 , the communication interface 602 , and the memory 603 communicate with each other via the communication bus 604 .
[0153] The memory 603 is used to store computer programs.
[0154] When the processor 601 is used to execute the program stored in the memory 603, the following steps are implemented: when the driver is operating the vehicle, the driving operation parameters of the vehicle are obtained; based on the driving operation parameters, different types of driving behaviors are identified, and characteristic data of at least one type of driving behavior is determined; the determined characteristic data is input into the identity recognition model to identify the current driver.
[0155] The processor 601 may also implement other steps in the above-mentioned data operation performance statistics method, which will not be described in detail here.
[0156] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0157] The communication interface is used for communication between the above electronic device and other devices.
[0158] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0159] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0160] In another embodiment of the present invention, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the data operation performance statistics method described in the above embodiment.
[0161] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute the data operation performance statistics method described in the above embodiment.
[0162] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data operation device such as a server, data center, etc. that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidStateDisk (SSD)), etc.
[0163] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0164] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For the embodiments of the device, electronic device, computer-readable storage medium and computer program products containing instructions, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0165] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A data operation performance statistics method, characterized in that: include: determining a first storage area and a second storage area; The first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs the data operation, and the operation parameters are used to describe the execution status of the data operation; When starting to write the operating parameters into the first storage area, obtaining the operating parameters stored in the second storage area; When starting to write the operating parameters into the second storage area, obtaining the operating parameters stored in the first storage area; Based on the stored operating parameters, data operation performance of the data operation device is determined.
2. The method according to claim 1, characterized in that The step of determining the first storage area and the second storage area includes: Determine a first storage area and a second storage area having the same space size; According to the number of threads for executing data operations, determining a plurality of sub-areas corresponding to the number of threads in the first storage area and the second storage area respectively; There is a mapping relationship between the sub-areas and the threads, and different sub-areas are used to store operation parameters of data operations executed on different threads.
3. The method according to claim 2, characterized in that The method further comprises: When the data operation device performs data operation, determining a target thread for executing the data operation and a target storage area currently used to write operation parameters; the target storage area is any one of the first storage area and the second storage area; Determine, according to the mapping relationship, a target sub-area corresponding to the target thread in the target storage area; An operation parameter of the data operation is obtained, and the operation parameter is written into the target sub-area.
4. The method according to claim 2, characterized in that: There are multiple data operation devices, and each data operation device has a corresponding parameter variable in each sub-area; the method further includes: When the data operation device performs data operation, determining a target thread for executing the data operation and a target storage area currently used for writing operation parameters; Determine, according to the mapping relationship, a target sub-area corresponding to the target thread in the target storage area; Determine a target parameter variable corresponding to the data operation device in the target sub-area; Obtain operation parameters of the data operation, and write the operation parameters into the target parameter variable.
5. The method according to claim 4, characterized in that The target parameter variables include operation times variable, delay time variable, and data size variable; The step of obtaining the operation parameters of the data operation and writing the operation parameters into the target parameter variable comprises: Obtaining the number of operations of at least one data operation performed by the data operation device, and writing the number of operations into the number of operations variable; Obtaining a delay time of at least one data operation, and writing the delay time into the delay time variable; The data amount of at least one data operation is obtained, and the data amount is written into the data size variable.
6. The method according to claim 4, characterized in that The parameter variables corresponding to the data operation device in each sub-area all carry the device information of the data operation device; The step of acquiring the operating parameters stored in the second storage area when starting to write the operating parameters to the first storage area comprises: In the case of starting to write the operation parameters into the first storage area, determining a target data operation device for which performance statistics are to be performed, and determining target device information corresponding to the target data operation device; According to the target device information, in each sub-area of the second storage area, determining parameter variables corresponding to the target device information one by one, so as to obtain the operation parameters stored in the second storage area from the parameter variables; The step of acquiring the operating parameters stored in the first storage area when starting to write the operating parameters to the second storage area includes: In the case of starting to write the operation parameters into the second storage area, determining a target data operation device for which performance statistics are to be performed, and determining target device information corresponding to the target data operation device; According to the target device information, in each sub-area of the second storage area, parameter variables corresponding to the target device information are determined one by one, so as to obtain the operation parameters stored in the first storage area from the parameter variables.
7. The method according to claim 1, characterized in that The first storage area and the second storage area are used to store the operating parameters in turn based on a preset rotation cycle; the method also includes: Determine a target storage area currently used for writing operation parameters; When the target storage area is the first storage area, after the preset rotation period, the target storage area is switched to the second storage area to start writing the operation parameters to the second storage area; When the target storage area is the second storage area, after the preset rotation period, the target storage area is switched to the first storage area to start writing the operation parameters to the first storage area.
8. The method according to claim 5, characterized in that The step of determining the data operation performance of the data operation device based on the stored operation parameters comprises: Obtaining the number of operations stored in the operation count variable, the delay time stored in the delay time variable, and the amount of data stored in the data size variable, and obtaining a preset rotation cycle for performing rotation storage; Determining the operation execution performance of the data operation device based on the preset rotation cycle and the number of operations; Determining the operation delay performance of the data operation device based on the preset rotation cycle and the delay time; Based on the preset rotation period and the data volume, an operation bandwidth performance of the data operation device is determined.
9. A data operation performance statistics device, characterized in that: include: A storage area module, used to determine a first storage area and a second storage area; The first storage area and the second storage area are used to store operation parameters corresponding to the data operation in turn when the data operation device performs the data operation, and the operation parameters are used to describe the execution status of the data operation; A first parameter module, configured to obtain the operating parameters stored in the second storage area when starting to write the operating parameters into the first storage area; A second parameter module, configured to obtain the operating parameters stored in the first storage area when starting to write the operating parameters into the second storage area; The performance statistics module is used to determine the data operation performance of the data operation device based on the stored operation parameters.
10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the data operation performance statistics method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer programs are executed by a processor, the data operation performance statistics method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Data interaction method, device and system, electronic equipment and storage medium
CN115061959A
Data reading method and device, computer equipment, storage medium and program product
CN118051168A
Storing data in multi-region storage devices
US20170168908A1
Memory system
US20190074283A1
Memory with processing in memory architecture and operating method thereof
US20200117597A1
