CN112699142A - Cold and hot data processing method and device, electronic equipment and storage medium - Google Patents

Cold and hot data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112699142A
CN112699142A CN202011603604.7A CN202011603604A CN112699142A CN 112699142 A CN112699142 A CN 112699142A CN 202011603604 A CN202011603604 A CN 202011603604A CN 112699142 A CN112699142 A CN 112699142A
Authority
CN
China
Prior art keywords
data set
weight
cold
key
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011603604.7A
Other languages
Chinese (zh)
Inventor
高玉环
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011603604.7A priority Critical patent/CN112699142A/en
Publication of CN112699142A publication Critical patent/CN112699142A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2445Data retrieval commands; View definitions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of data storage, and discloses a cold and hot data processing method, which comprises the following steps: the method comprises the steps of obtaining an original data set, classifying the original data set to obtain a classified data set, inquiring a key name set of the classified data set, obtaining an evaluation index set corresponding to the key name set, calculating the weight of the key name set based on the evaluation index set, evaluating whether the weight reaches a preset weight, marking the key name set as a hot data set if the weight reaches the preset weight, moving the key value set of the hot data set to a cache, marking the key name set as a cold data set if the weight does not reach the preset weight, and moving the key value set of the cold data set out of the cache. The invention also provides a cold and hot data processing device, electronic equipment and a storage medium. The invention also relates to blockchain techniques, the hot data sets may be stored in blockchain nodes. The invention can realize high-efficiency data query and reduce the data storage cost.

Description

Cold and hot data processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data storage, and in particular, to a method and an apparatus for processing cold and hot data, an electronic device, and a computer-readable storage medium.
Background
In the process of continuous change of enterprise business, business configuration data in an enterprise configuration system is increased explosively, and huge pressure is brought to a storage system along with continuous and rapid increase of data volume. The data is divided into cold data and hot data according to the access heat, and the cold data and the hot data have relative independence on logic space in a certain time. If the cold data and the hot data are stored in the same storage mode, the service performance of the system is affected, and the storage cost is greatly increased. How to reduce the data storage cost on the premise of ensuring the stability of the service performance of the system according to the cold and hot degree of the data is a problem which needs to be solved urgently.
Disclosure of Invention
The invention provides a cold and hot data processing method and device, electronic equipment and a computer readable storage medium, and mainly aims to realize efficient data query and reduce data storage cost.
In order to achieve the above object, the present invention provides a method for processing cold and hot data, comprising:
acquiring an original data set, and classifying the original data set to obtain a classified data set;
inquiring a key name set of the classified data set, and acquiring an evaluation index set corresponding to the key name set;
calculating the weight of the key name set based on the evaluation index set, and evaluating whether the weight reaches a preset weight;
if the weight reaches the preset weight, marking the key name set as a hot data set, and when judging that the key value set of the hot data set is not in the cache of a preset server, moving the key value set of the hot data set to the cache of the preset server;
if the weight does not reach the preset weight, marking the key name set as a cold data set, and shifting the key value set of the cold data set out of the cache of the preset server when judging that the key value set of the cold data set is in the cache of the preset server.
Optionally, the classifying the original data set to obtain a classified data set includes:
acquiring a service scene category corresponding to the original data set;
and classifying the original data set according to the scene category of the service scene to obtain a classified data set.
Optionally, the obtaining an evaluation index set corresponding to the key name set includes:
obtaining an access log according to an access result of the key name set in a database instance within a preset time period;
and extracting the evaluation index set of the key name set from the access information in the access log.
Optionally, the calculating the weight of the set of key names based on the set of evaluation metrics includes:
and calculating the weight of the key name set based on the evaluation index set according to a preset time threshold, and updating the weight of the key name set according to a recalculated result.
Optionally, the evaluating metric set includes an access data length, an access frequency, an update frequency, and a latest access time, and the calculating the weight of the key name set based on the evaluating metric set according to a preset time threshold includes:
and performing aggregation operation on the access frequency, the access data length, the latest access time and the update frequency which are updated regularly to obtain the weight of the key name set.
Optionally, when it is determined that the key value set of the hot data set is not in the cache of the preset server, moving the key value set of the hot data set to the cache of the preset server, including:
and if the cache does not contain the key value set of the hot data set, extracting the corresponding key value set from the database and storing the key value set into the cache.
Optionally, after the marking the set of key names as the hot data set, the method further comprises:
backing up the hot data set in a block link point;
and when the server storing the hot data set is down or restarted, acquiring the hot data set from the block chain node after the server is successfully restarted, and moving the hot data set to the cache of the server again.
In order to solve the above problem, the present invention also provides a cold and hot data processing apparatus, including:
the system comprises an acquisition module, a classification module and a processing module, wherein the acquisition module is used for acquiring an original data set and classifying the original data set to obtain a classified data set;
the query module is used for querying the key name set of the classified data set and acquiring an evaluation index set corresponding to the key name set;
the calculation module is used for calculating the weight of the key name set based on the evaluation index set and evaluating whether the weight reaches a preset weight;
and the processing module is used for marking the key name set as a hot data set if the weight reaches the preset weight, shifting the key value set of the hot data set to the cache of the preset server when judging that the key value set of the hot data set is not in the cache of the preset server, marking the key name set as a cold data set if the weight does not reach the preset weight, and shifting the key value set of the cold data set out of the cache of the preset server when judging that the key value set of the cold data set is in the cache of the preset server.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor: and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to implement the method of cold and hot data processing described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, comprising a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program, wherein the computer program realizes the above cold and hot data processing method when executed by a processor.
According to the cold and hot data processing method, the key names of the data are obtained, the weights of the key names are calculated based on the evaluation index sets corresponding to the key names, the cold and hot degrees of the data are defined according to the weight judgment results of the key names, and corresponding operation is performed according to the cold and hot degrees of the data.
Drawings
Fig. 1 is a schematic flow chart illustrating a method for processing cold and hot data according to an embodiment of the present invention;
FIG. 2 is a block diagram of a cold and hot data processing apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing a method for processing cold and hot data according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a cold and hot data processing method. The execution subject of the cold and hot data processing method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiments of the present application. In other words, the cold and hot data processing method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of a cold and hot data processing method according to an embodiment of the present invention. In this embodiment, the method for processing cold and hot data includes:
s1, acquiring an original data set, and classifying the original data set to obtain a classified data set.
In a preferred embodiment of the present invention, the original data set may be a set of all service data existing in a configuration system in a specific application scenario, and the service data may be acquired by interactively accessing a data source to each service system. The specific application scenario includes a bank, an insurance, and the like, for example, the business data of the configuration system of the bank includes liability business data, intermediate business data, asset business data, and the like.
Further, the classifying the original data set to obtain a classified data set includes:
acquiring a service scene category corresponding to the original data set;
and classifying the original data set according to the service scene category to obtain a classified data set.
According to the embodiment of the invention, the service parameters in the original data set can be collected and decoupled to obtain the information interaction flow and the logic frame information of the service scene reflected by the original data set, and the information interaction flow and the logic frame information are loaded into the Storm for calculation to restore the service scene type corresponding to the original data set.
Further, the embodiment of the present invention classifies the original data set according to the service scene category to obtain a classified data set. If the service scenes corresponding to the service scenes of the liability service data after the service scenes are restored comprise deposit service scenes, borrowing service scenes, peer service scenes and the like, dividing the liability service data into deposit service data, borrowing service data, peer service data and the like.
S2, inquiring the key name set of the classification data set, and acquiring an evaluation index set corresponding to the key name set.
According to one embodiment of the invention, the data attribute of the classified data set can be identified through js script, and the corresponding key name of the classified data set in the database table is queried by using a select query command based on SQL statement according to the data attribute.
In the preferred embodiment of the invention, the access log of the key name set in the database instance within the preset time period is obtained, and the evaluation index set of the key name set is extracted from the access information in the access log by utilizing the python script. The evaluation index set comprises evaluation indexes such as access data length, access frequency, update frequency and latest access time access data length. In one embodiment of the present invention, the preset time period may be 30 days, and the preset time period is not limited to the values listed in this embodiment, and may be set according to actual needs.
S3, calculating the weight of the key name set based on the evaluation index set.
Specifically, the embodiment of the present invention performs an aggregation operation on the access frequency, the access data length, the latest access time, and the update frequency to obtain the weight of the key name set. Preferably, in the embodiment of the present invention, the aggregation operation is to sequentially calculate the evaluation index set of the key name set by using a preset weight aggregation function, so as to obtain the weight of the key name set. In one embodiment of the present invention, the weight aggregation function may be:
Figure BDA0002869925270000051
wherein w represents a weight, n represents the number of evaluation indexes in the evaluation index set, λ is a hyperparameter representing an influence ability of each evaluation index, and f represents an evaluation index, and λ may be 0.1 in an embodiment of the present invention.
Further, in the embodiment of the present invention, the evaluation index set of the key name set changes in real time with the access of the key name set in the database instance, so that the weight of the key name set needs to be calculated in real time according to the evaluation index set that changes in real time. However, in order to save the computation loss and the computation delay caused by real-time computation, in one embodiment of the present invention, a time threshold may be preset, the weight of the key name set is computed based on the evaluation index set at regular time, and the weight of the key name set is updated according to the result of the re-computation, so as to facilitate the subsequent corresponding processing on the classified data set. In one embodiment of the present invention, the time threshold may be 7 days. The time threshold is not limited to the values listed in the present embodiment, and may be set as needed.
And S4, evaluating whether the weight reaches a preset weight.
In the preferred embodiment of the present invention, the preset Weight (Fix Weight) may be comprehensively set according to a memory threshold of Redis. In an embodiment of the present invention, the preset weight may be 0.7, when the weight of the key name set is not less than 0.7, the weight of the key name set reaches the preset weight, and when the weight of the key name set is less than 0.7, the weight of the key name set does not reach the preset weight.
In one embodiment of the present invention, if the weight reaches the preset weight, S5 is executed to mark the key name set as a hot data set.
In a preferred embodiment of the present invention, when the result of the weight evaluation of the key name set reaches the preset weight, which indicates that the access heat of the key name set on the database instance is high, the key name set is marked as a hot data set.
In the preferred embodiment of the present invention, step S5 is followed by: and backing up the hot data set in a block chain node, and when the server storing the hot data set is down or restarted, acquiring the hot data set from the block chain node after the server is successfully restarted, and transferring the hot data set to a cache of the server again.
In the preferred embodiment of the present invention, the cache refers to a data cache layer based on Redis.
And S6, judging whether the key value set of the hot data set is cached in a preset server or not.
In a preferred embodiment of the present invention, the set command of the Redis is used to determine whether the key value set of the hot data set is cached in a preset server.
And when the key value set of the hot data set is cached in a preset server, executing S11, and not processing the key value set of the hot data set.
And when the key value set of the hot data set is not in the cache of the preset server, executing S7, and moving the key value set of the hot data set to the cache of the preset server.
In a preferred embodiment of the present invention, the key value set corresponding to the hot data set is extracted from the database and stored in the cache.
Further, in another embodiment of the present invention, if the weight does not reach the preset weight, S8 is executed to mark the key name set as a cold data set.
In a preferred embodiment of the present invention, when the result of the weight evaluation of the key name set does not reach the preset weight, it indicates that the access heat of the key name set on the database instance is low, and at this time, the key name set is marked as a cold data set.
In a preferred embodiment of the present invention, after step S8, the method further includes calculating weights of the set of key names based on the set of evaluation indexes according to a preset time threshold, and updating the weights of the set of key names according to the result of recalculation. And updating the weight of the key name set according to the time threshold, wherein the updating basis is that aggregation operation is executed based on the updated access frequency, the access data length, the latest access time and the updated frequency to obtain the weight of the key name set, so that the classified data set is conveniently and correspondingly processed in the subsequent process.
And S9, judging whether the key value set of the cold data set is cached in a preset server or not.
In a preferred embodiment of the present invention, the set command of the Redis is used to determine whether the key value set of the cold data set is cached in a preset server.
And when the key value set of the cold data set is not cached in a preset server, executing S11, and not processing the key value set of the cold data set.
And when the key value set of the cold data set is cached in a preset server, executing S10, and moving the key value set of the cold data set out of the cache of the preset server.
In a preferred embodiment of the present invention, the key value set corresponding to the cold data set contained in the cache is deleted.
According to the cold and hot data processing method, the key names of the data are obtained, the weights of the key names are calculated based on the evaluation index sets corresponding to the key names, the cold and hot degrees of the data are defined according to the weight judgment results of the key names, and corresponding operation is performed according to the cold and hot degrees of the data.
Fig. 2 is a block diagram of a cold and hot data processing device according to the present invention.
The cold and hot data processing apparatus 100 according to the present invention may be installed in an electronic device. According to the realized functions, the cold and hot data processing device can comprise an acquisition module 101, a query module 102, a calculation module 103 and a processing module 104. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the obtaining module 101 is configured to obtain an original data set, and classify the original data set to obtain a classified data set;
in a preferred embodiment of the present invention, the original data set may be a set of all service data existing in a configuration system in a specific application scenario, and the service data may be acquired by interactively accessing a data source to each service system. The specific application scenario includes a bank, an insurance, and the like, for example, the business data of the configuration system of the bank includes liability business data, intermediate business data, asset business data, and the like.
The obtaining module 101 is configured to classify the original data set to obtain a classified data set, where the classified data set includes a service scene category corresponding to the original data set, and the original data set is classified according to the service scene category to obtain a classified data set.
According to the embodiment of the invention, the service parameters in the original data set can be collected and decoupled to obtain the information interaction flow and the logic frame information of the service scene reflected by the original data set, and the information interaction flow and the logic frame information are loaded into the Storm for calculation to restore the service scene type corresponding to the original data set.
Further, the embodiment of the present invention classifies the original data set according to the service scene category to obtain a classified data set. If the service scenes corresponding to the service scenes of the liability service data after the service scenes are restored comprise deposit service scenes, borrowing service scenes, peer service scenes and the like, dividing the liability service data into deposit service data, borrowing service data, peer service data and the like.
The query module 102 is configured to query a key name set of the classified data set and obtain an evaluation index set corresponding to the key name set;
the query module 102 may identify the data attribute of the classified data set through a js script, and query, according to the data attribute, a select query command based on an SQL statement for a key name corresponding to the classified data set in a database table.
In the preferred embodiment of the invention, the access log of the key name set in the database instance within the preset time period is obtained, and the evaluation index set of the key name set is extracted from the access information in the access log by utilizing the python script. The evaluation index set comprises evaluation indexes such as access data length, access frequency, update frequency and latest access time access data length. In one embodiment of the present invention, the preset time period may be 30 days, and the preset time period is not limited to the values listed in this embodiment, and may be set according to actual needs.
The calculating module 103 is configured to calculate a weight of the key name set based on the evaluation index set, and evaluate whether the weight reaches a preset weight;
the calculation module 103 performs an aggregation operation on the access frequency, the access data length, the latest access time, and the update frequency to obtain the weight of the key name set. Preferably, in the embodiment of the present invention, the aggregation operation is to sequentially calculate the evaluation index set of the key name set by using a preset weight aggregation function, so as to obtain the weight of the key name set. The calculation module 103 calculates the weight of the set of key names using the following method:
Figure BDA0002869925270000091
wherein w represents a weight, n represents the number of evaluation indexes in the evaluation index set, λ is a hyperparameter representing an influence ability of each evaluation index, and f represents an evaluation index, and λ may be 0.1 in an embodiment of the present invention.
Further, in the embodiment of the present invention, the evaluation index set of the key name set changes in real time with the access of the key name set in the database instance, so that the weight of the key name set needs to be calculated in real time according to the evaluation index set that changes in real time. However, in order to save the computation loss and the computation delay caused by real-time computation, in one embodiment of the present invention, a time threshold may be preset, the weight of the key name set is computed based on the evaluation index set at regular time, and the weight of the key name set is updated according to the result of the re-computation, so as to facilitate the subsequent corresponding processing on the classified data set. In one embodiment of the present invention, the time threshold may be 7 days. The time threshold is not limited to the values listed in the present embodiment, and may be set as needed.
In the preferred embodiment of the present invention, the preset Weight (Fix Weight) may be comprehensively set according to a memory threshold of Redis. In an embodiment of the present invention, the preset weight may be 0.7, when the weight of the key name set is not less than 0.7, the weight of the key name set reaches the preset weight, and when the weight of the key name set is less than 0.7, the weight of the key name set does not reach the preset weight.
The processing module 104 is configured to mark the key name set as a hot data set if the weight reaches the preset weight, and move the key value set of the hot data set to a cache of a preset server when determining that the key value set of the hot data set is not in the cache of the preset server, mark the key name set as a cold data set if the weight does not reach the preset weight, and move the key value set of the cold data set out of the cache of the preset server when determining that the key value set of the cold data set is in the cache of the preset server.
The processing module 104 is configured to mark the key name set as a hot data set if the weight reaches the preset weight.
In a preferred embodiment of the present invention, when the result of the weight evaluation of the key name set reaches the preset weight, which indicates that the access heat of the key name set on the database instance is high, the key name set is marked as a hot data set.
In a preferred embodiment of the present invention, after the step of marking the set of key names as the hot data set, the step of: and backing up the hot data set in a block chain node, and when the server storing the hot data set is down or restarted, acquiring the hot data set from the block chain node after the server is successfully restarted, and transferring the hot data set to a cache of the server again.
In the preferred embodiment of the present invention, the cache refers to a data cache layer based on Redis.
And judging whether the key value set of the hot data set is cached in a preset server or not.
And when the key value set of the hot data set is cached in a preset server, the key value set of the hot data set is not processed.
And when the key value set of the hot data set is not in the cache of the preset server, the key value set of the hot data set is moved to the cache of the preset server.
The processing module 104 is further configured to mark the key name set as a cold data set if the weight does not reach a preset weight.
In a preferred embodiment of the present invention, when the result of the weight evaluation of the key name set does not reach the preset weight, it indicates that the access heat of the key name set on the database instance is low, and at this time, the key name set is marked as a cold data set.
In a preferred embodiment of the present invention, after the marking the key name set as the cold data set, the method further includes calculating the weight of the key name set based on the evaluation index set according to a preset time threshold, and updating the weight of the key name set according to a result of the recalculation. And updating the weight of the key name set according to the time threshold, wherein the updating basis is that aggregation operation is executed based on the updated access frequency, the access data length, the latest access time and the updated frequency to obtain the weight of the key name set, so that the classified data set is conveniently and correspondingly processed in the subsequent process.
And judging whether the key value set of the cold data set is cached in a preset server or not.
And when the key value set of the cold data set is not cached in a preset server, the key value set of the cold data set is not processed.
And when the key value set of the cold data set is cached in a preset server, shifting the key value set of the cold data set out of the cache of the preset server.
Fig. 3 is a schematic structural diagram of an electronic device implementing a method for processing cold and hot data according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a cold and hot data processing program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of computer-readable storage medium, which includes flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, and the like. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the hot and cold data processing program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., executing a hot and cold data processing program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The memory 11 of the electronic device 1 stores a hot and cold data processing program 12 that is a combination of instructions that, when executed in the processor 10, enable:
acquiring an original data set, and classifying the original data set to obtain a classified data set;
inquiring a key name set of the classified data set, and acquiring an evaluation index set corresponding to the key name set;
calculating the weight of the key name set based on the evaluation index set, and evaluating whether the weight reaches a preset weight;
if the weight reaches the preset weight, marking the key name set as a hot data set, and moving a key value set of the hot data set to a cache of a preset server;
if the weight does not reach the preset weight, marking the key name set as a cold data set, and moving a key value set of the cold data set out of a cache of a preset server.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying claims should not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for processing cold and hot data, the method comprising:
acquiring an original data set, and classifying the original data set to obtain a classified data set;
inquiring a key name set of the classified data set, and acquiring an evaluation index set corresponding to the key name set;
calculating the weight of the key name set based on the evaluation index set, and evaluating whether the weight reaches a preset weight;
if the weight reaches the preset weight, marking the key name set as a hot data set, and when judging that the key value set of the hot data set is not in the cache of a preset server, moving the key value set of the hot data set to the cache of the preset server;
if the weight does not reach the preset weight, marking the key name set as a cold data set, and shifting the key value set of the cold data set out of the cache of the preset server when judging that the key value set of the cold data set is in the cache of the preset server.
2. A method as claimed in claim 1, wherein said classifying said original data set to obtain a classified data set comprises:
acquiring a service scene category corresponding to the original data set;
and classifying the original data set according to the service scene category to obtain a classified data set.
3. The method for processing cold and hot data according to claim 1, wherein the acquiring a set of evaluation metrics corresponding to the set of key names includes:
obtaining an access log according to an access result of the key name set in a database instance within a preset time period;
and extracting an evaluation index set corresponding to the key name set from the access information in the access log.
4. The method of cold-hot data processing according to claim 1, wherein said calculating weights for said set of key names based on said set of evaluation metrics comprises:
and calculating the weight of the key name set based on the evaluation index set according to a preset time threshold, and updating the weight of the key name set according to a recalculated result.
5. The method for cold and hot data processing according to claim 4, wherein the evaluation index set includes an access data length, an access frequency, an update frequency, and a latest access time, and the calculating of the weight of the key name set based on the evaluation index set according to a preset time threshold timing comprises:
and performing aggregation operation on the access frequency, the access data length, the latest access time and the update frequency which are updated regularly to obtain the weight of the key name set.
6. The method according to any one of claims 1 to 5, wherein the moving the key value set of the hot data set to the cache when determining that the key value set of the hot data set is not in the cache of the predetermined server comprises:
and if the cache does not contain the key value set of the hot data set, extracting the corresponding key value set from the database and storing the key value set into the cache.
7. A hot-cold data processing method according to any one of claims 1 to 5, wherein after said labeling said set of key names as a hot data set, said method further comprises:
backing up the hot data set in a block link point;
and when the server storing the hot data set is detected to be down or restarted, after the server is confirmed to be restarted successfully, acquiring the hot data set from the block chain node, and moving the hot data set to the cache of the server again.
8. A cold-hot data processing apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition module, a classification module and a processing module, wherein the acquisition module is used for acquiring an original data set and classifying the original data set to obtain a classified data set;
the query module is used for querying the key name set of the classified data set and acquiring an evaluation index set corresponding to the key name set;
the calculation module is used for calculating the weight of the key name set based on the evaluation index set and evaluating whether the weight reaches a preset weight;
and the processing module is used for marking the key name set as a hot data set if the weight reaches the preset weight, shifting the key value set of the hot data set to the cache of the preset server when judging that the key value set of the hot data set is not in the cache of the preset server, marking the key name set as a cold data set if the weight does not reach the preset weight, and shifting the key value set of the cold data set out of the cache of the preset server when judging that the key value set of the cold data set is in the cache of the preset server.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of cold and hot data processing as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium comprising a stored data area storing created data and a stored program area storing a computer program, wherein the computer program, when executed by a processor, implements a method of cold and hot data processing according to any one of claims 1 to 7.
CN202011603604.7A 2020-12-29 2020-12-29 Cold and hot data processing method and device, electronic equipment and storage medium Pending CN112699142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011603604.7A CN112699142A (en) 2020-12-29 2020-12-29 Cold and hot data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011603604.7A CN112699142A (en) 2020-12-29 2020-12-29 Cold and hot data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112699142A true CN112699142A (en) 2021-04-23

Family

ID=75512218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011603604.7A Pending CN112699142A (en) 2020-12-29 2020-12-29 Cold and hot data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112699142A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608670A (en) * 2021-05-25 2021-11-05 武汉理工大学 Block chain data storage method based on fairness and access heat
CN114238375A (en) * 2021-12-16 2022-03-25 中国平安财产保险股份有限公司 Index query method and device, electronic equipment and storage medium
CN114817425A (en) * 2022-06-28 2022-07-29 成都交大大数据科技有限公司 Method, device and equipment for classifying cold and hot data and readable storage medium
CN114238375B (en) * 2021-12-16 2024-05-28 中国平安财产保险股份有限公司 Index query method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268286A (en) * 2014-10-21 2015-01-07 北京国双科技有限公司 Method for querying hot data
CN106156331A (en) * 2016-07-06 2016-11-23 益佳科技(北京)有限责任公司 Cold and hot temperature data server system and processing method thereof
CN109491618A (en) * 2018-11-20 2019-03-19 上海科技大学 Data management system, method, terminal and medium based on mixing storage
CN109739646A (en) * 2018-12-28 2019-05-10 北京神州绿盟信息安全科技股份有限公司 A kind of data processing method and device
CN109857737A (en) * 2019-01-03 2019-06-07 平安科技(深圳)有限公司 A kind of cold and hot date storage method and device, electronic equipment
CN110471939A (en) * 2019-07-11 2019-11-19 平安普惠企业管理有限公司 Data access method, device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268286A (en) * 2014-10-21 2015-01-07 北京国双科技有限公司 Method for querying hot data
CN106156331A (en) * 2016-07-06 2016-11-23 益佳科技(北京)有限责任公司 Cold and hot temperature data server system and processing method thereof
CN109491618A (en) * 2018-11-20 2019-03-19 上海科技大学 Data management system, method, terminal and medium based on mixing storage
CN109739646A (en) * 2018-12-28 2019-05-10 北京神州绿盟信息安全科技股份有限公司 A kind of data processing method and device
CN109857737A (en) * 2019-01-03 2019-06-07 平安科技(深圳)有限公司 A kind of cold and hot date storage method and device, electronic equipment
CN110471939A (en) * 2019-07-11 2019-11-19 平安普惠企业管理有限公司 Data access method, device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608670A (en) * 2021-05-25 2021-11-05 武汉理工大学 Block chain data storage method based on fairness and access heat
CN113608670B (en) * 2021-05-25 2023-10-27 武汉理工大学 Block chain data storage method based on fairness and access heat
CN114238375A (en) * 2021-12-16 2022-03-25 中国平安财产保险股份有限公司 Index query method and device, electronic equipment and storage medium
CN114238375B (en) * 2021-12-16 2024-05-28 中国平安财产保险股份有限公司 Index query method and device, electronic equipment and storage medium
CN114817425A (en) * 2022-06-28 2022-07-29 成都交大大数据科技有限公司 Method, device and equipment for classifying cold and hot data and readable storage medium
CN114817425B (en) * 2022-06-28 2022-09-02 成都交大大数据科技有限公司 Method, device and equipment for classifying cold and hot data and readable storage medium

Similar Documents

Publication Publication Date Title
CN113449187A (en) Product recommendation method, device and equipment based on double portraits and storage medium
CN111652278A (en) User behavior detection method and device, electronic equipment and medium
CN114612194A (en) Product recommendation method and device, electronic equipment and storage medium
CN111768096A (en) Rating method and device based on algorithm model, electronic equipment and storage medium
CN112699142A (en) Cold and hot data processing method and device, electronic equipment and storage medium
CN113268665A (en) Information recommendation method, device and equipment based on random forest and storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN113868529A (en) Knowledge recommendation method and device, electronic equipment and readable storage medium
CN112579621A (en) Data display method and device, electronic equipment and computer storage medium
CN112560465A (en) Method and device for monitoring batch abnormal events, electronic equipment and storage medium
CN113505273A (en) Data sorting method, device, equipment and medium based on repeated data screening
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN112948380A (en) Data storage method and device based on big data, electronic equipment and storage medium
CN111652281B (en) Information data classification method, device and readable storage medium
CN115759746A (en) Configurable user early warning method and device, electronic equipment and storage medium
CN113449002A (en) Vehicle recommendation method and device, electronic equipment and storage medium
CN113657546A (en) Information classification method and device, electronic equipment and readable storage medium
CN114003787A (en) Data visualization method based on artificial intelligence and related equipment
CN113220551A (en) Index trend prediction and early warning method and device, electronic equipment and storage medium
CN111652741A (en) User preference analysis method and device and readable storage medium
CN113434365B (en) Data characteristic monitoring method and device, electronic equipment and storage medium
CN114840531B (en) Data model reconstruction method, device, equipment and medium based on blood edge relation
CN113360505B (en) Time sequence data-based data processing method and device, electronic equipment and readable storage medium
CN113448933B (en) Service data processing method, device, electronic equipment and medium
CN115222364A (en) Project quality evaluation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination