A method and device for processing memory data

By dividing hot and cold data areas in memory and migrating data according to the number of accesses, the problem of low memory utilization is solved, and the data access efficiency and utilization of hot data areas are improved.

CN113885801BActive Publication Date: 2024-12-31INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111158306.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-12-31
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

In the prior art, due to limited memory space, when the number of data accesses is higher than the threshold when using the LRU algorithm to manage memory data, the data is cached in memory, resulting in a lower memory utilization rate.

Method used

By dividing the memory into a cold data area and a hot data area, and setting a special area storage access identifier in the memory, using the LRU algorithm for data management, the accessed data is first stored in the cold data area, and the number of accesses is counted. When the number of times is greater than or equal to the threshold, the data is migrated to the hot data area, lowering the access threshold to improve the utilization of the hot data area.

Benefits of technology

It improves the utilization rate of the hot data area and the access efficiency of the data, makes it easier to cache data to the hot data area, avoids the large amount of temporary hot data replacing previous hot data, and maintains newer hot data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113885801B_ABST
    Figure CN113885801B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for processing memory data, which can be used in the financial field or other technical fields. The method includes: obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in the memory; if it is determined that the storage reference value is less than the corresponding reference threshold, the access threshold is lowered; if it is determined that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, the data corresponding to the access identifier is migrated to the hot data area; wherein the cold data area is a preset area in the memory. The device is used to execute the above method. The method and device for processing memory data provided by the embodiments of the present invention improve the utilization rate of the hot data area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for processing memory data. Background Art

[0002] At present, in actual business systems, there are repeated data reading operations. In order to improve the data reading efficiency, the data can be cached in the memory and read directly from the memory the next time the data is read.

[0003] In the prior art, due to the limited space of the memory, the Least Frequently Used (LFU) algorithm and the Least Recently Used (LRU) algorithm are often used to manage the data in the memory to improve the utilization of the memory. In the application process of the LRU algorithm, a threshold is usually set based on experience. If the number of accesses to the data is higher than the threshold, it is stored in the memory. When the number of accesses to a large amount of data is less than the threshold, there will be less data cached in the memory, resulting in low memory utilization. Summary of the invention

[0004] In view of the problems in the prior art, an embodiment of the present invention provides a method and device for processing memory data, which can at least partially solve the problems in the prior art.

[0005] In one aspect, the present invention provides a method for processing memory data, comprising:

[0006] Obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in the memory;

[0007] If it is determined that the stored reference value is less than the corresponding reference threshold, lowering the access threshold;

[0008] If it is determined that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, the data corresponding to the access identifier is migrated to the hot data area; wherein the cold data area is a preset area in the memory.

[0009] In another aspect, the present invention provides a memory data processing device, comprising:

[0010] An acquisition module, used to acquire a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in the memory;

[0011] A reducing module, configured to reduce the access threshold after determining that the stored reference value is less than the corresponding reference threshold;

[0012] The migration module is used to migrate the data corresponding to the access identifier to the hot data area after determining that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold; wherein the cold data area is a preset area in the memory.

[0013] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for processing memory data described in any of the above embodiments when executing the program.

[0014] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for processing memory data described in any of the above embodiments.

[0015] The memory data processing method and device provided by the embodiment of the present invention can obtain the storage reference value of the hot data area within a set period, and after judging that the storage reference value is less than the corresponding reference threshold, lower the access threshold, and after judging that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, migrate the data corresponding to the access identifier to the hot data area, thereby lowering the threshold for storing data in the hot data area, making it easier to cache data in the hot data area, and improving the utilization rate of the hot data area. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0017] Figure 1 It is a flowchart of a method for processing memory data provided by the first embodiment of the present invention.

[0018] Figure 2 It is a flowchart of a method for processing memory data provided by the second embodiment of the present invention.

[0019] Figure 3 It is a flowchart of a method for processing memory data provided by the third embodiment of the present invention.

[0020] Figure 4 It is a flowchart of a method for processing memory data provided by the fourth embodiment of the present invention.

[0021] Figure 5 It is a flowchart of a method for processing memory data provided by the fifth embodiment of the present invention.

[0022] Figure 6 It is a schematic diagram of the structure of a memory data processing device provided in the sixth embodiment of the present invention.

[0023] Figure 7 It is a schematic diagram of the structure of a memory data processing device provided in the seventh embodiment of the present invention.

[0024] Figure 8 It is a schematic diagram of the structure of a memory data processing device provided in the eighth embodiment of the present invention.

[0025] Fig. 9 It is a schematic diagram of the structure of a memory data processing device provided in the ninth embodiment of the present invention.

[0026] Fig.10 It is a schematic diagram of the structure of a memory data processing device provided in the tenth embodiment of the present invention.

[0027] Fig.11 It is a schematic diagram of the structure of a memory data processing device provided by the eleventh embodiment of the present invention.

[0028] Fig.12 It is a schematic diagram of the physical structure of an electronic device provided by the twelfth embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.

[0030] In order to facilitate the understanding of the technical solution provided by the present application, the relevant contents of the technical solution of the present application are first described below. In an embodiment of the present invention, the memory is divided into a cold data area and a hot data area, and a special area storage access identifier is set in the memory. The data stored in the hot data area and the cold data area are managed using the LRU algorithm. The accessed data is first stored in the cold data area, and the number of accesses of the data is counted. After the number of accesses to the data is greater than or equal to the access threshold, the data is migrated from the cold data area to the hot data area. For data eliminated from the hot data area, it is migrated to the cold data area. Among them, a storage period can be set for the data stored in the hot data area and the cold data area.

[0031] When the switching between hot and cold data is too fast and hot data is frequently switched, the threshold for entering the hot data area can be increased by raising the access threshold to prevent temporary hot data from replacing previous hot data in large quantities. When there is a large amount of idle data in the hot data area, the access threshold can be reduced to make it easier to migrate data stored in the cold data to the hot data area, thereby improving memory utilization and maintaining newer hot data.

[0032] The following uses a server as an example to illustrate the implementation process of the memory data processing method provided by the embodiment of the present invention. It is understandable that the execution subject of the memory data processing method provided by the embodiment of the present invention is not limited to the server.

[0033] Figure 1 FIG. 1 is a flow chart of a method for processing memory data provided by an embodiment of the present invention. Figure 1 As shown, the method for processing memory data provided by the embodiment of the present invention includes:

[0034] S101, obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in a memory;

[0035] Specifically, the server can obtain a storage reference value of a hot data area within a set period, where the hot data area is a preset area in the memory. The set period is set according to actual needs and is not limited in the embodiment of the present invention. The storage reference value is, for example, a storage size or the number of access identifiers.

[0036] For example, the set period is 24 hours or 12 hours.

[0037] S102: if it is determined that the stored reference value is less than the corresponding reference threshold, lowering the access threshold;

[0038] Specifically, the server compares the storage reference value with a reference threshold value corresponding to the storage reference value. If the storage reference value is less than the corresponding reference threshold value, it means that the amount of data stored in the hot data area is small. The server will lower the access threshold value so that more data can be stored in the hot data area to improve the utilization rate of the hot data area and the access efficiency of the data. The reference threshold value corresponding to the storage reference value is set according to actual needs and is not limited in the embodiment of the present invention. The access threshold value is preset and is set according to actual experience and is not limited in the embodiment of the present invention.

[0039] For example, when lowering the access threshold, the access threshold may be reduced by 1.

[0040] It is understandable that when a lot of data stored in the hot data area expires, the expired data will be cleared from the hot data area, which may cause a large amount of free space in the hot data area.

[0041] S103: If it is determined that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, the data corresponding to the access identifier is migrated to the hot data area; wherein the cold data area is a preset area in the memory.

[0042] Specifically, the server can obtain the number of accesses corresponding to each access identifier in the cold data area, and then compare the number of accesses corresponding to each access identifier in the cold data area with the access threshold. If the number of accesses corresponding to the access identifier in the cold data area is greater than or equal to the access threshold, the data corresponding to the access identifier in the cold data area is migrated to the hot data area. The cold data area is a preset area in the memory, and there is no overlap between the cold data area and the hot data area. The access identifier corresponds to the data one by one.

[0043] For example, the hot data area adopts the LRU algorithm for data management. When migrating data from the cold data area to the hot data area, the data migrated from the cold data area is stored in the hot data area, and the access identifier corresponding to the migrated data is stored in the queue head of the hot data area.

[0044] For example, the access identifier is derived from a key value of a key-value database, and the data corresponding to the access identifier is the value corresponding to the key value.

[0045] The method for processing memory data provided by the embodiment of the present invention can obtain the storage reference value of the hot data area within a set period, and after judging that the storage reference value is less than the corresponding reference threshold, reduce the access threshold, and after judging that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, migrate the data corresponding to the access identifier to the hot data area, lower the threshold for storing data in the hot data area, make it easier to cache data in the hot data area, and improve the utilization rate of the hot data area. In addition, since the data is stored in the hot data area, the access efficiency of the data can be improved.

[0046] Figure 2 FIG. 1 is a flow chart of a method for processing memory data provided by a second embodiment of the present invention. Figure 2 As shown, based on the above embodiments, further, the method for processing memory data provided by the embodiment of the present invention also includes:

[0047] S201, counting the number of data replacements in the hot data area within a preset period;

[0048] Specifically, after the server determines that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, the server will migrate the data corresponding to the access identifier in the cold data area to the hot data area. If the hot data area needs to migrate out the stored data before it can store the data migrated from the cold data area, the server will record a data replacement in the hot data area. The server can count the number of data replacements in the hot data area within a preset period. The preset period is, for example, 24 hours, which is set according to actual needs and is not limited in the embodiment of the present invention. It is understandable that after a preset period ends, the number of data replacements will be reset to zero.

[0049] For example, the data in the hot data area is managed using an LRU algorithm, and the access identifier corresponding to the data migrated from the cold data area will be stored at the head of the queue of the hot data area, and the data migrated from the cold data area will be stored in the hot data area. Before migrating data from the cold data area, the server can determine whether the hot data area has sufficient storage space to store the data to be migrated. If the storage space of the hot data area is insufficient, the data corresponding to the access identifier at the tail of the queue of the hot data area can be migrated to the cold data area first, and then the data can be migrated from the cold data area. In the above case, the server will record that one data replacement has occurred, and the number of data replacements within the preset period will be increased by 1.

[0050] S202: If it is determined that the number of data replacement times is greater than a replacement threshold, increase the access threshold.

[0051] Specifically, the server will compare the number of data replacements within the preset period with the replacement threshold. If the number of data replacements within the preset period is greater than the replacement threshold, it means that the data replacement frequency in the hot data area is high, and it is likely that a large amount of temporary data will replace the hot data. The server will increase the access threshold and increase the difficulty of storing data in the hot data area to reduce the data replacement frequency in the hot data area. The replacement threshold is set according to actual experience and is not limited in the embodiment of the present invention.

[0052] For example, when increasing the access threshold, the access threshold may be increased by 1.

[0053] Figure 3 FIG. 1 is a flow chart of a method for processing memory data provided by a third embodiment of the present invention. Figure 3 As shown, based on the above embodiments, the method for processing memory data further includes:

[0054] S301: If it is determined that the capacity of the hot data area is insufficient, the access identifier at the tail of the queue of the hot data area is stored in the head of the queue of the cold data area, and the data corresponding to the access identifier at the tail of the queue of the hot data area is migrated to the cold data area;

[0055] Specifically, when data needs to be migrated from the cold data area to the hot data area, the server will determine whether the capacity of the hot data area is sufficient. If the capacity of the hot data area is insufficient, a portion of the data in the hot data area needs to be migrated out first, and the data corresponding to the access identifier at the tail of the queue in the hot data area can be migrated to the cold data area, and the access identifier at the tail of the queue in the hot data area is stored in the head of the queue in the cold data area. The queue in the cold data area is specifically used to store access identifiers to facilitate the query of access identifiers, and a special area can be set in the memory to store the queue in the cold data area.

[0056] For example, the maximum storage space of the hot data area can be set. When judging whether the capacity of the hot data area is sufficient, the remaining storage space of the hot data area can be obtained first, and the size of the data to be migrated from the cold data area can be obtained. If the size of the data to be migrated to the hot data area is larger than the remaining storage space of the hot data area, then the capacity of the hot data area is insufficient.

[0057] For example, the maximum number of queues in the hot data area can be set, that is, the maximum number of access identifiers that the queues in the hot data area can store. When judging whether the capacity of the hot data area is sufficient, the remaining number of queues in the hot data area can be obtained first, that is, how many access identifiers the queues in the hot data area can still store. If the remaining number of queues in the hot data area is equal to 0, then the capacity of the hot data area is insufficient.

[0058] S302: Store the access identifier corresponding to the data migrated from the cold data area into the queue head of the hot data area, and store the data migrated from the cold data area into the hot data area.

[0059] Specifically, when migrating data from the cold data area to the hot data area, the server will store the access identifier corresponding to the data migrated from the cold data area to the queue head of the hot data area, and store the data migrated from the cold data area to the hot data area. The queue of the hot data area is specifically used to store access identifiers to facilitate the query of access identifiers, and a special area can be set in the memory to store the queue of the hot data area.

[0060] Figure 4 FIG. 4 is a flow chart of a method for processing memory data provided by a fourth embodiment of the present invention. Figure 4 As shown, based on the above embodiments, further, the method for processing memory data provided by the embodiment of the present invention also includes:

[0061] S401, receiving an access request, where the access request includes an access identifier;

[0062] Specifically, the server may receive an access request from a client, wherein the access request includes an access identifier. The client includes but is not limited to a desktop computer, a notebook computer, and other devices.

[0063] S402: If it is determined that the access identifier is stored in the queue of the cold data area, data corresponding to the access identifier is obtained from the cold data area and returned;

[0064] Specifically, after receiving the access request, the server will first determine whether the data corresponding to the access identifier has been cached in the memory. The server will first search for the access identifier from the queue of the hot data area according to the access identifier. If the access identifier is not found in the queue of the hot data area, the server will continue to search for the access identifier in the queue of the cold data area. If the access identifier is found in the queue of the cold data area, the server will obtain the data corresponding to the access identifier from the cold data area according to the access identifier, and then return the data corresponding to the access identifier to the client.

[0065] S403: Update the number of accesses corresponding to the access identifier.

[0066] Specifically, after returning the data corresponding to the access identifier to the client, the server updates the number of accesses corresponding to the access identifier.

[0067] On the basis of the above embodiments, further, the method for processing memory data provided by the embodiment of the present invention also includes:

[0068] If it is determined that the updated access number corresponding to the access identifier is greater than or equal to the access threshold, the data corresponding to the access identifier is migrated to the hot data area.

[0069] Specifically, after updating the access count corresponding to the access identifier, the server obtains the updated access count corresponding to the access identifier, and then compares the updated access count with the access threshold. If the updated access count is greater than the access threshold, the data period corresponding to the access identifier can be migrated to the hot data area.

[0070] Figure 5 FIG. 5 is a flow chart of a method for processing memory data provided by a fifth embodiment of the present invention. Figure 5 As shown, based on the above embodiments, further, the method for processing memory data provided by the embodiment of the present invention also includes:

[0071] S501, receiving an access request, where the access request includes an access identifier;

[0072] Specifically, the server may receive an access request from a client, where the access request includes an access identifier.

[0073] S502: If it is determined that the data corresponding to the access identifier is not stored in the cold data area and the hot data area, the data corresponding to the access identifier is obtained from the database and returned;

[0074] Specifically, after receiving the access request, the server will first determine whether the data corresponding to the access identifier has been cached in the memory. The server will first search for the access identifier from the queue of the hot data area according to the access identifier. If the access identifier is not found in the queue of the hot data area, the server will continue to search for the access identifier in the queue of the cold data area. If the access identifier is still not found in the queue of the cold data area, the server can search for the data corresponding to the access identifier from the database, and then return the data corresponding to the access identifier obtained from the database to the client.

[0075] S503: Load the data corresponding to the access identifier into the cold data area, and record the number of accesses corresponding to the access identifier.

[0076] Specifically, the server will load the data corresponding to the access identifier into the cold data area, store the access identifier at the head of the queue in the cold data area, and copy the data corresponding to the access identifier to the cold data area. The server will also record the number of accesses corresponding to the access identifier. Since the data is copied from the database, the number of accesses corresponding to the access identifier is 1.

[0077] On the basis of the above embodiments, further, the storage reference value is a storage size or the number of access identifiers.

[0078] Specifically, the storage reference value may be a storage size, and the server may count the size of the storage data of the hot data area within a set period as the storage size of the hot data area within the set period. The storage reference value may be the number of access identifiers, and the server may count the number of access identifiers included in the queue of the hot data area within the set period to obtain the number of access identifiers.

[0079] For example, the server can sample the size of the storage data in the hot data area within a set period, such as setting the period to 12 hours, sampling every half hour, obtaining the sizes of 12 storage data, and calculating the average of the sizes of the 12 storage data as the storage size.

[0080] For example, the number of access identifiers included in the queue of the hot data area can be sampled within a set period. For example, the set period is 24 hours, sampling is performed every hour, 24 sampling values ​​of access identifiers are obtained, and the average value of the sampling values ​​of the 24 access identifiers is calculated as the number of access identifiers.

[0081] Figure 6 is a schematic diagram of the structure of a memory data processing device provided by a sixth embodiment of the present invention. Figure 6 As shown, the memory data processing device provided by the embodiment of the present invention includes an acquisition module 601, a reduction module 602 and a migration module 603, wherein:

[0082] The acquisition module 601 is used to obtain the storage reference value of the hot data area within a set period; wherein the hot data area is a preset area in the memory; the reduction module 602 is used to reduce the access threshold after judging that the storage reference value is less than the corresponding reference threshold; the migration module 603 is used to migrate the data corresponding to the access identifier to the hot data area after judging that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold; wherein the cold data area is a preset area in the memory.

[0083] Specifically, the acquisition module 601 can acquire the storage reference value of the hot data area within a set period, and the hot data area is a preset area in the memory. The set period is set according to actual needs and is not limited in the embodiment of the present invention. The storage reference value is, for example, the storage size or the number of access identifiers.

[0084] The reduction module 602 compares the storage reference value with the reference threshold value corresponding to the storage reference value. If the storage reference value is less than the corresponding reference threshold value, it means that the amount of data stored in the hot data area is small. The server will lower the access threshold value so that more data can be stored in the hot data area to improve the utilization rate of the hot data area and the access efficiency of the data. The reference threshold value corresponding to the storage reference value is set according to actual needs and is not limited in the embodiment of the present invention. The access threshold value is preset and is set according to actual experience and is not limited in the embodiment of the present invention.

[0085] The migration module 603 can obtain the number of accesses corresponding to each access identifier in the cold data area, and then compare the number of accesses corresponding to each access identifier in the cold data area with the access threshold. If the number of accesses corresponding to the access identifier in the cold data area is greater than or equal to the access threshold, the data corresponding to the access identifier in the cold data area is migrated to the hot data area. The cold data area is a preset area in the memory, and there is no overlap between the cold data area and the hot data area. The access identifier corresponds to the data one by one.

[0086] The memory data processing device provided by the embodiment of the present invention can obtain the storage reference value of the hot data area within a set period, and after judging that the storage reference value is less than the corresponding reference threshold, reduce the access threshold, and after judging that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, migrate the data corresponding to the access identifier to the hot data area, lower the threshold for storing data in the hot data area, make it easier to cache data in the hot data area, and improve the utilization rate of the hot data area. In addition, since the data is stored in the hot data area, the access efficiency of the data can be improved.

[0087] Figure 7 is a schematic diagram of the structure of a memory data processing device provided by a seventh embodiment of the present invention. Figure 7 As shown, based on the above embodiments, the memory data processing device provided by the embodiment of the present invention further includes a statistical module 604 and an adding module 605, wherein:

[0088] The statistical module 604 is used to count the number of data replacements in the hot data area within a preset period; the increasing module 605 is used to increase the access threshold after determining that the number of data replacements is greater than the replacement threshold.

[0089] Figure 8 is a schematic diagram of the structure of a memory data processing device provided by an eighth embodiment of the present invention. Figure 8As shown, based on the above embodiments, the memory data processing device provided by the embodiment of the present invention further includes a migration module 606 and a migration module 607, wherein:

[0090] The migration module 606 is used to store the access identifier at the tail of the queue of the hot data area to the head of the queue of the cold data area after determining that the capacity of the hot data area is insufficient, and migrate the data corresponding to the access identifier at the tail of the queue of the hot data area to the cold data area; the migration module 607 is used to store the access identifier corresponding to the data migrated from the cold data area to the head of the queue of the hot data area, and store the data migrated from the cold data area to the hot data area.

[0091] Fig. 9 is a schematic diagram of the structure of a memory data processing device provided by a ninth embodiment of the present invention. Fig. 9 As shown, based on the above embodiments, further, the memory data processing device provided by the embodiment of the present invention further includes a first receiving module 608, a returning module 609 and an updating module 610, wherein:

[0092] The first receiving module 608 is used to receive an access request, which includes an access identifier; the returning module 609 is used to obtain data corresponding to the access identifier from the cold data area and return it after determining that the access identifier is stored in the queue of the cold data area; the updating module 610 is used to update the number of accesses corresponding to the access identifier.

[0093] Fig.10 is a schematic diagram of the structure of a memory data processing device provided by the tenth embodiment of the present invention. Fig.10 As shown, based on the above embodiments, further, the memory data processing device provided by the embodiment of the present invention further includes a first judgment module 611, wherein:

[0094] The first judgment module 611 is used to migrate the data corresponding to the access identifier to the hot data area after judging that the updated access number corresponding to the access identifier is greater than or equal to the access threshold.

[0095] Fig.11 is a schematic diagram of the structure of a memory data processing device provided by the eleventh embodiment of the present invention, such as Fig.11 As shown, based on the above embodiments, further, the memory data processing device provided by the embodiment of the present invention further includes a second receiving module 612, a second judging module 613 and a recording module 614, wherein:

[0096] The second receiving module 612 is used to receive an access request, which includes an access identifier; the second judging module 613 is used to obtain and return the data corresponding to the access identifier from the database after judging that the data corresponding to the access identifier is not stored in the cold data area and the hot data area; the recording module 614 is used to load the data corresponding to the access identifier into the cold data area and record the number of accesses corresponding to the access identifier.

[0097] On the basis of the above embodiments, further, the storage reference value is the storage size or the number of data corresponding to the access identifier.

[0098] The embodiments of the apparatus provided in the embodiments of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments, and its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0099] It should be noted that the memory data processing method and device provided in the embodiments of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiments of the present invention do not limit the application field of the memory data processing method and device.

[0100] Fig.12 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Fig.12 As shown, the electronic device may include: a processor 1201, a communication interface 1202, a memory 1203 and a communication bus 1204, wherein the processor 1201, the communication interface 1202 and the memory 1203 communicate with each other through the communication bus 1204. The processor 1201 may call the logic instructions in the memory 1203 to execute the following method: obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in the memory; if it is determined that the storage reference value is less than the corresponding reference threshold, then the access threshold is lowered; if it is determined that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, then the data corresponding to the access identifier is migrated to the hot data area; wherein the cold data area is a preset area in the memory.

[0101] In addition, the logic instructions in the above-mentioned memory 1203 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0102] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in a memory; if it is determined that the storage reference value is less than a corresponding reference threshold, then lowering an access threshold; if it is determined that the number of accesses corresponding to an access identifier in a cold data area is greater than the access threshold, then migrating data corresponding to the access identifier to the hot data area; wherein the cold data area is a preset area in the memory.

[0103] The present embodiment provides a computer-readable storage medium, which stores a computer program. The computer program enables the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in the memory; if it is determined that the storage reference value is less than the corresponding reference threshold, then lowering the access threshold; if it is determined that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, then migrating the data corresponding to the access identifier to the hot data area; wherein the cold data area is a preset area in the memory.

[0104] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0105] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0109] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for processing memory data, characterized in that: include: Obtaining a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in a memory; the storage reference value is a storage size or a number of access identifiers; When the storage reference value is the storage size, the size of the storage data in the hot data area is sampled within a set period and an average value is taken as the storage size; When the storage reference value is the number of access identifiers, sampling the number of access identifiers included in the queue of the hot data area within a set period and taking an average value as the number of access identifiers; If it is determined that the stored reference value is less than the corresponding reference threshold, lowering the access threshold; If it is determined that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold, the data corresponding to the access identifier is migrated to the hot data area; wherein the cold data area is a preset area in the memory; If it is determined that the capacity of the hot data area is insufficient, the access identifier at the tail of the queue of the hot data area is stored in the head of the queue of the cold data area, and the data corresponding to the access identifier at the tail of the queue of the hot data area is migrated to the cold data area; and a data replacement occurs in the hot data area; storing the access identifier corresponding to the data migrated from the cold data area in the queue head of the hot data area, and storing the data migrated from the cold data area in the hot data area; Counting the number of data replacements in the hot data area within a preset period; If it is determined that the number of data replacements is greater than the replacement threshold, the access threshold is increased.

2. The method according to claim 1, characterized in that Also includes: receiving an access request, wherein the access request includes an access identifier; If it is determined that the access identifier is stored in the queue of the cold data area, then obtaining data corresponding to the access identifier from the cold data area and returning the data; The access count corresponding to the access identifier is updated.

3. The method according to claim 2, characterized in that Also includes: If it is determined that the updated access number corresponding to the access identifier is greater than or equal to the access threshold, the data corresponding to the access identifier is migrated to the hot data area.

4. The method according to claim 1, characterized in that Also includes: receiving an access request, wherein the access request includes an access identifier; If it is determined that the data corresponding to the access identifier is not stored in the cold data area and the hot data area, the data corresponding to the access identifier is obtained from the database and returned; The data corresponding to the access identifier is loaded into the cold data area, and the number of accesses corresponding to the access identifier is recorded.

5. A memory data processing device, characterized in that: include: An acquisition module, used to acquire a storage reference value of a hot data area within a set period; wherein the hot data area is a preset area in a memory; and the storage reference value is a storage size or a number of access identifiers; When the storage reference value is the storage size, the size of the storage data in the hot data area is sampled within a set period and an average value is taken as the storage size; When the storage reference value is the number of access identifiers, sampling the number of access identifiers included in the queue of the hot data area within a set period and taking an average value as the number of access identifiers; A reducing module, configured to reduce the access threshold after determining that the stored reference value is less than the corresponding reference threshold; A migration module, configured to migrate data corresponding to the access identifier to the hot data area after determining that the number of accesses corresponding to the access identifier in the cold data area is greater than the access threshold; wherein the cold data area is a preset area in the memory; A migration module is used to store the access identifier at the tail of the queue of the hot data area to the head of the queue of the cold data area after determining that the capacity of the hot data area is insufficient, and migrate the data corresponding to the access identifier at the tail of the queue of the hot data area to the cold data area; and record a data replacement in the hot data area; A migration module, used to store the access identifier corresponding to the data migrated from the cold data area to the queue head of the hot data area, and store the data migrated from the cold data area to the hot data area; A statistics module, used to count the number of data replacements in the hot data area within a preset period; The increasing module is used to increase the access threshold after determining that the number of data replacement times is greater than the replacement threshold.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.