[go: up one dir, main page]

CN114489481A - Method and system for storing and accessing data in hard disk - Google Patents

Method and system for storing and accessing data in hard disk Download PDF

Info

Publication number
CN114489481A
CN114489481A CN202111592151.7A CN202111592151A CN114489481A CN 114489481 A CN114489481 A CN 114489481A CN 202111592151 A CN202111592151 A CN 202111592151A CN 114489481 A CN114489481 A CN 114489481A
Authority
CN
China
Prior art keywords
data
file
hard disk
path
stored
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
CN202111592151.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.)
Shenzhen Sekorm Component Network Co Ltd
Original Assignee
Shenzhen Sekorm Component Network 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 Shenzhen Sekorm Component Network Co Ltd filed Critical Shenzhen Sekorm Component Network Co Ltd
Priority to CN202111592151.7A priority Critical patent/CN114489481A/en
Publication of CN114489481A publication Critical patent/CN114489481A/en
Priority to PCT/CN2022/141044 priority patent/WO2023116828A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a system for storing and accessing data in a hard disk, which store the data to be stored in a hard disk file, maintain a file path, the current state of the path and the data volume stored in the file through a data storage maintenance center, upgrade the current file path to a directory when the data volume stored in the file reaches a threshold value, split a plurality of files under the current directory, store the data of an original file into the split files, and maintain the split file path, the current state of the path and the data volume stored in the split files through the data storage maintenance center, thereby providing a data storage basis for the efficient addressing access of the hard disk.

Description

硬盘存储数据并访问的方法及系统Method and system for storing and accessing hard disk data

技术领域technical field

本发明涉及计算机检索及存储技术领域,尤其涉及一种硬盘存储数据并访问的方法及系统。The present invention relates to the technical field of computer retrieval and storage, and in particular, to a method and system for storing and accessing hard disk data.

背景技术Background technique

随着计算机、互联网技术的飞速发展,人类已进入大数据时代。高速访问数据,快速响应用户请求已是常态。针对高频访问的数据,一般采用内存缓存的模式来达到快速读取的效果。而内存的硬件价格昂贵,且容量小。With the rapid development of computer and Internet technologies, human beings have entered the era of big data. High-speed access to data and quick response to user requests have become the norm. For frequently accessed data, the memory cache mode is generally used to achieve the effect of fast reading. The memory hardware is expensive and has a small capacity.

发明内容SUMMARY OF THE INVENTION

本发明要解决的技术问题在于,针对现有技术存在的至少一个缺陷,提供一种硬盘存储数据并访问的方法及系统。The technical problem to be solved by the present invention is to provide a method and system for storing and accessing data on a hard disk, aiming at at least one defect existing in the prior art.

本发明解决其技术问题所采用的技术方案是:构造一种硬盘存储数据并访问的方法,包括以下步骤:The technical scheme adopted by the present invention to solve the technical problem is: constructing a method for storing and accessing data on a hard disk, comprising the following steps:

S1:将需要存储的数据存储至硬盘文件中;S1: Store the data to be stored in the hard disk file;

S2:通过数据存储维护中心对文件路径、该路径当前状态和文件存储的数据量进行维护;S2: Maintain the file path, the current state of the path and the amount of data stored in the file through the data storage and maintenance center;

S3:当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件;S3: When the amount of data stored in the file has reached the threshold, upgrade the current file path to a directory, and fission multiple files in the current directory;

S4:将原文件的数据存储至裂变的多个文件中,并执行步骤S2。S4: Store the data of the original file into the multiple fissioned files, and perform step S2.

优选地,在本发明所述的硬盘存储数据并访问的方法中,步骤S1包括:Preferably, in the method for storing and accessing hard disk data according to the present invention, step S1 includes:

基于hash自定义分组算法,将需要存储的数据均分至硬盘的多个文件中。Based on the hash custom grouping algorithm, the data to be stored is evenly divided into multiple files on the hard disk.

优选地,在本发明所述的硬盘存储数据并访问的方法中,步骤S2包括:Preferably, in the method for storing and accessing data on a hard disk according to the present invention, step S2 includes:

文件路径进入数据存储维护中心,数据格式为:{文件路径:文件,文件存储的数据量}。The file path enters the data storage and maintenance center, and the data format is: {file path: file, the amount of data stored in the file}.

优选地,在本发明所述的硬盘存储数据并访问的方法中,步骤S4包括:Preferably, in the method for storing and accessing hard disk data according to the present invention, step S4 includes:

基于目录层级对应的hash自定义分组算法,将原文件的数据均分至裂变的多个文件中,且裂变后的文件路径进入所述数据存储维护中心,数据格式为:{裂变后的文件路径:文件,文件存储的数据量}。Based on the hash custom grouping algorithm corresponding to the directory level, the data of the original file is evenly divided into multiple fissioned files, and the file path after fission enters the data storage and maintenance center. The data format is: {file path after fission :file, the amount of data stored in the file}.

优选地,在本发明所述的硬盘存储数据并访问的方法中,所述方法还包括:Preferably, in the method for storing and accessing data on a hard disk according to the present invention, the method further includes:

S0:自定义一个数据存储维护中心,数据格式为:{文件路径:文件or目录,文件存储的数据量}。S0: Customize a data storage and maintenance center, the data format is: {file path: file or directory, data amount stored in the file}.

优选地,在本发明所述的硬盘存储数据并访问的方法中,所述方法还包括:Preferably, in the method for storing and accessing data on a hard disk according to the present invention, the method further includes:

S5:根据访问输入值进行寻址时,在所述数据存储维护中心中获取当前路径是否为文件;S5: when addressing according to the access input value, obtain in the data storage and maintenance center whether the current path is a file;

S6:若否,则在目录层级下进行下轮的寻址;S6: If not, perform the next round of addressing under the directory level;

S7:若是,则将文件内容加载,并循环筛选所述访问输入值对应的数据。S7: If yes, load the content of the file, and cyclically filter the data corresponding to the access input value.

优选地,在本发明所述的硬盘存储数据并访问的方法中,所述寻址为hash自定义分组算法寻址。Preferably, in the method for storing and accessing data on a hard disk according to the present invention, the addressing is hash self-defined grouping algorithm addressing.

本发明还构造了一种硬盘存储数据并访问的系统,包括:The present invention also constructs a system for storing and accessing hard disk data, including:

存储模块,用于将需要存储的数据存储至硬盘文件中;以及,将原文件的数据存储至裂变的多个文件中;The storage module is used to store the data to be stored in the hard disk file; and, store the data of the original file into the multiple files of fission;

数据存储维护中心,用于对文件路径、该路径当前状态和文件存储的数据量进行维护;The data storage and maintenance center is used to maintain the file path, the current state of the path and the amount of data stored in the file;

裂变模块,用于当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件。The fission module is used to upgrade the current file path to a directory and fission multiple files in the current directory when the amount of data stored in the file has reached the threshold.

优选地,在本发明所述的硬盘存储数据并访问的系统中,Preferably, in the system for storing data and accessing the hard disk according to the present invention,

所述存储模块,进一步用于基于hash自定义分组算法,将需要存储的数据均分至硬盘的多个文件中;以及,用于基于目录层级对应的hash自定义分组算法,将原文件的数据均分至裂变的多个文件中。The storage module is further used to divide the data that needs to be stored into multiple files of the hard disk based on the hash self-defined grouping algorithm; Evenly split into multiple files of fission.

优选地,在本发明所述的硬盘存储数据并访问的系统中,所述系统还包括:Preferably, in the system for storing and accessing hard disk data according to the present invention, the system further includes:

寻址模块,用于根据访问输入值进行寻址;以及,用于在目录层级下进行下轮的寻址;an addressing module for addressing according to the access input value; and, for performing the next round of addressing under the directory hierarchy;

判断模块,用于在所述数据存储维护中心中获取当前路径是否为文件,若否,则执行所述寻址模块;若是,则执行筛选模块;a judging module, used to obtain in the data storage and maintenance center whether the current path is a file, if not, execute the addressing module; if so, execute the screening module;

筛选模块,用于将文件内容加载,并循环筛选所述访问输入值对应的数据。The filtering module is used to load the content of the file, and cyclically filter the data corresponding to the access input value.

通过实施本发明,具有以下有益效果:By implementing the present invention, it has the following beneficial effects:

本发明通过将需要存储的数据存储至硬盘文件中,通过数据存储维护中心对文件路径、该路径当前状态和文件存储的数据量进行维护,当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件,将原文件的数据存储至裂变的多个文件中,并通过数据存储维护中心对裂变后的文件路径、该路径当前状态和裂变后的文件存储的数据量进行维护,从而为硬盘高效寻址访问提供数据存储基础。By storing the data to be stored in the hard disk file, the present invention maintains the file path, the current state of the path and the amount of data stored in the file through the data storage and maintenance center. When the amount of data stored in the file has reached the threshold, the current file The path is upgraded to a directory, and multiple files are fissioned in the current directory, the data of the original file is stored in the multiple fissioned files, and the fissioned file path, the current state of the path and the fissioned file path, the current state of the path and the fissioned file are stored in the data storage and maintenance center. The amount of data stored in the file is maintained, thereby providing a data storage basis for the efficient addressing and access of the hard disk.

同时,根据访问输入值进行寻址时,在数据存储维护中心中获取当前路径是否为文件,若否,则在目录层级下进行下轮的寻址;若是,则将文件内容加载,并循环筛选访问输入值对应的数据,从而完成高效寻址访问。At the same time, when addressing according to the access input value, obtain in the data storage and maintenance center whether the current path is a file, if not, perform the next round of addressing under the directory level; if so, load the file content and cyclically filter Access the data corresponding to the input value, thereby completing efficient addressing access.

附图说明Description of drawings

下面将结合附图及实施例对本发明作进一步说明,附图中:The present invention will be further described below in conjunction with the accompanying drawings and embodiments, in which:

图1是本发明硬盘存储数据并访问的方法流程示意图一;Fig. 1 is the method flow schematic diagram one of hard disk storage data of the present invention and accessing;

图2是本发明硬盘存储数据并访问的方法流程示意图二;Fig. 2 is the method flow schematic diagram two of hard disk storage data and access of the present invention;

图3是本发明硬盘存储数据并访问的系统模块示意图一;Fig. 3 is the system module schematic diagram one of hard disk storage data and access of the present invention;

图4是本发明硬盘存储数据并访问的系统模块示意图二。FIG. 4 is a second schematic diagram of a system module for storing data and accessing the hard disk of the present invention.

具体实施方式Detailed ways

为了对本发明的技术特征、目的和效果有更加清楚的理解,现对照附图详细说明本发明的具体实施方式。In order to have a clearer understanding of the technical features, objects and effects of the present invention, the specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

需要说明的是,附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。It should be noted that, the flowcharts shown in the accompanying drawings are only exemplary descriptions, and do not necessarily include all contents and operations/steps, and do not necessarily have to be executed in the described order. For example, some operations/steps can be decomposed, and some operations/steps can be combined or partially combined, so the actual execution order may be changed according to the actual situation.

附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the figures are merely functional entities and do not necessarily necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices entity.

如图1所示,本发明公开了一种硬盘存储数据并访问的方法,包括以下步骤:As shown in Figure 1, the present invention discloses a method for storing and accessing data on a hard disk, comprising the following steps:

步骤S1:将需要存储的数据存储至硬盘文件中;Step S1: store the data to be stored in a hard disk file;

步骤S2:通过数据存储维护中心对文件路径、该路径当前状态(文件or目录)和文件存储的数据量进行维护;Step S2: maintaining the file path, the current state of the path (file or directory) and the amount of data stored in the file through the data storage and maintenance center;

步骤S3:当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件;Step S3: when the amount of data stored in the file has reached the threshold, upgrade the current file path to a directory, and fission multiple files in the current directory;

步骤S4:将原文件的数据存储至裂变的多个文件中,并执行步骤S2。Step S4: Store the data of the original file into the multiple fissioned files, and execute Step S2.

具体地,在一些实施例中,该硬盘存储数据并访问的方法包括以下步骤:Specifically, in some embodiments, the method for storing and accessing data on the hard disk includes the following steps:

步骤S1:基于hash自定义分组算法,将需要存储的数据均分至硬盘的多个文件中;Step S1: based on the hash self-defined grouping algorithm, evenly divide the data to be stored into multiple files on the hard disk;

步骤S2:文件路径进入数据存储维护中心,数据格式为:{文件路径:文件,文件存储的数据量}。其中,文件存储一行信息为一个数据;Step S2: The file path enters the data storage and maintenance center, and the data format is: {file path: file, data amount stored in the file}. Among them, the file stores one line of information as one data;

步骤S3:当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件;Step S3: when the amount of data stored in the file has reached the threshold, upgrade the current file path to a directory, and fission multiple files in the current directory;

步骤S4:基于目录层级对应的hash自定义分组算法,将原文件的数据均分至裂变的多个文件中,且裂变后的文件路径进入数据存储维护中心,数据格式为:{裂变后的文件路径:文件,文件存储的数据量}。Step S4: Based on the hash custom grouping algorithm corresponding to the directory level, the data of the original file is divided into multiple fission files, and the file path after fission enters the data storage and maintenance center, and the data format is: {file after fission path: file, the amount of data stored in the file}.

其中,有多少个目录和文件,数据存储维护中心就记录多少条数据,即{裂变后的文件路径:文件,文件存储的数据量}。有几层的目录结构,就对应有几个hash分组算法。一旦文件存储的数据量达到阀值,就按默认定义好的分组策略,进行下一个目录的文件裂变。Among them, as many directories and files exist, the data storage and maintenance center records as many pieces of data, that is, {file path after fission: file, amount of data stored in the file}. There are several levels of directory structure, corresponding to several hash grouping algorithms. Once the amount of data stored in the file reaches the threshold, the file fission of the next directory is performed according to the grouping strategy defined by default.

在本实施例中,如图2所示,本方法还包括:In this embodiment, as shown in Figure 2, the method further includes:

步骤S0:自定义一个数据存储维护中心,数据格式为:{文件路径:文件or目录,文件存储的数据量},便于用来快速存储数据与寻址。Step S0: Customize a data storage and maintenance center, and the data format is: {file path: file or directory, data amount stored in the file}, which is convenient for quickly storing data and addressing.

在本实施例中,如图2所示,本方法还包括:In this embodiment, as shown in Figure 2, the method further includes:

步骤S5:根据访问输入值进行寻址时,在数据存储维护中心中获取当前路径是否为文件。在一些实施例中,可根据访问输入值按hash自定义分组算法进行寻址;Step S5: when addressing is performed according to the access input value, obtain whether the current path is a file in the data storage and maintenance center. In some embodiments, addressing can be performed by a hash custom grouping algorithm according to the access input value;

步骤S6:若否,则在目录层级下进行下轮的寻址。在一些实施例中,可按目录层级对应的hash自定义分组算法进行下轮的寻址;Step S6: If not, perform the next round of addressing under the directory level. In some embodiments, the next round of addressing can be performed according to the hash custom grouping algorithm corresponding to the directory level;

步骤S7:若是,则将文件内容加载,并循环筛选访问输入值对应的数据。Step S7: If yes, load the content of the file, and cyclically filter and access the data corresponding to the input value.

具体地,在快速寻址时,根据访问输入值,进行一轮一轮的hash自定义分组算法寻址,然后去数据存储维护中心获取当前路径是文件还是目录,如为目录,则继续下一轮的hash自定义分组算法寻址,直至找到文件即可。如为文件,则把该文件内容做整体加载,最后再去循环筛选输入值对应的数据。Specifically, during fast addressing, according to the access input value, perform rounds of hash custom grouping algorithm addressing, and then go to the data storage and maintenance center to obtain whether the current path is a file or a directory. If it is a directory, continue to the next The hash of the round is addressed by a custom grouping algorithm until the file is found. If it is a file, load the content of the file as a whole, and finally filter the data corresponding to the input value in a loop.

完整地,例如:存储海量用户信息,需要用用户名字进行查找用户的所有信息。本方法包括:Completely, for example: to store massive user information, it is necessary to use the user name to find all the information of the user. This method includes:

步骤S0:自定义一个数据存储维护中心,数据格式为:{文件路径:文件or目录,文件存储的数据量};Step S0: Customize a data storage and maintenance center, the data format is: {file path: file or directory, data amount stored in the file};

步骤S1:在date文件下新增1000个txt文本,基于hash_1000_1算法,将用户姓名均分至1000个txt文本中;Step S1: Add 1000 txt texts under the date file, and divide the user names into 1000 txt texts based on the hash_1000_1 algorithm;

步骤S2:每个txt文本进行存储时,数据存储维护中心均会维护数据,每个txt文本路径进入数据存储维护中心,数据格式为:{文件路径:文件,文件存储的数据量}。例如{data/1:文件,1};Step S2: When each txt text is stored, the data storage and maintenance center will maintain the data, and each txt text path enters the data storage and maintenance center, and the data format is: {file path: file, data amount stored in the file}. For example {data/1:file,1};

步骤S3:假设每个txt文本存储的数据量阀值为5000,当txt文本存储的数据量达到5000后,即{data/1:文件,5000},会触发将当前文件路径升级为目录,并在当前目录下裂变1000个txt文本,data/1在数据存储维护中心会变成:{data/1:目录};Step S3: Assuming that the threshold value of the data volume stored in each txt text is 5000, when the volume of data stored in the txt text reaches 5000, that is, {data/1: file, 5000}, it will trigger to upgrade the current file path to a directory, and Fission 1000 txt texts in the current directory, data/1 will become: {data/1:directory} in the data storage and maintenance center;

步骤S4:同时会使用与该目录层级对应的hash_1000_2算法,将5000个数据,均分到新增的1000个txt文本里,新增的文本路径在数据中心为变成:{data/1/1:文件,1};Step S4: At the same time, the hash_1000_2 algorithm corresponding to the directory level will be used to divide the 5000 data into the newly added 1000 txt texts. The new text path in the data center will become: {data/1/1 :File 1};

步骤S5:当根据用户姓名来搜索信息时,根据hash_1000_1算法,获取该用户姓名会落到哪个路径下,然后去数据存储维护中心中获取当前路径是否为文件;Step S5: when searching for information according to the user name, according to the hash_1000_1 algorithm, obtain the path to which the user name will fall, and then go to the data storage and maintenance center to obtain whether the current path is a file;

步骤S6:如是目录,则按默认的目录层级选择对应的hash_1000_2算法,再去寻址路径,直到当前路径为文件为止;Step S6: If it is a directory, select the corresponding hash_1000_2 algorithm according to the default directory level, and then go to the addressing path until the current path is a file;

步骤S7:当获取到用户姓名存放在具体的某一个文件时,就批量将改文件内容全部读取,然后只进行5000次的对比来精确定位该用户。Step S7: When the user name is obtained and stored in a specific file, all the contents of the modified file are read in batches, and then only 5000 comparisons are performed to precisely locate the user.

如图3所示,本发明还公开了一种硬盘存储数据并访问的系统,包括:As shown in Figure 3, the present invention also discloses a system for storing and accessing hard disk data, including:

存储模块,用于将需要存储的数据存储至硬盘文件中;以及,将原文件的数据存储至裂变的多个文件中;The storage module is used to store the data to be stored in the hard disk file; and, store the data of the original file into the multiple files of fission;

数据存储维护中心,用于对文件路径、该路径当前状态(文件or目录)和文件存储的数据量进行维护。具体地,文件路径进入数据存储维护中心,数据格式为:{文件路径:文件,文件存储的数据量}。其中,文件存储一行信息为一个数据;The data storage maintenance center is used to maintain the file path, the current state of the path (file or directory), and the amount of data stored in the file. Specifically, the file path enters the data storage and maintenance center, and the data format is: {file path: file, data amount stored in the file}. Among them, the file stores one line of information as one data;

裂变模块,用于当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件。The fission module is used to upgrade the current file path to a directory and fission multiple files in the current directory when the amount of data stored in the file has reached the threshold.

具体地,在一些实施例中,该存储模块,进一步用于基于hash自定义分组算法,将需要存储的数据均分至硬盘的多个文件中;以及,用于基于目录层级对应的hash自定义分组算法,将原文件的数据均分至裂变的多个文件中。Specifically, in some embodiments, the storage module is further configured to divide the data that needs to be stored into multiple files on the hard disk based on a hash custom grouping algorithm; and, based on the hash custom corresponding to the directory level The grouping algorithm divides the data of the original file into multiple fission files.

其中,有多少个目录和文件,数据存储维护中心就记录多少条数据,即{裂变后的文件路径:文件,文件存储的数据量}。有几层的目录结构,就对应有几个hash分组算法。一旦文件存储的数据量达到阀值,就按默认定义好的分组策略,进行下一个目录的文件裂变。Among them, as many directories and files exist, the data storage and maintenance center records as many pieces of data, that is, {file path after fission: file, amount of data stored in the file}. There are several levels of directory structure, corresponding to several hash grouping algorithms. Once the amount of data stored in the file reaches the threshold, the file fission of the next directory is performed according to the grouping strategy defined by default.

在本实施例中,本系统自定义的一个数据存储维护中心,数据格式为:{文件路径:文件or目录,文件存储的数据量},便于用来快速存储数据与寻址。In this embodiment, a data storage and maintenance center is customized by the system, and the data format is: {file path: file or directory, data amount stored in the file}, which is convenient for quickly storing data and addressing.

在本实施例中,如图4所示,本系统还包括:In this embodiment, as shown in Figure 4, the system further includes:

寻址模块,用于根据访问输入值进行寻址,在一些实施例中,可根据访问输入值按hash自定义分组算法进行寻址;以及,用于在目录层级下进行下轮的寻址,在一些实施例中,可按目录层级对应的hash自定义分组算法进行下轮的寻址;an addressing module, configured to perform addressing according to the access input value, in some embodiments, can perform addressing according to the access input value according to a hash user-defined grouping algorithm; and, for performing the next round of addressing under the directory hierarchy, In some embodiments, the next round of addressing can be performed according to the hash custom grouping algorithm corresponding to the directory level;

判断模块,用于在数据存储维护中心中获取当前路径是否为文件,若否,则执行寻址模块,用于在目录层级下进行下轮的寻址;若是,则执行筛选模块;The judgment module is used to obtain whether the current path is a file in the data storage and maintenance center. If not, the addressing module is executed to perform the next round of addressing under the directory level; if so, the screening module is executed;

筛选模块,用于将文件内容加载,并循环筛选访问输入值对应的数据。The filter module is used to load the content of the file and loop through the data corresponding to the input value.

具体地,在快速寻址时,根据访问输入值,进行一轮一轮的hash自定义分组算法寻址,然后去数据存储维护中心获取当前路径是文件还是目录,如为目录,则继续下一轮的hash自定义分组算法寻址,直至找到文件即可。如为文件,则把该文件内容做整体加载,最后再去循环筛选输入值对应的数据。Specifically, during fast addressing, according to the access input value, perform rounds of hash custom grouping algorithm addressing, and then go to the data storage and maintenance center to obtain whether the current path is a file or a directory. If it is a directory, continue to the next The hash of the round is addressed by a custom grouping algorithm until the file is found. If it is a file, load the content of the file as a whole, and finally filter the data corresponding to the input value in a loop.

通过实施本发明,具有以下有益效果:By implementing the present invention, it has the following beneficial effects:

本发明通过将需要存储的数据存储至硬盘文件中,通过数据存储维护中心对文件路径、该路径当前状态和文件存储的数据量进行维护,当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件,将原文件的数据存储至裂变的多个文件中,并通过数据存储维护中心对裂变后的文件路径、该路径当前状态和裂变后的文件存储的数据量进行维护,从而为硬盘高效寻址访问提供数据存储基础。By storing the data to be stored in the hard disk file, the present invention maintains the file path, the current state of the path and the amount of data stored in the file through the data storage and maintenance center. When the amount of data stored in the file has reached the threshold, the current file The path is upgraded to a directory, and multiple files are fissioned in the current directory, the data of the original file is stored in the fissioned multiple files, and the fissioned file path, the current state of the path and the fissioned file path, the current state of the path and the fissioned file are stored in the data storage and maintenance center. The amount of data stored in the file is maintained, thereby providing a data storage basis for the efficient addressing and access of the hard disk.

同时,根据访问输入值进行寻址时,在数据存储维护中心中获取当前路径是否为文件,若否,则在目录层级下进行下轮的寻址;若是,则将文件内容加载,并循环筛选访问输入值对应的数据,从而完成高效寻址访问。At the same time, when addressing according to the access input value, obtain in the data storage and maintenance center whether the current path is a file, if not, perform the next round of addressing under the directory level; if so, load the file content and cyclically filter Access the data corresponding to the input value, thereby completing efficient addressing access.

可以理解的,以上实施例仅表达了本发明的优选实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制;应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,可以对上述技术特点进行自由组合,还可以做出若干变形和改进,这些都属于本发明的保护范围;因此,凡跟本发明权利要求范围所做的等同变换与修饰,均应属于本发明权利要求的涵盖范围。It can be understood that the above examples only represent the preferred embodiments of the present invention, and the descriptions thereof are more specific and detailed, but should not be construed as a limitation on the scope of the patent of the present invention; it should be noted that for those of ordinary skill in the art In other words, without departing from the concept of the present invention, the above-mentioned technical features can be freely combined, and some deformations and improvements can also be made, and these all belong to the protection scope of the present invention; All equivalent transformations and modifications made shall fall within the scope of the claims of the present invention.

Claims (10)

1.一种硬盘存储数据并访问的方法,其特征在于,包括以下步骤:1. a method for hard disk storage data and access, is characterized in that, comprises the following steps: S1:将需要存储的数据存储至硬盘文件中;S1: Store the data to be stored in the hard disk file; S2:通过数据存储维护中心对文件路径、该路径当前状态和文件存储的数据量进行维护;S2: Maintain the file path, the current state of the path and the amount of data stored in the file through the data storage and maintenance center; S3:当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件;S3: When the amount of data stored in the file has reached the threshold, upgrade the current file path to a directory, and fission multiple files in the current directory; S4:将原文件的数据存储至裂变的多个文件中,并执行步骤S2。S4: Store the data of the original file into the multiple fissioned files, and perform step S2. 2.根据权利要求1所述的硬盘存储数据并访问的方法,其特征在于,步骤S1包括:2. the method for hard disk storage data and access according to claim 1, is characterized in that, step S1 comprises: 基于hash自定义分组算法,将需要存储的数据均分至硬盘的多个文件中。Based on the hash custom grouping algorithm, the data to be stored is evenly divided into multiple files on the hard disk. 3.根据权利要求2所述的硬盘存储数据并访问的方法,其特征在于,步骤S2包括:3. the method for hard disk storage data and access according to claim 2, is characterized in that, step S2 comprises: 文件路径进入数据存储维护中心,数据格式为:{文件路径:文件,文件存储的数据量}。The file path enters the data storage and maintenance center, and the data format is: {file path: file, the amount of data stored in the file}. 4.根据权利要求3所述的硬盘存储数据并访问的方法,其特征在于,步骤S4包括:4. the method for hard disk storage data and access according to claim 3, is characterized in that, step S4 comprises: 基于目录层级对应的hash自定义分组算法,将原文件的数据均分至裂变的多个文件中,且裂变后的文件路径进入所述数据存储维护中心,数据格式为:{裂变后的文件路径:文件,文件存储的数据量}。Based on the hash custom grouping algorithm corresponding to the directory level, the data of the original file is divided into multiple fission files, and the file path after fission enters the data storage and maintenance center. The data format is: {file path after fission :file, the amount of data stored in the file}. 5.根据权利要求1所述的硬盘存储数据并访问的方法,其特征在于,所述方法还包括:5. The method for storing and accessing hard disk data according to claim 1, wherein the method further comprises: S0:自定义一个数据存储维护中心,数据格式为:{文件路径:文件or目录,文件存储的数据量}。S0: Customize a data storage and maintenance center, the data format is: {file path: file or directory, data amount stored in the file}. 6.根据权利要求1所述的硬盘存储数据并访问的方法,其特征在于,所述方法还包括:6. The method for storing and accessing hard disk data according to claim 1, wherein the method further comprises: S5:根据访问输入值进行寻址时,在所述数据存储维护中心中获取当前路径是否为文件;S5: when addressing according to the access input value, obtain in the data storage and maintenance center whether the current path is a file; S6:若否,则在目录层级下进行下轮的寻址;S6: If not, perform the next round of addressing under the directory level; S7:若是,则将文件内容加载,并循环筛选所述访问输入值对应的数据。S7: If yes, load the content of the file, and cyclically filter the data corresponding to the access input value. 7.根据权利要求6所述的硬盘存储数据并访问的方法,其特征在于,所述寻址为hash自定义分组算法寻址。7 . The method for storing and accessing hard disk data according to claim 6 , wherein the addressing is hash self-defined grouping algorithm addressing. 8 . 8.一种硬盘存储数据并访问的系统,其特征在于,包括:8. A system for storing data and accessing a hard disk, comprising: 存储模块,用于将需要存储的数据存储至硬盘文件中;以及,将原文件的数据存储至裂变的多个文件中;The storage module is used to store the data to be stored in the hard disk file; and, store the data of the original file into the multiple files of fission; 数据存储维护中心,用于对文件路径、该路径当前状态和文件存储的数据量进行维护;The data storage and maintenance center is used to maintain the file path, the current state of the path and the amount of data stored in the file; 裂变模块,用于当文件存储的数据量已达阈值时,将当前文件路径升级为目录,并在当前目录下裂变多个文件。The fission module is used to upgrade the current file path to a directory when the amount of data stored in the file has reached the threshold, and fission multiple files in the current directory. 9.根据权利要求8所述的硬盘存储数据并访问的系统,其特征在于,9. The system for hard disk storage data and access according to claim 8, characterized in that, 所述存储模块,进一步用于基于hash自定义分组算法,将需要存储的数据均分至硬盘的多个文件中;以及,用于基于目录层级对应的hash自定义分组算法,将原文件的数据均分至裂变的多个文件中。The storage module is further used to divide the data that needs to be stored into multiple files of the hard disk based on the hash self-defined grouping algorithm; Evenly split into multiple files of fission. 10.根据权利要求8所述的硬盘存储数据并访问的系统,其特征在于,所述系统还包括:10. The system for storing and accessing hard disk data according to claim 8, wherein the system further comprises: 寻址模块,用于根据访问输入值进行寻址;以及,用于在目录层级下进行下轮的寻址;an addressing module for addressing according to the access input value; and, for performing the next round of addressing under the directory hierarchy; 判断模块,用于在所述数据存储维护中心中获取当前路径是否为文件,若否,则执行所述寻址模块;若是,则执行筛选模块;a judging module, used to obtain in the data storage and maintenance center whether the current path is a file, if not, execute the addressing module; if so, execute the screening module; 筛选模块,用于将文件内容加载,并循环筛选所述访问输入值对应的数据。The filtering module is used to load the content of the file, and cyclically filter the data corresponding to the access input value.
CN202111592151.7A 2021-12-23 2021-12-23 Method and system for storing and accessing data in hard disk Pending CN114489481A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111592151.7A CN114489481A (en) 2021-12-23 2021-12-23 Method and system for storing and accessing data in hard disk
PCT/CN2022/141044 WO2023116828A1 (en) 2021-12-23 2022-12-22 Method and system for hard disk data storing and access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111592151.7A CN114489481A (en) 2021-12-23 2021-12-23 Method and system for storing and accessing data in hard disk

Publications (1)

Publication Number Publication Date
CN114489481A true CN114489481A (en) 2022-05-13

Family

ID=81494622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111592151.7A Pending CN114489481A (en) 2021-12-23 2021-12-23 Method and system for storing and accessing data in hard disk

Country Status (2)

Country Link
CN (1) CN114489481A (en)
WO (1) WO2023116828A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116828A1 (en) * 2021-12-23 2023-06-29 深圳市世强元件网络有限公司 Method and system for hard disk data storing and access

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761059A (en) * 2014-01-24 2014-04-30 中国科学院信息工程研究所 Multi-disk storage method and system for mass data management
CN107315547A (en) * 2017-07-18 2017-11-03 郑州云海信息技术有限公司 A kind of method and device for reading distributed meta data file
CN107609140A (en) * 2017-09-20 2018-01-19 郑州云海信息技术有限公司 A kind of method and device of distributive catalogue of document system file access
CN109783440A (en) * 2018-12-19 2019-05-21 平安普惠企业管理有限公司 Date storage method and data retrieval method, device, medium, electronic equipment
CN111638853A (en) * 2020-05-08 2020-09-08 杭州海康威视系统技术有限公司 Data storage method and device, storage cluster, gateway equipment and main equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136338B (en) * 2013-02-04 2016-02-10 中国科学院信息工程研究所 A kind of metadata distribution method based on catalogue division and device
CN106843745A (en) * 2015-12-03 2017-06-13 南京中兴新软件有限责任公司 Capacity expansion method and device
US10705959B2 (en) * 2018-08-31 2020-07-07 Advanced Micro Devices, Inc. Region based split-directory scheme to adapt to large cache sizes
CN114489481A (en) * 2021-12-23 2022-05-13 深圳市世强元件网络有限公司 Method and system for storing and accessing data in hard disk

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761059A (en) * 2014-01-24 2014-04-30 中国科学院信息工程研究所 Multi-disk storage method and system for mass data management
CN107315547A (en) * 2017-07-18 2017-11-03 郑州云海信息技术有限公司 A kind of method and device for reading distributed meta data file
CN107609140A (en) * 2017-09-20 2018-01-19 郑州云海信息技术有限公司 A kind of method and device of distributive catalogue of document system file access
CN109783440A (en) * 2018-12-19 2019-05-21 平安普惠企业管理有限公司 Date storage method and data retrieval method, device, medium, electronic equipment
CN111638853A (en) * 2020-05-08 2020-09-08 杭州海康威视系统技术有限公司 Data storage method and device, storage cluster, gateway equipment and main equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023116828A1 (en) * 2021-12-23 2023-06-29 深圳市世强元件网络有限公司 Method and system for hard disk data storing and access

Also Published As

Publication number Publication date
WO2023116828A1 (en) 2023-06-29

Similar Documents

Publication Publication Date Title
JP6553649B2 (en) Clustering storage method and apparatus
JP6362316B2 (en) Method, system and computer program product for hybrid table implementation using buffer pool as resident in-memory storage for memory resident data
US11580162B2 (en) Key value append
CN107038206B (en) LSM tree establishing method, LSM tree data reading method and server
CN110888837B (en) Object storage small file merging method and device
JP2005267600A5 (en)
CN113535670B (en) Virtual resource mirror image storage system and implementation method thereof
CN115454994A (en) Metadata storage method and device based on distributed key value database
CN112416880A (en) Method and device for optimizing storage performance of mass small files based on real-time merging
Zhai et al. Hadoop perfect file: A fast and memory-efficient metadata access archive file to face small files problem in hdfs
CN106980665A (en) Data dictionary implementation method, device and data dictionary management system
CN114138193A (en) A data writing method, device and device for partition namespace solid state hard disk
CN115576947A (en) Data management method and device, combined library, electronic equipment and storage medium
CN114297196A (en) Metadata storage method and device, electronic equipment and storage medium
CN114489481A (en) Method and system for storing and accessing data in hard disk
US20200019539A1 (en) Efficient and light-weight indexing for massive blob/objects
US8775746B2 (en) Information processing system and method
CN113220992B (en) A method, system and medium for recommending information flow content
CN117807174A (en) Index processing method, apparatus, computer device, medium, and program product
CN115374127A (en) Data storage method and device
CN112306955A (en) File system capacity management optimization device and method and electronic equipment
CN116860564B (en) Cloud server data management method and data management device thereof
CN115510000B (en) File merging method, device, electronic equipment, storage medium and program product
CN110096223A (en) Tracking information related with the free space of container
CN118861064A (en) Database large object deletion method, storage medium and device

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