Data management method and device and computer readable storage medium

By obtaining and adjusting the survival time of data corresponding to large key values ​​in the Redis database, and optimizing memory usage according to load indicators and access frequency, the memory shortage caused by the large key value data in the Redis database is solved, and the rational use of memory is realized and The database runs stably.

CN118939693APending Publication Date: 2024-11-12CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410962255.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing technology uses a lot of memory for data corresponding to large key values ​​in the Redis database, resulting in insufficient memory for the device. The existing solution extends the survival time when the large key value access frequency is large, and shortens when the access frequency is small. Survival time cannot effectively avoid the problem of insufficient memory.

Method used

By obtaining the load indicator of the target device, the accessed frequency of the target key value and the survival time of the target data, adjust the survival time according to the load indicator and access frequency, sending an indication message to adjust the survival time of the data in memory, ensuring the reasonableness of the device memory use.

Benefits of technology

It effectively avoids the problem of insufficient memory of the device. By dynamically adjusting the survival time of the data corresponding to large key values, optimizing memory usage according to load indicators and access frequency, ensuring the stable operation of the Redis database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939693A_ABST
    Figure CN118939693A_ABST
Patent Text Reader

Abstract

The invention provides a data management method and device and a computer readable storage medium, relates to the technical field of computers, and can avoid insufficient memory of equipment. The method comprises the following steps: acquiring a target load index of target equipment, the accessed frequency of a target key value and the survival time of target data corresponding to the target key value; the target equipment is used for processing a task request corresponding to the target key value, the data volume of the target data is greater than a first threshold value, and the survival duration is the maximum duration of survival of the target data in a memory of the target equipment; adjusting the survival time length according to the target load index and the accessed frequency to obtain the adjusted survival time length; sending an indication message to the target device; the indication message is used for indicating that the maximum survival time length of the target data in the memory of the target equipment is the adjusted survival time length.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data management method, device and computer-readable storage medium. Background Art

[0002] The redis database cluster can deploy the redis database. The amount of data corresponding to large key values ​​in the redis database is large, which occupies more device memory. In order to avoid the data corresponding to large key values ​​in the redis database occupying the device memory for a long time, resulting in insufficient device memory, the existing solution usually extends the survival time of the data corresponding to the large key value in the memory when the large key value is accessed frequently, and shortens the survival time of the data corresponding to the large key value in the memory when the large key value is accessed less frequently.

[0003] However, if the number of data corresponding to large key values ​​in the device is large and the access frequency of each large key value is high, the existing solution will cause the data corresponding to each large key value to survive for a long time in the device's memory, thereby causing insufficient memory of the device. Summary of the invention

[0004] The present application provides a data management method, apparatus, and computer-readable storage medium, which can avoid insufficient memory of a device.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a data management method is provided, the method comprising: obtaining a target load indicator of a target device, an access frequency of a target key value, and a survival time of target data corresponding to the target key value; the target device is used to process a task request corresponding to the target key value, the data volume of the target data is greater than a first threshold, and the survival time is the maximum survival time of the target data in the memory of the target device; adjusting the survival time according to the target load indicator and the access frequency to obtain an adjusted survival time; sending an indication message to the target device; the indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

[0007] Based on this scheme, compared with the existing scheme of extending the survival time of the data corresponding to the large key value in the memory when the access frequency of the large key value is high, and shortening the survival time of the data corresponding to the large key value in the memory when the access frequency of the large key value is low, the scheme of the present application obtains the target load indicator of the target device, the access frequency of the target key value and the survival time of the target data, and then adjusts the survival time according to the target load indicator and the access frequency to obtain the adjusted survival time, and finally sends the adjusted survival time to the target device. Since the survival time of the target data with a data volume greater than the first threshold is adjusted according to the target load indicator and the access frequency, the target load indicator of the target device will also affect the survival time of the target data, thereby avoiding insufficient memory of the device.

[0008] In combination with the first aspect, in certain embodiments of the first aspect, the survival time is adjusted according to the target load indicator and the access frequency to obtain an adjusted survival time, including: determining an evaluation value of the target data according to the target load indicator and the access frequency; when the evaluation value is greater than a second threshold, increasing the survival time by a first time length to obtain an adjusted survival time; when the evaluation value is not greater than the second threshold and the evaluation value is less than a third threshold, reducing the survival time by a second time length to obtain an adjusted survival time.

[0009] Based on the scheme, the evaluation value of the target data is determined according to the target load index and the access frequency. When the evaluation value is greater than the second threshold, the survival time is increased by the first time to obtain the adjusted survival time. When the evaluation value is not greater than the second threshold and the evaluation value is less than the third threshold, the survival time is reduced by the second time to obtain the adjusted survival time, which can achieve the scheme of adjusting the survival time according to the target load index and the access frequency to obtain the adjusted survival time.

[0010] In combination with the first aspect, in certain embodiments of the first aspect, an evaluation value of the data is determined based on the target load indicator and the access frequency, including: normalizing the target load indicator and the access frequency to obtain a first normalized indicator and a normalized frequency; taking the sum of the first product and the second product as the evaluation value; the first product is the product of the first normalized indicator and the weight corresponding to the target load indicator, and the second product is the product of the normalized frequency and the weight corresponding to the access frequency.

[0011] Based on this scheme, the target load index and the access frequency are normalized to obtain the first normalized index and the normalized frequency; the product of the first normalized index and the weight corresponding to the target load index, and the sum of the product of the normalized frequency and the weight corresponding to the access frequency are used as evaluation values, thereby realizing a scheme for determining the evaluation value of data based on the target load index and the access frequency.

[0012] In combination with the first aspect, in certain embodiments of the first aspect, the method also includes: obtaining a task request and a load indicator of each device among multiple devices; the device is allowed to process the task request; for each device, determining a capacity value of the device based on the load indicator of the device; the capacity value is positively correlated with the ability of the device to process the task request; sending the task request to a target device among the multiple devices; the capacity value of the target device is not less than the capacity value of other devices, and the other devices are any device among the multiple devices except the target device.

[0013] Based on this scheme, by obtaining the task request and the load index of each device in multiple devices, for each device, the capacity value of the device is determined according to the load index of the device, and finally to the target device in multiple devices; since the capacity value is positively correlated with the capacity of the device, the capacity value of the target device is not less than the capacity values ​​of other devices, and the other devices are any device in the multiple devices except the target device, so that the task request can be allocated to the target device with the best ability to process the task request.

[0014] In combination with the first aspect, in certain embodiments of the first aspect, when the number of load indicators is multiple, the capacity value of the device is determined according to the load indicator of the device, including: for each load indicator, normalizing the load indicator to obtain a second normalized indicator; for each second normalized indicator, multiplying the second normalized indicator and the weight corresponding to the second normalized indicator as a third product; and taking the sum of multiple third products as the capacity value.

[0015] Based on this solution, when there are multiple load indicators, the load indicator is normalized for each load indicator to obtain a second normalized indicator; for each second normalized indicator, the product of the second normalized indicator and the weight corresponding to the second normalized indicator is taken as the third product; the sum of multiple third products is taken as the capacity value, thereby realizing a solution for determining the capacity value of a device based on the load indicator of the device.

[0016] In a second aspect, a data management device is provided for implementing the data management method of the first aspect. The data management device includes a module, unit, or means corresponding to the method, which can be implemented by hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.

[0017] In combination with the second aspect, in certain embodiments of the second aspect, the data management device includes: a transceiver module and a processing module; the transceiver module is used to obtain a target load indicator of the target device, an access frequency of the target key value, and a survival time of the target data corresponding to the target key value; the target device is used to process a task request corresponding to the target key value, the data volume of the target data is greater than a first threshold, and the survival time is the maximum survival time of the target data in the memory of the target device; the processing module is used to adjust the survival time according to the target load indicator and the access frequency to obtain an adjusted survival time; the transceiver module is also used to send an indication message to the target device; the indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

[0018] In combination with the second aspect, in certain embodiments of the second aspect, the processing module is specifically used to: determine an evaluation value of the target data based on the target load index and the access frequency; when the evaluation value is greater than the second threshold, increase the survival time by the first time length to obtain an adjusted survival time; when the evaluation value is not greater than the second threshold and the evaluation value is less than the third threshold, reduce the survival time by the second time length to obtain an adjusted survival time.

[0019] In combination with the second aspect, in certain embodiments of the second aspect, the processing module is also used to determine an evaluation value of the data based on the target load indicator and the access frequency, including: normalizing the target load indicator and the access frequency to obtain a first normalized indicator and a normalized frequency; taking the sum of the first product and the second product as the evaluation value; the first product is the product of the first normalized indicator and the weight corresponding to the target load indicator, and the second product is the product of the normalized frequency and the weight corresponding to the access frequency.

[0020] In combination with the second aspect, in certain embodiments of the second aspect, the processing module is also used to: obtain a task request and a load indicator of each device among multiple devices; the device is allowed to process the task request; for each device, determine the capacity value of the device according to the load indicator of the device; the capacity value is positively correlated with the ability of the device to process the task request; send a task request to a target device among multiple devices; the capacity value of the target device is not less than the capacity value of other devices, and the other devices are any device among the multiple devices except the target device.

[0021] In combination with the second aspect, in certain embodiments of the second aspect, when the number of load indicators is multiple, the processing module is also used to determine the capacity value of the device based on the load indicator of the device, including: for each load indicator, normalizing the load indicator to obtain a second normalized indicator; for each second normalized indicator, multiplying the second normalized indicator and the weight corresponding to the second normalized indicator as the third product; and taking the sum of multiple third products as the capacity value.

[0022] In a third aspect, a data management device is provided, comprising: at least one processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute instructions to implement the method provided in the first aspect and any possible implementation manner thereof.

[0023] In a fourth aspect, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a data management device, the data management device is enabled to execute the method provided in the first aspect and any possible implementation manner thereof.

[0024] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method provided in the first aspect and any possible implementation manner thereof.

[0025] In the sixth aspect, a chip system is provided, comprising: a processor and an interface circuit; the interface circuit is used to receive a computer program or instruction and transmit it to the processor; the processor is used to execute the computer program or instruction so that the chip system performs the method provided in the first aspect above and any possible implementation manner thereof.

[0026] Among them, the technical effects brought about by any implementation of the second to sixth aspects can refer to the technical effects brought about by different implementations of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of the architecture of a data management system provided for this application;

[0028] Figure 2 A flowchart of a data management method provided for this application;

[0029] Figure 3 A flowchart of another data management method provided in this application;

[0030] Figure 4 A flowchart of another data management method provided in this application;

[0031] Figure 5 A flowchart of another data management method provided in this application;

[0032] Figure 6 A flowchart of another data management method provided in this application;

[0033] Figure 7 A flowchart of another data management method provided in this application;

[0034] Figure 8 A schematic diagram of the structure of a data management device provided by this application;

[0035] Fig. 9 A schematic diagram of the structure of another data management device provided by the present application. DETAILED DESCRIPTION

[0036] In the description of this application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0037] In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0038] Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0039] It is understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It is understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0040] It can be understood that in the present application, "when", "if" and "if" all mean that corresponding processing will be carried out under certain objective circumstances, but do not limit the time, nor do they require judgment actions when implementing them, nor do they mean the existence of other limitations.

[0041] It can be understood that some optional features in the embodiments of the present application may be implemented independently in certain scenarios without relying on other features, such as the solution on which they are currently based, to solve corresponding technical problems and achieve corresponding effects, or may be combined with other features according to needs in certain scenarios. Accordingly, the devices provided in the embodiments of the present application may also realize these features or functions accordingly, which will not be elaborated here.

[0042] In this application, unless otherwise specified, the same or similar parts between the various embodiments can refer to each other. In the various embodiments in this application, and the various implementation methods in each embodiment, if there is no special description and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The following implementation methods of this application do not constitute a limitation on the scope of protection of this application.

[0043] The Redis database is an open source, high-performance non-relational in-memory database. The Redis database has been widely used in many different scenarios, including building memory scenarios, distributed session management scenarios, queue system scenarios, and distributed lock scenarios.

[0044] The Redis database is widely used because it has many excellent features, including:

[0045] ① Based on memory storage: Because all read and write operations are performed in the device's memory, the Redis database responds very quickly.

[0046] ②Based on key-value storage: Each data in the Redis database is bound to a unique key value.

[0047] ③ Have a variety of data structures: The data structures supported by the Redis database include not only simple string key-value pairs, but also other complex data structures such as lists, hashes, sets, and ordered sets.

[0048] ④Support distributed storage: Redis database data can be distributed and stored on multiple devices in the Redis database cluster.

[0049] In order to better utilize the Redis database and balance the load of each device in the Redis database, existing solutions often include polling strategy and random strategy. The polling strategy is to assign tasks to devices according to the order of devices. The random strategy is to randomly assign tasks to available devices.

[0050] However, the above two strategies do not take into account the load of the device memory, especially when there is data corresponding to large key values ​​in the device memory. Since the amount of data corresponding to large key values ​​in the redis database is large and occupies more device memory, if other tasks continue to be assigned to the device for processing, it will cause insufficient device memory, thereby affecting the efficiency of the Redis database.

[0051] In order to prevent the data corresponding to large key values ​​in the redis database from occupying the device's memory for a long time, causing insufficient device memory, the existing solution usually extends the survival time of the data corresponding to the large key value in the memory when the large key value is accessed frequently, and shortens the survival time of the data corresponding to the large key value in the memory when the large key value is accessed less frequently.

[0052] However, if the number of data corresponding to large key values ​​in the device is large and the access frequency of each large key value is high, the existing solution will cause the data corresponding to each large key value to survive for a long time in the device's memory, thereby causing insufficient memory of the device.

[0053] To solve the above problems, the present application provides a data management method, which includes: obtaining a target load indicator of a target device, an access frequency of a target key value, and a survival time of target data corresponding to the target key value; the target device is used to process a task request corresponding to the target key value, the data volume of the target data is greater than a first threshold, and the survival time is the maximum survival time of the target data in the memory of the target device; adjusting the survival time according to the target load indicator and the access frequency to obtain an adjusted survival time; sending an indication message to the target device; the indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

[0054] Based on this scheme, compared with the existing scheme of extending the survival time of the data corresponding to the large key value in the memory when the access frequency of the large key value is high, and shortening the survival time of the data corresponding to the large key value in the memory when the access frequency of the large key value is low, the scheme of the present application obtains the target load indicator of the target device, the access frequency of the target key value and the survival time of the target data, and then adjusts the survival time according to the target load indicator and the access frequency to obtain the adjusted survival time, and finally sends the adjusted survival time to the target device. Since the survival time of the target data with a data volume greater than the first threshold is adjusted according to the target load indicator and the access frequency, the target load indicator of the target device will also affect the survival time of the target data, thereby avoiding insufficient memory of the device.

[0055] Figure 1 This is a schematic diagram of the architecture of a data management system provided by the present application. The technical solution of the embodiment of the present application can be applied to Figure 1 The data management system shown, such as Figure 1 As shown, the data management system 10 includes a data management device 11 and an electronic device 12 .

[0056] The data management device 11 is directly or indirectly connected to the electronic device 12 . In this connection relationship, a wired connection or a wireless connection may be adopted, which is not limited in the embodiment of the present application.

[0057] The data management device 11 can be used to receive data from the electronic device 12 .

[0058] The electronic device 12 can be used to send data to the data management device 11 .

[0059] It should be noted that the data management device 11 and the electronic device 12 may be independent devices or integrated into the same device, and this application does not make any specific limitation on this.

[0060] When the data management device 11 and the electronic device 12 are integrated into the same device, the communication between the data management device 11 and the electronic device 12 is the communication between the internal modules of the device. In this case, the communication process between the two is the same as "the communication process between the data management device 11 and the electronic device 12 when they are independent of each other".

[0061] In the following embodiments provided in the present application, the present application is described by taking the data management device 11 and the electronic device 12 as being independently configured.

[0062] In practical applications, the data management method provided in the embodiment of the present application can be applied to the data management device 11, and can also be applied to the devices included in the data management device 11.

[0063] In the following, in conjunction with the accompanying drawings, the data management method provided in the embodiment of the present application is described by taking the application of the data management method to the data management device 11 as an example.

[0064] Figure 2 A flow chart of a data management method provided for this application, such as Figure 2 As shown, the method comprises the following steps:

[0065] S201. The data management apparatus obtains a target load indicator of a target device, an access frequency of a target key value, and a survival time of target data corresponding to the target key value.

[0066] The target device is used to process the task request corresponding to the target key value, the data volume of the target data is greater than the first threshold, and the survival time is the maximum survival time of the target data in the memory of the target device.

[0067] It should be noted that the target device may also be referred to as a target node, and the target device may be a device in a redis database cluster.

[0068] The target load index may be a target load index within a preset time period, and the end time of the preset time period may be the current time. The duration of the preset time period may also be 10 minutes, or the duration of the preset time period may also be 1 hour, and this application does not impose any specific restrictions on this.

[0069] The target load index may include memory usage and / or central processing unit (CPU) usage. Of course, the target load index may also include other indicators, which are not specifically limited in the present application.

[0070] The target key value can also be called the target bigkey, and the target key value can be the key value in the redis database.

[0071] The access frequency may be the access frequency within a preset time period.

[0072] Task requests can be used to request target data corresponding to the target key value in the redis database.

[0073] The first threshold may be 200 megabits (MB), or the first threshold may be 300 MB. Of course, the first threshold may also have other values, and the present application does not impose any specific limitation on this.

[0074] As a possible implementation, combining Figure 1 The data management device receives a message from an electronic device, the message including a target load indicator of the target device, an access frequency of the target key value, and a survival time of the target data corresponding to the target key value. The data management device obtains the target load indicator of the target device, the access frequency of the target key value, and the survival time of the target data corresponding to the target key value from the message.

[0075] S202: The data management device adjusts the survival time according to the target load index and the access frequency to obtain an adjusted survival time.

[0076] As a possible implementation method, the data management device determines an evaluation value of the target data based on the target load index and the access frequency; when the evaluation value is greater than the second threshold, the survival time is increased by the first time length to obtain an adjusted survival time; when the evaluation value is not greater than the second threshold and the evaluation value is less than the third threshold, the survival time is reduced by the second time length to obtain an adjusted survival time.

[0077] It should be noted that the specific description of this possible implementation method can refer to the relevant description in the subsequent part of the specific implementation method of this application, and this application will not explain it here.

[0078] S203: The data management apparatus sends an instruction message to the target device.

[0079] The indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

[0080] As a possible implementation manner, the data management device encapsulates indication information indicating that the maximum survival time of the target data in the memory of the target device is the adjusted survival time, obtains an indication message, and then sends the target message to the target device.

[0081] Based on this scheme, compared with the existing scheme of extending the survival time of the data corresponding to the large key value in the memory when the access frequency of the large key value is high, and shortening the survival time of the data corresponding to the large key value in the memory when the access frequency of the large key value is low, the scheme of the present application obtains the target load indicator of the target device, the access frequency of the target key value and the survival time of the target data, and then adjusts the survival time according to the target load indicator and the access frequency to obtain the adjusted survival time, and finally sends the adjusted survival time to the target device. Since the survival time of the target data with a data volume greater than the first threshold is adjusted according to the target load indicator and the access frequency, the target load indicator of the target device will also affect the survival time of the target data, thereby avoiding insufficient memory of the device.

[0082] The above is a general description of the data management method provided by the present application. The data management method provided by the present application will be further described below in conjunction with the accompanying drawings.

[0083] In one design, Figure 3 A flowchart of another data management method provided in this application is as follows: Figure 3 As shown, S202 provided in the specific implementation manner of the present application may specifically include the following multiple steps:

[0084] S301. The data management device determines an evaluation value of target data according to a target load index and an access frequency.

[0085] It should be noted that the evaluation value is used to adjust the survival time.

[0086] As a possible implementation manner, the data management device normalizes the target load index and the access frequency to obtain a first normalized index and a normalized frequency; and uses the sum of the first product and the second product as an evaluation value.

[0087] The first product is the product of the first normalized index and the weight corresponding to the target load index, and the second product is the product of the normalized frequency and the weight corresponding to the accessed frequency.

[0088] It should be noted that the specific description of this possible implementation method can refer to the relevant description in the subsequent part of the specific implementation method of this application, and this application will not explain it here.

[0089] S302: When the evaluation value is greater than the second threshold, the data management device increases the survival time by the first time to obtain an adjusted survival time.

[0090] It should be noted that the second threshold value may also be referred to as an extended threshold value. The second threshold value may be 8, or the second threshold value may also be 12. Of course, the second threshold value may also have other values, and the present application does not impose any specific limitation on this.

[0091] The first duration may also be 5 minutes, or the first duration may also be 10 minutes. Of course, the first duration may also be other durations, and this application does not impose any specific limitation on this.

[0092] As a possible implementation manner, the data management device determines whether the evaluation value is greater than a second threshold value. If the evaluation value is greater than the second threshold value, the survival time is increased by the first time length to obtain an adjusted survival time.

[0093] S303: When the evaluation value is not greater than the second threshold and is less than the third threshold, the data management device reduces the survival time by the second time to obtain an adjusted survival time.

[0094] It should be noted that the third threshold value may also be referred to as a shortening threshold value. The third threshold value may be 5, or the third threshold value may also be 10. Of course, the third threshold value may also have other values, and this application does not impose any specific limitation on this.

[0095] The duration of the second duration may be the same as that of the first duration, or the duration of the second duration may be different from that of the first duration, and this application does not impose any specific limitation on this.

[0096] The second duration may also be 5 minutes, or the second duration may also be 10 minutes. Of course, the second duration may also be other durations, and this application does not impose any specific limitation on this.

[0097] As a possible implementation manner, the data management device determines whether the evaluation value is not greater than the second threshold and the evaluation value is less than the third threshold. If so, the survival time is increased by the second time to obtain an adjusted survival time.

[0098] If the evaluation value is not greater than the second threshold value and the evaluation value is not less than the third threshold value, the data management device does not adjust the survival time.

[0099] Based on the scheme, the evaluation value of the target data is determined according to the target load index and the access frequency. When the evaluation value is greater than the second threshold, the survival time is increased by the first time to obtain the adjusted survival time. When the evaluation value is not greater than the second threshold and the evaluation value is less than the third threshold, the survival time is reduced by the second time to obtain the adjusted survival time, which can achieve the scheme of adjusting the survival time according to the target load index and the access frequency to obtain the adjusted survival time.

[0100] In one design, Figure 4 A flowchart of another data management method provided in this application is as follows: Figure 4 As shown, S301 provided in the specific implementation manner of the present application may specifically include the following multiple steps:

[0101] S401. The data management device normalizes the target load index and the access frequency to obtain a first normalized index and a normalized frequency.

[0102] As a possible implementation manner, the data management device normalizes the target load index and the access frequency according to a normalization algorithm to obtain a first normalized index and a normalized frequency.

[0103] It should be noted that the specific solution of this possible implementation method can refer to the existing solution, and this application will not explain it again here.

[0104] S402: The data management device uses the sum of the first product and the second product as an evaluation value.

[0105] The first product is the product of the first normalized index and the weight corresponding to the target load index, and the second product is the product of the normalized frequency and the weight corresponding to the accessed frequency.

[0106] As a possible implementation manner, the data management device uses the product of the first normalized index and the weight corresponding to the target load index as the first product, and uses the product of the normalized frequency and the weight corresponding to the accessed frequency as the second product.

[0107] Then, the data management device uses the sum of the first product and the second product as an evaluation value.

[0108] Based on this scheme, the target load index and the access frequency are normalized to obtain the first normalized index and the normalized frequency; the product of the first normalized index and the weight corresponding to the target load index, and the sum of the product of the normalized frequency and the weight corresponding to the access frequency are used as evaluation values, thereby realizing a scheme for determining the evaluation value of data based on the target load index and the access frequency.

[0109] In one design, Figure 5 A flowchart of another data management method provided in this application is as follows: Figure 5 As shown, the data management method provided by the present application may also include the following steps:

[0110] S501: The data management apparatus obtains a task request and a load indicator of each device in a plurality of devices.

[0111] Among them, the device is allowed to process task requests.

[0112] It should be noted that the task request may also be referred to as a user request, and the task request may include a target key value.

[0113] A device can also be called a node, and a device can be a device in a redis database cluster.

[0114] The load index may be a load index within a preset time period.

[0115] The load indicator may include memory usage and / or CPU usage. Of course, the load indicator may also include other indicators, which are not specifically limited in this application.

[0116] As a possible implementation, combining Figure 1 The data management device receives a message from an electronic device, the message including a task request and a load indicator of each device in a plurality of devices, and the data management device obtains the task request and the load indicator of each device in the plurality of devices from the message.

[0117] S502: The data management device determines the capacity value of each device according to the load index of the device.

[0118] Among them, the capability value is positively correlated with the ability of the device to process task requests.

[0119] As a possible implementation method, when there are multiple load indicators, the data management device normalizes the load indicator for each load indicator to obtain a second normalized indicator; for each second normalized indicator, the product of the second normalized indicator and the weight corresponding to the second normalized indicator is taken as the third product; and the sum of multiple third products is taken as the capacity value.

[0120] It should be noted that the specific description of this possible implementation method can refer to the relevant description in the subsequent part of the specific implementation method of this application, and this application will not explain it here.

[0121] As another possible implementation, when the number of load indicators is 1, the data management device uses the opposite number of the load indicator as the capacity value of the device.

[0122] S503: The data management apparatus sends a task request to a target device among the multiple devices.

[0123] The capability value of the target device is not less than the capability value of other devices, and the other devices are any one of the multiple devices except the target device.

[0124] As a possible implementation manner, the data management device determines the largest target capability value among multiple capability values.

[0125] If the number of target capability values ​​is 1, the device corresponding to the target capability value is determined as the target device.

[0126] If there are multiple target capability values, one target capability value is randomly selected from the multiple target capability values ​​as the final capability value, and the device corresponding to the final capability value is determined as the target device.

[0127] Finally, the data management device forwards the task request to the target device.

[0128] Based on this scheme, by obtaining the task request and the load index of each device in multiple devices, for each device, the capacity value of the device is determined according to the load index of the device, and finally to the target device in multiple devices; since the capacity value is positively correlated with the capacity of the device, the capacity value of the target device is not less than the capacity values ​​of other devices, and the other devices are any device in the multiple devices except the target device, so that the task request can be allocated to the target device with the best ability to process the task request.

[0129] In one design, Figure 6 A flowchart of another data management method provided in this application is as follows: Figure 6 As shown, in the case where there are multiple load indicators, S501 provided in the specific implementation of the present application may specifically include the following multiple steps:

[0130] S601. The data management device normalizes each load indicator to obtain a second normalized indicator.

[0131] As a possible implementation manner, for each load indicator, the data management device normalizes the load indicator according to a normalization algorithm to obtain a second normalized indicator.

[0132] It should be noted that the specific solution of this possible implementation method can refer to the existing solution, and this application will not explain it again here.

[0133] S602: For each second normalized index, the data management device uses the product of the second normalized index and the weight corresponding to the second normalized index as a third product.

[0134] As a possible implementation manner, for each second normalized index, the data management device multiplies the second normalized index by a weight corresponding to the second normalized index to obtain a third product.

[0135] S603: The data management device uses the sum of multiple third products as the capability value.

[0136] As a possible implementation manner, the data management device adds each third product of the plurality of third products to obtain the capability value.

[0137] Based on this solution, when there are multiple load indicators, the load indicator is normalized for each load indicator to obtain a second normalized indicator; for each second normalized indicator, the product of the second normalized indicator and the weight corresponding to the second normalized indicator is taken as the third product; the sum of multiple third products is taken as the capacity value, thereby realizing a solution for determining the capacity value of a device based on the load indicator of the device.

[0138] In one design, Figure 7 A flowchart of another data management method provided in this application is as follows: Figure 7 As shown, the data management method provided by the present application may also include the following steps:

[0139] S701: The data management device obtains a task request.

[0140] It should be noted that the specific description of S701 may refer to the relevant description in the specific implementation S501 of this application.

[0141] S702: The data management device determines whether the key value corresponding to the task request is the target key value.

[0142] As a possible implementation manner, the data management device determines a key value corresponding to the task request, and then determines whether the data volume of data corresponding to the key value is greater than a first threshold.

[0143] If not, execute S703.

[0144] If yes, execute S704.

[0145] S703: The data management device processes the task request normally.

[0146] It should be noted that the specific solution for the data management device to normally process task requests can refer to the existing solution, and this application will not explain it again here.

[0147] After S703, the process execution of the data management method ends.

[0148] S704: The data management device obtains a load indicator of each device among the multiple devices.

[0149] It should be noted that the specific description of S704 may refer to the relevant description in the specific implementation S501 of this application.

[0150] While executing S704 , the data management device may asynchronously execute S708 .

[0151] S705. The data management device determines the capacity value of each device according to the load index of the device.

[0152] It should be noted that for the specific description of S705, reference may be made to the relevant description in S502 of the specific implementation manner of this application.

[0153] S706: The data management apparatus sends a task request to a target device among the multiple devices.

[0154] It should be noted that the specific description of S706 may refer to the relevant description in S503 of the specific implementation manner of this application.

[0155] S707: The data management apparatus receives the task request response message returned by the target device, and sends the task request response message to the device sending the task request.

[0156] It should be noted that the specific solution of S707 can refer to the existing solution, and this application will not explain it again here.

[0157] While executing S707 , the data management device may asynchronously execute S710 .

[0158] After S707, the process execution of the data management method ends.

[0159] S708: The data management device determines whether the current time is the time of the load indicator of the synchronization device.

[0160] If yes, execute S709.

[0161] If not, the process of the data management method ends.

[0162] S709: The data management device synchronizes the load index of each device.

[0163] As a possible implementation manner, the data management apparatus sends a synchronization load indicator request to each device, and receives a response message including the load indicator from each device.

[0164] S710: The data management apparatus obtains a target load indicator of a target device, an access frequency of a target key value, and a survival time of target data corresponding to the target key value.

[0165] It should be noted that the specific description of S710 may refer to the relevant description in the specific implementation S201 of this application.

[0166] S711. The data management device determines an evaluation value of the target data according to the target load index and the access frequency.

[0167] It should be noted that for the specific description of S711, reference may be made to the relevant description in the specific implementation S301 of this application.

[0168] S712: The data management device determines whether the evaluation value is greater than a second threshold.

[0169] If yes, execute S713.

[0170] If not, execute S714.

[0171] S713: When the evaluation value is greater than the second threshold, the data management device increases the survival time by the first time to obtain an adjusted survival time.

[0172] It should be noted that for the specific description of S713, reference may be made to the relevant description in the specific implementation S302 of this application.

[0173] S714: The data management device determines whether the evaluation value is less than a third threshold.

[0174] If yes, execute S715.

[0175] If not, the process execution of the data management method ends.

[0176] S715: When the evaluation value is not greater than the second threshold and is less than the third threshold, the data management device reduces the survival time by the second time to obtain an adjusted survival time.

[0177] It should be noted that for the specific description of S715, reference may be made to the relevant description in S303 of the specific implementation manner of this application.

[0178] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the data management device executing the data management method. In order to achieve the above functions, the data management device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0179] The embodiment of the present application can divide the functional modules of the data management device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, the "module" here can refer to a specific application-specific integrated circuit (ASIC), a circuit, a processor and memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions.

[0180] In the case of functional module division, Figure 8 FIG. 1 shows a schematic diagram of the structure of a data management device. Figure 8 As shown, the data management device 80 includes a transceiver module 801 and a processing module 802 .

[0181] In some embodiments, the data management device 80 may also include a storage module ( Figure 8 ), for storing program instructions and data.

[0182] Among them, the transceiver module 801 is used to obtain the target load index of the target device, the access frequency of the target key value and the survival time of the target data corresponding to the target key value; the target device is used to process the task request corresponding to the target key value, the data volume of the target data is greater than the first threshold, and the survival time is the maximum survival time of the target data in the memory of the target device; the processing module 802 is used to adjust the survival time according to the target load index and the access frequency to obtain the adjusted survival time; the transceiver module 801 is also used to send an indication message to the target device; the indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

[0183] Optionally, processing module 802 is specifically used to: determine an evaluation value of the target data based on the target load index and the access frequency; when the evaluation value is greater than a second threshold, increase the survival time by a first time length to obtain an adjusted survival time; when the evaluation value is not greater than the second threshold and the evaluation value is less than a third threshold, reduce the survival time by a second time length to obtain an adjusted survival time.

[0184] Optionally, the processing module 802 is also used to determine the evaluation value of the data based on the target load indicator and the access frequency, including: normalizing the target load indicator and the access frequency to obtain a first normalized indicator and a normalized frequency; taking the sum of the first product and the second product as the evaluation value; the first product is the product of the first normalized indicator and the weight corresponding to the target load indicator, and the second product is the product of the normalized frequency and the weight corresponding to the access frequency.

[0185] Optionally, the processing module 802 is also used to: obtain a task request and a load indicator of each device among multiple devices; the device is allowed to process the task request; for each device, determine the capacity value of the device according to the load indicator of the device; the capacity value is positively correlated with the ability of the device to process the task request; send a task request to a target device among multiple devices; the capacity value of the target device is not less than the capacity value of other devices, and the other devices are any device among the multiple devices except the target device.

[0186] Optionally, when there are multiple load indicators, the processing module 802 is also used to determine the capacity value of the device based on the load indicator of the device, including: for each load indicator, normalizing the load indicator to obtain a second normalized indicator; for each second normalized indicator, multiplying the second normalized indicator and the weight corresponding to the second normalized indicator as the third product; and taking the sum of multiple third products as the capacity value.

[0187] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0188] When the functions of the above functional modules are implemented in the form of hardware, Fig. 9 FIG. 1 shows a schematic diagram of the structure of a data management device. Fig. 9 As shown, the data management device 90 includes a processor 901, a memory 902 and a bus 903. The processor 901 and the memory 902 may be connected via the bus 903.

[0189] The processor 901 is the control center of the data management device 90, which can be a processor or a general term for multiple processing elements. For example, the processor 901 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.

[0190] As an embodiment, the processor 901 may include one or more CPUs, such as Fig. 9 CPU 0 and CPU 1 are shown in .

[0191] The memory 902 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0192] As a possible implementation, the memory 902 may exist independently of the processor 901, and the memory 902 may be connected to the processor 901 via a bus 903 for storing instructions or program codes. When the processor 901 calls and executes the instructions or program codes stored in the memory 902, the data management method provided in the embodiment of the present application can be implemented.

[0193] In another possible implementation, the memory 902 may also be integrated with the processor 901 .

[0194] The bus 903 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0195] It should be pointed out that Fig. 9 The structure shown does not constitute a limitation on the data management device 90. Fig. 9 In addition to the components shown, the data management device 90 may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0196] As an example, combining Figure 8 The functions implemented by the transceiver module 801 and the processing module 802 in the data management device 80 are similar to those Fig. 9 The function of processor 901 in is the same.

[0197] Optional, such as Fig. 9 As shown, the data management device 90 provided in the embodiment of the present application may further include a communication interface 904 .

[0198] The communication interface 904 is used to connect with other devices through a communication network. The communication network may be Ethernet, wireless access network, wireless local area network (WLAN), etc. The communication interface 904 may include a receiving unit for receiving data and a sending unit for sending data.

[0199] In a possible implementation, in the data management device 90 provided in the embodiment of the present application, the communication interface 904 may also be integrated in the processor 901, and the embodiment of the present application does not specifically limit this.

[0200] As a possible product form, the data management device of the embodiment of the present application can also be implemented using the following: one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout the present application.

[0201] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0202] An embodiment of the present application also provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed, the computer executes each step in the method flow shown in the above method embodiment.

[0203] An embodiment of the present application provides a computer program product including instructions. When the instructions are executed on a computer, the computer is caused to execute each step in the method flow shown in the above method embodiment.

[0204] An embodiment of the present application provides a chip system, including: a processor and an interface circuit; the interface circuit is used to receive a computer program or instruction and transmit it to the processor; the processor is used to execute the computer program or instruction so that the chip system executes each step in the method flow shown in the above method embodiment.

[0205] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, and a hard disk. Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), registers, hard disks, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any other form of computer-readable storage media in a suitable combination of the above, or numerical values ​​in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in a specific-purpose ASIC. In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0206] Since the data management device, computer-readable storage medium, and computer program product provided in this embodiment can be applied to the data management method provided by this embodiment, the technical effects that can be obtained can also refer to the above-mentioned method embodiments, and the embodiments of this application will not be repeated here.

[0207] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0208] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data management method, characterized in that: The method comprises: Obtaining a target load indicator of a target device, an access frequency of a target key value, and a survival time of target data corresponding to the target key value; the target device is used to process a task request corresponding to the target key value, the data volume of the target data is greater than a first threshold, and the survival time is a maximum survival time of the target data in the memory of the target device; Adjusting the survival time according to the target load indicator and the access frequency to obtain an adjusted survival time; An indication message is sent to the target device; the indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

2. The method according to claim 1, characterized in that: The adjusting the survival time according to the target load indicator and the access frequency to obtain the adjusted survival time includes: Determining an evaluation value of the target data according to the target load indicator and the access frequency; When the evaluation value is greater than the second threshold, the survival time is increased by the first time to obtain the adjusted survival time; When the evaluation value is not greater than the second threshold value and the evaluation value is less than the third threshold value, the survival time is reduced by the second time period to obtain the adjusted survival time.

3. The method according to claim 2, characterized in that The step of determining the evaluation value of the data according to the target load indicator and the access frequency includes: Normalizing the target load index and the access frequency to obtain a first normalized index and a normalized frequency; The sum of the first product and the second product is taken as the evaluation value; the first product is the product of the first normalized index and the weight corresponding to the target load index, and the second product is the product of the normalized frequency and the weight corresponding to the accessed frequency.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquiring the task request and a load indicator of each device in a plurality of devices; the device is allowed to process the task request; For each device, determining a capacity value of the device according to a load indicator of the device; the capacity value is positively correlated with the ability of the device to process the task request; The task request is sent to the target device among the multiple devices; the capability value of the target device is not less than the capability value of other devices, and the other device is any one device among the multiple devices except the target device.

5. The method according to claim 4, characterized in that In the case where there are multiple load indicators, determining the capacity value of the device according to the load indicator of the device includes: For each load indicator, normalize the load indicator to obtain a second normalized indicator; For each second normalized index, taking the product of the second normalized index and the weight corresponding to the second normalized index as the third product; The sum of the plurality of third products is taken as the capability value.

6. A data management device, characterized in that: The data management device comprises: a transceiver module and a processing module; The transceiver module is used to obtain a target load indicator of a target device, an access frequency of a target key value, and a survival time of target data corresponding to the target key value; the target device is used to process a task request corresponding to the target key value, the data volume of the target data is greater than a first threshold, and the survival time is a maximum survival time of the target data in the memory of the target device; The processing module is used to adjust the survival time according to the target load index and the access frequency to obtain an adjusted survival time; The transceiver module is further used to send an indication message to the target device; the indication message is used to indicate that the maximum survival time of the target data in the memory of the target device is the adjusted survival time.

7. The data management device according to claim 6, characterized in that: The processing module is specifically used for: Determining an evaluation value of the target data according to the target load indicator and the access frequency; When the evaluation value is greater than the second threshold, the survival time is increased by the first time to obtain the adjusted survival time; When the evaluation value is not greater than the second threshold value and the evaluation value is less than the third threshold value, the survival time is reduced by the second time period to obtain the adjusted survival time.

8. The data management device according to claim 7, characterized in that: The processing module is further used to determine the evaluation value of the data according to the target load index and the access frequency, including: Normalizing the target load index and the access frequency to obtain a first normalized index and a normalized frequency; The sum of the first product and the second product is taken as the evaluation value; the first product is the product of the first normalized index and the weight corresponding to the target load index, and the second product is the product of the normalized frequency and the weight corresponding to the accessed frequency.

9. The data management device according to any one of claims 6 to 8, characterized in that: The processing module is further used for: Acquiring the task request and a load indicator of each device in a plurality of devices; the device is allowed to process the task request; For each device, determining a capacity value of the device according to a load indicator of the device; The capability value is positively correlated with the capability of the device to process the task request; Sending the task request to the target device among the multiple devices; The capability value of the target device is not less than the capability value of other devices, and the other devices are any one of the multiple devices except the target device.

10. The data management device according to claim 9, characterized in that: In the case where there are multiple load indicators, the processing module is further configured to determine the capacity value of the device according to the load indicator of the device, including: For each load indicator, normalize the load indicator to obtain a second normalized indicator; For each second normalized index, taking the product of the second normalized index and the weight corresponding to the second normalized index as the third product; The sum of the plurality of third products is taken as the capability value.

11. A data management device, characterized in that: The data management device comprises: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the device executes the method according to any one of claims 1 to 5.

12. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instructions are executed, the computer is caused to perform the method according to any one of claims 1 to 5.