CN111881140A - Data structure tree checking method, device, equipment and storage medium - Google Patents
Data structure tree checking method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111881140A CN111881140A CN202010746737.3A CN202010746737A CN111881140A CN 111881140 A CN111881140 A CN 111881140A CN 202010746737 A CN202010746737 A CN 202010746737A CN 111881140 A CN111881140 A CN 111881140A
- Authority
- CN
- China
- Prior art keywords
- data structure
- structure tree
- verification
- data
- tree
- 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.)
- Withdrawn
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/22—Indexing; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Stored Programmes (AREA)
Abstract
本申请公开了一种数据结构树校验方法、装置、设备及存储介质。该方法的步骤包括:统计数据卷中的数据结构树;判断数据结构树中是否存在未校验的目标数据结构树;若存在未校验的目标数据结构树时,调用线程对目标数据结构树执行校验操作;其中,线程的总数量大于1,且目标数据结构树与线程之间存在唯一对应关系;执行判断数据结构树中是否存在未校验的目标数据结构树的步骤。本方法相对确保了对数据卷中的数据结构树进行校验过程的整体效率。此外,本申请还提供一种数据结构树校验装置、设备及存储介质,有益效果同上所述。
The present application discloses a data structure tree verification method, device, device and storage medium. The steps of the method include: counting the data structure tree in the data volume; judging whether there is an unverified target data structure tree in the data structure tree; if there is an unverified target data structure tree, calling the thread A verification operation is performed; wherein, the total number of threads is greater than 1, and there is a unique correspondence between the target data structure tree and the thread; the step of judging whether there is an unverified target data structure tree in the data structure tree is performed. The method relatively ensures the overall efficiency of the verification process for the data structure tree in the data volume. In addition, the present application also provides a data structure tree verification device, equipment and storage medium, the beneficial effects are the same as described above.
Description
技术领域technical field
本申请涉及数据存储领域,特别是涉及一种数据结构树校验方法、装置、设备及存储介质。The present application relates to the field of data storage, and in particular, to a data structure tree verification method, apparatus, device and storage medium.
背景技术Background technique
数据结构树是一种数据结构,是由n(n大于或等于0)个有限结点组成一个具有层次关系的数据集合,包含根节点、内部节点和叶子节点。数据结构树通常用于数据库系统和操作系统的文件系统中,用于进行数据的索引,能够保持数据存储的稳定有序,其插入与修改拥有较稳定的对数时间复杂度。A data structure tree is a data structure that consists of n (n greater than or equal to 0) finite nodes to form a hierarchical data set, including root nodes, internal nodes and leaf nodes. The data structure tree is usually used in the file system of the database system and the operating system for data indexing, which can keep the data storage stable and orderly, and its insertion and modification have a relatively stable logarithmic time complexity.
在数据库系统或文件系统中,数据结构树往往存储于预先划分的数据卷中,在对数据结构树进行校验时,往往是对各数据卷分配单独的线程,进而通过利用线程对相应数据卷中的数据结构树完成校验,但是在当前的数据结构树校验方法中,当可用线程的数量大于数据卷的数量时,往往会存在空闲线程,进而难以确保对数据卷中的数据结构树进行校验过程的整体效率。In a database system or file system, the data structure tree is often stored in pre-divided data volumes. When verifying the data structure tree, a separate thread is often allocated to each data volume, and then the corresponding data volume is processed by using threads. However, in the current data structure tree verification method, when the number of available threads is greater than the number of data volumes, there are often idle threads, which makes it difficult to ensure that the data structure tree in the data volume is verified. The overall efficiency of the verification process.
由此可见,提供一种数据结构树校验方法,以相对确保对数据卷中的数据结构树进行校验过程的整体效率,是本领域技术人员需要解决的问题。It can be seen that it is a problem to be solved by those skilled in the art to provide a data structure tree verification method to relatively ensure the overall efficiency of the verification process of the data structure tree in the data volume.
发明内容SUMMARY OF THE INVENTION
本申请的目的是提供一种数据结构树校验方法、装置、设备及存储介质,以相对确保对数据卷中的数据结构树进行校验过程的整体效率。The purpose of the present application is to provide a data structure tree verification method, apparatus, device and storage medium, so as to relatively ensure the overall efficiency of the verification process of the data structure tree in the data volume.
为解决上述技术问题,本申请提供一种数据结构树校验方法,包括:In order to solve the above-mentioned technical problems, the application provides a data structure tree verification method, including:
统计数据卷中的数据结构树;Data structure tree in the statistics volume;
判断数据结构树中是否存在未校验的目标数据结构树;Determine whether there is an unverified target data structure tree in the data structure tree;
若存在未校验的目标数据结构树时,调用线程对目标数据结构树执行校验操作;其中,线程的总数量大于1,且目标数据结构树与线程之间存在唯一对应关系;If there is an unverified target data structure tree, the calling thread performs a verification operation on the target data structure tree; wherein, the total number of threads is greater than 1, and there is a unique correspondence between the target data structure tree and the thread;
执行判断数据结构树中是否存在未校验的目标数据结构树的步骤。The step of judging whether there is an unchecked target data structure tree in the data structure tree is performed.
优选地,当数据卷的数量大于1时,在判断数据结构树中是否存在未校验的目标数据结构树之后,方法还包括:Preferably, when the number of data volumes is greater than 1, after judging whether there is an unverified target data structure tree in the data structure tree, the method further includes:
若不存在未校验的目标数据结构树时,判断是否存在未执行校验操作的数据卷;If there is no unverified target data structure tree, determine whether there is a data volume that has not been verified;
若存在未执行校验操作的数据卷,则基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤;If there is a data volume for which the verification operation is not performed, then based on the data volume for which the verification operation is not performed, the step of counting the data structure tree in the data volume is performed;
否则,停止校验操作。Otherwise, stop the verification operation.
优选地,在基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤之前,方法还包括:Preferably, before performing the step of counting the data structure tree in the data volume based on the data volume for which the verification operation has not been performed, the method further includes:
判断未执行校验操作的数据卷是否满足预设校验标准;Determine whether the data volume that has not performed the verification operation meets the preset verification standard;
若满足预设校验标准,则基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤;If the preset verification standard is met, based on the data volume for which the verification operation has not been performed, the step of counting the data structure tree in the data volume is performed;
否则,过滤未执行校验操作的数据卷。Otherwise, filter the data volumes that have not performed the verification operation.
优选地,在调用线程对目标数据结构树执行校验操作之前,方法还包括:Preferably, before the calling thread performs the verification operation on the target data structure tree, the method further includes:
判断通过目标数据结构树的根地址是否能够访问得到根节点数据;Determine whether the root node data can be accessed through the root address of the target data structure tree;
若能够访问得到根节点数据,则执行调用线程对目标数据结构树执行校验操作的步骤;If the root node data can be accessed, the calling thread performs the verification operation on the target data structure tree;
否则,过滤目标数据结构树。Otherwise, filter the target data structure tree.
优选地,数据结构树包括B树、B+树以及平衡二叉树中一种或多种。Preferably, the data structure tree includes one or more of a B-tree, a B+ tree and a balanced binary tree.
此外,本申请还提供一种数据结构树校验装置,包括:In addition, the present application also provides a data structure tree verification device, comprising:
统计模块,用于统计数据卷中的数据结构树;Statistics module, used to count the data structure tree in the data volume;
结构树判断模块,用于判断数据结构树中是否存在未校验的目标数据结构树,若是,则依次调用线程校验模块以及结构树判断模块;The structure tree judgment module is used to judge whether there is an unverified target data structure tree in the data structure tree, and if so, then call the thread verification module and the structure tree judgment module in turn;
线程校验模块,用于调用线程对目标数据结构树执行校验操作;其中,线程的总数量大于1,且目标数据结构树与线程之间存在唯一对应关系。The thread verification module is used to call the thread to perform verification operation on the target data structure tree; wherein, the total number of threads is greater than 1, and there is a unique correspondence between the target data structure tree and the thread.
优选地,当数据卷的数量大于1时,结构树判断模块在当不存在未校验的目标数据结构树时,调用数据卷判断模块;Preferably, when the number of data volumes is greater than 1, the structure tree judgment module calls the data volume judgment module when there is no unverified target data structure tree;
数据卷判断模块,用于判断是否存在未执行校验操作的数据卷,若是,则基于未执行校验操作的数据卷调用统计模块,否则,调用校验停止模块;The data volume judgment module is used to judge whether there is a data volume that has not performed the verification operation, if so, call the statistics module based on the data volume that has not performed the verification operation, otherwise, call the verification stop module;
校验停止模块,用于停止校验操作。The verification stop module is used to stop the verification operation.
优选地,装置还包括:Preferably, the device further includes:
校验标准判断模块,用于判断未执行校验操作的数据卷是否满足预设校验标准,若是,则基于未执行校验操作的数据卷调用统计模块,否则,调用数据卷过滤模块;The verification standard judgment module is used to judge whether the data volume that has not performed the verification operation meets the preset verification standard, and if so, calls the statistics module based on the data volume that has not performed the verification operation;
数据卷过滤模块,用于过滤未执行校验操作的数据卷。The data volume filtering module is used to filter the data volumes that have not been verified.
此外,本申请还提供一种数据结构树校验设备,包括:In addition, the application also provides a data structure tree verification device, including:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行计算机程序时实现如上述的数据结构树校验方法的步骤。The processor is configured to implement the steps of the above-mentioned data structure tree verification method when executing the computer program.
此外,本申请还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的数据结构树校验方法的步骤。In addition, the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned data structure tree verification method are implemented.
本申请所提供的数据结构树校验方法,首先统计数据卷中的数据结构树,进而判断数据结构树中是否存在未校验的目标数据结构树,若存在未校验的目标数据结构树,则调用与目标数据结构树唯一对应的线程对该目标数据结构树执行校验操作,且线程的总数量大于1,并进一步执行判断数据结构树中是否存在未校验的目标数据结构树的步骤,以此完成对数据卷中全部数据结构树的校验。本方法通过对数据卷中未校验的目标数据结构树分配单独的线程,由于数据卷中的数据结构树的整体数量相对较大,因此能够相对确保线程整体的利用率,进而相对避免出现因可用的线程的数量大于数据卷的数量,而导致线程中存在空闲线程的情况,相对确保了对数据卷中的数据结构树进行校验过程的整体效率。此外,本申请还提供一种数据结构树校验装置、设备及存储介质,有益效果同上所述。The data structure tree verification method provided by this application firstly counts the data structure tree in the data volume, and then judges whether there is an unverified target data structure tree in the data structure tree, if there is an unverified target data structure tree, Then call the thread uniquely corresponding to the target data structure tree to perform the verification operation on the target data structure tree, and the total number of threads is greater than 1, and further perform the step of judging whether there is an unverified target data structure tree in the data structure tree , so as to complete the verification of all data structure trees in the data volume. This method allocates a separate thread to the unverified target data structure tree in the data volume. Since the overall number of data structure trees in the data volume is relatively large, the overall utilization rate of the thread can be relatively ensured, thereby relatively avoiding the occurrence of causes The number of available threads is greater than the number of data volumes, resulting in the existence of idle threads in the threads, which relatively ensures the overall efficiency of the process of verifying the data structure tree in the data volume. In addition, the present application also provides a data structure tree verification device, equipment and storage medium, the beneficial effects are the same as above.
附图说明Description of drawings
为了更清楚地说明本申请实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to describe the embodiments of the present application more clearly, the following will briefly introduce the drawings that are used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, which are not relevant to ordinary skills in the art. As far as personnel are concerned, other drawings can also be obtained from these drawings on the premise of no creative work.
图1为本申请实施例公开的一种数据结构树校验方法的流程图;1 is a flowchart of a method for verifying a data structure tree disclosed in an embodiment of the present application;
图2为本申请实施例公开的一种数据结构树校验方法的流程图;2 is a flowchart of a method for verifying a data structure tree disclosed in an embodiment of the present application;
图3为本申请实施例公开的一种数据同步装置的结构示意图。FIG. 3 is a schematic structural diagram of a data synchronization apparatus disclosed in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本申请保护范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative work fall within the protection scope of the present application.
在数据库系统或文件系统中,数据结构树往往存储于预先划分的数据卷中,在对数据结构树进行校验时,往往是对各数据卷分配单独的线程,进而通过利用线程对相应数据卷中的数据结构树完成校验,但是在当前的数据结构树校验方法中,当可用线程的数量大于数据卷的数量时,往往会存在空闲线程,进而难以确保对数据卷中的数据结构树进行校验过程的整体效率。In a database system or file system, the data structure tree is often stored in pre-divided data volumes. When verifying the data structure tree, a separate thread is often allocated to each data volume, and then the corresponding data volume is processed by using threads. However, in the current data structure tree verification method, when the number of available threads is greater than the number of data volumes, there are often idle threads, which makes it difficult to ensure that the data structure tree in the data volume is verified. The overall efficiency of the verification process.
为此,本申请的核心是提供一种数据结构树校验方法,以相对确保对数据卷中的数据结构树进行校验过程的整体效率。Therefore, the core of the present application is to provide a data structure tree verification method, so as to relatively ensure the overall efficiency of the verification process for the data structure tree in the data volume.
为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。In order to make those skilled in the art better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
请参见图1所示,本申请实施例公开了一种数据结构树校验方法,包括:Referring to FIG. 1 , an embodiment of the present application discloses a method for verifying a data structure tree, including:
步骤S10:统计数据卷中的数据结构树。Step S10: Statistics of the data structure tree in the data volume.
需要说明的是,本实施例中的数据卷指的是一个可以供一个或多个容器使用的文件目录,另外,数据结构存储于预先划分的数据卷中,用于记录数据卷中所存储数据的存储地址,以此用于提供对数据卷中所存储数据的访问检索。It should be noted that the data volume in this embodiment refers to a file directory that can be used by one or more containers. In addition, the data structure is stored in a pre-divided data volume for recording data stored in the data volume The storage address of the data volume is used to provide access and retrieval of the data stored in the data volume.
本步骤中统计数据卷中的数据结构树,目的是在后续步骤中对数据结构树进行校验,校验的目的是包括但不限于对数据结构树中的索引内容进行修复,或利用数据结构树对数据卷中的存储数据进行访问等。The purpose of counting the data structure tree in the data volume in this step is to verify the data structure tree in the subsequent steps. The purpose of the verification includes but is not limited to repairing the index content in the data structure tree, or using the data structure The tree accesses the stored data in the data volume, etc.
另外,数据卷中存储的数据结构树的数量应根据实际情况而定,可以为一个或多个。In addition, the number of data structure trees stored in the data volume should be determined according to the actual situation, and may be one or more.
步骤S11:判断数据结构树中是否存在未校验的目标数据结构树,若是,则依次执行步骤S12以及步骤S11。Step S11: Determine whether there is an unverified target data structure tree in the data structure tree, and if so, perform step S12 and step S11 in sequence.
步骤S12:调用线程对目标数据结构树执行校验操作。Step S12: The calling thread performs a check operation on the target data structure tree.
其中,线程的总数量大于1,且目标数据结构树与线程之间存在唯一对应关系。Among them, the total number of threads is greater than 1, and there is a unique correspondence between the target data structure tree and the threads.
在统计到数据卷中的数据结构树之后,本实施例进一步判断数据结构树中是否存在未校验的目标数据结构树,进而当存储未校验的目标数据结构树时,调用线程对目标数据结构树执行校验操作。另外,需要强调的是,本实施例的重点在于线程的总数量大于1,并且目标数据结构树与线程之间存在唯一对应关系,也就是说,当数据结构树的数量大于1时,至少存在两个或以上的线程同时对同一数据卷中不同的数据结构树执行校验操作。After the data structure tree in the data volume is counted, the present embodiment further judges whether there is an unverified target data structure tree in the data structure tree, and further when the unverified target data structure tree is stored, the calling thread The structure tree performs verification operations. In addition, it should be emphasized that the key point of this embodiment is that the total number of threads is greater than 1, and there is a unique correspondence between the target data structure tree and the thread, that is, when the number of data structure trees is greater than 1, at least there is Two or more threads simultaneously perform checksum operations on different data structure trees in the same data volume.
本申请所提供的数据结构树校验方法,首先统计数据卷中的数据结构树,进而判断数据结构树中是否存在未校验的目标数据结构树,若存在未校验的目标数据结构树,则调用与目标数据结构树唯一对应的线程对该目标数据结构树执行校验操作,且线程的总数量大于1,并进一步执行判断数据结构树中是否存在未校验的目标数据结构树的步骤,以此完成对数据卷中全部数据结构树的校验。本方法通过对数据卷中未校验的目标数据结构树分配单独的线程,由于数据卷中的数据结构树的整体数量相对较大,因此能够相对确保线程整体的利用率,进而相对避免出现因可用的线程的数量大于数据卷的数量,而导致线程中存在空闲线程的情况,相对确保了对数据卷中的数据结构树进行校验过程的整体效率。The data structure tree verification method provided by this application firstly counts the data structure tree in the data volume, and then judges whether there is an unverified target data structure tree in the data structure tree, if there is an unverified target data structure tree, Then call the thread uniquely corresponding to the target data structure tree to perform the verification operation on the target data structure tree, and the total number of threads is greater than 1, and further perform the step of judging whether there is an unverified target data structure tree in the data structure tree , so as to complete the verification of all data structure trees in the data volume. This method allocates a separate thread to the unverified target data structure tree in the data volume. Since the overall number of data structure trees in the data volume is relatively large, the overall utilization rate of the thread can be relatively ensured, thereby relatively avoiding the occurrence of causes The number of available threads is greater than the number of data volumes, resulting in the existence of idle threads in the threads, which relatively ensures the overall efficiency of the process of verifying the data structure tree in the data volume.
在上述实施例的基础上,作为一种优选的实施方式,在调用线程对目标数据结构树执行校验操作之前,方法还包括:On the basis of the above embodiment, as a preferred implementation, before the calling thread performs the verification operation on the target data structure tree, the method further includes:
判断通过目标数据结构树的根地址是否能够访问得到根节点数据;Determine whether the root node data can be accessed through the root address of the target data structure tree;
若能够访问得到根节点数据,则执行调用线程对目标数据结构树执行校验操作的步骤;If the root node data can be accessed, the calling thread performs the verification operation on the target data structure tree;
否则,过滤目标数据结构树。Otherwise, filter the target data structure tree.
需要说明的是,本实施方式的重点在于,在调用线程对目标数据结构树执行校验操作之前,首先判断通过目标数据结构树的根地址是否能够访问得到根节点数据,也就是判断目标数据结构树能够被正常遍历访问,若能够访问得到根节点数据,则说明目标数据结果树能够被正常遍历访问,进而进一步执行调用线程对目标数据结构树执行校验操作的步骤;相反的,若通过目标数据结构树的根地址不能访问得到根节点数据,则进一步过滤该目标数据结构树。本实施方式进一步确保了对于数据结构树校验的可靠性。It should be noted that the key point of this embodiment is that, before the calling thread performs the verification operation on the target data structure tree, it is first judged whether the root node data can be accessed through the root address of the target data structure tree, that is, to judge the target data structure. The tree can be accessed by normal traversal. If the root node data can be accessed, it means that the target data result tree can be accessed by normal traversal, and then the calling thread performs the verification operation on the target data structure tree. If the root address of the data structure tree cannot be accessed to obtain the root node data, the target data structure tree is further filtered. This embodiment further ensures the reliability of checking the data structure tree.
请参见图2所示,当数据卷的数量大于1时,本申请实施例公开了一种数据结构树校验方法,包括:Referring to FIG. 2 , when the number of data volumes is greater than 1, an embodiment of the present application discloses a method for verifying a data structure tree, including:
步骤S20:统计数据卷中的数据结构树。Step S20: Statistical data structure tree in the data volume.
步骤S21:判断数据结构树中是否存在未校验的目标数据结构树,若是,则依次执行步骤S22以及步骤S21,否则,执行步骤S23。Step S21: Determine whether there is an unverified target data structure tree in the data structure tree, if so, execute step S22 and step S21 in sequence, otherwise, execute step S23.
步骤S22:若存在未校验的目标数据结构树时,调用线程对目标数据结构树执行校验操作。Step S22: If there is an unverified target data structure tree, the calling thread performs a verification operation on the target data structure tree.
其中,线程的总数量大于1,且目标数据结构树与线程之间存在唯一对应关系。Among them, the total number of threads is greater than 1, and there is a unique correspondence between the target data structure tree and the threads.
步骤S23:判断是否存在未执行校验操作的数据卷,若是,则基于未执行校验操作的数据卷,执行步骤S20,否则,执行步骤S24。Step S23: Determine whether there is a data volume for which the verification operation has not been performed, and if so, perform Step S20 based on the data volume for which the verification operation has not been performed; otherwise, perform Step S24.
步骤S24:停止校验操作。Step S24: Stop the verification operation.
需要说明的是,本实施例适用于数据卷的数量大于1的场景中,当数据卷数量大于1时,若判断数据结构树中是否存在未校验的目标数据结构树的结果为不存在未校验的目标数据结构树时,则说明对于当前数据卷中的数据结构树已经全部校验完毕,因此在此情况下,进一步判断是否存在未执行校验操作的数据卷,如果存在未执行校验操作的数据卷,则进一步统计未执行校验操作的数据卷中的数据结构树,并进一步对未执行校验操作的数据卷中数据结构树的校验,若不存在为执行校验操作的数据卷,则说明对于所有数据卷中数据结构树的校验已经全部完成,因此停止校验操作。本实施例进一步确保了当数据卷的数量大于1时,对于数据结构树校验的可靠性以及全面性。It should be noted that this embodiment is applicable to a scenario where the number of data volumes is greater than 1. When the number of data volumes is greater than 1, if it is determined whether there is an unverified target data structure tree in the data structure tree, the result is that there is no unverified target data structure tree. When verifying the target data structure tree, it means that all the data structure trees in the current data volume have been verified. Therefore, in this case, it is further judged whether there is a data volume for which the verification operation has not been performed. If the data volume for which the verification operation has not been performed, the data structure tree in the data volume without the verification operation will be further counted, and the data structure tree in the data volume without the verification operation will be further verified. If the data volume is displayed, it means that the verification of the data structure tree in all data volumes has been completed, so the verification operation is stopped. This embodiment further ensures the reliability and comprehensiveness of the data structure tree check when the number of data volumes is greater than 1.
在上述实施例的基础上,作为一种优选的实施方式,在基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤之前,方法还包括:On the basis of the foregoing embodiment, as a preferred implementation manner, before performing the step of counting the data structure tree in the data volume based on the data volume for which the verification operation has not been performed, the method further includes:
判断未执行校验操作的数据卷是否满足预设校验标准;Determine whether the data volume that has not performed the verification operation meets the preset verification standard;
若满足预设校验标准,则基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤;If the preset verification standard is met, based on the data volume for which the verification operation has not been performed, the step of counting the data structure tree in the data volume is performed;
否则,过滤未执行校验操作的数据卷。Otherwise, filter the data volumes that have not performed the verification operation.
需要说明的是,本实施方式的重点在于,在基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤之前,进一步判断未执行校验操作的数据卷是否满足预设校验标准,进而当未执行校验操作的数据卷满足预设校验标准时,进一步基于未执行校验操作的数据卷,执行统计数据卷中的数据结构树的步骤;相反的,当未执行校验操作的数据卷不满足预设校验标准时,进一步过滤未执行校验操作的数据卷。另外,本实施方式中的预设校验标准包括但不限于数据卷属于特定类型、数据卷能够被访问或数据卷的读写控制权限属于本地控制器等。It should be noted that the key point of this embodiment is to further determine whether the data volume for which the verification operation is not performed satisfies the preset value before performing the step of counting the data structure tree in the data volume based on the data volume for which the verification operation has not been performed. The verification standard, and then when the data volume for which the verification operation is not performed meets the preset verification standard, the step of counting the data structure tree in the data volume is further performed based on the data volume for which the verification operation is not performed; on the contrary, when the data volume is not performed When the data volume of the verification operation does not meet the preset verification standard, the data volume for which the verification operation has not been performed is further filtered. In addition, the preset verification standard in this embodiment includes, but is not limited to, the data volume belongs to a specific type, the data volume can be accessed, or the read-write control authority of the data volume belongs to the local controller, and the like.
本实施方式通过仅对满足预设校验标准的数据卷执行数据结构树的校验,进一步确保了数据结构树校验的整体可靠性。This embodiment further ensures the overall reliability of the data structure tree verification by performing the verification of the data structure tree only on the data volumes that meet the preset verification standard.
在上述一系列实施方式的基础上,作为一种优选的实施方式,数据结构树包括B树、B+树以及平衡二叉树中一种或多种。On the basis of the foregoing series of implementations, as a preferred implementation, the data structure tree includes one or more of a B-tree, a B+ tree and a balanced binary tree.
需要说明的是,平衡二叉树是采用二分法思想把数据按规则组装成一个树形结构的数据,用这个树形结构的数据减少无关数据的检索,大大的提升了数据检索的速度;B树又名平衡多路查找树,与平衡二叉树相比查找路径不止两条;B+树相对于B树来说B+树更充分的利用了节点的空间,让查询速度更加稳定,其速度完全接近于二分法查找。It should be noted that the balanced binary tree adopts the idea of dichotomy to assemble data into a tree-structured data according to the rules. Using this tree-structured data reduces the retrieval of irrelevant data and greatly improves the speed of data retrieval; B-tree also Compared with the balanced binary tree, there are more than two search paths; compared with the B tree, the B+ tree makes more full use of the node space, making the query speed more stable, and its speed is completely close to the dichotomy method Find.
本实施方式进一步确保了数据结构树的多样性,进一步提高了对数据结构树进行校验的整体灵活性。This embodiment further ensures the diversity of the data structure tree, and further improves the overall flexibility of verifying the data structure tree.
请参见图3所示,本申请实施例提供了一种数据结构树校验装置,包括:Referring to FIG. 3, an embodiment of the present application provides a data structure tree verification device, including:
统计模块10,用于统计数据卷中的数据结构树;The
结构树判断模块11,用于判断数据结构树中是否存在未校验的目标数据结构树,若是,则依次调用线程校验模块12以及结构树判断模块11;The structure
线程校验模块12,用于调用线程对目标数据结构树执行校验操作;其中,线程的总数量大于1,且目标数据结构树与线程之间存在唯一对应关系。The
优选地,当数据卷的数量大于1时,结构树判断模块在当不存在未校验的目标数据结构树时,调用数据卷判断模块;Preferably, when the number of data volumes is greater than 1, the structure tree judgment module calls the data volume judgment module when there is no unverified target data structure tree;
数据卷判断模块,用于判断是否存在未执行校验操作的数据卷,若是,则基于未执行校验操作的数据卷调用统计模块,否则,调用校验停止模块;The data volume judgment module is used to judge whether there is a data volume that has not performed the verification operation, if so, call the statistics module based on the data volume that has not performed the verification operation, otherwise, call the verification stop module;
校验停止模块,用于停止校验操作。The verification stop module is used to stop the verification operation.
优选地,装置还包括:Preferably, the device further includes:
校验标准判断模块,用于判断未执行校验操作的数据卷是否满足预设校验标准,若是,则基于未执行校验操作的数据卷调用统计模块,否则,调用数据卷过滤模块;The verification standard judgment module is used to judge whether the data volume that has not performed the verification operation meets the preset verification standard, and if so, calls the statistics module based on the data volume that has not performed the verification operation;
数据卷过滤模块,用于过滤未执行校验操作的数据卷。The data volume filtering module is used to filter the data volumes that have not been verified.
本申请所提供的数据结构树校验装置,首先统计数据卷中的数据结构树,进而判断数据结构树中是否存在未校验的目标数据结构树,若存在未校验的目标数据结构树,则调用与目标数据结构树唯一对应的线程对该目标数据结构树执行校验操作,且线程的总数量大于1,并进一步执行判断数据结构树中是否存在未校验的目标数据结构树的步骤,以此完成对数据卷中全部数据结构树的校验。本装置通过对数据卷中未校验的目标数据结构树分配单独的线程,由于数据卷中的数据结构树的整体数量相对较大,因此能够相对确保线程整体的利用率,进而相对避免出现因可用的线程的数量大于数据卷的数量,而导致线程中存在空闲线程的情况,相对确保了对数据卷中的数据结构树进行校验过程的整体效率。The data structure tree verification device provided by the present application firstly counts the data structure tree in the data volume, and then judges whether there is an unverified target data structure tree in the data structure tree, if there is an unverified target data structure tree, Then call the thread uniquely corresponding to the target data structure tree to perform the verification operation on the target data structure tree, and the total number of threads is greater than 1, and further perform the step of judging whether there is an unverified target data structure tree in the data structure tree , so as to complete the verification of all data structure trees in the data volume. By assigning a separate thread to the unverified target data structure tree in the data volume, the device can relatively ensure the overall utilization rate of the thread because the overall number of the data structure tree in the data volume is relatively large, thereby relatively avoiding the occurrence of The number of available threads is greater than the number of data volumes, resulting in the existence of idle threads in the threads, which relatively ensures the overall efficiency of the process of verifying the data structure tree in the data volume.
此外,本申请实施例还提供一种数据结构树校验设备,包括:In addition, the embodiment of the present application also provides a data structure tree verification device, including:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行计算机程序时实现如上述的数据结构树校验方法的步骤。The processor is configured to implement the steps of the above-mentioned data structure tree verification method when executing the computer program.
本申请所提供的数据结构树校验设备,首先统计数据卷中的数据结构树,进而判断数据结构树中是否存在未校验的目标数据结构树,若存在未校验的目标数据结构树,则调用与目标数据结构树唯一对应的线程对该目标数据结构树执行校验操作,且线程的总数量大于1,并进一步执行判断数据结构树中是否存在未校验的目标数据结构树的步骤,以此完成对数据卷中全部数据结构树的校验。本设备通过对数据卷中未校验的目标数据结构树分配单独的线程,由于数据卷中的数据结构树的整体数量相对较大,因此能够相对确保线程整体的利用率,进而相对避免出现因可用的线程的数量大于数据卷的数量,而导致线程中存在空闲线程的情况,相对确保了对数据卷中的数据结构树进行校验过程的整体效率。The data structure tree verification device provided by the present application firstly counts the data structure tree in the data volume, and then judges whether there is an unverified target data structure tree in the data structure tree, if there is an unverified target data structure tree, Then call the thread uniquely corresponding to the target data structure tree to perform the verification operation on the target data structure tree, and the total number of threads is greater than 1, and further perform the step of judging whether there is an unverified target data structure tree in the data structure tree , so as to complete the verification of all data structure trees in the data volume. The device allocates a separate thread to the unverified target data structure tree in the data volume. Since the overall number of data structure trees in the data volume is relatively large, it can relatively ensure the overall utilization rate of the thread, and thus relatively avoid the occurrence of The number of available threads is greater than the number of data volumes, resulting in the existence of idle threads in the threads, which relatively ensures the overall efficiency of the process of verifying the data structure tree in the data volume.
此外,本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的数据结构树校验方法的步骤。In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned data structure tree verification method are implemented.
本申请所提供的计算机可读存储介质,首先统计数据卷中的数据结构树,进而判断数据结构树中是否存在未校验的目标数据结构树,若存在未校验的目标数据结构树,则调用与目标数据结构树唯一对应的线程对该目标数据结构树执行校验操作,且线程的总数量大于1,并进一步执行判断数据结构树中是否存在未校验的目标数据结构树的步骤,以此完成对数据卷中全部数据结构树的校验。本计算机可读存储介质通过对数据卷中未校验的目标数据结构树分配单独的线程,由于数据卷中的数据结构树的整体数量相对较大,因此能够相对确保线程整体的利用率,进而相对避免出现因可用的线程的数量大于数据卷的数量,而导致线程中存在空闲线程的情况,相对确保了对数据卷中的数据结构树进行校验过程的整体效率。The computer-readable storage medium provided by the present application firstly counts the data structure tree in the data volume, and then judges whether there is an unverified target data structure tree in the data structure tree, if there is an unverified target data structure tree, then Call the thread uniquely corresponding to the target data structure tree to perform a verification operation on the target data structure tree, and the total number of threads is greater than 1, and further perform the step of judging whether there is an unverified target data structure tree in the data structure tree, In this way, the verification of all data structure trees in the data volume is completed. The computer-readable storage medium allocates a separate thread to the unverified target data structure tree in the data volume. Since the overall number of data structure trees in the data volume is relatively large, the overall utilization rate of the thread can be relatively ensured, and further Relatively avoids the situation that the number of available threads is greater than the number of data volumes, which leads to the existence of idle threads in the threads, and relatively ensures the overall efficiency of the verification process of the data structure tree in the data volume.
以上对本申请所提供的一种数据结构树校验方法、装置、设备及存储介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。A method, apparatus, device and storage medium for verifying a data structure tree provided by the present application have been described above in detail. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can also be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is no such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010746737.3A CN111881140A (en) | 2020-07-29 | 2020-07-29 | Data structure tree checking method, device, equipment and storage medium |
PCT/CN2021/077348 WO2022021865A1 (en) | 2020-07-29 | 2021-02-23 | Data structure tree verification method, apparatus, and device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010746737.3A CN111881140A (en) | 2020-07-29 | 2020-07-29 | Data structure tree checking method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111881140A true CN111881140A (en) | 2020-11-03 |
Family
ID=73201205
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010746737.3A Withdrawn CN111881140A (en) | 2020-07-29 | 2020-07-29 | Data structure tree checking method, device, equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111881140A (en) |
WO (1) | WO2022021865A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112463042A (en) * | 2020-11-19 | 2021-03-09 | 苏州浪潮智能科技有限公司 | Data volume import data verification method, device, terminal and storage medium |
WO2022021865A1 (en) * | 2020-07-29 | 2022-02-03 | 苏州浪潮智能科技有限公司 | Data structure tree verification method, apparatus, and device, and storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9753813B1 (en) * | 2015-09-25 | 2017-09-05 | Amazon Technologies, Inc. | Data replication snapshots for persistent storage using operation numbers |
CN106326040B (en) * | 2016-08-27 | 2019-12-31 | 苏州浪潮智能科技有限公司 | A snapshot metadata management method and device |
CN106445412A (en) * | 2016-09-14 | 2017-02-22 | 郑州云海信息技术有限公司 | Data volume compression ratio assessment method and system |
CN110688377B (en) * | 2019-08-30 | 2020-07-17 | 阿里巴巴集团控股有限公司 | Method and device for updating state Merck tree |
CN110825734B (en) * | 2019-10-09 | 2023-04-28 | 上海交通大学 | Concurrent update method and read-write system of balanced tree |
CN111881140A (en) * | 2020-07-29 | 2020-11-03 | 苏州浪潮智能科技有限公司 | Data structure tree checking method, device, equipment and storage medium |
-
2020
- 2020-07-29 CN CN202010746737.3A patent/CN111881140A/en not_active Withdrawn
-
2021
- 2021-02-23 WO PCT/CN2021/077348 patent/WO2022021865A1/en active Application Filing
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022021865A1 (en) * | 2020-07-29 | 2022-02-03 | 苏州浪潮智能科技有限公司 | Data structure tree verification method, apparatus, and device, and storage medium |
CN112463042A (en) * | 2020-11-19 | 2021-03-09 | 苏州浪潮智能科技有限公司 | Data volume import data verification method, device, terminal and storage medium |
CN112463042B (en) * | 2020-11-19 | 2022-08-12 | 苏州浪潮智能科技有限公司 | A data volume import data verification method, device, terminal and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2022021865A1 (en) | 2022-02-03 |
WO2022021865A9 (en) | 2022-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022021865A1 (en) | Data structure tree verification method, apparatus, and device, and storage medium | |
CN109474640B (en) | Malicious crawler detection method, device, electronic device and storage medium | |
US10241856B2 (en) | Memory quarantine | |
CN111708992B (en) | Report data access method, device, electronic equipment and storage medium | |
CN111857721A (en) | Verification method, data acquisition method, device and storage device of SQL statement | |
WO2021004266A1 (en) | Data insertion method and apparatus, device and storage medium | |
CN103345439B (en) | A kind of full link monitoring method of health state of information system and device | |
CN111858466A (en) | A data storage method, device, device and storage medium | |
WO2025011208A1 (en) | Method and apparatus for extracting query permission points on basis of data lake, and device and medium | |
CN112231232A (en) | Method, device and device for determining test data model and generating test data | |
CN108959584B (en) | A method and device for processing graph data based on community structure | |
CN112181790B (en) | Capacity statistical method and system of storage equipment and related components | |
CN114356898A (en) | Data storage method and device, electronic equipment and storage medium | |
CN118838930A (en) | A database management system and method | |
CN116680299B (en) | Database query method, system, storage medium and device | |
CN108021678A (en) | A kind of compact-sized key-value pair storage organization and quick key-value pair lookup method | |
US12292973B2 (en) | Query generalization for prevention of injection attacks | |
CN114610644B (en) | Method and device for testing database | |
WO2023030461A1 (en) | Distributed database detection method and apparatus | |
CN107368434B (en) | Device and method for verifying Cache consistency protocol | |
CN116401229A (en) | Database data verification method, device and equipment | |
KR102182573B1 (en) | Apparatus for Setting Access Permission in Large-Scale Data Environment and Computer-Readable Recording Medium with Program therefor | |
CN110413617B (en) | Method for dynamically adjusting hash table group according to size of data volume | |
CN106682005A (en) | Method for determining database hot page and device | |
CN113032400B (en) | High-performance TopN query method, system and medium for mass data |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20201103 |