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 PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
- G06F16/2445—Data retrieval commands; View definitions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
- G06F16/285—Clustering 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
Description
技术领域technical field
本发明涉及数据存储领域,尤其涉及一种冷热数据处理方法、装置、电子设备及计算机可读存储介质。The present invention relates to the field of data storage, and in particular, to a method, device, electronic device and computer-readable storage medium for processing cold and hot data.
背景技术Background technique
在企业业务不断变化的过程中,企业配置系统内的业务配置数据呈现爆炸式增长,随着数据量的不断激增,给存储系统带来巨大压力。数据会随着访问热度划分为冷数据和热数据,且冷热数据在一定时间内具有逻辑空间上的相对独立性。如果将冷数据和热数据都按照相同的存储方式进行存储,会影响系统的服务性能同时大幅度提升存储成本。如何根据数据的冷热程度,在保证系统服务性能稳定的前提下降低数据存储成本是一个亟需解决的问题。In the process of continuous changes of enterprise business, the business configuration data in the enterprise configuration system shows an explosive growth. The data will be divided into cold data and hot data according to the access heat, and the cold and hot data have relative independence in logical space within a certain period of time. If both cold data and hot data are stored in the same storage method, the service performance of the system will be affected and the storage cost will be greatly increased. How to reduce the cost of data storage on the premise of ensuring the stability of system service performance is an urgent problem to be solved according to the degree of hot and cold data.
发明内容SUMMARY OF THE INVENTION
本发明提供一种冷热数据处理方法、装置、电子设备及计算机可读存储介质,其主要目的在于实现高效的数据查询,同时降低数据存储成本。The present invention provides a method, device, electronic device and computer-readable storage medium for processing hot and cold data, the main purpose of which is to realize efficient data query and reduce data storage cost at the same time.
为实现上述目的,本发明提供的一种冷热数据处理方法,包括:In order to achieve the above-mentioned purpose, a kind of cold and heat data processing method provided by the present invention comprises:
获取原始数据集,对所述原始数据集进行分类,得到分类数据集;Obtain an original data set, classify the original data set, and obtain a classified data set;
查询所述分类数据集的键名集,并获取所述键名集对应的评估指标集;query the key name set of the classification data set, and obtain the evaluation index set corresponding to the key name set;
基于所述评估指标集计算所述键名集的权重,并评估所述权重是否达到预设权重;Calculate the weight of the key name set based on the evaluation index set, and evaluate whether the weight reaches a preset weight;
若所述权重达到所述预设权重,则标记所述键名集为热数据集,并判断所述热数据集的键值集不在预设服务器的缓存内时,将所述热数据集的键值集移至预设服务器的缓存;If the weight reaches the preset weight, the key name set is marked as a hot data set, and when it is judged that the key value set of the hot data set is not in the cache of the preset server, the hot data set is The key-value set is moved to the cache of the default server;
若所述权重未达到所述预设权重,则标记所述键名集为冷数据集,并判断所述冷数据集的键值集在预设服务器的缓存内时,将所述冷数据集的键值集移出预设服务器的缓存。If the weight does not reach the preset weight, the key name set is marked as a cold data set, and when it is judged that the key value set of the cold data set is in the cache of the preset server, the cold data set is The key-value set is moved out of the preset server's cache.
可选地,所述对所述原始数据集进行分类,得到分类数据集,包括:Optionally, classifying the original data set to obtain a classified data set, including:
获取所述原始数据集对应的业务场景类别;obtaining the business scenario category corresponding to the original data set;
根据所述业务场景的场景类别,将所述原始数据集进行分类,得到分类数据集。According to the scene category of the business scene, the original data set is classified to obtain a classified data set.
可选地,所述获取键名集对应的评估指标集,包括:Optionally, the obtaining the evaluation index set corresponding to the key name set includes:
根据所述键名集在数据库实例中预设时间段内的访问结果,得到访问日志;Obtain an access log according to the access result of the key name set within the preset time period in the database instance;
从所述访问日志中的访问信息中提取所述键名集的评估指标集。The evaluation index set of the key name set is extracted from the access information in the access log.
可选地,所述基于所述评估指标集计算所述键名集的权重,包括:Optionally, calculating the weight of the key name set based on the evaluation index set includes:
根据预设的时间阈值定时基于所述评估指标集计算所述键名集的权重,并根据重新计算的结果更新所述键名集的权重。The weight of the key name set is periodically calculated based on the evaluation index set according to a preset time threshold, and the weight of the key name set is updated according to the recalculation result.
可选地,所述评估指标集包括访问数据长度、访问频次、更新频次和最近访问时间,所述根据预设的时间阈值定时基于所述评估指标集计算所述键名集的权重,包括:Optionally, the evaluation indicator set includes access data length, access frequency, update frequency and recent access time, and the calculation of the weight of the key name set based on the evaluation indicator set regularly according to a preset time threshold includes:
对定时更新的所述访问频次、所述访问数据长度、所述最近访问时间、所述更新频次执行聚合运算,得到所述键名集的权重。An aggregation operation is performed on the regularly updated access frequency, the access data length, the most recent access time, and the update frequency to obtain the weight of the key name set.
可选地,所述判断所述热数据集的键值集不在预设服务器的缓存内时,将所述热数据集的键值集移至预设服务器的缓存,包括:Optionally, when judging 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:
若所述缓存中不包含所述热数据集的键值集,则从数据库中提取对应的键值集,并将所述键值集保存至缓存中。If the cache does not contain the key-value set of the hot data set, extract the corresponding key-value set from the database, and save the key-value set into the cache.
可选地,所述标记所述键名集为热数据集之后,所述方法还包括:Optionally, after marking the key name set as a hot data set, the method further includes:
将所述热数据集备份在区块链节点中;back up the hot data set in the blockchain node;
当存储所述热数据集的服务器出现宕机或者重启时,在确认服务器重启成功后,从所述区块链节点中获取所述热数据集,并将所述热数据集重新移至所述服务器的缓存中。When the server storing the hot data set is down or restarted, after confirming that the server restarts successfully, the hot data set is obtained from the blockchain node, and the hot data set is moved to the in the server's cache.
为了解决上述问题,本发明还提供一种冷热数据处理装置,所述装置包括:In order to solve the above problems, the present invention also provides a cold and heat data processing device, the device includes:
获取模块,用于获取原始数据集,对所述原始数据集进行分类,得到分类数据集;an acquisition module for acquiring an original data set, classifying the original data set, and obtaining a classified data set;
查询模块,用于查询所述分类数据集的键名集,并获取所述键名集对应的评估指标集;a query module, used to query the key name set of the classified data set, and obtain the evaluation index set corresponding to the key name set;
计算模块,用于基于所述评估指标集计算所述键名集的权重,并评估所述权重是否达到预设权重;A calculation module, 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;
处理模块,用于若所述权重达到所述预设权重,则标记所述键名集为热数据集,并判断所述热数据集的键值集不在预设服务器的缓存内时,将所述热数据集的键值集移至预设服务器的缓存,若所述权重未达到所述预设权重,则标记所述键名集为冷数据集,并判断所述冷数据集的键值集在预设服务器的缓存内时,将所述冷数据集的键值集移出预设服务器的缓存。The processing module is configured to mark the key name set as a hot data set if the weight reaches the preset weight, and determine that 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. If the weight does not reach the preset weight, the key name set is marked as a cold data set, and the key value of the cold data set is judged When the set is stored in the cache of the preset server, the key-value set of the cold data set is moved out of the cache of the preset server.
为了解决上述问题,本发明还提供一种电子设备,所述电子设备包括:In order to solve the above problems, the present invention also provides an electronic device, the electronic device includes:
至少一个处理器:以及,at least one processor: and,
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够实现上述所述的冷热数据处理方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement the above-described method for processing hot and cold data.
为了解决上述问题,本发明还提供一种计算机可读存储介质,包括存储数据区和存储程序区,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序,其中,所述计算机程序被处理器执行时实现上述所述的冷热数据处理方法。In order to solve the above problems, the present invention also 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 When the computer program is executed by the processor, the above-mentioned cold and hot data processing method is realized.
本发明实施例提供的冷热数据处理方法通过获取数据的键名,并基于所述键名对应的评估指标集计算所述键名的权重,根据键名的权重判断结果定义数据的冷热程度,并按照数据的冷热程度进行相应的操作,本发明实施例通过对冷热数据进行不同的存储处理,将热数据存储在缓存中,实现数据更高效的访问,保证了系统的服务性能,将冷数据移出缓存,减少缓存资源的浪费,降低数据存储的成本。The cold and hot data processing method provided by the embodiment of the present invention obtains the key name of the data, calculates the weight of the key name based on the evaluation index set corresponding to the key name, and defines the degree of hot and cold data according to the weight judgment result of the key name. , and perform corresponding operations according to the degree of hot and cold data. The embodiment of the present invention stores the hot data in the cache by performing different storage processing on the hot and cold data, so as to realize more efficient access to the data and ensure the service performance of the system. Move cold data out of the cache, reduce the waste of cache resources, and reduce the cost of data storage.
附图说明Description of drawings
图1为本发明一实施例提供的冷热数据处理方法的流程示意图;1 is a schematic flowchart of a method for processing cold and hot data according to an embodiment of the present invention;
图2为本发明一实施例提供的冷热数据处理装置的模块示意图;FIG. 2 is a schematic block diagram of a cold and heat data processing apparatus according to an embodiment of the present invention;
图3为本发明一实施例提供的实现冷热数据处理方法的电子设备的内部结构示意图;3 is a schematic diagram of an internal structure of an electronic device for implementing a method for processing cold and hot data according to an embodiment of the present invention;
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
本申请实施例提供一种冷热数据处理方法。所述冷热数据处理方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述冷热数据处理方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。Embodiments of the present application provide a method for processing cold and heat data. The execution body of the cold and hot data processing method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the cold and hot data processing method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain 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.
参照图1所示,为本发明一实施例提供的冷热数据处理方法的流程示意图。在本实施例中,所述冷热数据处理方法包括:Referring to FIG. 1 , it is a schematic flowchart of a method for processing cold and heat data according to an embodiment of the present invention. In this embodiment, the cold and heat data processing method includes:
S1、获取原始数据集,并对所述原始数据集进行分类,得到分类数据集。S1. 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 business data existing in the configuration system under a specific application scenario, and the business data may be obtained by interacting with each business system to access data sources. The specific application scenarios include banking, insurance, etc. 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 described original data set is classified to obtain a classified data set, including:
获取所述原始数据集对应的业务场景类别;obtaining the business scenario category corresponding to the original data set;
根据所述业务场景类别,将所述原始数据集进行分类,得到分类数据集。Classify the original data set according to the business scenario category to obtain a classified data set.
本发明实施例可以通过采集所述原始数据集中的业务参数,将所述业务参数进行解耦,得到所述原始数据集反映的业务场景的信息交互流程及逻辑框架信息,将所述信息交互流程及逻辑框架信息加载到Storm中进行计算,还原所述原始数据集对应的业务场景类别。In this embodiment of the present invention, the business parameters in the original data set can be collected, and the business parameters can be decoupled to obtain the information exchange process and logical framework information of the business scenario reflected in the original data set, and the information exchange process and logical framework information is loaded into Storm for calculation, and the business scenario category corresponding to the original data set is restored.
进一步地,本发明实施例根据所述业务场景类别,将所述原始数据集进行分类,得到分类数据集。如对负债业务数据进行业务场景还原后对应的业务场景包括存款业务场景、借款业务场景、同业业务场景等,则将所述负债业务数据划分为存款业务数据、借款业务数据、同业业务数据等。Further, in the embodiment of the present invention, the original data set is classified according to the business scenario category to obtain a classified data set. If the business scenarios corresponding to the business scenario restoration of the debt business data include deposit business scenarios, loan business scenarios, inter-bank business scenarios, etc., the debt business data is divided into deposit business data, loan business data, inter-bank business data, etc.
S2、查询所述分类数据集的键名集,并获取所述键名集对应的评估指标集。S2. Query the key name set of the classification data set, and obtain the evaluation index set corresponding to the key name set.
本发明其中一个实施例,可以通过js脚本识别所述分类数据集的数据属性,根据所述数据属性,利用基于SQL语句的select查询命令查询所述分类数据集在数据库表中对应的键名。In one embodiment of the present invention, the data attribute of the classified data set can be identified by js script, and according to the data attribute, the corresponding key name of the classified data set in the database table is queried by using the select query command based on the SQL statement.
本发明较佳实施例通过获取所述键名集在数据库实例中预设时间段内的访问日志,利用python脚本从所述访问日志中的访问信息中提取所述键名集的评估指标集。其中,所述评估指标集包括访问数据长度、访问频次、更新频次、最近访问时间访问数据长度等评估指标。本发明其中一个实施例,所述预设时间段可以为30天,对于所述预设时间段,不限于本实施例列举出的值,还可以按照实际需要进行设定。A preferred embodiment of the present invention extracts the evaluation index set of the key name set from the access information in the access log by obtaining the access log of the key name set within a preset time period in the database instance by using a python script. The evaluation indicator set includes evaluation indicators such as access data length, access frequency, update frequency, and access data length at the most recent access time. 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 can also be set according to actual needs.
S3、基于所述评估指标集计算所述键名集的权重。S3. Calculate 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, access data length, recent access time, and 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 to obtain the weight of the key name set. In one embodiment of the present invention, the weight aggregation function may be:
其中,所述w表示权重,n表示评估指标集中评估指标的个数,λ为超参数,表示每个评估指标的影响能力,f表示评估指标,在本发明实施例中所述λ可以为0.1,本发明其他实施例不限于上述列举出的值,还可以按照实际需要进行设定。Wherein, the w represents the weight, n represents the number of evaluation indicators in the evaluation indicator set, λ is a hyperparameter, representing the influence ability of each evaluation indicator, f represents the evaluation indicator, and in the embodiment of the present invention, the λ may be 0.1 , other embodiments of the present invention are not limited to the values listed above, and can also be set according to actual needs.
进一步地,本发明实施例中所述键名集的评估指标集会随着所述键名集在数据库实例中的访问进行实时变化的,所以所述键名集的权重需要根据实时变化的评估指标集进行实时计算。但是为了节约计算损耗及实时计算带来的计算延迟,本发明其中一个实施例可以通过预设一个时间阈值,定时基于所述评估指标集计算所述键名集的权重,并根据重新计算的结果更新所述键名集的权重,便于后续对分类数据集进行对应的处理。本发明其中一个实施例,所述时间阈值可以为7天。对于所述时间阈值的设定,不限于本实施例列举出的值,还可以按照实际需要进行设定。Further, in the embodiment of the present invention, the evaluation index set of the key name set will change in real time with the access of the key name set in the database instance, so the weight of the key name set needs to be based on the real-time changing evaluation index. set for real-time computation. However, in order to save calculation loss and calculation delay caused by real-time calculation, one embodiment of the present invention may preset a time threshold, periodically calculate the weight of the key name set based on the evaluation index set, and calculate the weight of the key name set according to the recalculated result. The weight of the key name set is updated to facilitate subsequent corresponding processing of the classified data set. In one embodiment of the present invention, the time threshold may be 7 days. The setting of the time threshold is not limited to the values listed in this embodiment, and may also be set according to actual needs.
S4、评估所述权重是否达到预设权重。S4. Evaluate whether the weight reaches a preset weight.
本发明较佳实施例中,所述预设权重(Fix Weight)可以是根据Redis的内存阈值综合设定的。本发明其中一个实施例,所述预设权重可以为0.7,当所述键名集的权重不小于0.7时,则所述键名集的权重达到所述预设权重,当所述键名集的权重小于0.7时,则所述键名集的权重未达到所述预设权重。In a preferred embodiment of the present invention, the preset weight (Fix Weight) may be comprehensively set according to the memory threshold of Redis. In one 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. 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.
本发明其中一个实施例中,若所述权重达到所述预设权重,则执行S5、标记所述键名集为热数据集。In one embodiment of the present invention, if the weight reaches the preset weight, S5 is performed to mark the key name set as a hot data set.
本发明较佳实施例中,当所述键名集的权重评估结果为达到所述预设权重,说明所述键名集在数据库实例上的访问热度高,此时将所述键名集标记为热数据集。In a preferred embodiment of the present invention, when the weight evaluation result of the key name set reaches the preset weight, it indicates that the key name set has a high access rate on the database instance, and at this time, the key name set is marked is a hot dataset.
本发明较佳实施例中,步骤S5之后还包括:将所述热数据集备份在区块链节点中,当存储所述热数据集的服务器出现宕机或者重启时,在确认服务器重启成功后,从所述区块链节点中获取所述热数据集,并重新移至所述服务器的缓存中。In a preferred embodiment of the present invention, after step S5, the method further includes: backing up the hot data set in the blockchain node, when the server storing the hot data set crashes or restarts, after confirming that the server restarts successfully , obtain the hot data set from the blockchain node, and re-move it to the cache of the server.
本发明较佳实施例中,所述缓存是指基于Redis做的一个数据缓存层。In a preferred embodiment of the present invention, the cache refers to a data cache layer based on Redis.
S6、判断所述热数据集的键值集是否在预设服务器的缓存。S6. Determine whether the key-value set of the hot data set is in the cache of the preset server.
本发明较佳实施例中,利用所述Redis的set命令判断所述热数据集的键值集是否在预设服务器的缓存。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 in the cache of the preset server.
当所述热数据集的键值集在预设服务器的缓存时,执行S11,对所述热数据集的键值集不做处理。When the key-value set of the hot data set is in the cache of the preset server, S11 is performed, and the key-value set of the hot data set is not processed.
当所述热数据集的键值集不在预设服务器的缓存时,执行S7、将所述热数据集的键值集移至预设服务器的缓存。When the key-value set of the hot data set is not in the cache of the preset server, perform S7 to move 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.
进一步地,本发明另一个实施例中,若所述权重未达到预设权重,则执行S8、标记所述键名集为冷数据集。Further, in another embodiment of the present invention, if the weight does not reach the preset weight, S8 is performed to mark the key name set as a cold data set.
本发明较佳实施例中,当所述键名集的权重评估结果为未达到所述预设权重,则说明所述键名集在数据库实例上的访问热度低,此时将所述键名集标记为冷数据集。In a preferred embodiment of the present invention, when the weight evaluation result of the key name set does not reach the preset weight, it means that the access popularity of the key name set on the database instance is low, and at this time, the key name set is Sets are marked as cold datasets.
本发明较佳实施例中,步骤S8之后,还包括,根据预设的时间阈值定时基于所述评估指标集计算所述键名集的权重,并根据重新计算的结果更新所述键名集的权重。按照所述时间阈值对键名集的权重进行更新,其更新依据为基于更新后的访问频次、访问数据长度、最近访问时间及更新频次,执行聚合运算,得到所述键名集的权重,便于后续对分类数据集进行对应的处理。In a preferred embodiment of the present invention, after step S8, the method further includes: periodically 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 the recalculation result. Weights. The weight of the key name set is updated according to the time threshold, and the update basis is based on the updated access frequency, the length of the access data, the latest access time and the update frequency, performing an aggregation operation to obtain the weight of the key name set, which is convenient for The classification data set is then processed accordingly.
S9、判断所述冷数据集的键值集是否在预设服务器的缓存。S9. Determine whether the key-value set of the cold data set is in the cache of the preset server.
本发明较佳实施例中,利用所述Redis的set命令判断所述冷数据集的键值集是否在预设服务器的缓存。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 in the cache of the preset server.
当所述冷数据集的键值集不在预设服务器的缓存时,执行S11,对所述冷数据集的键值集不做处理。When the key-value set of the cold data set is not in the cache of the preset server, S11 is executed, and the key-value set of the cold data set is not processed.
当所述冷数据集的键值集在预设服务器的缓存时,执行S10、将所述冷数据集的键值集移出预设服务器的缓存。When the key-value set of the cold data set is in the cache of the preset server, perform S10 to move 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.
本发明实施例提供的冷热数据处理方法通过获取数据的键名,并基于所述键名对应的评估指标集计算所述键名的权重,根据键名的权重判断结果定义数据的冷热程度,并按照数据的冷热程度进行相应的操作,本发明实施例通过对冷热数据进行不同的存储处理,将热数据存储在缓存中,实现数据更高效的访问,保证了系统的服务性能,将冷数据移出缓存,减少缓存资源的浪费,降低数据存储的成本。The cold and hot data processing method provided by the embodiment of the present invention obtains the key name of the data, calculates the weight of the key name based on the evaluation index set corresponding to the key name, and defines the degree of hot and cold data according to the weight judgment result of the key name. , and perform corresponding operations according to the degree of hot and cold data. The embodiment of the present invention stores the hot data in the cache by performing different storage processing on the hot and cold data, so as to realize more efficient access to the data and ensure the service performance of the system. Move cold data out of the cache, reduce the waste of cache resources, and reduce the cost of data storage.
如图2所示,是本发明冷热数据处理装置的模块示意图。As shown in FIG. 2 , it is a schematic diagram of a module of the cold and heat data processing device of the present invention.
本发明所述冷热数据处理装置100可以安装于电子设备中。根据实现的功能,所述冷热数据处理装置可以包括获取模块101、查询模块102、计算模块103及处理模块104。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The cold and heat data processing apparatus 100 of the present invention can be installed in an electronic device. According to the realized functions, the cold and heat data processing apparatus may include an acquisition module 101 , a query module 102 , a calculation module 103 and a processing module 104 . The modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述获取模块101,用于获取原始数据集,对所述原始数据集进行分类,得到分类数据集;The obtaining module 101 is configured to obtain an original data set, classify the original data set, and obtain a classified data set;
本发明较佳实施例中,所述原始数据集可以是某一具体应用场景下的配置系统内存在的所有业务数据的集合,可以通过与各个业务系统交互接入数据源,从而获取业务数据。其中,所述具体应用场景包括银行、保险等,如银行的配置系统的业务数据包括负债业务数据、中间业务数据、资产业务数据等。In a preferred embodiment of the present invention, the original data set may be a set of all business data existing in the configuration system under a specific application scenario, and the business data may be obtained by interacting with each business system to access data sources. The specific application scenarios include banking, insurance, etc. 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.
所述获取模块101,用于对所述原始数据集进行分类,得到分类数据集,包括获取所述原始数据集对应的业务场景类别,根据所述业务场景类别,将所述原始数据集进行分类,得到分类数据集。The obtaining module 101 is configured to classify the original data set to obtain a classified data set, including obtaining a business scene category corresponding to the original data set, and classifying the original data set according to the business scene category , to get a classification dataset.
本发明实施例可以通过采集所述原始数据集中的业务参数,将所述业务参数进行解耦,得到所述原始数据集反映的业务场景的信息交互流程及逻辑框架信息,将所述信息交互流程及逻辑框架信息加载到Storm中进行计算,还原所述原始数据集对应的业务场景类别。In this embodiment of the present invention, the business parameters in the original data set can be collected, and the business parameters can be decoupled to obtain the information exchange process and logical framework information of the business scenario reflected in the original data set, and the information exchange process and logical framework information is loaded into Storm for calculation, and the business scenario category corresponding to the original data set is restored.
进一步地,本发明实施例根据所述业务场景类别,将所述原始数据集进行分类,得到分类数据集。如对负债业务数据进行业务场景还原后对应的业务场景包括存款业务场景、借款业务场景、同业业务场景等,则将所述负债业务数据划分为存款业务数据、借款业务数据、同业业务数据等。Further, in the embodiment of the present invention, the original data set is classified according to the business scenario category to obtain a classified data set. If the business scenarios corresponding to the business scenario restoration of the debt business data include deposit business scenarios, loan business scenarios, inter-bank business scenarios, etc., the debt business data is divided into deposit business data, loan business data, inter-bank business data, etc.
所述查询模块102,用于询所述分类数据集的键名集,并获取所述键名集对应的评估指标集;The query module 102 is configured to query the key name set of the classified data set, and obtain the evaluation index set corresponding to the key name set;
所述查询模块102,可以通过js脚本识别所述分类数据集的数据属性,根据所述数据属性,利用基于SQL语句的select查询命令查询所述分类数据集在数据库表中对应的键名。The query module 102 can identify the data attribute of the classified data set through js script, and according to the data attribute, use the select query command based on the SQL statement to query the corresponding key name of the classified data set in the database table.
本发明较佳实施例通过获取所述键名集在数据库实例中预设时间段内的访问日志,利用python脚本从所述访问日志中的访问信息中提取所述键名集的评估指标集。其中,所述评估指标集包括访问数据长度、访问频次、更新频次、最近访问时间访问数据长度等评估指标。本发明其中一个实施例,所述预设时间段可以为30天,对于所述预设时间段,不限于本实施例列举出的值,还可以按照实际需要进行设定。A preferred embodiment of the present invention extracts the evaluation index set of the key name set from the access information in the access log by obtaining the access log of the key name set within a preset time period in the database instance by using a python script. The evaluation indicator set includes evaluation indicators such as access data length, access frequency, update frequency, and access data length at the most recent access time. 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 can also be set according to actual needs.
所述计算模块103,用于基于所述评估指标集计算所述键名集的权重,并评估所述权重是否达到预设权重;The calculation module 103 is configured to calculate the weight of the key name set based on the evaluation index set, and evaluate whether the weight reaches a preset weight;
所述计算模块103,对所述访问频次、访问数据长度、最近访问时间、更新频次执行聚合运算,得到所述键名集的权重。较佳地,本发明实施例中,所述聚合运算是利用预设的权重聚合函数依次对所述键名集的评估指标集进行计算,得到所述键名集的权重。所述计算模块103利用下述方法,计算所述键名集的权重:The calculation module 103 performs an aggregation operation on the access frequency, access data length, latest access time, and 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 to obtain the weight of the key name set. The calculation module 103 uses the following method to calculate the weight of the key name set:
其中,所述w表示权重,n表示评估指标集中评估指标的个数,λ为超参数,表示每个评估指标的影响能力,f表示评估指标,在本发明实施例中所述λ可以为0.1,本发明其他实施例不限于上述列举出的值,还可以按照实际需要进行设定。Wherein, the w represents the weight, n represents the number of evaluation indicators in the evaluation indicator set, λ is a hyperparameter, representing the influence ability of each evaluation indicator, f represents the evaluation indicator, and in the embodiment of the present invention, the λ may be 0.1 , other embodiments of the present invention are not limited to the values listed above, and can also be set according to actual needs.
进一步地,本发明实施例中所述键名集的评估指标集会随着所述键名集在数据库实例中的访问进行实时变化的,所以所述键名集的权重需要根据实时变化的评估指标集进行实时计算。但是为了节约计算损耗及实时计算带来的计算延迟,本发明其中一个实施例可以通过预设一个时间阈值,定时基于所述评估指标集计算所述键名集的权重,并根据重新计算的结果更新所述键名集的权重,便于后续对分类数据集进行对应的处理。本发明其中一个实施例,所述时间阈值可以为7天。对于所述时间阈值的设定,不限于本实施例列举出的值,还可以按照实际需要进行设定。Further, in the embodiment of the present invention, the evaluation index set of the key name set will change in real time with the access of the key name set in the database instance, so the weight of the key name set needs to be based on the real-time changing evaluation index. set for real-time computation. However, in order to save calculation loss and calculation delay caused by real-time calculation, one embodiment of the present invention may preset a time threshold, periodically calculate the weight of the key name set based on the evaluation index set, and calculate the weight of the key name set according to the recalculated result. The weight of the key name set is updated to facilitate subsequent corresponding processing of the classified data set. In one embodiment of the present invention, the time threshold may be 7 days. The setting of the time threshold is not limited to the values listed in this embodiment, and may also be set according to actual needs.
本发明较佳实施例中,所述预设权重(Fix Weight)可以是根据Redis的内存阈值综合设定的。本发明其中一个实施例,所述预设权重可以为0.7,当所述键名集的权重不小于0.7时,则所述键名集的权重达到所述预设权重,当所述键名集的权重小于0.7时,则所述键名集的权重未达到所述预设权重。In a preferred embodiment of the present invention, the preset weight (Fix Weight) may be comprehensively set according to the memory threshold of Redis. In one 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. 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.
所述处理模块104,用于若所述权重达到所述预设权重,则标记所述键名集为热数据集,并判断所述热数据集的键值集不在预设服务器的缓存内时,将所述热数据集的键值集移至预设服务器的缓存,若所述权重未达到所述预设权重,则标记所述键名集为冷数据集,并判断所述冷数据集的键值集在预设服务器的缓存内时,将所述冷数据集的键值集移出预设服务器的缓存。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 determine when the key value set of the hot data set is not in the cache of the preset server , move 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, mark the key name set as a cold data set, and judge the cold data set When the key-value set of the cold data set is in the cache of the preset server, the key-value set of the cold data set is moved out of the cache of the preset server.
所述处理模块104,用于若所述权重达到所述预设权重,则标记所述键名集为热数据集。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 weight evaluation result of the key name set reaches the preset weight, it indicates that the key name set has a high access rate on the database instance, and at this time, the key name set is marked is a hot dataset.
本发明较佳实施例中,所述标记所述键名集为热数据集之后还包括:将所述热数据集备份在区块链节点中,当存储所述热数据集的服务器出现宕机或者重启时,在确认服务器重启成功后,从所述区块链节点中获取所述热数据集,并重新移至所述服务器的缓存中。In a preferred embodiment of the present invention, after marking the key name set as a hot data set, the method further includes: backing up the hot data set in the blockchain node, and when the server storing the hot data set crashes Or when restarting, after confirming that the server restarts successfully, the hot data set is obtained from the blockchain node and moved to the cache of the server again.
本发明较佳实施例中,所述缓存是指基于Redis做的一个数据缓存层。In a preferred embodiment of the present invention, the cache refers to a data cache layer based on Redis.
判断所述热数据集的键值集是否在预设服务器的缓存,本发明较佳实施例中,利用所述Redis的set命令判断所述热数据集的键值集是否在预设服务器的缓存。Determine whether the key-value set of the hot data set is in the cache of the preset server. 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 in the cache of the preset server. .
当所述热数据集的键值集在预设服务器的缓存时,对所述热数据集的键值集不做处理。When the key-value set of the hot data set is in the cache of the preset server, the key-value set of the hot data set is not processed.
当所述热数据集的键值集不在预设服务器的缓存时,将所述热数据集的键值集移至预设服务器的缓存,本发明较佳实施例中,从数据库中提取所述热数据集对应的键值集,并保存至所述缓存。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. In a preferred embodiment of the present invention, the key-value set of the hot data set is extracted from the database. The key-value set corresponding to the hot data set is saved to the cache.
所述处理模块104,还用于若所述权重未达到预设权重,则标记所述键名集为冷数据集。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 weight evaluation result of the key name set does not reach the preset weight, it means that the access popularity of the key name set on the database instance is low, and at this time, the key name set is Sets are marked as cold datasets.
本发明较佳实施例中,所述标记所述键名集为冷数据集之后,还包括,根据预设的时间阈值定时基于所述评估指标集计算所述键名集的权重,并根据重新计算的结果更新所述键名集的权重。按照所述时间阈值对键名集的权重进行更新,其更新依据为基于更新后的访问频次、访问数据长度、最近访问时间及更新频次,执行聚合运算,得到所述键名集的权重,便于后续对分类数据集进行对应的处理。In a preferred embodiment of the present invention, after marking the key name set as a cold data set, the method further includes: periodically calculating the weight of the key name set based on the evaluation index set according to a preset time threshold, and calculating the weight of the key name set according to the new The result of the calculation updates the weight of the set of key names. The weight of the key name set is updated according to the time threshold, and the update basis is based on the updated access frequency, the length of the access data, the latest access time and the update frequency, performing an aggregation operation to obtain the weight of the key name set, which is convenient for The classification data set is then processed accordingly.
判断所述冷数据集的键值集是否在预设服务器的缓存,本发明较佳实施例中,利用所述Redis的set命令判断所述冷数据集的键值集是否在预设服务器的缓存。Determine whether the key-value set of the cold data set is in the cache of the preset server. 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 in the cache of the preset server. .
当所述冷数据集的键值集不在预设服务器的缓存时,对所述冷数据集的键值集不做处理。When the key-value set of the cold data set is not in the cache of the preset server, the key-value set of the cold data set is not processed.
当所述冷数据集的键值集在预设服务器的缓存时,将所述冷数据集的键值集移出预设服务器的缓存,本发明较佳实施例中,删除所述缓存中包含的所述冷数据集对应的键值集。When the key-value set of the cold data set is in the cache of the preset server, the key-value set of the cold data set is moved out of the cache of the preset server. The key-value set corresponding to the cold data set.
如图3所示,是本发明实现冷热数据处理方法的电子设备的结构示意图。As shown in FIG. 3 , it is a schematic structural diagram of an electronic device implementing the method for processing cold and hot data according to the present invention.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如冷热数据处理程序12。The electronic device 1 may include a processor 10 , a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a thermal data processing program 12 .
其中,所述存储器11至少包括一种类型的计算机可读存储介质,所述计算机可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如冷热数据处理程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of computer-readable storage medium, and the computer-readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, Disks, CDs, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) device equipped on the electronic device 1. , SD) card, flash memory card (Flash Card) and so on. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used 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, etc., but also can be used to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行冷热数据处理程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits. Central processing unit (Central Processing Unit, CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing the program or module (for example, executing the program) stored in the memory 11. Hot and cold data processing programs, etc.), and call the data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management The device implements functions such as charge management, discharge management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, 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 is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, 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, organic light-emitting diode) touch device, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的冷热数据处理程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The cold and hot data processing program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
获取原始数据集,对所述原始数据集进行分类,得到分类数据集;Obtain an original data set, classify the original data set, and obtain a classified data set;
查询所述分类数据集的键名集,并获取所述键名集对应的评估指标集;query the key name set of the classification data set, and obtain the evaluation index set corresponding to the key name set;
基于所述评估指标集计算所述键名集的权重,并评估所述权重是否达到预设权重;Calculate the weight of the key name set based on the evaluation index set, and evaluate 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 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, the key name set is marked as a cold data set, and the key value set of the cold data set is removed from the cache of the preset server.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the modules/units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) .
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer usable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; using the created data, etc.
在本发明所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。It will be apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, but that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics of the invention.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。Therefore, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the invention is to be defined by the appended claims rather than the foregoing description, which are therefore intended to fall within the scope of the claims. All changes within the meaning and range of the equivalents of , are included in the present invention. Any accompanying reference signs in the claims should not be construed as limiting the involved claims.
本发明所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in the present invention is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present invention.
Claims (10)
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 (10)
| 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 |
| CN114253952A (en) * | 2021-11-04 | 2022-03-29 | 浙江时空道宇科技有限公司 | Data asset assessment method and device |
| CN114817425A (en) * | 2022-06-28 | 2022-07-29 | 成都交大大数据科技有限公司 | Method, device and equipment for classifying cold and hot data and readable storage medium |
| CN115048053A (en) * | 2022-06-15 | 2022-09-13 | 中国工商银行股份有限公司 | Data storage method and device and electronic equipment |
| CN115357618A (en) * | 2022-08-19 | 2022-11-18 | 京东科技控股股份有限公司 | Data access method, data processing system, electronic device and readable medium |
| CN115544005A (en) * | 2022-09-23 | 2022-12-30 | 中国平安财产保险股份有限公司 | Cold and hot data conversion storage method, device, computer equipment and storage medium |
| CN116361290A (en) * | 2023-03-23 | 2023-06-30 | 平安科技(深圳)有限公司 | Cold and hot data processing method, device, electronic equipment and storage medium |
| CN119357085A (en) * | 2024-09-30 | 2025-01-24 | 招商局智融供应链服务有限公司 | A dynamic caching method, device and medium for supply chain financial factoring orders |
| WO2026056089A1 (en) * | 2024-09-14 | 2026-03-19 | 山东大学 | Data attribute-aware storage system and data management method for key-value database |
Citations (6)
| 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 |
-
2020
- 2020-12-29 CN CN202011603604.7A patent/CN112699142A/en active Pending
Patent Citations (6)
| 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 (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113608670B (en) * | 2021-05-25 | 2023-10-27 | 武汉理工大学 | Blockchain data storage method based on fairness and access popularity |
| CN113608670A (en) * | 2021-05-25 | 2021-11-05 | 武汉理工大学 | Block chain data storage method based on fairness and access heat |
| CN114253952A (en) * | 2021-11-04 | 2022-03-29 | 浙江时空道宇科技有限公司 | Data asset assessment method and device |
| 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, device, electronic device and storage medium |
| CN115048053A (en) * | 2022-06-15 | 2022-09-13 | 中国工商银行股份有限公司 | Data storage method and device and electronic equipment |
| 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 |
| CN115357618A (en) * | 2022-08-19 | 2022-11-18 | 京东科技控股股份有限公司 | Data access method, data processing system, electronic device and readable medium |
| CN115544005A (en) * | 2022-09-23 | 2022-12-30 | 中国平安财产保险股份有限公司 | Cold and hot data conversion storage method, device, computer equipment and storage medium |
| CN115544005B (en) * | 2022-09-23 | 2026-01-06 | 中国平安财产保险股份有限公司 | Cold and hot data conversion and storage methods, devices, computer equipment and storage media |
| CN116361290A (en) * | 2023-03-23 | 2023-06-30 | 平安科技(深圳)有限公司 | Cold and hot data processing method, device, electronic equipment and storage medium |
| WO2026056089A1 (en) * | 2024-09-14 | 2026-03-19 | 山东大学 | Data attribute-aware storage system and data management method for key-value database |
| CN119357085A (en) * | 2024-09-30 | 2025-01-24 | 招商局智融供应链服务有限公司 | A dynamic caching method, device and medium for supply chain financial factoring orders |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112699142A (en) | Cold and hot data processing method and device, electronic equipment and storage medium | |
| WO2022121171A1 (en) | Similar text matching method and apparatus, and electronic device and computer storage medium | |
| CN112418798A (en) | Information auditing method, device, electronic device and storage medium | |
| CN111768096A (en) | Rating method and device based on algorithm model, electronic equipment and storage medium | |
| CN112347042A (en) | File uploading method and device, electronic equipment and storage medium | |
| CN114840531B (en) | Data model reconstruction method, device, equipment and medium based on blood edge relation | |
| CN115630194A (en) | Data visualization display method, device, equipment and storage medium | |
| CN112328592A (en) | Data storage method, electronic device and computer readable storage medium | |
| CN112631731A (en) | Data query method and device, electronic equipment and storage medium | |
| CN114706870A (en) | Database and cache consistency synchronization method, device, equipment and storage medium | |
| WO2022048362A1 (en) | Data storage method and apparatus, electronic device, and storage medium | |
| CN112685384A (en) | Data migration method and device, electronic equipment and storage medium | |
| CN114612194A (en) | Product recommendation method, device, electronic device and storage medium | |
| CN114138761B (en) | Data query method, device, equipment and storage medium based on python | |
| CN115543198A (en) | Method, device, electronic equipment and storage medium for unstructured data into lake | |
| CN114625755A (en) | Script checking method and device, electronic equipment and storage medium | |
| WO2022160443A1 (en) | Lineage mining method and apparatus, electronic device and computer-readable storage medium | |
| CN114036174B (en) | Data updating method, device, equipment and storage medium | |
| CN112925753B (en) | File additional writing method and device, electronic equipment and storage medium | |
| WO2022134345A1 (en) | File access method, apparatus, device, and readable storage medium | |
| WO2022179122A1 (en) | Big-data-based data storage method and apparatus, and electronic device and storage medium | |
| CN117609368A (en) | A genealogy analysis system, method, equipment and medium based on off-chain storage | |
| CN114021036A (en) | Network point screening method, device, equipment and storage medium | |
| CN114238278A (en) | Data partitioning method and device, electronic equipment and storage medium | |
| CN115114297A (en) | Data lightweight storage and search method, device, electronic device 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 | ||
| WD01 | Invention patent application deemed withdrawn after publication | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210423 |

