Data merging and sorting method and apparatus

A sorting method and data technology, applied in the database field, can solve the problem of low efficiency of merging and sorting of massive data, and achieve the effect of avoiding adverse effects, avoiding reading and writing operations, and improving system performance.

Active Publication Date: 2018-04-13
SHANGHAI DAMENG DATABASE
View PDF4 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] Embodiments of the present invention provide a method and device for merging and sorting data to solve the problem of low efficiency in merging and sorting massive data in the prior art

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
  • Data merging and sorting method and apparatus
  • Data merging and sorting method and apparatus
  • Data merging and sorting method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0033] figure 1 It is a flow chart of a method for merging and sorting data provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of merging and sorting massive data according to available memory resources, and the method can be executed by a data merging and sorting device , the device can be realized by means of software and / or hardware, and is generally integrated into a terminal device, such as a PC or a tablet computer. Such as figure 1 As shown, the method of this embodiment specifically includes:

[0034] S110. According to at least two sorted sub-tables corresponding to the data to be sorted, generate sub-table control information corresponding to each of the sorted sub-tables, wherein the sub-table control information includes data in the sorted sub-tables Minimum, maximum, and access addresses for sorted sublists.

[0035]Generally speaking, the sorting buffer in the memory resources performs merge and sort operations on...

Embodiment 2

[0057] figure 2It is a flow chart of a method for merging and sorting data provided by Embodiment 2 of the present invention. Embodiment 2 of the present invention is optimized on the basis of Embodiment 1. Specifically, according to the type of sorting, the control information of each sub-table is optimized. Sorting, the operation of obtaining the subtable control information queue is further optimized, such as figure 2 As shown, Embodiment 2 of the present invention specifically includes:

[0058] S210. According to at least two sorted sub-tables corresponding to the data to be sorted, generate sub-table control information corresponding to each of the sorted sub-tables, wherein the sub-table control information includes data in the sorted sub-tables Minimum, maximum, and access addresses for sorted sublists.

[0059] S220. According to the sorting type, sort the control information of each sub-list in ascending order of the smallest value to obtain a sub-list control in...

Embodiment 3

[0072] image 3 It is a flow chart of a data merging and sorting method provided by Embodiment 3 of the present invention. Embodiment 3 of the present invention is optimized and improved on the basis of the above-mentioned embodiments, and the sub-table control information in the queue according to the sub-table control information The order of arrangement, order to obtain at least one sorted subtable that satisfies the merge condition and join the merge queue is further explained, such as image 3 As shown, the method of the third embodiment of the present invention specifically includes:

[0073] S310. According to at least two sorted sub-tables corresponding to the data to be sorted, generate sub-table control information corresponding to each of the sorted sub-tables, wherein the sub-table control information includes data in the sorted sub-tables Minimum, maximum, and access addresses for sorted sublists.

[0074] S320. According to the sorting type, sort the sub-table ...

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

Embodiments of the invention disclose a data merging and sorting method and apparatus. The method comprises the steps of according to at least two sorted sub-tables corresponding to to-be-sorted data,generating sub-table control information corresponding to the sorted sub-tables respectively; obtaining a sub-table control information queue; according to an arrangement sequence of the sub-table control information in the sub-table control information queue, sequentially obtaining at least one sorted sub-table meeting a merging condition and adding the sub-tables to a merging queue; performingmerging and sorting on the sorted sub-tables in the merging queue, and obtaining and outputting a merging and sorting result of the to-be-sorted data; and if it is determined that all data in the at least one sorted sub-table in the merging queue is output, continuing to obtain the sorted sub-tables meeting the merging condition and adding the sub-tables to the merging queue, until all the sortedsub-tables are added to the merging queue. The flexibility of memory resource use can be improved and the data merging and sorting efficiency is improved.

Description

technical field [0001] The embodiments of the present invention relate to the technical field of databases, in particular to a method and device for merging and sorting data. Background technique [0002] With the continuous and rapid development of information technology and the Internet, database technology has developed into a very important technology in information science, widely used in business management, government office, scientific research and engineering development and other fields. In database applications, a two-stage multi-way merge sort algorithm is often used to solve the sorting problem of massive data. The algorithm includes the following two stages: [0003] 1. Divide the data to be sorted into N pieces, and sort each piece to form N subtables, where N is a positive integer; [0004] 2. Merge N sub-tables to form a single sorting table. The merging process is: perform data block processing for each sub-table, load the first data block in the N sub-tab...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/24549G06F16/24556G06F16/24578
Inventor 王攀望声宜
Owner SHANGHAI DAMENG DATABASE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products