Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

AVL tree-based data writing method and apparatus

A technology of data writing and AVL tree, which is applied in the computer field, can solve the problems of high performance overhead and achieve the effect of improving performance

Inactive Publication Date: 2016-03-09
INSPUR BEIJING ELECTRONICS INFORMATION IND
View PDF3 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, this processing method does not conflict with the search path of the two requests to modify the node, that is to say, the request that the search path does not conflict can be issued at the same time, but it must wait for the previous request to be completed before it can be issued. , the time consumed by this waiting process brings additional performance overhead, and it may not be two requests, but more requests, then the performance overhead will be even greater

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • AVL tree-based data writing method and apparatus
  • AVL tree-based data writing method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

specific Embodiment approach

[0075] As a specific implementation manner, the above-mentioned judging module 300 may also include:

[0076] The positioning unit is used to determine the search path according to the size of the node value written in the data of the current concurrent write operation and the characteristics of the AVL tree, and locate the position of the second node actually written;

[0077] A calculation unit, configured to calculate the balance factor of the parent node of the second node, and recursively calculate the balance factors of other nodes upwards until the first node whose balance factor value is 2 or -2 is calculated;

[0078] an opening unit, configured to open the lock state of the first node, and make corresponding adjustments according to the value of the balance factor;

[0079] A release unit, configured to release the lock state of the first node after the write operation is completed.

[0080] As a specific implementation manner, the above-mentioned opening unit can a...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention discloses an AVL tree-based data writing method and apparatus, which use a read-write lock for performing concurrency control on data writing. The method comprises: receiving a data write request; determining a search path according to sizes of written node value and characteristics of an AVL tree; determining whether each node in the search path is in a lock state, wherein the lock state is that when a first node in a currently concurrent write operation is a root node of a subtree locally adjusted, the first node is set into a locked state; If no node in the search path is in the lock state, performing the write operation; and if a certain node in the search path is in the lock state, blocking the write operation up to the locked node until the lock state of the locked node is canceled. According to the AVL tree-based data writing method and apparatus provided by the present invention, parallel processing is allowed to be performed on the write operation without a conflict in the local of the AVL tree, thereby improving data writing performance.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to an AVL tree-based data writing method and device. Background technique [0002] AVL tree, also known as Balanced Binary Tree, has the following properties: it is an empty tree or the absolute value of the height difference between its left and right subtrees does not exceed 1, and both left and right subtrees are a balanced binary tree. Because of its special structure, it has better performance than linear data structures in indexing and storing single-threaded data; however, the lock mechanism introduced by concurrency protection is not perfect during multi-threaded access, resulting in performance bottlenecks. [0003] Red-black tree (RedBlackTree) is a self-balancing binary search tree. Similar to AVL tree, the red-black tree maintains the balance of the binary search tree through specific operations during insertion and deletion operations, thereby obtaining a higher searc...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30
CPCG06F16/9027
Inventor 杨敏
Owner INSPUR BEIJING ELECTRONICS INFORMATION IND
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products