Storage management method and device
By evaluating and migrating data blocks in the mixed memory insertion scenario, the problem of data failures affecting the reliability and performance of terminal equipment in the memory mixed insertion scenario is solved, and the effect of improving the reliability and performance of terminal equipment is achieved.
Patent Information
- Application Number
- CN202310333936.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2024-09-24
AI Technical Summary
In a memory mixed-insertion scenario, regardless of the risk level of data stored on the memory, the probability of data failure affects the operational reliability and performance of the terminal device. It is difficult for existing technology to effectively solve this problem.
By obtaining the memory access information of the target process in a certain period of time in the past, the risk level of the data block is evaluated, and the data is migrated to the appropriate storage location based on the risk level, thereby improving the reliability of the data block and reducing the probability of memory failure.
It improves the operational reliability and performance of terminal equipment and reduces the probability of data block failure by accurately assessing and migrating the risk level of data blocks.
Smart Images

Figure CN118689376A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a storage management method and device. Background Art
[0002] The scenario where a terminal device uses storage devices with different reliability levels is called a mixed storage scenario. In a mixed storage scenario, regardless of the risk level of the data stored on the storage device, the probability that the data is affected by a storage device failure is the same, which will reduce the operating reliability and performance of the terminal device. Therefore, a storage management method is urgently needed to improve the operating reliability and performance of terminal devices in a mixed storage scenario.
[0003] The risk level of data is the frequency of errors in the data during the reading and writing process. The higher the frequency of data errors, the higher the risk level of the data. Conversely, the lower the risk level of the data. Summary of the invention
[0004] The embodiments of the present application can fully consider the relevant factors that affect the data risk level in the mixed memory insertion scenario, and provide a storage management method and related devices for improving the operating reliability and performance of terminal equipment in the mixed memory insertion scenario.
[0005] In a first aspect, an embodiment of the present application provides a storage management method, the method comprising:
[0006] Acquire first information, the first information including first access information of a target process to a first storage space in a first time period. The first time period is a first preset time period before acquiring the first information. Evaluate a risk level of data stored in the first storage space based on the first information. Migrate the data stored in the first storage space to a second storage space based on the risk level.
[0007] This solution evaluates the risk level of the target data block by obtaining the target process's memory access information for the target data block in a certain period of time in the past. The memory access information includes the target process's read and write operations on the cache or memory and the hit rate of the last-level cache. By analyzing the memory access information of the target data block, the frequency of reading and writing data to the target data block by the target process over a period of time can be obtained, and then the risk level of the target data block can be evaluated. Furthermore, the storage location of the target data block can be migrated based on the risk level, and the target data block can be migrated to a suitable storage location, thereby improving the reliability of storing the target data block and reducing the probability of memory failure of the data block, thereby improving the reliability and performance of the terminal device operation.
[0008] In a possible embodiment, the first memory access information includes n second memory access information, where n is an integer greater than 1. The first time period includes n sub-time periods, and the memory access information acquired in the m-th sub-time period of the n sub-time periods is the m-th second memory access information of the n second memory access information. m is an integer from 1 to n.
[0009] Evaluating the risk level of the data stored in the first storage space based on the first information includes:
[0010] The third memory access information of the first storage space in the second time period is evaluated based on the n second memory access information. The second time period is a second preset time period after the first information is obtained.
[0011] The risk level is evaluated based on the third access information.
[0012] In this solution, the first time period is first divided into a plurality of continuous sub-time periods, and a plurality of sub-memory access information is evaluated based on the plurality of continuous sub-time periods. Secondly, the memory access information of the next time period can also be predicted based on the plurality of sub-memory access information. The risk assessment model can predict the changing trend of the risk level of the target data block based on the risk level of the target data block evaluated according to the memory access information of the next time period. The changing trend of the risk level can enable the target data block to be migrated to a more suitable storage location, further improve the reliability of storing the target data block, and reduce the probability of memory failure of the data block, thereby improving the reliability and performance of the terminal device operation.
[0013] In a possible embodiment, the first storage space includes a plurality of cache lines, and each of the n second memory access information is composed of memory access information of a plurality of cache lines.
[0014] In this solution, the target data block contains multiple cache lines, which is equivalent to the minimum granularity of accessing memory information being a cache line. The risk level of the target data block is evaluated one by one using the cache line as the minimum evaluation unit. Therefore, the risk level of the target data block can be evaluated more accurately. A more accurate risk level can enable the target data block to be migrated to a more appropriate storage location, further improve the reliability of storing the target data block, and reduce the probability of memory failure of the data block, thereby improving the reliability and performance of the terminal device operation.
[0015] In a possible embodiment, the first information further includes usage of a target storage space obtained at a first time point. The target storage space is a storage space occupied by the target process, and the target storage space includes the first storage space. The usage of the target storage space includes: an address of the target storage space, a type of the target storage space, and a dirty page ratio of the target storage space. The first time point is a preset time point before obtaining the first information.
[0016] In this solution, the first information also includes the memory usage of the target process. The risk assessment model can evaluate the risk level of the target data block based on both the memory access information and the memory usage. Since the memory usage is a personalized feature of the target process, the risk level assessed based on the memory usage can be adaptively adjusted according to the different processes. Therefore, in this solution, the risk level of the target data block can also be adaptively adjusted following the target process, which can further improve the accuracy of assessing the risk level. Therefore, the target data block can be migrated to a more suitable storage location based on the risk level, further improving the reliability of storing the target data block and reducing the probability of memory failure of the data block, thereby achieving the goal of improving the reliability and performance of the terminal device operation.
[0017] In a possible embodiment, the usage of the target storage space further includes: the size of the resident memory set RSS of the target process and / or the memory access information of the target storage space by the target process in a third time period. The third time period is a third preset time period before the first time point.
[0018] In this solution, the storage space usage of the target process also includes: the size of the resident memory set RSS of the target process and / or the memory access information of the storage space used by the target process in the second time period. Since the storage space usage of the target process can more completely reflect the characteristics of the storage space used during the operation of the target process, the assessment accuracy of the risk assessment model can be further improved based on this information.
[0019] In a possible embodiment, the step of evaluating the risk level of the data stored in the first storage space based on the first information includes:
[0020] The risk level of the data stored in the first storage space is evaluated based on the first information using a risk evaluation model.
[0021] The risk assessment model is trained based on simulated memory access information and simulated storage space usage.
[0022] The simulated memory access information and the simulated storage space usage are obtained by simulating the operation of the target process.
[0023] In this solution, the risk level of the data stored in the first storage space is evaluated based on the first information through a risk assessment model, so that the risk level of the data can be generated more quickly and accurately. The steps of obtaining the risk assessment model are: first, when the target process is not running, the first memory access information and / or the first memory usage of the target process are obtained by simulating the operation of the target process. Then, based on the first memory access information and / or the first memory usage, the above-mentioned risk assessment model is obtained. Because the risk assessment model is obtained when the target process is not running, when the risk assessment model is needed, it is only necessary to load the relevant parameters of the risk assessment model, which saves a lot of model training time. Moreover, a large amount of sample data can be used to train the risk assessment model, so that the trained risk assessment model has a higher assessment accuracy.
[0024] In a possible embodiment, the step of evaluating the risk level of the data stored in the first storage space based on the first information includes:
[0025] The risk level of the data stored in the first storage space is evaluated based on the first information by using a risk evaluation model.
[0026] The risk assessment model is obtained by training based on the fourth memory access information and the usage of the target storage space.
[0027] The fourth memory access information and the usage of the target storage space are obtained by running the target process.
[0028] In this solution, the risk level of the data stored in the first storage space is evaluated based on the first information through a risk assessment model, so that the risk level of the data can be generated more quickly and accurately. The step of obtaining the risk assessment model is to obtain the second memory access information and the second memory usage of the target process when the target process is running. Then, based on the first memory access information and the first memory usage, the risk assessment model is obtained. Since this solution does not require the risk assessment model to be trained in advance, the space used to store the risk assessment model is saved, and the risk assessment model can be evaluated immediately when the process is running, which has higher flexibility.
[0029] In a possible embodiment, the above method is applied to a terminal device. The above-mentioned migrating the data stored in the first storage space to the second storage space based on the risk level includes: migrating the data stored in the first storage space to the second storage space based on the risk level and second information. The second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the storage space reliability of the terminal device.
[0030] This solution migrates the storage location of the target data block based on the risk level of the target data block and the second information, and the second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the memory reliability of the terminal device. When migrating the target data block in combination with the running load of the terminal device, the target data can be migrated at an appropriate time. When migrating the target data in combination with the NUMA affinity of the target process, it is convenient to migrate the target data to the same node to avoid different latency in accessing the memory. When migrating the target data in combination with the memory reliability of the terminal device, the target data can select a storage space with appropriate reliability for migration. Therefore, this solution can enable the target data block to select an appropriate migration time, migration node, and migration location during the storage location migration process.
[0031] In a possible embodiment, the storage management method further includes: obtaining a migration frequency of data stored in the first storage space. Migrating the data stored in the first storage space to the second storage space based on the risk level and the second information includes: migrating the data stored in the first storage space to the second storage space based on the migration frequency, the risk level and the second information.
[0032] In this solution, the storage location of the target data block is migrated according to the migration frequency of the target data block. The frequency of migrating the target data block can be flexibly set to complete the migration of the storage location of the target data block in a timely manner while minimizing the impact of data migration on the performance of the terminal device.
[0033] In a possible embodiment, the above storage management method further includes: establishing a mapping relationship between the virtual storage address managed by the target process and the second storage space.
[0034] In this solution, after the target data block is migrated to the second storage space, a mapping relationship between the virtual memory address managed by the target process and the target memory segment is established, so that the target process can directly access the target memory segment during subsequent operation, reducing the amount of data migration.
[0035] In a second aspect, an embodiment of the present application provides a terminal device, characterized in that the terminal device includes:
[0036] The acquisition unit is used to acquire first information, the first information including first memory access information of the target process to the first storage space in a first time period. The first time period is a first preset time period before acquiring the first information.
[0037] An evaluation unit is used to evaluate the risk level of the data stored in the first storage space based on the first information.
[0038] A migration unit is used to migrate the data stored in the first storage space to the second storage space based on the risk level.
[0039] In a possible embodiment, the first memory access information includes n second memory access information, where n is an integer greater than 1. The first time period includes n sub-time periods, and the memory access information acquired in the m-th sub-time period of the n sub-time periods is the m-th second memory access information of the n second memory access information, where m is an integer from 1 to n.
[0040] The step of evaluating the risk level of the data stored in the first storage space based on the first information includes:
[0041] The third memory access information of the first storage space in a second time period is evaluated based on the n second memory access information. The second time period is a second preset time period after obtaining the first information.
[0042] The risk level is evaluated based on the third access information.
[0043] In a possible embodiment, the first storage space includes a plurality of cache lines, and each of the n second memory access information is composed of memory access information of the plurality of cache lines.
[0044] In a possible embodiment, the first information further includes usage of the target storage space acquired at the first time point. The target storage space is the storage space occupied by the target process, and the target storage space includes the first storage space.
[0045] The usage of the target storage space includes: the address of the target storage space, the type of the target storage space and the dirty page ratio of the target storage space. The first time point is a preset time point before acquiring the first information.
[0046] In a possible embodiment, the usage of the target storage space further includes:
[0047] The size of the resident memory set RSS of the target process and / or the memory access information of the target process to the target storage space in a third time period.
[0048] The third time period is a third preset time period before the first time point.
[0049] In a possible embodiment, the evaluation unit is specifically configured to: evaluate the risk level of the data stored in the first storage space based on the first information by using a risk evaluation model.
[0050] The risk assessment model is trained based on simulated memory access information and simulated storage space usage.
[0051] The simulated memory access information and the simulated storage space usage are obtained by simulating the operation of the target process.
[0052] In a possible embodiment, the evaluation unit is specifically configured to: evaluate the risk level of the data stored in the first storage space based on the first information by using a risk evaluation model.
[0053] The risk assessment model is obtained by training based on the fourth memory access information and the usage of the target storage space.
[0054] The fourth memory access information and the usage of the target storage space are obtained by running the target process.
[0055] In a possible embodiment, the migration unit is specifically configured to migrate the data stored in the first storage space to the second storage space based on the risk level and the second information.
[0056] The second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the storage space reliability of the terminal device.
[0057] In a possible embodiment, the acquisition unit is specifically configured to acquire a migration frequency of the data stored in the first storage space.
[0058] The migration unit is specifically configured to migrate the data stored in the first storage space to the second storage space based on the migration frequency, the risk level and the second information.
[0059] In a possible embodiment, the terminal device further includes:
[0060] An establishing unit is used to establish a mapping relationship between the virtual storage address managed by the target process and the second storage space.
[0061] In a third aspect, an embodiment of the present application provides a terminal device, the terminal device comprising a processor and a memory. The memory is coupled to the processor, and when the processor executes a computer program or computer instruction stored in the memory, the method described in any one of the first aspects can be implemented. The terminal device may also include a communication interface, the communication interface is used for the terminal device to communicate with other terminal devices, and illustratively, the communication interface may be a transceiver, circuit, bus, module or other type of communication interface.
[0062] In a possible implementation, the terminal device may include:
[0063] Memory is used to store computer programs or computer instructions.
[0064] Processor for:
[0065] First information is obtained, the first information including first memory access information of a target process to a first storage space in a first time period, the first time period being a first preset time period before obtaining the first information.
[0066] The risk level of the data stored in the first storage space is evaluated based on the first information.
[0067] The data stored in the first storage space is migrated to the second storage space based on the risk level.
[0068] It should be noted that the computer program or computer instruction in the memory in the present application can be stored in advance or downloaded from the Internet when the terminal device is used, and the source of the computer program or computer instruction in the memory is not specifically limited in the present application. The coupling in the embodiments of the present application is an indirect coupling or connection between terminal devices, units or modules, which can be electrical, mechanical or other forms, and is used for information exchange between terminal devices, units or modules.
[0069] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program or computer instructions, and the aforementioned computer program or computer instructions are executed by a processor to implement any one of the methods of the first aspect.
[0070] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed by a processor, any one of the methods in the first aspect will be implemented.
[0071] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a memory, wherein the memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, so that the chip executes any one of the methods of the first aspect.
[0072] The solutions provided in the second to sixth aspects are used to implement or cooperate with the corresponding methods provided in the first aspect, and therefore can achieve the same or corresponding beneficial effects as the corresponding methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0074] Figure 1A A schematic diagram of a scenario architecture of an embodiment of the present application;
[0075] Figure 1B A schematic diagram of reliability level of a memory provided in an embodiment of the present application;
[0076] Figure 2 A flowchart of a storage management method provided in an embodiment of the present application;
[0077] Figure 3 A flowchart of another storage management method provided in an embodiment of the present application;
[0078] Figure 4 Another schematic diagram of a scenario architecture provided for an embodiment of the present application;
[0079] Figure 5 A flowchart of another storage management method provided in an embodiment of the present application;
[0080] Figure 6 A schematic diagram of a storage management module 140 provided in an embodiment of the present application;
[0081] Figure 7 A schematic diagram of the logical structure of a terminal device provided in an embodiment of the present application;
[0082] Figure 8 A schematic diagram of the physical device structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] In the embodiment of the present application, "multiple" refers to two or more. In the embodiment of the present application, "and / or" is used to describe the association relationship of the associated objects, indicating three relationships that can exist independently, for example, A and / or B, which can be expressed as: A exists alone, B exists alone, or A and B exist at the same time. The description methods such as "at least one (or at least one) of a1, a2, ... and an" used in the embodiment of the present application include the situation where any one of a1, a2, ... and an exists alone, and also include any combination of any multiple of a1, a2, ... and an, each of which can exist alone; for example, the description method of "at least one of a, b and c" includes the situation where a is alone, b is alone, c is alone, a and b are combined, a and c are combined, b and c are combined, or abc is combined.
[0084] In the various embodiments of the present application, unless otherwise specified or logically conflicting, the terms and / or descriptions between the various embodiments are consistent and may be referenced to each other, and the technical features in different embodiments may be combined to form new embodiments according to their inherent logical relationships.
[0085] The embodiments of the present application are described below with reference to the accompanying drawings.
[0086] To facilitate understanding of the embodiments of the present application, please refer to Figure 1A The scenario architecture shown in FIG. 1 includes a software layer and a hardware layer. The software layer includes a target process 110 , and the hardware layer includes a processor 120 and a plurality of memories 130 .
[0087] The target process 110 may be any process run by the processor 120. Exemplarily, the target process 110 may be, for example, a business process, a parent process, a child process, or a daemon process. A business process is a process that executes tasks and implements functions. A child process is a process created by another process (correspondingly referred to as a parent process). A daemon process is a special process that runs in the background and is used to perform specific system tasks. The target process 110 may also be, for example, a collection of multiple processes generated by the processor 120 running an application.
[0088] The processor 120 may be, for example, a central processing unit (CPU) or a graphics processing unit (GPU). The processor 120 may include one or more processing units, such as a performance monitor unit (PMU), an application processor (AP), a modem processing unit, a graphics processing unit, an image signal processor (ISP), a control unit, a storage unit, a video codec unit, a digital signal processing unit (DSP), a baseband processing unit, and / or a neural network processing unit (NPU). Different processing units may be independent devices or may be integrated in one or more processors.
[0089] The memory 130 can be used to store computer executable program codes, which include instructions. The processor 120 executes various functional applications and process data processing by running the instructions stored in the memory 130. The memory 130 may include a program storage area and a data storage area. Among them, the program storage area may store applications required by at least one function of the operating system (such as face recognition function, fingerprint recognition function, mobile payment function, etc.). The data storage area may store data created during the use of the target process 110 (such as face information template data, fingerprint information template, etc.). The memory 130 may be, for example, a register, a cache, a main memory (MM), etc. In addition, the processor 120 is connected to at least two memories 130 with different attributes, which include any one or more of the following: the model of the memory, the read and write speed of the memory, the structure of the memory, the quality of the memory, the capacity of the memory, the bandwidth of the memory, the interface type of the memory, the error correction code of the memory, and the usage time of the memory. Exemplarily, the memories connected to the processor 120 are respectively the fourth generation memory (double-data-rate fourth generation synchronous dynamic random access memory, DDR4 SDRAM) and DDR5. Exemplarily, the memories connected to the processor 120 are respectively dynamic random access memory (dynamic random access memory, DRAM) and high bandwidth memory (high bandwidth memory, HBM). Exemplarily, the memories connected to the processor 120 are respectively a memory bar that has been used for one year and a memory bar that has been used for two years.
[0090] In one possible implementation, the processor 120 runs the target process 110, and the target process 110 needs to occupy and / or use part of the storage space on the memory 130 during the running process. The processor 120 establishes a mapping relationship between the virtual storage space that can be directly managed by the target process 110 and the physical storage space on the memory 130, thereby realizing the occupation and / or use of part of the storage space on the memory 130 by the above-mentioned target process 110 during the running process.
[0091] It is understandable that the above Figure 1A The scene architecture shown is only exemplary and does not constitute a limitation to the embodiments of the present application.
[0092] When a process needs to access storage resources, the processor will only allocate storage space according to the access requirements of the process, without distinguishing the reliability level of the storage space. The reliability level is determined by the properties of the memory 130 where the storage space is located. For example, the higher the quality of the memory, the higher the reliability, and vice versa. The shorter the usage time of the memory, the higher the reliability, and vice versa. The stronger the error correction capability of the memory error correction code, the higher the reliability, and vice versa.
[0093] Figure 1B A schematic diagram of reliability levels of a memory provided in an embodiment of the present application is provided, wherein the memory 130 includes at least two reliability levels of memories, illustratively, a high reliability memory 131 and a low reliability memory 132 .
[0094] In a possible implementation, the memory 130 may include memories of more reliability levels, for example, memories of reliability level 1, memories of reliability level 2, memories of reliability level 3, etc. The present application does not limit how many levels of memories the memory 130 includes.
[0095] In the case where there are differences in the reliability levels of the memories connected to the processor, on the one hand, the above-mentioned processes will randomly use storage spaces of different reliability levels, and all processes, regardless of their own importance, have the same probability of being affected by the failure of the storage control. On the other hand, since different data have different memory access characteristics, different data are affected to different degrees by the failure of the storage space, and the degree of this impact is called the data risk level. Further, the target process accesses data of different data risk levels, which will affect the operating reliability of the target process. Exemplarily, data of different data risk levels also have different degrees of impact on the operating reliability of the target process. The probability of the target process being affected by data with a high data risk level when accessing the data will be greater than the probability of the target process accessing data with a low data risk level. In addition, since the frequency and number of errors in data with a high data risk level will be greater, the impact of data with a high data risk level on the target process will also be more serious, and it is easier to cause the target process to be blocked or crashed.
[0096] It should be understood that the erroneous data in the memory 130 does not necessarily affect the normal operation of the process. Only when the processor 120 consumes / uses the erroneous data will it affect the normal operation of the target process. Usually, the processor's consumption of data corresponds to the operation of reading the memory.
[0097] In order to reduce the impact of memory failure on the process in a mixed memory insertion scenario, a possible implementation method is as follows: Figure 2 The flowchart of the storage management method shown is as follows. The method includes but is not limited to the following steps:
[0098] S201 : The processor 120 sets the reliability level of the target process 110 .
[0099] Exemplarily, the administrator manually determines the reliability level of the target process 110 and configures the reliability level of the target process 110. When the processor 120 runs the target process 110, the processor 120 can read the reliability level of the target process 110.
[0100] S202 , the processor 120 obtains an error correction code corresponding to the reliability level of the target process 110 .
[0101] Exemplarily, each reliability level is configured with its corresponding error correction code, and after the processor 120 obtains the reliability level, it can obtain the error correction code matching the reliability level by reading the configuration file. The error correction code is the error correction code used by the memory 130 to store the data used by the target process 110.
[0102] S203 : The processor 120 sends the reliability level and the error correction code to the memory 130 .
[0103] S204. The memory 130 establishes a first mapping relationship according to the reliability level, and establishes a second mapping relationship according to the error correction code.
[0104] Exemplarily, the memory 130 establishes a mapping relationship between the data used by the target process 110 and part of the storage space in the memory 130 according to the reliability level, which is referred to as the first mapping relationship. The first mapping relationship is used to place the data used by the target process 110 in the specified storage space. The memory 130 then establishes a mapping relationship between the redundant data obtained by encoding the data and part of the storage space in the memory 130 according to the error correction code, which is referred to as the second mapping relationship. The second mapping relationship is used to place the redundant data in the specified storage space. Generally, placing redundant data in a storage space with high reliability can reduce the redundant data errors due to memory failure, thereby improving the security of the source data. Please refer to a mapping relationship table provided in Table 1 for example. The mapping relationship diagram includes process A and process B, wherein the reliability level of process A is level 1, and the reliability level of process B is level 2. Then the processor establishes a first data mapping relationship and a first coding mapping relationship respectively according to the level 1. The processor establishes a second data mapping relationship and a second coding mapping relationship respectively according to the level 2.
[0105] Table 1
[0106] Target process Reliability level The first mapping relationship The second mapping relationship Process A Level 1 First data mapping relationship First encoding mapping relationship Process B Level 2 Second data mapping relationship Second encoding mapping relationship
[0107] S205 : The processor 120 sends an access request to the memory 130 .
[0108] Exemplarily, when the target process 110 needs to access data, the processor 120 sends a data access request to the memory 130 .
[0109] S206 : The memory 130 accesses data according to the request.
[0110] Exemplarily, according to the request, the memory 130 first extracts the data to be accessed from the data mapping area according to the above-mentioned first mapping relationship, and extracts the redundant data obtained by encoding the data from the fault-tolerant coding area according to the above-mentioned second mapping relationship. The redundant data is used to verify the data to be accessed, and if the verification passes, the data is returned to the processor. If the verification fails, the redundant data is used to correct the data to be accessed, and the corrected data is verified. If the verification passes, the data is returned to the processor. If the corrected data still fails to pass the verification, the exception is reported to the processor 120.
[0111] Figure 2 The storage management method shown uses a large amount of expert knowledge to evaluate and configure the reliability level of each process, and then determines the first mapping relationship between data and storage space and the second mapping relationship between redundant data obtained after encoding and storage space according to the reliability level of each process, thereby improving the storage reliability of important data.
[0112] Another possible implementation is shown in Figure 3 A flowchart of another storage management method is provided. The method includes but is not limited to the following steps:
[0113] S301. Set a startup rule for evaluating a storage page.
[0114] Exemplarily, the evaluation of the storage page may be started periodically, for example, the storage page may be evaluated once every 5 minutes. The storage page refers to any storage page on the memory 130, for example, each storage page may store 4KB or 8KB of data.
[0115] S302: Evaluate the risk and migration cost of storage pages.
[0116] Exemplarily, the page risk of the storage page is evaluated based on the memory failure information of the storage 130, and the storage 130 suitable for storing the data is determined. The migration cost of migrating the storage page to each storage is evaluated based on the popularity of the storage page, the probability that the storage page may fail (fail), and the performance of the storage 130.
[0117] S303: Select a target storage device with the lowest migration cost.
[0118] Exemplarily, according to the migration cost evaluated in step S302, a memory with the minimum migration cost is selected as the target memory.
[0119] S304: Determine whether the target memory is the current memory.
[0120] S305: Perform data migration.
[0121] Exemplarily, if the target memory is not the current memory, the data stored on the current memory page is migrated to the target memory.
[0122] S306, migration completed.
[0123] Exemplarily, if the target memory is the current memory, there is no need to migrate the data.
[0124] Figure 3 The method shown reads the page risk of the storage page through the memory fault information disk of the storage 130, determines the migration cost of the storage page based on the performance of the storage 130, the possible failure time, etc., and then selects the storage with the smallest migration cost as the target storage, and migrates the data to the target storage.
[0125] With the increase in storage services, users' requirements for data reliability continue to increase. In the mixed memory insertion scenario, due to the existence of memories with different reliability levels, users have higher requirements for data reliability. How to adaptively evaluate the impact of different processes on data risk levels in the mixed memory insertion scenario without the help of expert knowledge, adaptively select the storage location of data, and dynamically generate data migration strategies is an urgent problem that needs to be solved. To this end, the embodiment of the present application fully considers the characteristics of the mixed memory insertion scenario and provides another storage management method.
[0126] See also Figure 4 , which exemplarily shows another scenario architecture diagram provided in an embodiment of the present application. Figure 4 The scene architecture shown and Figure 1A The difference in the scenario architecture shown is that Figure 4 The illustrated scenario architecture adds a storage management module 140, which is located at the software layer.
[0127] The storage management module 140 is used to manage the storage address of the data in the storage space occupied by the target process 110. For example, the storage management module 140 can generate the risk level of the data stored in each storage page in the storage space based on the storage access information of the target process 110 on the data in the storage space and / or the usage of the storage space by the target process 110. For the relevant introduction of the storage access information and the usage of the storage space, please refer to the subsequent Figure 5 The relevant introduction of step S501 in the above is not described in detail here. Among them, the above storage space is located in the above memory 130. Exemplarily, the storage management module 140 can also determine the migration strategy according to the risk level of the data stored in the above storage page, the operation load of the terminal device, the affinity of non-uniform memory access (NUMA) and the reliability of the memory 130. The terminal device can be, for example, a terminal device including a processor 120 and a memory 130. The migration strategy includes the migration time, the node to be migrated and the target address of the migration. The migrated node refers to a storage node in the NUMA storage architecture, and the access delay of the same storage node is the same. Exemplarily, the processor 120 can determine the appropriate migration time based on the operation load of the terminal device. For example, it is selected to migrate data when the operation load of the terminal device is small, so that there is no or only a small amount of data access demand during the data migration process, which can minimize the impact of the migration data on the operation performance of the terminal device. Exemplarily, the processor 120 can link the memory 130 where the data is located before and after the migration to the same node based on NUMA affinity. Ensure that the data access delay is the same before and after the data migration. For example, the processor 120 may select a memory 130 matching the risk level as the target memory 130 for migrating the data based on the risk level of the data stored in the storage page and the reliability level of the memory 130, and allocate storage space from the target memory 130 as the target address for migration.
[0128] In one possible implementation, first, when the processor 120 runs the target process 110, the administrator issues a control instruction, which is used to allow the storage management module 140 to monitor the target process 110 and manage the data occupied by the target process 110, which is stored in part of the storage space on the memory 130.
[0129] Secondly, after the storage management module 140 is started to monitor the target process 110, the processor 120 inputs the memory access information of the target process 110 to the storage space occupied by it and / or the usage of the storage space occupied by the target process 110 to the storage management module 140, so that the storage management module 140 outputs the risk level of the data on the storage space occupied by the target process 110. For a detailed description of the memory access information of the target process 110 to the storage space occupied by it and / or the usage of the storage space occupied by it by the target process 110, please refer to the subsequent Figure 5 The relevant introduction of step S501 is not described in detail here.
[0130] Then, the processor 120 inputs the state information of the terminal device where the processor 120 is located into the storage management module 140 to generate a migration strategy for the data. The state information of the terminal device includes one or more of the following: the running load of the device, the affinity of non-uniform memory access (NUMA), and the reliability of the memory 130. The processor 120 migrates the data process storage location on the storage space occupied by the target process 110 based on the migration strategy.
[0131] It is understandable that the above Figure 4 The scene architecture shown is only exemplary and does not constitute a limitation to the embodiments of the present application.
[0132] See also Figure 5 , exemplarily shows a flow chart of another storage management method provided by an embodiment of the present application, the method includes but is not limited to the following steps:
[0133] S501. Obtain first information, where the first information includes first memory access information of a target process to a first storage space in a first time period, where the first time period is a first preset time period before obtaining the first information.
[0134] Exemplarily, the target process may be, for example, the above Figure 1A and Figure 4 The target process 110 under any scenario architecture in the scenario architecture shown. The first storage space may be, for example, the above Figure 1A and Figure 4 Part of the storage space occupied by the target process in the memory 130 included in any one of the scenario architectures shown.
[0135] The first storage space may be, for example, one or more storage pages or one or more cache lines in a storage page. For example, the first storage space may be a storage page of 4 KB in size. For example, the storage space may also be a cache line of 64 bytes in size.
[0136] When the first storage space includes a plurality of storage pages, the plurality of storage pages may be located in the same memory 130 or in different memories 130 .
[0137] Exemplarily, the first preset time period may be, for example, a time period consisting of a preset duration and a termination time point at the time point when the first information is obtained. For example, the time point when the first information is obtained is 9:00 a.m. on January 1, 2000, and the preset duration is 1 hour, then the first preset time period is a period from 8:00 a.m. on January 1, 2000 to 9:00 a.m. on January 1, 2000. The preset duration may be, for example, 1 microsecond, 1 millisecond, 1 minute or 1 hour, and the specific range of the preset duration is not limited in this application. It is understandable that the first time period is equivalent to the first preset time period.
[0138] Exemplarily, the first preset time period may be, for example, a time period consisting of a time point when the first information was last acquired as a starting time point and a time point when the first information is acquired this time as an ending time point. For example, the time point when the first information was last acquired was 8:59 a.m. on January 1, 2000, and the time point when the first information is acquired this time is 9:00 a.m. on January 1, 2000, then the first preset time period is a period from 8:59 a.m. on January 1, 2000 to 9:00 a.m. on January 1, 2000. It can be understood that the first time period is equivalent to the first preset time period.
[0139] Exemplarily, the first preset time period may be, for example, any time period from when the target process starts to run to when the first information is obtained. For example, the target process starts to run at 7:00 a.m. on January 1, 2000, and the time point for obtaining the first information is 9:00 a.m. on January 1, 2000. Then the first preset time period may be any time period between 7:00 a.m. on January 1, 2000 and 9:00 a.m. on January 1, 2000.
[0140] Exemplarily, the first preset time period can be determined based on memory access information of the target process to the first storage space, the memory access information including the number of times the target process reads data from the first storage space in the first time period and / or the number of times the target process writes data to the first storage space in the first time period.
[0141] In a possible implementation, the time point for obtaining the first information is determined by the wake-up strategy of the storage management module 140. For the wake-up strategy of the storage management module 140, please refer to the subsequent related introduction, which is not described in detail here.
[0142] In a possible implementation, the memory access information of the storage space includes memory access time, memory access event, and memory access address.
[0143] The memory access event includes reading data and writing data, wherein writing data refers to deleting the data to be written to the storage space and writing new data. The reading data may include reading data on the cache or reading data on the memory, and the writing data may include writing data on the cache or writing data on the memory.
[0144] It is understandable that only when reading data will the normal operation of the process be disturbed or the process crashed due to the memory failure.
[0145] Furthermore, only when the target process reads the erroneous data and the processor 120 consumes / uses the erroneous data, will the normal operation of the target process be affected. Usually, the consumption of data by the processor corresponds to the operation of reading the memory. Because the process of reading data may read erroneous data, the erroneous data is used by the process, thereby affecting the normal operation of the process and even causing the process to crash.
[0146] Writing data usually deletes the erroneous data and writes the correct data, which is equivalent to overwriting the erroneous data with the correct data.
[0147] Therefore, the more frequency / number of data writes in a data access event on a storage space, the lower the risk level of the data stored in the storage space. Conversely, the more frequency / number of data reads in a data access event on the storage space, the higher the risk level of the data stored in the storage space.
[0148] The memory access time is the time point or time period when the memory access event occurs. The memory access time may be, for example, the first preset time period. For a detailed description of the first preset time period, please refer to the above-mentioned related content, which will not be repeated here.
[0149] The memory access address is the address of the storage space where the memory access event occurs, and the memory access address may be, for example, "0xa000" or "0xa008". The memory access address may refer to, for example, a cache line, multiple cache lines, a storage page, or multiple storage pages.
[0150] Exemplarily, the memory access information also includes the type of storage space, such as a heap, a stack, or an anonymous page, etc. For example, a level 1 cache (L1Cache), a level 2 cache (L2Cache), a main memory (MM), or a last level cache (LLC).
[0151] Illustratively, the first memory access information may be found in Table 2.
[0152] Table 2
[0153]
[0154] As shown in Table 2, the first memory access information is that the target process reads data D1 times and writes data D2 times to the first storage space in the first time period.
[0155] The data in the above-mentioned "read data" or "write data" refers to the data stored in the above-mentioned first storage space. The data stored in the first storage space will change continuously with the running of the process. Therefore, to be precise, "read data" refers to the read data operation on the first storage space, and "write data" refers to the write data operation on the first storage space.
[0156] Exemplarily, the specific operations of "reading data" and "writing data" can be distinguished according to the processor that initiates the operation and the memory that receives the operation. Among them, the processor that initiates the operation can be, for example, a CPU or a GPU. The memory that receives the operation can be, for example, an L1Cache, an L2Cache, an MM, or an LLC. The operation types of the embodiments in this application are divided into "reading data" and "writing data".
[0157] It can be seen that the memory access information mentioned in the embodiments of the present application refers to the memory access information of a certain storage space, and cannot be understood as the memory access information of specific data.
[0158] In a possible implementation manner, the first memory access information includes n second memory access information, where n is an integer greater than 1. The first time period includes n sub-time periods, and the memory access information acquired in the m-th sub-time period of the n sub-time periods is the m-th second memory access information of the n second memory access information, where m is an integer from 1 to the n;
[0159] For example, if the first time period is a time period of 5 seconds, the time period includes 5 sub-time periods of 1 second, and the 5 sub-time periods are named T1, T2, T3, T4 and T5 respectively. The plurality of second memory access information is the memory access information of the target process to the first storage space in the time period T1, T2, T3, T4 or T5.
[0160] In a possible implementation, the first storage space includes a plurality of sub-storage spaces. Then, the memory access information of the first storage space is composed of the memory access information of the plurality of sub-storage spaces.
[0161] Exemplarily, the first storage space includes two cache lines, and the two cache lines are named as the first cache line and the second cache line respectively. Then, the second memory access information is composed of the memory access information corresponding to the first cache line and the memory access information corresponding to the second cache line.
[0162] Table 3
[0163]
[0164] See Table 3, which exemplarily shows the first memory access information of the target process to the first storage space in the first time period. The first time period is divided into T1, T2, T3, T4 and T5, the first storage space includes the first cache line and the second cache line, and the memory access event includes "read data" and "write data".
[0165] Exemplarily, the third memory access information may be, for example, “read data” and “write data” corresponding to the first cache line in the T1 time period.
[0166] Exemplarily, the types of the first cache line and the second cache line may be further identified based on Table 3. For example, the type of the first cache line is a stack, and the type of the second cache line is an anonymous page.
[0167] It is understandable that the first information includes but is not limited to the information shown in Table 2 and Table 3. The specific form of the first information is not limited in this application.
[0168] In a possible implementation, the first information further includes usage of a target storage space acquired at a first time point. The target storage space is a storage space occupied by the target process, and the target storage space includes the first storage space. The first time point is a preset time point before acquiring the first information.
[0169] The usage of the target storage space includes: the address of the target storage space, the type of the target storage space, and the dirty page ratio of the target storage space.
[0170] The target storage space is the total storage space occupied by the target process when the processor runs the target process. The target storage space is composed of one or more storage pages, and the target storage space includes the first storage space. Since the storage space occupied by the target process will change continuously during its operation, the target storage space is, to be precise, the total storage space occupied by the target process at the first time point.
[0171] The above-mentioned first time point is a preset time point before obtaining the above-mentioned first information, and this application does not limit how to preset the time point.
[0172] Exemplarily, the preset time point is a periodic time point. For example, the first time when the target process starts running is 7:00 a.m. on January 1, 2000, and a preset time point is selected every 6 hours. Then, the preset time points include: 7:00 a.m., 13:00 a.m., 19:00 a.m., etc. on January 1, 2000. For example, 0:00 and 12:00 a.m. in a natural day are used as the preset time points.
[0173] Exemplarily, the preset time point may also be a non-periodic time point. For example, the first time point when the amount of data migration reaches the first threshold is used as the preset time point. The migration amount, for example, may be the ratio of the migrated data to the total data used by the target process.
[0174] The address of the above-mentioned target storage space refers to the physical address of the target storage space, for example: 0000-001f, 0x38001002 or x20000020~0x2000002e, etc.
[0175] The data type of the target storage space may be, for example, a file-backed page or an anonymous page.
[0176] Exemplarily, the file page refers to the data that can be recycled after the system releases it, such as data in a cache or buffer. For example, it can also be a code segment of a process or a file mapped by a process. Most of the data on the file page can be directly recycled by the system, and if the data is needed, it can be read from the disk again.
[0177] Exemplarily, the anonymous page refers to data without a file background, such as a heap, a stack, or a data segment, which does not exist in the form of a file and therefore cannot be directly exchanged with a disk file.
[0178] Exemplarily, the dirty page refers to data that has been modified by the application and has not yet been written to the disk. The data on the dirty page needs to be written to the disk before the memory can be released. The above-mentioned file pages and anonymous pages may evolve into dirty pages, and can also become clean pages.
[0179] The dirty page ratio of the target storage space refers to the ratio of dirty pages to the target storage space.
[0180] For example, the higher the proportion of dirty pages in the target storage space, the more data that has been modified by the process and has not yet been written to the disk. From the analysis of the above related content, it can be known that the more times of "writing data" in the memory access information, the lower the risk level of the data in the storage space. Therefore, the risk level of the data can be inferred from the number of "writing data" in the memory.
[0181] From the perspective of the process, the dirty page ratio refers to the ratio of dirty pages in the storage space occupied by the process. It can be understood that the higher the dirty page ratio, the higher the frequency of data writing in the process, and the lower the dirty page ratio, the lower the frequency of data writing in the process. Therefore, the risk level of the data can be inferred based on the dirty page ratio of the memory.
[0182] For example, at a first time point, the proportion of dirty pages of process A occupying storage space is 30%, and the proportion of dirty pages of process B occupying storage space is 60%. Then, the risk level of data on the storage space occupied by process B may be lower than the risk level of data on the storage space occupied by process A. The storage space may be, for example, the memory of a shared library, heap memory, stack memory, and other anonymous pages or file page memory.
[0183] It should be understood that the dirty page ratio is an evaluation criterion for data risk level, and the dirty page ratio is not necessarily proportional or inversely proportional to the risk level of the data.
[0184] In a possible implementation, the usage of the target storage space further includes one or more of the following: the size of the resident set size (RSS) of the target process, the size of the virtual memory size (VSZ) of the target process, and the memory access information of the target storage space by the target process in a third time period. The third time period is a third preset time period before the first time point.
[0185] Exemplarily, the size of the resident memory set refers to the size of the storage space allocated to the process. The resident set does not include the memory that enters the swap partition, but includes the memory occupied by the shared library, the heap memory, and the stack memory.
[0186] Exemplarily, the virtual memory includes all storage spaces accessible to the target process, including, in addition to the resident memory set, the storage space entered into the swap area and the storage space occupied by the shared library.
[0187] For example, the code segment size of the target process is 500KB, the shared library size linked to the target process is 2500KB, the heap and stack memory are 200KB in total, and 100KB of the heap and stack memory enter the swap partition. The process actually loads 1000KB of data in the shared library and 400KB of data in its own code segment.
[0188] The resident memory set size of the target process is: 400KB (code segment loaded into the target process) + 1000KB (data loaded into the shared library) + 100KB (data in the heap and stack memory that are not in the swap partition) = 1500KB.
[0189] The virtual memory size of the target process is: 500KB (target process code segment) + 2500KB (size of the shared library) + 200KB (memory occupied by the heap and stack) = 3200KB.
[0190] Exemplarily, the third preset time period is a preset time before the first time point, and the selection of the third preset time period is similar to the first preset time period. The difference is that the first preset time period is a period before obtaining the first information, while the third preset time period is a period before the first time point. The selection of the third time period refers to the selection of the first time period, which will not be repeated here.
[0191] Exemplarily, the memory access information of the target process to the above-mentioned target storage space in the third time period may include multiple sub-memory access information, and the granularity of the sub-memory access information is not limited in this application. The granularity of the sub-memory access information refers to the size of the storage space corresponding to the sub-memory access information and the time length for obtaining the sub-memory access information. For example, the target storage space is divided into multiple sub-storage spaces, and then one sub-memory access information includes the memory access information of multiple target processes to the sub-memory space in the third time period. Furthermore, the memory access information of the sub-memory space can also be divided in the time dimension to obtain sub-memory access information with a smaller granularity. For details, please refer to the difference between Table 2 and Table 3 above.
[0192] In a possible implementation, before the storage management module 140 manages the target process 110, simulated memory access information and simulated target storage space usage are obtained by simulating the operation of the target process 110. The risk assessment model is trained based on the simulated memory access information and simulated target storage space usage.
[0193] Exemplarily, the operation of the target process 110 can be simulated by running simulation software through an existing process. The operation of the target process 110 can also be simulated by running the process offline. The operation of the target process 110 can also be simulated by performing static program analysis on the process. The specific method of simulating the operation of the target process 110 is not limited in this application.
[0194] Exemplarily, the above-mentioned acquisition of simulated memory access information and simulated target storage space usage is similar to the aforementioned memory access information and target storage space usage. For detailed introduction, please refer to the aforementioned related content, which will not be repeated here.
[0195] Exemplarily, the risk assessment model can be a machine learning model, such as a decision tree algorithm, an association rule learning model, an artificial neural network, a deep learning model, and a Bayesian network. The application does not limit which machine learning model is used. During the training of the machine learning model, the input parameters are the simulated memory access information and the usage of the simulated target storage space.
[0196] Exemplarily, by simulating the operation of the target process, obtaining simulated memory access information and the usage of the simulated target storage space, a risk assessment model is trained. In the case where it is necessary to perform a risk level assessment on the data stored in the first storage space, the risk assessment model can be directly loaded without retraining. Since the model is not trained during the operation of the process, a large number of training parameters can be obtained to train a risk assessment model with higher assessment accuracy. For example, the target process is simulated multiple times to obtain multiple simulated parameter training risk assessment models. For example, the operation of the target process can be simulated for a long time to obtain a large amount of memory access information, and the usage of the simulated target storage space can be obtained multiple times. This application does not limit how to simulate the operation of the target process, how to set the simulation strategy, and how to train the risk assessment model.
[0197] In another possible implementation, when the storage management module 140 manages the target process 110, the fourth memory access information of the target process to the third storage space and the usage of the target storage space are obtained. The target storage space includes the third storage space. The risk assessment model is trained based on the fourth memory access information and the usage of the target storage space.
[0198] Exemplarily, the target storage space includes the third storage space, and the third storage space may be any storage space in the target storage space. For example, the third storage space is a cache line or a storage page.
[0199] Exemplarily, the fourth memory access information may include one or more sub-memory access information, and the granularity of the sub-memory access information may also be different. For the granularity of the memory access information, please refer to the introduction of the aforementioned related content, which will not be repeated here. For example, the memory access information of the target process for one storage page in 1 second can be used as the granularity of the sub-memory access information. For example, the memory access information of the target information for 10 storage pages in 1 minute can be used as the granularity of the sub-memory access information.
[0200] Exemplarily, the usage of the target storage space may be collected every 3 minutes, for example. The usage of the target storage space includes the access information of the target process to the target storage space in the third time period, and the duration of the third time period may be 5 minutes, for example.
[0201] Exemplarily, training the risk assessment model based on the fourth memory access information and the usage of the target storage space is similar to training the risk assessment model based on the simulated memory access information and the usage of the simulated target storage space. For a detailed introduction, please refer to the above related content, which will not be repeated here.
[0202] Regarding how to use the above risk assessment model, please refer to the introduction of the subsequent step S502, which will not be described in detail here.
[0203] In a possible implementation, the storage management module 140 manages the storage address of the data in the storage space occupied by the target process 110 , and also configures a wake-up frequency and a migration frequency associated with the target process 110 .
[0204] Exemplarily, the wake-up frequency refers to the frequency of waking up the storage management module 140 to manage the storage address of the data in the storage space of the target process. The wake-up frequency can be, for example, 1 second / time, 1 minute / time or 1 hour / time. The embodiment of the present application does not limit the magnitude of the wake-up frequency.
[0205] Exemplarily, the migration frequency refers to the migration frequency of data on the storage space occupied by the process 110. For example, when the migration frequency is 5 minutes / time, the storage management module 140 will send a migration instruction to the processor 120 every 5 minutes to batch migrate the data that needs to be migrated. Between two adjacent migration time points, the data that needs to be migrated will be added to the migration queue. The migration frequency can be, for example, 5 minutes / time or 2 hours / time. The embodiment of the present application does not limit the size of the migration frequency.
[0206] S502: Evaluate the risk level of the data stored in the first storage space based on the first information.
[0207] For example, if a storage page is used as an evaluation unit, data migration should be performed with data stored on the storage page as a unit during data migration.
[0208] Exemplarily, a cache line may be used as an evaluation unit to first evaluate the risk level of data on each cache line in a storage page, and then evaluate the risk level of the storage page according to the risk level of data on each cache line.
[0209] Exemplarily, multiple storage pages may be used as an evaluation unit, and during the data migration process, the data stored on the multiple storage pages are used as a unit to perform data migration. The application does not limit the specific number of storage pages used as the evaluation unit.
[0210] In a possible implementation, when a storage page is used as an evaluation unit, the obtained "read data" and "write data" times refer to the "read data" and "write data" times obtained for the storage page as a whole. When a cache line is used as an evaluation unit, the obtained "read data" and "write data" times refer to the "read data" and "write data" times obtained for the cache line as a whole.
[0211] For example, when a storage page is used as an evaluation unit, a "read data" refers to a data read operation performed on the storage page, and the data read operation may refer to reading data of multiple cache lines at a time, or reading data of a cache line at a time. However, when a cache line is used as an evaluation unit, a "read data" refers to a data read operation performed on the cache line.
[0212] It can be seen that taking a storage page as an evaluation unit can only evaluate the risk level of the storage page at the storage page level. However, taking a cache line as an evaluation unit can accurately evaluate the risk level of each cache line in a storage page, and thus the risk level of the storage page can be evaluated more accurately.
[0213] Similarly, in the process of evaluating the risk level of data, the target access information obtained in the target time period is divided into several sub-access information of sub-time periods, and then several data risk levels are evaluated based on the several sub-access information. The data risk level obtained based on the several data risk level evaluations will be more accurate than the data risk level obtained directly through the above target access information evaluation. Among them, the shorter the length of the sub-time period, the more accurate the data risk level obtained in the end.
[0214] It should be understood that the minimum data migration unit in the data migration process is a storage page, and a storage page contains multiple cache lines. For example, a storage page with a storage space size of 4KB contains 512 cache lines, and each cache line can store 64 bytes of data.
[0215] Therefore, before migrating data, it is necessary to at least evaluate the risk level of the data stored in one storage page.
[0216] In a possible implementation, the risk level of the data stored in the first storage space is evaluated based on the first information, and the risk level of the data stored in the first storage space can be obtained by weighted calculation of the read data and the write data in the first information. The weighted calculation method conforms to the following formula:
[0217] L = (F1*D1+F2*D2) / T, where L is the assessed risk level, D1 is the number of times data is read, F1 is the weighting coefficient of D1, D2 is the number of times data is written, F2 is the weighting coefficient of D2, and T is the length of the time period for obtaining read data or writing data. Wherein, F1 is a rational number greater than 0, and F2 is a rational number less than 0 or 0. The values of F1 and F2 can be artificially determined by a preset method.
[0218] Exemplarily, the values of F1 and F2 can be determined by using expert knowledge and selecting appropriate values based on experience. The values of F1 and F2 can also be obtained by training using a machine learning method. This application does not limit how to train the values of F1 and F2 using a machine learning method.
[0219] In a possible implementation, the values of F1 and F2 may be fixed values, for example, the value of F1 is 2.0, and the value of F2 is -1.0. The fixed value means that the values of F1 and F2 are fixed values that have been determined in any case, for example, they will not change due to different storage devices where the data is located.
[0220] Exemplarily, the first information may be the information shown in Table 3, and the calculated risk level may refer to Table 4.
[0221] Table 4
[0222]
[0223] As shown in Table 4, the risk level of the data on a cache line of the target process in each sub-time period can be calculated by the formula L = (F1*D1+F2*D2) / T. Among them, the value of F1 is 2.0 and the value of F2 is -1.0. A negative risk level does not mean that there is no risk on the data on the storage page, but only means that the risk level of the data on the storage page is low.
[0224] Table 4 above exemplarily shows that a cache line is used as an evaluation unit, and the risk level of the data stored in each cache line is evaluated according to the formula L = (F1*D1+F2*D2) / T. Taking a storage page as an evaluation unit, the risk level can also be evaluated according to the formula L = (F1*D1+F2*D2) / T.
[0225] In a possible implementation, the third memory access information of the first storage space can be evaluated by performing weighted calculation on the second memory access information shown in Table 3. The weighted calculation method conforms to the following formula:
[0226] L=S1*H1+S2*H2+S3*H3+S4*H4+S5*H5, where S1, S2, S3, S4 and S5 represent weighting coefficients, D T1 , D T2 , D T3 , D T4 and D T5 Indicates the number of "read data" or "write data" operations, where T1, T2, ... represent memory access time, for example, D T1 Indicates the number of "read data" or "write data" in the T1 time period. The present application does not limit the selection of weighting coefficients. For example, the weighting coefficients can be increasing in sequence, for example, S1=1, S2=2, S3=3, S4=4, S5=5. For example, the weighting coefficients can be the same value, for example, S1=S2=S3=S4=S5=1.
[0227] Exemplarily, the third memory access information may be the information shown in Table 5.
[0228] Table 5
[0229]
[0230] The weighted coefficients for obtaining the third memory access information shown in Table 5 are S1=S2=S3=S4=S5=1.
[0231] T6 in Table 5 is used to indicate the time when the first information is obtained, or the second preset time period after the first information is obtained.
[0232] Exemplarily, the second preset time period is a period of time that starts at the time point when the first information is obtained and is equal to T5 in length. For example, if T5 is 1 hour long and the time point when the first information is obtained is 9:00 a.m. on January 1, 2000, then the time period represented by T6 is from 9:00 a.m. on January 1, 2000 to 10:00 a.m. on January 1, 2000.
[0233] Exemplarily, the second preset time period is a period of time that takes the time point when the first information is obtained as the starting time point and is shorter than T5.
[0234] The second preset time period is a period of any length, starting from the time point at which the first information is obtained.
[0235] In a possible implementation, the third memory access information shown in Table 5 can also be used to obtain the risk level of the data stored on each cache line according to the weighted formula L = (F1*D1+F2*D2) / T. For example, the value of the weighted formula F1 is selected to be 2.0, and the value of F2 is -1.0. The risk level of the first cache line in the T6 time period is 27*2-40=14. The risk level of the second cache line in the T6 time period is 23*2-60=-14.
[0236] In a possible implementation, after evaluating the data risk levels of multiple cache lines on a storage page, the data risk level on the storage page can be evaluated by weighting the multiple data risk levels. The weighted calculation method conforms to the following formula:
[0237] L = F3*Z+F4*N, where Z represents the set of cache data with a risk level greater than 0, F3 is the weighting coefficient of Z, N represents the set of cache data with a risk level less than 0, and F4 is the weighting coefficient of N. F3 is a rational number greater than 0, and F4 is a rational number less than 0 or 0. The values of F3 and F4 can be artificially determined by a preset method to determine the size of the values of F1 and F2. For example, F3 is 1.0 and F4 is -0.25.
[0238] Exemplarily, the values of F3 and F4 can be determined by using expert knowledge and selecting appropriate values based on experience. The values of F3 and F4 can also be obtained by training through machine learning methods. This application does not limit how to train through machine learning methods to obtain the values of F1 and F2.
[0239] Exemplarily, the risk level of the data in the first storage space in each time period is calculated by the formula L=F3*Z+F4*N, as shown in Table 6.
[0240] Table 6
[0241] process Time period Storage Space Risk Level Target process <![CDATA[T6]]> First storage space 10.5
[0242] In Table 6, the risk level of the data in the first storage space of the target process at the time period / time T6 is evaluated to be 10.5. The calculation process is 14*1-14*0.25=10.5.
[0243] Table 4, Table 5 and Table 6 above exemplarily introduce how to generate the risk level of the data stored in the first storage space by weighted calculation based on the memory access information.
[0244] In a possible implementation, the first information includes first memory access information of the target process to the first storage space in a first time period and usage of the target storage space acquired at a first time point, and the risk level of the data stored in the first storage space can be generated through the first information.
[0245] Exemplarily, when the usage of the target storage space includes: the address of the target storage space, the type of the target storage space, and the dirty page ratio of the target storage space. The risk level of the process can be evaluated based on the usage of the storage space, and then a more accurate risk level of the data can be evaluated based on the risk level of the process and the memory access information. For a detailed introduction to the address of the target storage space, the type of the target storage space, and the dirty page ratio of the target storage space, please refer to the relevant content of the aforementioned step S501, which will not be repeated here.
[0246] In a possible implementation, each sub-target storage space of the target storage space can be identified according to the address of the target storage space and the type of the target storage space. The sub-target storage space can be, for example, a storage page or a storage segment composed of multiple storage pages. In order to facilitate understanding of the subsequent content, a storage page will be used as an example of a sub-target storage space. Identifying each sub-target storage space of the target storage space can facilitate statistics of the proportion of each storage type.
[0247] Exemplarily, each sub-target storage space of the target storage space is identified, and the obtained data is in the form of storage address+storage type, for example, 0000-001f+dirty page.
[0248] In a possible implementation, it can be learned from the relevant analysis of step S501 that the risk level of the data can be inferred by the ratio of dirty pages in the target storage space. For the specific analysis process, please refer to the aforementioned related content, which will not be repeated here. Therefore, the risk level of the target process can be generated according to the ratio of dirty pages in the target storage space. It should be understood that the ratio of dirty pages is an evaluation criterion for the risk level of data, and the ratio of dirty pages is not necessarily proportional / inversely proportional to the risk level of the data.
[0249] In a possible implementation, the risk level of the target process may be determined according to the ratio range of file pages to anonymous pages in dirty pages.
[0250] Exemplarily, when the proportion of file pages in dirty pages is 0-30%, the risk level of the target process is A. When the proportion of file pages in dirty pages is 31-60%, the risk level of the target process is B. When the proportion of file pages in dirty pages is 61-100%, the risk level of the target process is C. Among them, when the risk level of the target process is A, it indicates that the risk level of the target process is the highest. When the risk level of the target process is C, it indicates that the risk level of the target process is the lowest. When the memory access information is the same, the higher the risk level of the target process, the higher the risk level of the generated data.
[0251] In a possible implementation, the usage of the target storage space also includes the size of the resident memory set of the target process. From the relevant analysis of step S501, it can be seen that the larger the resident memory set of the target process, the higher the risk level of the data stored in the target storage space. On the contrary, the smaller the resident memory set of the target process, the lower the risk level of the data stored in the target storage space. For the specific analysis process, please refer to the above-mentioned related content, which will not be repeated here.
[0252] Therefore, the risk level of the target process can be generated according to the resident memory set size of the target process. Generating the risk level of the target process according to the resident memory set size of the target process is similar to generating the risk level of the target process according to the dirty page ratio in the target storage space. For the generation method, please refer to the generation process similar to the generation process of generating the risk level of the target process according to the dirty page ratio in the target storage space, which will not be repeated here.
[0253] For example, if the resident memory set is greater than 100MB and less than 500MB, the risk level of the process is a. If the resident memory set is greater than 500MB and less than 1000MB, the risk level of the process is b. If the resident memory set is greater than 1000MB, the risk level of the process is c.
[0254] In a possible implementation, the usage of the target storage space also includes the memory access information of the target storage space by the target process in a third time period. For a detailed introduction to the memory access information of the target storage space in the third time period, please refer to the relevant content of the aforementioned step S501, which will not be repeated here. The memory access information can reflect the characteristics of "reading data" and / or "writing data" of the target process in the third time period. If the target process "reads data" more times in the third time period, it indicates that the risk level of the target process is higher. If the target process "writes data" more times in the third time period, it indicates that the risk level of the target process is lower.
[0255] The risk level of the target process generated above can be combined with the first memory access information of the target process to the first storage space in the first time period to generate the risk level of the data stored in the first storage space.
[0256] In a possible implementation, the risk level of the data stored in the first storage space is first generated according to the first access information of the target process to the first storage space in the first time period as shown in Table 6. Then, the risk level of the data shown in Table 6 is corrected according to the risk level of the process to obtain the risk level of the corrected data.
[0257] In a possible implementation, if the risk level of the process is higher than a certain threshold, the risk level of the data will be appropriately increased, and if the risk level of the process is lower than a certain threshold, the risk level of the data will be appropriately reduced or will not be changed.
[0258] Exemplarily, the dirty page ratio of the target storage space is evaluated, and the risk level of the process is A. The risk level of the data generated according to the memory access information is 10. Then the risk level of the corrected data is greater than 10, for example, the risk level of the corrected data is 11. If the dirty page ratio of the target storage space is evaluated, the risk level of the process is B. Then the risk level of the corrected data may remain unchanged and still be 10. If the dirty page ratio of the target storage space is evaluated, the risk level of the process is C. Then the risk level of the corrected data may be less than 10, for example, the risk level of the corrected data is 9.
[0259] In a possible implementation, in addition to using a weighted calculation method to evaluate the risk level of the data stored in the first storage space, the risk assessment model can also be used to evaluate the risk level of the data. The risk assessment model is the risk assessment model introduced in step S501. For the specific implementation of the risk assessment model, please refer to the relevant content of step S501, which will not be repeated here.
[0260] In one possible implementation, the first memory access information shown in Table 2 above may be used as input to a risk assessment model, which outputs a risk level of data stored in the first storage space based on the memory access information of the target process to the first storage space in the first time period.
[0261] In another possible implementation, the second memory access information shown in Table 3 above can be used as an input to a risk assessment model, and the risk assessment model predicts the risk level of the data stored by the target process in the first storage space in the T6 time period / time based on the second memory access information.
[0262] In another possible implementation, the above Table 3 and the usage of the target storage space can be used as inputs to a risk assessment model. The risk assessment model predicts the risk level of the data stored by the target process in the first storage space at time period / time T6 based on the second memory access information and the usage of the target storage space.
[0263] In another possible implementation, the information in Table 3 above may be input into a convolutional neural network and / or a recurrent neural network to output memory access information of the target process to the first storage space in the T6 time period / time.
[0264] In the above method, the third memory access information can be obtained by processing the first memory access information or the second memory access information, and the third memory access information can be the memory access information of the first storage space in the next time period. The risk level change trend of the data in the first storage space can be better predicted, and a more appropriate migration address can be determined to improve the reliability of the data.
[0265] In the above method, the risk level of the data stored in the first storage space can be evaluated by evaluating the risk level of the data in the sub-storage space of the first storage space, and then combining the risk levels of the data in the multiple sub-storage spaces to generate the risk level of the data in the first storage space. Since more fine-grained memory access information can be obtained in the process of evaluating the risk level of the data in the sub-storage space, the evaluated risk level will be more accurate.
[0266] In the above method, by using the usage of the target storage space as a parameter for evaluating the data risk level, the process of evaluating the data risk level can be bound to the characteristics of the process, thereby evaluating a more accurate data risk level. For example, if the dirty page ratio of process A is greater than that of process B, it means that process A has more "write data" and less "read data", while process B has less "write data" and more "read data". Overall, the data on the storage space occupied by process A is less prone to errors than that of process B. Further, it is detected that there are two storage pages with the same memory access information, which belong to process A and process B respectively. Since the data on the storage space occupied by process A is less prone to errors than that of process B, the risk level of the storage page belonging to process A will be lower than the risk level of the storage page belonging to process B.
[0267] In summary, the above method can adaptively evaluate / predict the risk level of data without the help of expert knowledge, and can also adaptively evaluate the impact of different processes on the data risk level, making the assessed data risk level more accurate, facilitating the selection of more accurate migration addresses, and improving the reliability of the data.
[0268] S503: Migrate the data stored in the first storage space to the second storage space based on the risk level.
[0269] Exemplarily, the second storage space is part of the space in the memory 130, and the second storage space may be the same storage space as the first storage space. In the case where the second storage space and the first storage space are the same storage space, it indicates that the risk level of the data on the first storage space matches the reliability of the first storage space and no migration operation needs to be performed; otherwise, a data migration operation needs to be performed.
[0270] Exemplarily, when a data migration operation needs to be performed, the data migration needs to be completed according to the migration strategy. This application does not limit how to achieve data migration, for example, the data on the first storage space may be copied first, then the data may be pasted to the second storage space, and finally the data on the first storage space may be deleted.
[0271] Exemplarily, after completing the data migration, it is also necessary to establish a mapping relationship between the virtual storage address of the process management and the second storage space. The virtual storage address is the virtual storage address that has a mapping relationship with the first storage space before the data migration.
[0272] Exemplarily, the reliability level of each memory 130 managed by the processor 120 can be preset. The processor 120 inputs the reliability level of each memory 130 into the storage management module 140, and the storage management module evaluates the memory 130 where the second storage space is located based on the reliability level and the risk level of the data. Then, the storage management module 140 determines whether the first storage space and the second storage space are the same storage space or on the same memory 130. If the above judgment structure is no, the information that the data on the first storage space needs to be migrated and the address of the second storage space are sent to the processor 120. The processor 120 completes the migration operation based on the information that the data on the first storage space needs to be migrated and the address of the second storage space, and cooperates with the memory 130.
[0273] In a possible implementation, the data stored in the first storage space is migrated to the second storage space based on the risk level and the second information; the second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the storage space reliability of the terminal device. The terminal device includes the processor 120 and the memory 130.
[0274] In a possible implementation, the second information is input to the storage management module 140, so that the storage management module 140 outputs a data migration strategy. The processor 120 then completes the data migration together with the memory 130 according to the migration strategy.
[0275] In a possible implementation, when the second information includes the operating load of the terminal device, the storage management module 140 generates a timing for data migration according to the operating load.
[0276] Exemplarily, selecting a case where the operating load of the terminal device is low to perform the data migration operation can reduce the interference of the data migration process on the performance of the terminal device, and can also reduce the interference caused by the target process reading / writing data during the data migration process.
[0277] In a possible implementation, when the second information includes NUMA affinity, the storage management module 140 selects a node to migrate according to the NUMA affinity.
[0278] For example, if the node linked to the memory 130 where the data is located is A, it is necessary to ensure that the node linked to the memory 130 where the migration address is located is also A. The access delay of the processor 120 to the data can be consistent before and after data migration to avoid the influence of node inconsistency noise before and after data migration.
[0279] In one possible implementation, when the second information includes the storage space reliability of the terminal device, the storage management module 140 determines the migration address of the data based on the storage space reliability and the risk level of the data, reduces the interference of the data by the memory failure, and makes the data have higher data reliability in the storage space after migration.
[0280] In a possible implementation, after receiving the migration strategy from the storage management module 140, the processor 120 first determines the migration address and the migration node. Then, it is determined whether the migration address is consistent with the address where the data is located. If the addresses before and after the migration are consistent, the migration operation ends. If the addresses before and after the migration are inconsistent, the data is added to the migration queue. Finally, the processor 120 performs batch migration of the data in the migration queue according to the migration timing.
[0281] It can be seen that the embodiment of the present application can adaptively select the storage location of the data and dynamically generate a data migration strategy based on the above-mentioned second information. The processor 120 cooperates with the memory 130 to complete the data migration operation according to the migration strategy, thereby improving the reliability of the data, reducing the interference of the data by the memory failure, and improving the operating reliability and performance of the terminal device.
[0282] A schematic diagram of a storage management module 140 provided in an embodiment of the present application is shown as follows: Figure 6 When the storage management module 140 is divided into functional modules, the storage management module 140 includes any one or more of the following: a business application analysis module, a data access analysis module, a data risk assessment module, and a memory classification management module.
[0283] Exemplarily, the business application analysis module is used to obtain the usage of the target storage space at the first time point, and generate static features of the target process based on the usage. The static features are used to represent the usage of the target storage space, which is a form of expression of the usage, so that other modules can use the usage of the target storage space. For the above-mentioned first time point to obtain the usage of the target storage space, please refer to the relevant content of the aforementioned step S502, which will not be repeated here.
[0284] Exemplarily, the business application analysis module is also used to complete the training of the risk assessment model. For example, the business analysis module monitors the target process, collects the target process's usage of the target storage space, and uses the storage access information to train the risk assessment model. If the risk assessment model already exists, the risk assessment model is directly loaded. For how to train the risk assessment model, please refer to the relevant content of the aforementioned step S501, which will not be repeated here.
[0285] Exemplarily, the data memory access analysis module is used to obtain the first memory access information of the target process to the first storage space in the first time period, and generate the dynamic characteristics of the target process according to the first memory access information. The dynamic characteristics are used to represent the first memory access information, which is a form of expression of the first memory access information, so that other modules can use the first memory access information. For a detailed description of the first memory access information, please refer to the relevant content of the aforementioned step S501, which will not be repeated here. The data memory access analysis module can obtain the first memory access information through the performance monitoring unit in the processor 120.
[0286] It should be understood that the information represented by the static characteristics of the target process is equivalent to the usage of the target storage space, and the information represented by the dynamic characteristics of the target process is equivalent to the first memory access information.
[0287] Exemplarily, the data risk assessment module is used to generate the risk level of the data stored in the first storage space according to the dynamic characteristics of the target process and / or the static characteristics of the target process. For example, the data risk assessment module can generate the risk level of the data stored in the first storage space according to only the dynamic characteristics of the target process. The data risk assessment module can also generate the risk level of the data stored in the first storage space according to the dynamic characteristics and static characteristics of the target process. For the method of generating the risk level of the data according to the dynamic characteristics and / or static characteristics of the target process, please refer to the relevant content of the above step S502, which will not be repeated here.
[0288] Exemplarily, the memory classification management module is used to generate a data migration strategy based on the risk level of the data and the operating load of the terminal device, the affinity of the non-uniform memory access of the target process, and the reliability of the storage space of the terminal device. For how to generate the data migration strategy, please refer to the relevant content of the above step S503, which will not be repeated here.
[0289] In a possible implementation, first, the system administrator communicates with the running storage management module 140 through a command line, adds the target process identifier to be protected to the list of applications to be managed, and also adds some configuration information, such as data migration frequency, wake-up frequency, etc. The migration frequency and wake-up frequency refer to the relevant introduction of the aforementioned step S501, which will not be repeated here.
[0290] Secondly, the business application module obtains the risk assessment model of the target process, for example, by loading a trained risk assessment model. The risk assessment model can also be obtained by obtaining the static features of the target process and training online. For the specific implementation method, please refer to the relevant introduction of the aforementioned step S501, which will not be repeated here.
[0291] Next, the first memory access information of the target process to the first storage space obtained by the performance monitoring unit of the processor 120 is input into the data memory access analysis module. The data memory access analysis module generates the dynamic characteristics of the target process according to the first memory access information. For the specific implementation method, please refer to the relevant introduction of the aforementioned step S501, which will not be repeated here.
[0292] Again, the business application analysis module obtains the usage of the target storage space occupied by the target process through the system call of the operating system. The business application analysis module then generates static features of the target process based on the usage. For the specific implementation method, please refer to the relevant introduction of the aforementioned step S501, which will not be repeated here.
[0293] Thirdly, the data risk assessment module generates a risk level of the data stored in the first storage space according to the dynamic characteristics and / or static characteristics of the target process. For the specific implementation method, please refer to the relevant introduction of the aforementioned step S502, which will not be repeated here.
[0294] Again, the memory classification management module generates a data migration strategy based on the risk level of the above data and the operating load of the terminal device, the affinity of the non-uniform memory access of the above target process, and the reliability of the storage space of the above terminal device. After this step is completed, the storage management module 140 enters a dormant state and waits to be awakened next time according to the above wake-up frequency. There is no need to re-acquire the risk assessment module when the storage management module 140 is awakened again. Please refer to the relevant introduction of the aforementioned step S502 for the specific implementation method, which will not be repeated here.
[0295] Finally, the processor 120 performs a data migration operation according to the above data migration frequency and migration strategy. For example, the processor 120 is awakened according to the migration frequency to cooperate with the memory 130 to perform a data migration operation, and the processor 120 then performs a data migration operation according to the above migration strategy and cooperates with the memory 130. For the specific implementation method, please refer to the relevant introduction of the above step S503, which will not be repeated here.
[0296] In summary, the method provided by the embodiment of the present application can, on the one hand, adaptively determine the risk level of the data on the first storage space occupied by the target process according to the characteristics of the target process, reduce the intrusive modification of the target process, reduce the reliance on the knowledge of business experts, reduce the storage management cost and improve the reliability of the data. On the other hand, the risk level of the data on the first storage space can be represented in a fine-grained manner, improving the accuracy of the risk level assessment of the data on the first storage space.
[0297] The above mainly introduces the vehicle insurance formulation method provided by the embodiment of the present application. It can be understood that in order to realize the corresponding functions mentioned above, each control unit or device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0298] The embodiment of the present application can divide the functional modules of the device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0299] In the case of dividing each functional module according to each function, the embodiment of the present application also provides a device for implementing any of the above methods, for example, a device is provided including units (or means) for implementing each step in any of the above methods.
[0300] For example, see Figure 7 , which is a structural diagram of a terminal device 700 provided in an embodiment of the present application. Figure 7The terminal device 700 shown may be a terminal device for implementing any embodiment of the above storage management method. The terminal device 700 may include an acquisition unit 701, an evaluation unit 702 and a migration unit 703. Among them:
[0301] The acquisition unit 701 is used to acquire first information, wherein the first information includes first memory access information of the target process to the first storage space in a first time period. The first time period is a first preset time period before acquiring the first information.
[0302] The evaluation unit 702 is used to evaluate the risk level of the data stored in the first storage space based on the first information.
[0303] The migration unit 703 is used to migrate the data stored in the first storage space to the second storage space based on the risk level.
[0304] In a possible embodiment, the first memory access information includes n second memory access information, where n is an integer greater than 1. The first time period includes n sub-time periods, and the memory access information acquired in the m-th sub-time period of the n sub-time periods is the m-th second memory access information of the n second memory access information, where m is an integer from 1 to n.
[0305] The step of evaluating the risk level of the data stored in the first storage space based on the first information includes:
[0306] The third memory access information of the first storage space in a second time period is evaluated based on the n second memory access information. The second time period is a second preset time period after obtaining the first information.
[0307] The risk level is evaluated based on the third access information.
[0308] In a possible embodiment, the first storage space includes a plurality of cache lines, and each of the n second memory access information is composed of memory access information of the plurality of cache lines.
[0309] In a possible embodiment, the first information further includes usage of the target storage space acquired at the first time point. The target storage space is the storage space occupied by the target process, and the target storage space includes the first storage space.
[0310] The usage of the target storage space includes: the address of the target storage space, the type of the target storage space and the dirty page ratio of the target storage space. The first time point is a preset time point before acquiring the first information.
[0311] In a possible embodiment, the usage of the target storage space further includes:
[0312] The size of the resident memory set RSS of the target process and / or the memory access information of the target process to the target storage space in a third time period.
[0313] The third time period is a third preset time period before the first time point.
[0314] In a possible embodiment, the evaluation unit 702 is specifically configured to: evaluate the risk level of the data stored in the first storage space based on the first information by using a risk evaluation model.
[0315] The risk assessment model is trained based on simulated memory access information and simulated storage space usage.
[0316] The simulated memory access information and the simulated storage space usage are obtained by simulating the operation of the target process.
[0317] In a possible embodiment, the evaluation unit 702 is specifically configured to: evaluate the risk level of the data stored in the first storage space based on the first information by using a risk evaluation model.
[0318] The risk assessment model is obtained by training based on the fourth memory access information and the usage of the target storage space.
[0319] The fourth memory access information and the usage of the target storage space are obtained by running the target process.
[0320] In a possible embodiment, the migration unit 703 is specifically configured to migrate the data stored in the first storage space to the second storage space based on the risk level and the second information.
[0321] The second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the storage space reliability of the terminal device.
[0322] In a possible embodiment, the acquisition unit 701 is specifically configured to acquire the migration frequency of the data stored in the first storage space.
[0323] The migration unit 703 is specifically configured to migrate the data stored in the first storage space to the second storage space based on the migration frequency, the risk level and the second information.
[0324] In a possible embodiment, the terminal device further includes:
[0325] An establishing unit is used to establish a mapping relationship between the virtual storage address managed by the target process and the second storage space.
[0326] For the convenience of subsequent description, the terminal device 700 is referred to as a device. It should be understood that the division of the units in the device is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the units in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or implement the functions of the units of the device, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory inside the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all of the units can be realized by designing the hardware circuits, and the hardware circuits can be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be realized by a programmable logic device (PLD), taking a field programmable gate array (FPGA) as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be realized in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.
[0327] In the embodiment of the present application, the processor is a circuit with data processing capability. In one implementation, the processor may be a circuit with instruction reading and running capability, such as a CPU, a microprocessor, a graphics processing unit (GPU) (which may be understood as a microprocessor), or a digital signal processor (DSP), etc.; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit may be fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and implementing the hardware circuit configuration may be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it may also be a hardware circuit designed for artificial intelligence, which may be understood as an ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc.
[0328] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0329] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0330] For example, see Figure 8 , which is a structural diagram of a possible physical entity of the terminal device provided in this application. Figure 8 The terminal device 800 shown may be the terminal device in the method described in the above embodiment. The terminal device 800 includes: a processor 801, a memory 802 and a communication interface 803. The processor 801, the communication interface 803 and the memory 802 may be connected to each other or connected to each other through a bus 804.
[0331] Exemplarily, the memory 802 is used to store computer programs and data of the terminal device 800. The memory 802 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM) or portable read-only memory (CD-ROM), etc.
[0332] The software or program codes required for all or part of the functions of the terminal device in the above method embodiment are stored in the memory 802 .
[0333] In one possible implementation, if the software or program code required for some functions is stored in the memory 802, the processor 801, in addition to calling the program code in the memory 802 to implement some functions, can also cooperate with other components (such as the communication interface 803) to complete other functions described in the method embodiment (such as the function of receiving or sending data).
[0334] There may be multiple communication interfaces 803 for supporting the terminal device 800 to communicate, such as receiving or sending data or signals.
[0335] Exemplarily, the processor 801 may be the CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms. The processor 801 may be used to read the program stored in the memory 802, execute the program, and so on. Figure 2 And the operations performed by the terminal device in possible embodiments thereof.
[0336] Figure 8 The specific operations and beneficial effects of each unit in the terminal device 800 shown can be found in the corresponding description in the above method embodiment, which will not be repeated here.
[0337] The present application also provides a chip, which includes a processor and a memory. The memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, so that the chip executes the above Figure 2 And the operations performed by the terminal device in possible embodiments thereof.
[0338] The present application also provides a chip, which includes a processor and a memory. The memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, so that the chip executes the above Figure 3 And the operations performed by the terminal device in possible embodiments thereof.
[0339] The present application also provides a computer-readable storage medium, which stores a computer program or computer instructions, which is executed by a processor to implement the above Figure 2 And the method implemented by the terminal device in possible embodiments thereof.
[0340] The present application also provides a computer-readable storage medium, which stores a computer program or computer instructions, which is executed by a processor to implement the above Figure 3 And methods implemented by terminal devices in possible embodiments thereof.
[0341] The present application also provides a computer program product. When the computer program product is read and executed by a computer, the above Figure 2 The method implemented by the terminal device in its possible embodiments will be executed.
[0342] The present application also provides a computer program product. When the computer program product is read and executed by a computer, the above Figure 3 The method implemented by the terminal device in its possible embodiments will be executed.
[0343] In summary, this solution evaluates the risk level of the target data block by obtaining the risk assessment model of the target process and obtaining the memory access information of the target process to the target data block in a certain period of time in the past. The memory access information includes the read and write operations of the target process on the cache or memory and the hit rate of the last-level cache. The risk assessment model evaluates the risk level of the data block by analyzing the memory access information of the target data block. Furthermore, the storage location of the target data block is migrated based on the risk level, which can improve the reliability of storing the target data block and reduce the probability of memory failure of the data block, thereby improving the reliability and performance of the terminal device operation.
[0344] In addition, in this solution, the terminal device can use the above-mentioned first memory access information as an evaluation basis through a risk assessment model to evaluate the risk level of the data, thereby generating the risk level of the data more quickly and accurately. Further, the above-mentioned first memory access information can also be divided into multiple sub-memory access information, and the risk assessment model can predict the memory access information of the next time period by evaluating the multiple sub-memory access information. Then the risk level of the target data block evaluated by the risk assessment model according to the memory access information of the next time period can predict the change trend of the risk level of the target data block. The change trend of the risk level can enable the target data block to be migrated to a more suitable storage location, further improving the reliability of storing the target data block. In order to further improve the accuracy of evaluating the risk level of data, the risk level of multiple cache lines contained in the target data block can also be evaluated, and then the risk level of the target data block can be obtained according to the risk level evaluation of the data on the multiple cache lines. The risk level of the target data block obtained by the evaluation will be more accurate. It is convenient to further improve the reliability of storing the target data block and reduce the probability of memory failure of the data block.
[0345] In addition, the embodiment of the present application also combines the target process's use of storage space to evaluate the risk level of the target data block. The data risk level obtained by the evaluation takes into account the operating characteristics of the target process, and the risk level of the target data block will be dynamically adjusted according to the target process's use of storage space, making the risk level of the target data block obtained by the evaluation more accurate, which can further reduce the probability of memory failure of the target data block, and at the same time improve the operating reliability of the target process.
[0346] Finally, after evaluating the risk level of the data, the device status of the terminal device can be combined so that the solution can select the appropriate migration time, migration node and migration location during the storage location migration of the target data block.
[0347] Obviously, the embodiments described above are only a part of the embodiments of the present application, rather than all the embodiments. The reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present embodiment application. The phrase appearing in various positions in the specification is not necessarily the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It can be understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of the present application. The terms "first", "second", "third", etc. in the specification and claims of the present application and the drawings are distinguished from different objects, rather than being used to describe a specific order.
[0348] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or optionally, steps or units that are not listed are also included, or other steps or units that are inherent to these processes, methods, products or devices are optionally included. It can be understood that the equal sign of the above-mentioned conditional judgment can be greater than one end or less than one end. For example, the above-mentioned conditional judgment that a threshold is greater than, less than or equal to can also be changed to a conditional judgment that the threshold is greater than, equal to or less than, and is not limited here. It should be understood that the above-mentioned communication mode can be indirect communication and direct communication. Direct communication can be understood as communication between two devices without going through other devices, and indirect communication can be understood as communication between two devices that needs to go through other devices.
[0349] It should be noted that, under logical circumstances, the steps in the above method flow can be flexibly adjusted in some cases. For example, some steps in the above method flow can be executed in advance. For another example, some steps in the above method flow can be split or merged, or can be deleted, which is not limited here.
[0350] It is to be understood that only the part relevant to the present application but not all the contents are shown in the accompanying drawings. It should be understood that some exemplary embodiments are described as the processing or method described as a flow chart. Although the flow chart describes each operation (or step) as a sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0351] As used in this specification, the terms "component", "module", "system", "unit", etc. are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate through local and / or remote processes, for example, based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).
[0352] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation methods of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.
Claims
1. A storage management method, characterized in that: The method comprises: Acquire first information, where the first information includes first memory access information of a target process to a first storage space in a first time period; the first time period is a first preset time period before acquiring the first information; evaluating a risk level of data stored in the first storage space based on the first information; The data stored in the first storage space is migrated to a second storage space based on the risk level.
2. The method according to claim 1, characterized in that The first memory access information includes n second memory access information, where n is an integer greater than 1; the first time period includes n sub-time periods, and the memory access information acquired in the m-th sub-time period of the n sub-time periods is the m-th second memory access information of the n second memory access information; The m is an integer from 1 to the n; The evaluating the risk level of the data stored in the first storage space based on the first information includes: evaluating the third memory access information of the first storage space in a second time period based on the n second memory access information; the second time period is a second preset time period after obtaining the first information; The risk level is evaluated based on the third access information.
3. The method according to claim 2, characterized in that The first storage space includes a plurality of cache lines; each of the n second memory access information is composed of memory access information of the plurality of cache lines.
4. The method according to any one of claims 1 to 3, characterized in that: The first information also includes usage of the target storage space obtained at a first time point; the first time point is a preset time point before obtaining the first information; the target storage space is the storage space occupied by the target process, and the target storage space includes the first storage space; The usage of the target storage space includes: the address of the target storage space, the type of the target storage space, and the dirty page ratio of the target storage space.
5. The method according to claim 4, characterized in that The usage of the target storage space also includes: The size of the resident memory set RSS of the target process and / or the memory access information of the target process to the target storage space in a third time period; The third time period is a third preset time period before the first time point.
6. The method according to any one of claims 1 to 5, characterized in that: The evaluating the risk level of the data stored in the first storage space based on the first information includes: evaluating the risk level of the data stored in the first storage space based on the first information by using a risk assessment model; The risk assessment model is obtained by training based on simulated memory access information and simulated storage space usage; The simulated memory access information and the simulated storage space usage are obtained by simulating the operation of the target process.
7. The method according to any one of claims 1 to 5, characterized in that: The evaluating the risk level of the data stored in the first storage space based on the first information includes: evaluating the risk level of the data stored in the first storage space based on the first information by using a risk assessment model; The risk assessment model is obtained by training based on the fourth memory access information and the usage of the target storage space; The fourth memory access information and the usage of the target storage space are obtained by running the target process.
8. The method according to any one of claims 1 to 7, characterized in that: The method is applied to a terminal device; the migrating the data stored in the first storage space to the second storage space based on the risk level includes: Migrating the data stored in the first storage space to a second storage space based on the risk level and the second information; The second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the storage space reliability of the terminal device.
9. The method according to claim 8, characterized in that The method further comprises: Acquire the migration frequency of the data stored in the first storage space; The step of migrating the data stored in the first storage space to the second storage space based on the risk level and the second information includes: The data stored in the first storage space is migrated to the second storage space based on the migration frequency, the risk level and the second information.
10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: A mapping relationship between the virtual storage address managed by the target process and the second storage space is established.
11. A terminal device, characterized in that: The terminal device comprises: An acquiring unit, configured to acquire first information, wherein the first information includes first memory access information of the target process to the first storage space in a first time period; the first time period is a first preset time period before acquiring the first information; an evaluation unit, configured to evaluate a risk level of data stored in the first storage space based on the first information; A migration unit is used to migrate the data stored in the first storage space to a second storage space based on the risk level.
12. The terminal device according to claim 11, characterized in that: The first memory access information includes n second memory access information, where n is an integer greater than 1; the first time period includes n sub-time periods, and the memory access information acquired in the m-th sub-time period of the n sub-time periods is the m-th second memory access information of the n second memory access information, where m is an integer from 1 to n; The evaluation unit is specifically configured to evaluate the third memory access information of the first storage space in a second time period based on the n second memory access information; the second time period is a second preset time period after obtaining the first information; The risk level is evaluated based on the third access information.
13. The terminal device according to claim 12, characterized in that: The first storage space includes a plurality of cache lines; each of the n second memory access information is composed of memory access information of the plurality of cache lines.
14. The terminal device according to any one of claims 11 to 13, characterized in that: The first information also includes usage of the target storage space obtained at a first time point; the first time point is a preset time point before obtaining the first information; the target storage space is the storage space occupied by the target process, and the target storage space includes the first storage space; The usage of the target storage space includes: the address of the target storage space, the type of the target storage space, and the dirty page ratio of the target storage space.
15. The terminal device according to claim 14, characterized in that: The usage of the target storage space also includes: The size of the resident memory set RSS of the target process and / or the memory access information of the target process to the target storage space in a third time period; The third time period is a third preset time period before the first time point.
16. The terminal device according to any one of claims 11 to 15, characterized in that: The evaluation unit is specifically configured to: evaluate the risk level of the data stored in the first storage space based on the first information by using a risk evaluation model; The risk assessment model is obtained by training based on simulated memory access information and simulated storage space usage; The simulated memory access information and the simulated storage space usage are obtained by simulating the operation of the target process.
17. The terminal device according to any one of claims 11 to 15, characterized in that: The evaluation unit is specifically configured to: evaluate the risk level of the data stored in the first storage space based on the first information by using a risk evaluation model; The risk assessment model is obtained by training based on the fourth memory access information and the usage of the target storage space; The fourth memory access information and the usage of the target storage space are obtained by running the target process.
18. The terminal device according to any one of claims 11 to 17, characterized in that: The migration unit is specifically configured to migrate the data stored in the first storage space to the second storage space based on the risk level and the second information; The second information includes one or more of the following: the running load of the terminal device, the affinity of the non-uniform memory access NUMA of the target process, and the storage space reliability of the terminal device.
19. The terminal device according to claim 18, characterized in that: The acquiring unit is specifically configured to acquire the migration frequency of the data stored in the first storage space; The migration unit is specifically configured to migrate the data stored in the first storage space to the second storage space based on the migration frequency, the risk level, and the second information.
20. The terminal device according to any one of claims 11 to 19, characterized in that: The terminal device further includes: An establishing unit is used to establish a mapping relationship between the virtual storage address managed by the target process and the second storage space.
21. A terminal device, characterized in that: The terminal device includes a processor and a memory, wherein the memory is used to store computer programs or computer instructions, and the processor is used to execute the computer programs or computer instructions stored in the memory, so that the terminal device executes the method according to any one of claims 1-10.
22. A computer storable medium, characterized in that: The computer-readable storage medium stores a computer program; the computer program is executed by a processor to implement the method according to any one of claims 1 to 10.
23. A computer program product, characterized in that When the computer program product is executed by a processor, the method according to any one of claims 1 to 10 will be implemented.
Citation Information
Cited By
Database double-cache optimization method and device, equipment and medium
CN120448425A
Database double cache optimization method and device, equipment and medium
CN120448425B
