Memory resource processing method, electronic device and storage medium
By optimizing memory resource processing methods in the server, adjusting memory pool resources according to business needs and history, the performance problems caused by frequent memory application and return are solved, and software performance and memory resource management efficiency are improved.
Patent Information
- Application Number
- CN202411027980.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-30
AI Technical Summary
In the prior art, the software performance of the server is affected by the frequency of frequent application and return of memory resources, resulting in performance degradation. Especially in a multi-threaded environment, the competition and management of proprietary memory pools are complex, making it difficult to meet different memory requirements, resulting in performance. bottleneck.
A memory resource processing method is proposed. By obtaining the memory demand and historical processing records of the current business request when the base-level memory pool is insufficient, determining the target memory volume, and applying for resources from the superior memory pool, and returning the resources when the preset return conditions are met , avoid frequent application and return, and optimize resource coordination between memory pools.
It improves software performance, reduces lock competition between memory pools and frequent application for free paths, optimizes the efficiency of memory resources, and avoids performance bottlenecks.
Smart Images

Figure CN118550717B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a memory resource processing method, an electronic device, and a storage medium. Background Art
[0002] At present, with the continuous improvement of users' requirements for server performance and the continuous improvement of server hardware performance, how to improve server software performance has become a key research topic.
[0003] In the related art, several dedicated memory pools of appropriate sizes are usually allocated to the software. The software's memory allocation and release are based on the dedicated memory pools. Each software thread has a corresponding dedicated memory pool to improve the concurrency of the software.
[0004] However, as the types and number of software services continue to change, the dedicated memory pool previously allocated to each thread will not be able to meet its business needs. Therefore, memory resources will be frequently requested and returned to the superior memory pool, and there may even be competition for memory resources, which will reduce software performance. Summary of the invention
[0005] The present application provides a memory resource processing method, an electronic device and a storage medium to solve the defects of the related technology such as frequent application and return of memory resources to a superior memory pool, which reduces software performance.
[0006] The first aspect of the present application provides a memory resource processing method, comprising:
[0007] When the memory resources of the base memory pool corresponding to any thread are insufficient to meet the current service request, the memory requirement of the current service request, the remaining memory of the base memory pool and the historical processing record of the memory resources of the base memory pool are obtained;
[0008] Determine the target memory amount for this application according to the memory demand of the current business request, the remaining memory amount of the base memory pool and the historical processing record of the memory resources of the base memory pool;
[0009] According to the target memory amount, applying for memory resources from the upper-level memory pool of the base memory pool to expand the memory resources of the base memory pool;
[0010] When the remaining memory amount and the remaining memory amount fluctuation of the base memory pool meet the preset return conditions, the memory resources are returned to the upper-level memory pool.
[0011] In an optional implementation, determining the target memory amount for this application according to the memory demand of the current service request, the remaining memory amount of the base memory pool, and the memory resource historical processing record of the base memory pool includes:
[0012] Determine the weight coefficient of the memory amount applied for this time according to the historical application record and the historical return record of the base memory pool; wherein the historical processing record of the memory resource includes the historical application record and the historical return record;
[0013] The target memory amount for this application is determined according to the memory demand of the current business request, the remaining memory amount of the base memory pool and the memory amount weight coefficient.
[0014] In an optional implementation manner, determining the weight coefficient of the memory amount applied for this time according to the historical application records and historical return records of the base memory pool includes:
[0015] The memory weight coefficient for this application is determined based on the following formula:
[0016]
[0017] in, Indicates the memory weight coefficient of this application. Indicates the number of occurrences of insufficient memory resources in the base memory pool represented by the historical application record, The number of times the base memory pool represented by the historical return record returns memory resources to the upper memory pool, Indicates the preset memory weight coefficient.
[0018] In an optional implementation, determining the target memory amount for this application according to the memory demand of the current service request, the remaining memory amount of the base memory pool, and the memory resource historical processing record of the base memory pool includes:
[0019] The relationship between the remaining amount of memory in the base memory pool and the preset memory limit value indicates that when the remaining amount of memory in the base memory pool satisfies the first constraint condition, the target amount of memory for this application is determined based on the following formula:
[0020]
[0021] in, Indicates the target memory size for this application. Indicates the memory requirement. Indicates the memory weight coefficient of this application. represents the preset weighting coefficient, , Indicates the preset memory limit value.
[0022] In an optional implementation, determining the target memory amount for this application according to the memory requirement of the current service request, the remaining memory amount of the base memory pool, and the memory amount weight coefficient includes:
[0023] The relationship between the remaining amount of memory in the base memory pool and the preset memory limit value indicates that when the remaining amount of memory in the base memory pool satisfies the second constraint condition, the target amount of memory for this application is determined based on the following formula:
[0024]
[0025] in, Indicates the target memory size for this application. Indicates the memory requirement. Indicates the memory weight coefficient of this application. Indicates the preset memory limit value.
[0026] In an optional implementation, when the remaining memory amount and the remaining memory amount fluctuation of the base memory pool meet a preset return condition, returning the memory resources to the upper-level memory pool includes:
[0027] Detecting the maximum value and the minimum value of the remaining memory of the base memory pool according to a preset period;
[0028] Determine a fluctuation difference representing a fluctuation of the amount of remaining memory in the base memory pool according to a maximum remaining memory value and a minimum remaining memory value of the base memory pool;
[0029] Determine whether the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition;
[0030] When the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies the preset return condition, the memory resources are returned to the upper-level memory pool.
[0031] In an optional implementation manner, the determining whether the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition includes:
[0032] When the relationship between the remaining amount of memory in the base memory pool and the fluctuation difference satisfies the following expression, it is determined that the preset return condition is satisfied:
[0033]
[0034] in, Indicates the remaining memory amount of the base memory pool. Indicates the maximum value of the remaining memory in the base memory pool. Indicates the minimum remaining memory value of the base memory pool. represents the fluctuation difference, Indicates the preset memory limit value.
[0035] In an optional implementation, when the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition, returning the memory resources to the upper-level memory pool includes:
[0036] In the case where the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference meets the preset return condition, determining the target return amount of the base memory pool according to the remaining memory amount of the base memory pool, the maximum remaining memory value and the preset memory limit value;
[0037] Return memory resources to the upper-level memory pool according to the target return amount of the base-level memory pool.
[0038] In an optional implementation, determining the target return amount of the base memory pool according to the remaining memory amount, the maximum remaining memory value and the preset memory limit value of the base memory pool includes:
[0039] The target return amount of the base memory pool is determined based on the following formula:
[0040]
[0041] in, Indicates the target return amount of the base memory pool. Indicates the remaining memory amount of the base memory pool. Indicates the maximum value of the remaining memory in the base memory pool. Indicates the minimum remaining memory value of the base memory pool. represents the fluctuation difference, Indicates the preset memory limit value.
[0042] In an optional embodiment, the method further includes:
[0043] When the memory resources of the upper-level memory pool are insufficient to satisfy the memory resource application requirements of the base-level memory pool, the current service request is suspended in a waiting linked list to the base-level memory pool;
[0044] Marking the base memory pool and the upper memory pool as invalid;
[0045] When the base memory pool receives a new service request, the new service request is suspended in a waiting linked list to the base memory pool according to an invalid state flag of the base memory pool.
[0046] In an optional embodiment, the method further includes:
[0047] When the highest-level memory pool allocates memory resources to the upper-level memory pool so that the memory resources of the upper-level memory pool meet the memory resource application requirements of a plurality of preset base-level memory pools, the memory resources of the upper-level memory pool are preferentially allocated to the base-level memory pool carrying an invalid state flag;
[0048] Therein, the upper-level memory pool and the lower-level memory pool are in a one-to-many relationship.
[0049] In an optional embodiment, the method further includes:
[0050] When the memory resources of the base memory pool satisfy all the service requests in the waiting list, the base memory pool is marked as valid;
[0051] When the plurality of base memory pools corresponding to the upper-level memory pool are all marked as being in a valid state, the upper-level memory pool is marked as being in a valid state.
[0052] A second aspect of the present application provides a memory resource processing device, comprising:
[0053] An acquisition module, used to acquire the memory demand of the current business request, the remaining memory of the base memory pool and the historical processing record of the memory resources of the base memory pool when the memory resources of the base memory pool corresponding to any thread are insufficient to meet the current business request;
[0054] A determination module, configured to determine a target memory amount for this application according to a memory requirement of the current business request, a remaining memory amount of the base memory pool, and a historical memory resource processing record of the base memory pool;
[0055] An application module, used for applying for memory resources from a superior memory pool of the basic memory pool according to the target memory amount, so as to expand the memory resources of the basic memory pool;
[0056] The return module is used to return the memory resources to the upper-level memory pool when the remaining memory amount and the remaining memory amount fluctuation of the base-level memory pool meet the preset return conditions.
[0057] A third aspect of the present application provides an electronic device, comprising: at least one processor and a memory;
[0058] The memory stores computer-executable instructions;
[0059] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.
[0060] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.
[0061] The fifth aspect of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the method described in the first aspect and various possible designs of the first aspect.
[0062] The technical solution of this application has the following advantages:
[0063] The present application provides a memory resource processing method, an electronic device and a storage medium, the method comprising: when the memory resources of the base memory pool corresponding to any thread are insufficient to meet the current business request, obtaining the memory demand of the current business request, the remaining memory of the base memory pool and the memory resource historical processing record of the base memory pool; determining the target memory amount of this application according to the memory demand of the current business request, the remaining memory of the base memory pool and the memory resource historical processing record of the base memory pool; applying for memory resources from the upper-level memory pool of the base memory pool according to the target memory amount to expand the memory resources of the base memory pool; returning the memory resources to the upper-level memory pool when the remaining memory and the fluctuation of the remaining memory of the base memory pool meet the preset return conditions. The method provided by the above scheme applies for an appropriate amount of memory in the upper-level memory pool according to the actual memory demand of the current business request of the base memory pool, and limits the memory to be returned to the upper-level only when the preset return conditions are met, so as to avoid frequent application and return of memory resources to the upper-level memory pool, thereby improving software performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technical descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0065] Figure 1 A schematic diagram of the structure of the memory resource processing system on which the embodiment of the present application is based;
[0066] Figure 2 A flowchart of a memory resource processing method provided in an embodiment of the present application;
[0067] Figure 3 A diagram of the memory pool structure provided for an embodiment of the present application;
[0068] Figure 4 A flowchart of an exemplary memory resource processing method provided in an embodiment of the present application;
[0069] Figure 5 A flowchart of another exemplary memory resource processing method provided in an embodiment of the present application;
[0070] Figure 6 A schematic diagram of the structure of a memory resource processing device provided in an embodiment of the present application;
[0071] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0072] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0074] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0075] In cloud computing data centers, data storage performance is a core issue that users are concerned about. As hardware performance increases, software performance in storage systems becomes a key factor in overall system performance. In software performance optimization, memory usage performance becomes the key to improving software system performance.
[0076] The software uses the heap and stack to meet the software memory requirements. However, the small stack space can only provide memory support for small-scale data sets and temporary data. For the demand for large-scale data memory, the software mainly applies to the heap space. However, the memory allocation and release interface of the heap space is very inefficient and time-consuming. If the dynamic memory allocation and release operations are frequently performed, the performance of the software will be very poor. Since the system is for allocating and releasing memory requests from all users, a large amount of memory fragmentation will be generated after long-term operation, which will further reduce the performance of memory allocation and release operations.
[0077] Modern high-performance software usually uses a dedicated memory pool to improve software performance and optimize memory management and usage. The software can pre-apply a proper amount of memory to the dedicated memory pool at one time, and the software's memory allocation and release will be performed using the dedicated memory pool. This greatly improves the efficiency of software memory requests.
[0078] However, modern software systems use multithreading to improve the concurrent performance of software. When multiple threads concurrently use a dedicated memory pool, a dedicated memory pool competition problem arises. Frequent memory pool competition causes software performance to degrade and even becomes a performance bottleneck for the software. At the same time, since a dedicated memory pool can only meet a certain type of software memory requirements, different memory requirements need to be met by different dedicated memory pools. For large-scale software systems, there are many memory pools for different operations and different requirements within the software. Some software memory pools even have hundreds of memory pools. The management and memory usage of these memory pools have also become quite complex issues. Since memory requests may be forced to block and be performed asynchronously after the memory of the memory pool is used up, it is necessary to ensure that the memory of the memory pool is available in most cases. Then this situation often occurs. In a certain scenario, the memory of a certain memory pool is used up and becomes a performance bottleneck for the software; in another scenario, another memory pool becomes a performance bottleneck for the software. In large-scale software, how to manage dedicated memory pools, how to efficiently allocate its available memory, how to coordinate resources between memory pools, and how to optimize performance through the management of dedicated memory pools. These issues have become the core issues of storage systems.
[0079] In the related art, a tree-shaped dedicated memory pool is usually established to meet the memory requests of large-scale software.
[0080] In the tree-like dedicated memory pool, the first is to establish a primary memory pool, which is also a dedicated memory pool. When the software is started, a large block of memory is applied according to the amount of memory used by the software to establish a primary memory pool. All memory applications of the software come from the primary memory pool.
[0081] Secondly, multiple secondary memory pools are established according to the module division or application scenarios of the software. The sub-memory pool is a sub-pool of the primary memory pool, and the memory of the secondary memory pool comes from the memory of the primary memory pool.
[0082] For complex software, it is also necessary to establish a three-level memory pool according to different operating procedures. The three-level memory pool is a sub-pool of the two-level memory pool, and the memory of the three-level memory pool comes from the two-level memory pool.
[0083] Similarly, if a sub-pool of the third-level memory pool can be established, a fourth-level memory pool, all of its memory comes from the third-level memory pool, and so on.
[0084] For the convenience of description, the following uses a memory pool tree with up to three levels of memory pools as an example.
[0085] When building a tree-like memory pool, a fixed amount of memory is allocated to all memory pools according to their business types when the free memory is initialized, and the total amount of memory does not change thereafter. If a memory pool does not have enough free memory, it can temporarily borrow it from its parent memory pool and return it immediately after use.
[0086] In addition to allocating memory to its corresponding tertiary memory pool, the secondary memory pool also reserves some free memory. If a tertiary memory pool sub-pool is short of memory, it can temporarily borrow memory from the corresponding secondary memory pool and return it to the secondary memory pool immediately when it is used up.
[0087] Similarly, in addition to allocating memory to its corresponding secondary memory pool, the primary memory pool also leaves some free memory. If a secondary memory pool sub-pool is short of memory, it can temporarily borrow memory from the corresponding primary memory pool and return it to the primary memory pool immediately when it is used up.
[0088] If the third-level memory pool, the second-level memory pool, and the first-level memory pool cannot satisfy the business memory request, the business is put into the waiting list. When the memory is released to the third-level memory pool, check whether there is a pending business waiting for the memory request in the waiting list. If so, check whether the business memory request can be satisfied and execute the business.
[0089] The tree-like memory pool manages the memory pool in a unified manner and temporarily adjusts the memory of each sub-memory pool to adapt to different scenarios. However, when the memory required by the business of a certain scenario is greater than the pre-allocated memory of the memory pool, memory is frequently requested and released from the secondary memory pool and the primary memory pool. This not only greatly increases the number of memory request release paths, but also leads to fierce competition for locks between the secondary memory pool and the primary memory pool, which greatly reduces software performance. There may even be a scenario where the memory of a certain tertiary memory pool is exhausted due to excessive memory usage, causing all businesses using the memory pool to wait and possibly causing software crashes.
[0090] In view of the above problems, the embodiment of the present application provides a memory resource processing method, an electronic device and a storage medium, the method comprising: when the memory resources of the base memory pool corresponding to any thread are insufficient to meet the current business request, obtaining the memory demand of the current business request, the remaining memory of the base memory pool and the memory resource historical processing record of the base memory pool; determining the target memory amount of this application according to the memory demand of the current business request, the remaining memory of the base memory pool and the memory resource historical processing record of the base memory pool; applying for memory resources from the upper-level memory pool of the base memory pool according to the target memory amount to expand the memory resources of the base memory pool; returning the memory resources to the upper-level memory pool when the remaining memory and the fluctuation of the remaining memory of the base memory pool meet the preset return conditions. The method provided by the above scheme applies for an appropriate amount of memory in the upper-level memory pool according to the actual memory demand of the current business request of the base memory pool, and limits the memory to be returned to the upper-level only when the preset return conditions are met, so as to avoid frequent application and return of memory resources to the upper-level memory pool, thereby improving software performance.
[0091] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0092] First, the structure of the memory resource processing system on which this application is based is described:
[0093] The memory resource processing method, electronic device and storage medium provided in the embodiments of the present application are suitable for managing the application and return of memory resources between multi-level memory pools to avoid the lower-level memory pool from frequently applying for and returning memory resources to the upper-level memory pool. Figure 1 As shown, it is a schematic diagram of the structure of the memory resource processing system based on the embodiment of the present application, which mainly includes a memory resource processing device, a data collection device and a multi-level memory pool. Among them, the data collection device is used to collect the memory demand of the current business request, the remaining memory of the base memory pool and the historical processing record of the memory resources of the base memory pool when any memory pool in the multi-level memory pool needs to apply for memory resources from the upper level, and send the collected information to the memory resource processing device, so as to perform corresponding memory resource processing on the multi-level memory pool based on the memory resource processing device.
[0094] The embodiment of the present application provides a memory resource processing method for managing the application and return of memory resources between multiple memory pools to avoid the lower memory pool from frequently applying for and returning memory resources to the upper memory pool. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer, and other electronic devices that can be used for memory resource processing.
[0095] like Figure 2 FIG. 1 is a flow chart of a method for processing memory resources provided in an embodiment of the present application, the method comprising:
[0096] Step 201, when the memory resources of the base memory pool corresponding to any thread are insufficient to meet the current service request, the memory demand of the current service request, the remaining memory of the base memory pool and the historical processing record of the memory resources of the base memory pool are obtained.
[0097] Specifically, when the remaining memory amount of the basic memory pool corresponding to any thread is less than the memory requirement of the current business request, it is determined that the memory resources of the basic memory pool are insufficient to meet the current business request. At this time, the memory requirement of the current business request, the remaining memory amount of the basic memory pool and the historical processing record of the memory resources of the basic memory pool are obtained for subsequent determination of the target memory amount for this application.
[0098] Step 202, determining the target memory amount for this application according to the memory demand of the current business request, the remaining memory amount of the base memory pool and the historical processing record of the memory resources of the base memory pool.
[0099] It should be noted that the memory resource historical processing record at least includes the number of memory resource applications of the base memory pool. The base memory pool in the embodiment of the present application can adopt a business-following memory pool. The total amount of memory of the business-following memory pool is not fixed. It only allocates a small amount of free memory at the beginning, and then intelligently calculates and adjusts the total amount of memory demand for the memory pool according to the current business. When the total amount of business increases, the business-following memory pool increases the memory according to the current memory demand and the expected future memory demand. When the total amount of business decreases, the business-following memory pool reduces the memory according to the current memory demand and the expected future memory demand.
[0100] Specifically, the memory growth scale for this application can be determined based on the number of memory resource applications for the basic memory pool represented by the historical processing records of the memory resources, and then the target memory amount for this application can be determined in combination with the memory demand and the remaining memory.
[0101] Step 203: Apply for memory resources from the upper-level memory pool of the base memory pool according to the target memory amount, so as to expand the memory resources of the base memory pool.
[0102] Specifically, according to the determined target memory amount, a corresponding memory resource application request may be sent to the upper-level memory pool to apply for memory resources of the target memory amount from the upper-level memory pool to expand the memory resources of the base-level memory pool.
[0103] Step 204: Return the memory resources to the superior memory pool when the remaining memory amount and the remaining memory amount fluctuation of the grassroots memory pool meet the preset return conditions.
[0104] Specifically, since the base memory pool in the embodiment of the present application adopts a business-following memory pool, after completing the response to the business request based on the memory resources applied for from the upper-level memory pool, the memory resources do not need to be returned immediately. When the remaining memory amount and the fluctuation of the remaining memory amount of the base memory pool meet the preset return conditions, after determining the current return of the memory resources, the memory resources will not be applied for from the upper-level memory pool again due to insufficient memory resources in a short period of time. At this time, the memory resources can be returned to the upper-level memory pool, so as to avoid frequently applying for and returning memory resources to the upper-level memory pool, and avoid the occurrence of the base memory pool occupying the memory resources of the upper-level memory pool.
[0105] On the basis of the above embodiments, in order to improve the reliability of the target memory amount determination result and further avoid frequent application and return of memory resources to the superior memory pool, as an implementable method, in one embodiment, according to the memory demand of the current business request, the remaining memory of the base memory pool and the memory resource historical processing record of the base memory pool, the target memory amount of this application is determined, including:
[0106] Step 221, determining a weight coefficient of the memory amount applied for this time according to the historical application records and historical return records of the base memory pool; wherein the historical processing records of the memory resources include the historical application records and the historical return records;
[0107] Step 2022, determine the target memory amount for this application based on the memory demand of the current business request, the remaining memory amount of the basic memory pool and the memory weight coefficient.
[0108] Among them, Figure 3 As shown in the figure, it is a memory pool structure diagram provided in an embodiment of the present application. The base memory pool adopts a business-following memory pool. Taking the base memory pool as a three-level memory pool as an example, the upper-level memory pool of the base memory pool is Figure 3 The secondary memory pool in the , the parent memory pool of the secondary memory pool is the primary memory pool.
[0109] It should be noted that for the business-following basic memory pool, when the total amount of business increases, the business-following memory pool has insufficient free memory and cannot meet the current business request, the amount of memory requested by the current business and the total amount of memory in the current business-following memory pool, historical memory shortage records (historical application records), and historical memory release records to the upper-level memory pool (historical return records) are used to intelligently calculate how much memory is applied to the business-following memory pool from the upper-level memory pool, so as to ensure that the total amount of memory in the business-following memory pool is always dynamically matched with the total amount of memory required by the current business, and is always greater than the total amount of memory required by the current business, thereby reducing the number of dynamic memory applications from the business-following memory pool to the upper-level memory pool by more than 99%. The business memory application path is shortened, and the lock competition between the secondary memory pool and the primary memory pool is greatly reduced.
[0110] Specifically, in one embodiment, the memory weight coefficient of this application may be determined based on the following formula:
[0111]
[0112] in, Indicates the memory weight coefficient of this application. Indicates the number of times insufficient memory resources occurred in the base memory pool represented by the historical application records. The historical return record represents the number of times the base memory pool returns memory resources to the upper memory pool. Indicates the preset memory weight coefficient, for example .
[0113] Specifically, whenever the memory resources of the base memory pool are insufficient to meet the current business request and it is necessary to apply for memory resources from the upper memory pool, the number of times the memory resource shortage occurs is (Mem_ Exhaust_Count) plus 1, when the base memory pool returns memory resources to the upper memory pool, (Mem_FreeUp_Count) plus 1. Whenever the base memory pool needs to apply for memory resources from the upper memory pool, it can calculate the weight coefficient of the memory amount applied for this time based on the above formula to determine the corresponding memory amount growth scale according to the actual situation.
[0114] Specifically, in one embodiment, the size relationship between the remaining amount of memory in the base memory pool and the preset memory limit value indicates that when the remaining amount of memory in the base memory pool satisfies the first constraint condition, the target amount of memory for this application is determined based on the following formula:
[0115]
[0116] in, Indicates the target memory size for this application. Indicates the memory requirement. Indicates the memory weight coefficient of this application. represents the preset weighting coefficient, ,For example , Indicates the preset memory limit value.
[0117] It should be noted that (Mem_ Limit) can be equal to the initial amount of memory in the base memory pool.
[0118] Specifically, the amount of remaining memory in the base memory pool When (Mem_Total) is less than twice the preset memory limit value, it is determined that the remaining memory amount of the base memory pool meets the first constraint condition.
[0119] Specifically, in one embodiment, the size relationship between the remaining amount of memory in the base memory pool and the preset memory limit value indicates that when the remaining amount of memory in the base memory pool satisfies the second constraint condition, the target amount of memory for this application is determined based on the following formula:
[0120]
[0121] in, Indicates the target memory size for this application. Indicates the memory requirement. Indicates the memory weight coefficient of this application. Indicates the preset memory limit value.
[0122] Specifically, the amount of remaining memory in the base memory pool When (Mem_Total) is not less than two times of the preset memory limit value, it is determined that the remaining memory amount of the base memory pool meets the second constraint condition.
[0123] Specifically, the logic for determining the target memory amount is determined based on the size relationship between the remaining memory amount of the grassroots memory pool and the preset memory limit value, thereby ensuring that the final determined memory amount meets the actual needs of the grassroots memory pool, thereby improving the reliability of the target memory amount determination result, and further avoiding frequent application and return of memory resources to the superior memory pool.
[0124] On the basis of the above-mentioned embodiment, when a business releases memory to a business-following memory pool, it is decided whether to release the memory to the secondary memory pool according to the current memory status of the business-following memory pool, so that the current business-following memory pool is equivalent to the current business memory demand and has a slight surplus, so as to reduce the frequent release of memory to the secondary memory pool by the business. To reduce the business memory release path and greatly reduce the lock competition of the secondary memory pool, as an implementable method, in one embodiment, when the remaining memory amount and the fluctuation of the remaining memory amount of the base memory pool meet the preset return conditions, the memory resources are returned to the superior memory pool, including:
[0125] Step 2041, detecting the maximum value and the minimum value of the remaining memory of the base memory pool according to a preset period;
[0126] Step 2042, determining a fluctuation difference representing the fluctuation of the remaining memory amount of the base memory pool according to the maximum remaining memory value and the minimum remaining memory value of the base memory pool;
[0127] Step 2043, determining whether the relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition;
[0128] Step 2044: When the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies the preset return condition, the memory resources are returned to the upper-level memory pool.
[0129] Specifically, the preset return conditions can be determined according to the actual application scenarios of the memory pool to ensure that when the memory resources are returned to the superior memory pool by judging whether the preset return conditions are met, frequent application and return of memory resources to the superior memory pool can be avoided, while the grassroots memory pool can be prevented from occupying the memory resources of the superior memory pool.
[0130] Specifically, in one embodiment, when the magnitude relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies the following expression, it is determined that the preset return condition is satisfied:
[0131]
[0132] in, Indicates the remaining memory in the base memory pool. Indicates the maximum value of the remaining memory in the base memory pool. Indicates the minimum remaining memory of the base memory pool. represents the fluctuation difference, Indicates the preset memory limit value.
[0133] Specifically, a timer may be started to detect the maximum value and the minimum value of the remaining memory in the base memory pool according to a preset period based on the timer, and the minimum free memory in the pool (Mem_Free_num= ) is greater than the fluctuation difference and the preset memory limit value memory remains, it is determined that the preset return conditions are met.
[0134] Furthermore, in one embodiment, when the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference meets the preset return condition, the target return amount of the base memory pool is determined according to the remaining memory amount of the base memory pool, the maximum remaining memory value and the preset memory limit value; and the memory resources are returned to the superior memory pool according to the target return amount of the base memory pool.
[0135] Specifically, under the preset return conditions, based on information such as the remaining memory amount of the grassroots memory pool, the maximum remaining memory value and the preset memory limit value, the target return amount for this return is determined, and an appropriate amount of memory resources is returned to the superior memory pool to avoid returning too much or too little memory resources to the superior memory pool.
[0136] Specifically, in one embodiment, the target return amount of the base memory pool may be determined based on the following formula:
[0137]
[0138] in, Indicates the target return amount of the base memory pool. Indicates the remaining memory in the base memory pool. Indicates the maximum value of the remaining memory in the base memory pool. Indicates the minimum remaining memory of the base memory pool. represents the fluctuation difference, Indicates the preset memory limit value.
[0139] Accordingly, when the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference does not meet the preset return condition, the memory is only released to the business-following memory pool (base memory pool), so that when the total memory usage (remaining memory amount) increases, no memory is requested from the secondary memory pool and the primary memory pool, thereby ensuring that the free memory of the business-following memory pool is always sufficient, and there is no need to frequently request memory from the secondary memory pool and the primary memory pool. The software memory release and application path is greatly shortened, and the lock contention between the secondary memory pool and the primary memory pool is greatly reduced.
[0140] Based on the above embodiments, Figure 4As shown, it is a flowchart of an exemplary memory resource processing method provided by an embodiment of the present application. The three-level memory pool is the base memory pool. When a business request applies for memory from the business-following memory pool, and the free memory of the business-following memory pool is insufficient, the business-following memory pool applies for memory from its secondary memory pool. If the free memory of the secondary memory pool is still insufficient, it applies for memory from the primary memory pool. If the primary memory pool cannot satisfy the request, the request will be suspended. If the base memory pool judges whether the memory resources at all levels are sufficient for each business request received, it will waste judgment resources and is not conducive to ensuring the response efficiency of business requests. As an implementable method, in one embodiment, the method also includes:
[0141] Step 301, when the memory resources of the upper memory pool are insufficient to meet the memory resource application requirements of the base memory pool, the current service request is suspended in the waiting list to the base memory pool;
[0142] Step 302, marking the base memory pool and the upper memory pool as invalid;
[0143] Step 303: When the base memory pool receives a new service request, the new service request is suspended in a waiting list to the base memory pool according to the invalid state flag of the base memory pool.
[0144] Specifically, when the current business request is suspended in the waiting list (Mempool_waitqueue) to the base memory pool and the status (Mempool_State) of the base memory pool and the upper memory pool is marked as invalid (MEMPOOL_UNAVAILABLE), the subsequent business applies for memory business requests from the business-following memory pool and finds that the pool is marked as invalid. The business request is directly placed in the waiting list (Mempool_waitqueue) of the business-following memory pool without having to determine whether its memory resources meet the demand.
[0145] Specifically, in one embodiment, when the highest-level memory pool allocates memory resources to the upper-level memory pool so that the memory resources of the upper-level memory pool meet the memory resource application requirements of several preset base-level memory pools, the memory resources of the upper-level memory pool are preferentially allocated to the base-level memory pool carrying an invalid status identifier.
[0146] Among them, the upper-level memory pool and the grassroots memory pool are in a one-to-many relationship.
[0147] Specifically, when the highest-level memory pool (first-level memory pool) has memory resources returned by other memory pools, that is, the highest-level memory pool can allocate memory resources to the second-level memory pool (upper-level memory pool), when multiple upper-level memory pools apply for memory resources from the highest-level memory pool, the memory resources of the highest-level memory pool will be preferentially allocated to the upper-level memory pool with an invalid status identifier, and then the memory resources of the upper-level memory pool will be preferentially allocated to the grassroots memory pool with an invalid status identifier.
[0148] Specifically, if a business releases memory to the business-following memory pool, or the current secondary memory pool satisfies the memory request of the business-following memory pool business, the business-following memory pool will check the suspended business in the waiting list (Mempool_waitqueue). If the current free memory can satisfy the memory request of the suspended business, the free memory will be allocated to the suspended business, and it will be deleted from the waiting list (Mempool_waitqueue), and the business will continue to be executed.
[0149] Specifically, in one embodiment, when the memory resources of the base memory pool satisfy all service requests in the waiting list, the base memory pool is marked as valid; when the corresponding multiple base memory pools in the upper-level memory pool are all marked as valid, the upper-level memory pool is marked as valid.
[0150] Specifically, when all business requests suspended in the waiting list (Mempool_waitqueue) are satisfied, the business-following memory pool status is set to a valid state (MEMPOOL_AVAILABLE); when all business-following memory pool states of a secondary memory pool are in a valid state (MEMPOOL_AVAILABLE), the secondary memory pool is set to a valid state (MEMPOOL_AVAILABLE); when all secondary memory pools are in a valid state (MEMPOOL_AVAILABLE), the primary memory pool is set to a valid state (MEMPOOL_AVAILABLE).
[0151] For example, Figure 5 As shown, it is a flow chart of another exemplary memory resource processing method provided in an embodiment of the present application. When a business releases memory to the base memory pool, it is first determined whether there is a pending business in the waiting list. If so, the business request is blocked from the waiting list and the memory application is re-executed. If not, it is further determined whether the tertiary memory pool has borrowed memory from the secondary memory pool. If it has not borrowed memory from the secondary memory pool, the memory is released to the base memory pool. Otherwise, it is further determined whether the secondary memory pool has borrowed memory from the primary memory pool. If so, the memory is released to the primary memory pool. Otherwise, it is released to the secondary memory pool.
[0152] Specifically, in one embodiment, in actual application, the secondary memory pool (the upper-level memory pool) may also adopt a business-following memory. The upper-level memory pool may return the borrowed memory resources to the primary memory pool (the highest-level memory pool) only when the preset secondary memory resource return conditions are met, so as to avoid the secondary memory pool frequently applying for and returning memory resources to the highest-level memory pool.
[0153] The setting logic of the preset secondary memory resource return condition may be the same as the setting logic of the preset return condition of the base memory pool, or the preset secondary memory resource return condition may be determined according to time.
[0154] Specifically, the secondary memory pool can return the borrowed memory resources to the primary memory pool (the highest level memory pool) according to a preset return period. That is, when the time interval between the secondary memory pool and the last memory resource return time reaches a preset time interval threshold, it is determined that the secondary memory pool meets the preset secondary memory resource return conditions.
[0155] The memory resource processing method provided by the embodiment of the present application obtains the memory demand of the current business request, the remaining memory of the grassroots memory pool, and the historical processing record of the memory resources of the grassroots memory pool when the memory resources of the grassroots memory pool corresponding to any thread are insufficient to meet the current business request; determines the target memory amount of this application according to the memory demand of the current business request, the remaining memory of the grassroots memory pool, and the historical processing record of the memory resources of the grassroots memory pool; applies for memory resources from the superior memory pool of the grassroots memory pool according to the target memory amount to expand the memory resources of the grassroots memory pool; returns the memory resources to the superior memory pool when the remaining memory and the fluctuation of the remaining memory of the grassroots memory pool meet the preset return conditions. The method provided by the above scheme applies for an appropriate amount of memory in the superior memory pool according to information such as the actual memory demand of the current business request of the grassroots memory pool, and limits the return of memory to the superior only when the preset return conditions are met, so as to avoid frequent application and return of memory resources to the superior memory pool, thereby improving software performance. In addition, the memory pool adopts a tree-like memory pool architecture, but each leaf memory pool uses a business-following memory pool. Unlike the traditional tree-like memory pool, which determines the memory of all memory pools at the beginning, the total memory of the business-following memory pool is not fixed. It only allocates a small amount of free memory at the beginning, and then intelligently calculates and adjusts the total memory demand of the memory pool according to the current business. When the total amount of business increases, the business-following memory pool increases the memory according to the current memory demand and the expected future memory demand. When the total amount of business decreases, the business-following memory pool reduces the memory according to the current memory demand and the expected future memory demand. It greatly reduces the business memory request path, reduces the lock competition between the secondary memory pool and the tertiary memory pool, and greatly improves the performance of the software.
[0156] An embodiment of the present application provides a memory resource processing device, which is used to execute the memory resource processing method provided in the above embodiment.
[0157] like Figure 6 , which is a schematic diagram of the structure of a memory resource processing device provided in an embodiment of the present application. The memory resource processing device 60 comprises: an acquisition module 601 , a determination module 602 , an application module 603 and a return module 604 .
[0158] Among them, the acquisition module is used to obtain the memory demand of the current business request, the remaining memory of the grassroots memory pool and the historical processing record of the memory resources of the grassroots memory pool when the memory resources of the grassroots memory pool corresponding to any thread are insufficient to meet the current business request; the determination module is used to determine the target memory amount for this application according to the memory demand of the current business request, the remaining memory of the grassroots memory pool and the historical processing record of the memory resources of the grassroots memory pool; the application module is used to apply for memory resources from the superior memory pool of the grassroots memory pool according to the target memory amount to expand the memory resources of the grassroots memory pool; the return module is used to return the memory resources to the superior memory pool when the remaining memory amount and the fluctuation of the remaining memory amount of the grassroots memory pool meet the preset return conditions.
[0159] Regarding the memory resource processing device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0160] The memory resource processing device provided in the embodiment of the present application is used to execute the memory resource processing method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.
[0161] An embodiment of the present application provides an electronic device for executing the memory resource processing method provided in the above embodiment.
[0162] like Figure 7 FIG. 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 70 includes: at least one processor 71 and a memory 72 .
[0163] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the memory resource processing method provided in the above embodiment.
[0164] The electronic device provided in the embodiment of the present application is used to execute the memory resource processing method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.
[0165] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the memory resource processing method provided in any of the above embodiments is implemented.
[0166] The storage medium containing computer executable instructions provided in the embodiments of the present application can be used to store computer executable instructions of the memory resource processing method provided in the aforementioned embodiments. The implementation method and principle are the same and will not be repeated here.
[0167] An embodiment of the present application provides a computer program product, including computer instructions, which are used to enable a computer to execute the service request processing method provided in the aforementioned embodiment.
[0168] The embodiments of the present application provide a computer program product that can be used to execute computer instructions of the service request processing method provided in the aforementioned embodiments. The implementation method and principle are the same and will not be repeated here.
[0169] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0170] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0172] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0173] A part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0174] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A memory resource processing method, characterized in that: include: When the memory resources of the base memory pool corresponding to any thread are insufficient to meet the current service request, the memory requirement of the current service request, the remaining memory of the base memory pool and the historical processing record of the memory resources of the base memory pool are obtained; Determine the target memory amount for this application according to the memory demand of the current business request, the remaining memory amount of the base memory pool and the historical processing record of the memory resources of the base memory pool; According to the target memory amount, applying for memory resources from the upper-level memory pool of the base memory pool to expand the memory resources of the base memory pool; When the remaining memory amount and the remaining memory amount fluctuation of the base memory pool meet the preset return conditions, return the memory resources to the upper-level memory pool; The step of determining the target memory amount for this application according to the memory demand amount of the current business request, the remaining memory amount of the base memory pool, and the memory resource historical processing record of the base memory pool includes: Determine the weight coefficient of the memory amount applied for this time according to the historical application record and the historical return record of the base memory pool; wherein the historical processing record of the memory resource includes the historical application record and the historical return record; Determine the target memory amount for this application according to the memory demand of the current business request, the remaining memory amount of the base memory pool and the memory amount weight coefficient; The step of determining the weight coefficient of the memory amount applied for this time according to the historical application records and historical return records of the base memory pool includes: The memory weight coefficient for this application is determined based on the following formula: in, Indicates the memory weight coefficient of this application. Indicates the number of occurrences of insufficient memory resources in the base memory pool represented by the historical application record, The number of times the base memory pool represented by the historical return record returns memory resources to the upper memory pool, Indicates the preset memory weight coefficient.
2. The method according to claim 1, characterized in that: The determining the target memory amount for this application according to the memory requirement of the current business request, the remaining memory amount of the base memory pool and the memory amount weight coefficient includes: The relationship between the remaining amount of memory in the base memory pool and the preset memory limit value indicates that when the remaining amount of memory in the base memory pool satisfies the first constraint condition, the target amount of memory for this application is determined based on the following formula: in, Indicates the target memory size for this application. Indicates the memory requirement. Indicates the memory weight coefficient of this application. represents the preset weighting coefficient, , Indicates the preset memory limit value.
3. The method according to claim 1, characterized in that The determining the target memory amount for this application according to the memory requirement of the current business request, the remaining memory amount of the base memory pool and the memory amount weight coefficient includes: The relationship between the remaining amount of memory in the base memory pool and the preset memory limit value indicates that when the remaining amount of memory in the base memory pool satisfies the second constraint condition, the target amount of memory for this application is determined based on the following formula: in, Indicates the target memory size for this application. Indicates the memory requirement. Indicates the memory weight coefficient of this application. Indicates the preset memory limit value.
4. The method according to claim 1, characterized in that: When the remaining memory amount and the remaining memory amount fluctuation of the base memory pool meet the preset return condition, returning the memory resources to the upper-level memory pool includes: Detecting the maximum value and the minimum value of the remaining memory of the base memory pool according to a preset period; Determine a fluctuation difference representing a fluctuation of the amount of remaining memory in the base memory pool according to a maximum remaining memory value and a minimum remaining memory value of the base memory pool; Determine whether the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition; When the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies the preset return condition, the memory resources are returned to the upper-level memory pool.
5. The method according to claim 4, characterized in that The determining whether the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition includes: When the relationship between the remaining amount of memory in the base memory pool and the fluctuation difference satisfies the following expression, it is determined that the preset return condition is satisfied: in, Indicates the remaining memory amount of the base memory pool. Indicates the maximum value of the remaining memory in the base memory pool. Indicates the minimum remaining memory value of the base memory pool. represents the fluctuation difference, Indicates the preset memory limit value.
6. The method according to claim 4, characterized in that When the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference satisfies a preset return condition, returning the memory resources to the upper-level memory pool includes: In the case where the size relationship between the remaining memory amount of the base memory pool and the fluctuation difference meets the preset return condition, determining the target return amount of the base memory pool according to the remaining memory amount of the base memory pool, the maximum remaining memory value and the preset memory limit value; Return memory resources to the upper-level memory pool according to the target return amount of the base-level memory pool.
7. The method according to claim 6, characterized in that The step of determining a target return amount of the base memory pool according to the remaining memory amount, the maximum remaining memory value, and the preset memory limit value of the base memory pool includes: The target return amount of the base memory pool is determined based on the following formula: in, Indicates the target return amount of the base memory pool. Indicates the remaining memory amount of the base memory pool. Indicates the maximum value of the remaining memory in the base memory pool. Indicates the minimum remaining memory value of the base memory pool. represents the fluctuation difference, Indicates the preset memory limit value.
8. The method according to claim 1, characterized in that The method further comprises: When the memory resources of the upper-level memory pool are insufficient to satisfy the memory resource application requirements of the base-level memory pool, the current service request is suspended in a waiting linked list to the base-level memory pool; Marking the base memory pool and the upper memory pool as invalid; When the base memory pool receives a new service request, the new service request is suspended in a waiting linked list to the base memory pool according to an invalid state flag of the base memory pool.
9. The method according to claim 8, characterized in that The method further comprises: When the highest-level memory pool allocates memory resources to the upper-level memory pool so that the memory resources of the upper-level memory pool meet the memory resource application requirements of a plurality of preset base-level memory pools, the memory resources of the upper-level memory pool are preferentially allocated to the base-level memory pool carrying an invalid state flag; Therein, the upper-level memory pool and the lower-level memory pool are in a one-to-many relationship.
10. The method according to claim 8, characterized in that The method further comprises: When the memory resources of the base memory pool satisfy all the service requests in the waiting list, the base memory pool is marked as valid; When the plurality of base memory pools corresponding to the upper-level memory pool are all marked as being in a valid state, the upper-level memory pool is marked as being in a valid state.
11. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 10 is implemented.
13. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 10.
