A method and system for finding maximum and minimum values ​​in big data

Through the method of multi-threaded paging processing and filtering data reference values, the problem of resource waste and administrator burden caused by data table segmentation in the existing technology is solved, efficient maximum value query is realized, and query efficiency and resource utilization are improved.

CN114077618BActive Publication Date: 2024-10-22LINDE CHINA FORKELEVATOR TRUCK CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010825533.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-17
Publication Date
2024-10-22
Estimated Expiration
2040-08-17

AI Technical Summary

Technical Problem

When existing technology processes big data, in order to improve data query efficiency, data tables need to be segmented and business requirements predicted, resulting in a waste of resources and an increase in the burden on database administrators, and query efficiency is affected when business requirements change.

Method used

Use multi-threaded paging processing method to receive the maximum value query request, obtain configuration data and table data, start multiple threads for paging processing, construct filter data reference values, filter and compare based on the maximum value type, obtain N maximum values, and avoid Splitting the table improves query efficiency.

Benefits of technology

Without dividing the table, the efficiency of querying the most valuable data is improved, resources are saved, the burden on the database administrator is reduced, and the need for communication with business personnel and rule formulation is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114077618B_ABST
    Figure CN114077618B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for searching for maximum values ​​of big data, the method comprising: receiving maximum value query request information, obtaining configuration data and table data; starting P threads to perform paging processing on the table data, and obtaining P groups of data according to the data processed by each thread; obtaining the maximum value and minimum value of each group of data in the P groups of data, storing the maximum value in a first object set, and storing the minimum value in a second object set; filtering the P groups of data based on the maximum value type to obtain the filtered groups; and comparing the data of the filtered groups with the values ​​in the first object set or the values ​​in the second object set in sequence based on the maximum value type to obtain N maximum values. The present invention does not need to segment the table, improves the efficiency of querying the maximum value data, and saves the resources used for segmenting the table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data query technology, and in particular to a method and system for searching maximum values ​​of large data. Background Art

[0002] In order to improve the efficiency of searching for the maximum value of data that is relatively large but has not yet reached the level of massive data, the existing technology often uses the method of massive data for processing. Specifically, by horizontally splitting the data table and storing it in different libraries, it is routed to a specific library for search according to the search conditions. This implementation method requires specific rules to be formulated according to the business before the table is split, and the data is split on the basis of this rule. For example, to conduct statistics on a certain data table every month, it is necessary to obtain the sales volume of forklifts in the past five days, so when splitting the table, the data is first sorted in descending order by time. Therefore, when formulating rules, it is necessary to make certain predictions about the business. The main business determines how the database administrator needs to organize the data. When the prediction conflicts with future business needs, it will inevitably affect the efficiency of data query. Whenever there is new data, the data is routed to a specific library according to the formulated rules. For example, in the above example, the data is in descending order by time, so when inserting data, the time column is used as the participating column to route it to a specific library. Summary of the invention

[0003] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art and to propose a method and system for searching the maximum value of large data, which does not require table segmentation, improves the efficiency of querying the maximum value data, and saves resources used for table segmentation.

[0004] The present invention adopts the following technical solution:

[0005] In one aspect, the present invention provides a method for finding a maximum value of large data, comprising:

[0006] Receive the maximum value query request information, obtain configuration data including the maximum value type, the number of pages P and the maximum value number N, and obtain the table data and the total data volume TN corresponding to the maximum value query request information;

[0007] Start P threads to perform paging processing on the table data, wherein P-1 threads process the same amount of data and another thread processes the remaining data; store the data results processed by each thread into an independent group to obtain P groups of data;

[0008] Obtain the maximum value and the minimum value of each group of data in P groups of data, store the P maximum values ​​and their corresponding groups into the first object set, and store the P minimum values ​​and their corresponding groups into the second object set;

[0009] Based on the maximum value type, obtain the maximum value in the second object set, discard the group and the data in the group where the value in the first object set is smaller than the maximum value, and obtain the filtered group; or; obtain the minimum value in the first object set, discard the group and the data in the group where the value in the second object set is larger than the minimum value, and obtain the filtered group;

[0010] Based on the maximum value type, the data of the filtered group is compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values.

[0011] Preferably, if the maximum value type is to find the maximum value, the maximum value in the second object set is obtained, and the group containing the value whose value in the first object set is smaller than the maximum value and the data in the group are discarded to obtain the filtered group.

[0012] Preferably, obtaining the maximum value in the second object set, discarding the group and the data in the group where the value in the first object set is smaller than the maximum value, and obtaining the filtered group specifically includes:

[0013] The first object set and the second object set are sorted according to numerical values, the maximum value MinArr_max in the second object set is obtained, and the values ​​MaxArr_min_p other than the maximum value in the first object set are obtained in ascending order, and MaxArr_min_p is compared with the MinArr_max; if the MaxArr_min_p is greater than or equal to the MinArr_max, the P groups of data are retained; otherwise, the group corresponding to MaxArr_min_p and the data in the group are discarded, and the comparison is continued until the remaining groups are retained or all MaxArr_min_ps are compared.

[0014] Preferably, if the maximum value type is to find the minimum value, the minimum value in the first object set is obtained, and the group containing the value greater than the minimum value in the second object set and the data in the group are discarded to obtain the filtered group.

[0015] Preferably, obtaining the minimum value in the first object set, discarding the group and the data in the group where the value in the second object set is greater than the minimum value, and obtaining the filtered group specifically includes:

[0016] Sort the first object set and the second object set by numerical value, obtain the minimum value MaxArr_min in the first object set, and obtain the values ​​MinArr_max_p other than the minimum value in the second object set in descending order, and compare MinArr_max_p with the MaxArr_min; if the MinArr_max_p is less than or equal to the MaxArr_min, retain the P groups of data; otherwise, discard the group corresponding to MinArr_max_p and the data in the group, and continue to compare until the remaining groups are retained or all MinArr_max_ps are compared.

[0017] Preferably, after obtaining the filtered group, the method further includes:

[0018] For each group after filtering, extract the N maximum values ​​in the group to form a new group, and obtain the maximum value group after filtering;

[0019] The step of comparing the data of the filtered group with the values ​​in the first object set or the values ​​in the second object set in sequence based on the maximum value type to obtain N maximum values ​​includes:

[0020] Based on the extreme value type, the data of the filtered extreme value group are compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N extreme values.

[0021] Preferably, if the maximum value type is to find the maximum value, the data of the filtered group is compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values, specifically including:

[0022] Get the maximum value and the corresponding group in the first object set, compare the data in the group corresponding to the values ​​in the first object set except the maximum value with the values ​​in the group corresponding to the current maximum value in order from large to small to obtain N-1 larger values, and store the maximum value and the first N-1 larger values ​​in a result set; the current maximum value refers to the larger value obtained in each round of comparison. When comparing for the first time, the current maximum value is taken as the maximum value in the first object set.

[0023] Preferably, if the maximum value type is to find the minimum value, the data of the filtered group is compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values, specifically including:

[0024] Get the minimum value and the corresponding group in the second object set, compare the data in the group corresponding to the values ​​in the second object set except the minimum value with the values ​​in the group corresponding to the current minimum value in ascending order to obtain N-1 smaller values, and store the minimum value and the first N-1 smaller values ​​in a result set; the current minimum value refers to the smaller value obtained in each round of comparison. When comparing for the first time, the current minimum value is the minimum value in the first object set.

[0025] Preferably, the configuration data also includes a sorting type; the sorting type includes ascending or descending; if the sorting type is ascending, the obtained N maximum values ​​are arranged in ascending order; if the sorting type is descending, the obtained N maximum values ​​are arranged in descending order.

[0026] In another aspect, the present invention provides a large data maximum value search system, comprising:

[0027] A data acquisition module, used to receive the maximum value query request information, acquire configuration data including the maximum value type, the number of pages P and the maximum value number N, and acquire the table data and the total data volume TN corresponding to the maximum value query request information;

[0028] A paging multi-thread processing module is used to start P threads to perform paging processing on the table data, wherein P-1 threads process the same amount of data and another thread processes the remaining data; the data processed by each thread is stored in an independent group to obtain P groups of data;

[0029] A filter data reference value construction module is used to obtain the maximum value and the minimum value of each group of data in P groups of data, store the P maximum values ​​and their corresponding groups into a first object set, and store the P minimum values ​​and their corresponding groups into a second object set;

[0030] A data filtering module, based on the maximum value type, obtains the maximum value in the second object set, discards the group and the data in the group where the value in the first object set is smaller than the maximum value, and obtains the filtered group; or obtains the minimum value in the first object set, discards the group and the data in the group where the value in the second object set is larger than the minimum value, and obtains the filtered group;

[0031] The maximum value acquisition module compares the data of the filtered group with the values ​​in the first object set or the values ​​in the second object set in sequence based on the maximum value type to obtain N maximum values.

[0032] It can be seen from the above description of the present invention that, compared with the prior art, the present invention has the following beneficial effects:

[0033] The present invention starts several threads to perform paging processing on table data, thereby improving the efficiency of querying the maximum value data without segmenting the table; since there is no need to segment the table, a large amount of resources is saved, and there is no need to apply for new resources, such as virtual machines, disks, etc., to store the segmented table; since there is no need to segment the table, the burden of the DBA (database administrator) can be reduced, so that the database administrator does not need to do a lot of work to segment the table, such as reducing the communication between the DBA and the business personnel, including the formulation of specific rules, business prediction, etc.

[0034] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention so that it can be implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below.

[0035] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flow chart of the method of the present invention;

[0037] Figure 2 A flowchart of a reference value for constructing filtering data of the present invention;

[0038] Figure 3 A flowchart of filtering data when searching for a maximum value according to the present invention;

[0039] Figure 4 A flowchart of sorting and obtaining the maximum value when searching for the maximum value of the present invention;

[0040] Figure 5 A flow chart of filtering data when searching for a minimum value according to the present invention;

[0041] Figure 6 A flowchart of sorting and obtaining the maximum value when searching for the minimum value of the present invention;

[0042] Figure 7 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION

[0043] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0044] See also Figure 1 As shown, on the one hand, the present invention provides a method for finding a maximum value of large data, comprising:

[0045] S101, obtaining configuration data and table data: receiving a maximum value query request information, obtaining configuration data including a maximum value type, a number of pages P and a maximum value number N, and obtaining table data and a total data volume TN corresponding to the maximum value query request information.

[0046] S102, start threads to perform paging processing: start P threads to perform paging processing on the table data, where P-1 threads process the same amount of data and another thread processes the remaining data; store the data results processed by each thread into an independent group to obtain P groups of data.

[0047] S103, constructing reference values ​​for filtering data: obtaining the maximum value and the minimum value of each group of data in P groups of data, storing the P maximum values ​​and their corresponding groups into a first object set, and storing the P minimum values ​​and their corresponding groups into a second object set;

[0048] S104, filtering data: based on the maximum value type, obtaining the maximum value in the second object set, discarding the group containing values ​​in the first object set that are smaller than the maximum value and the data in the group, to obtain the filtered group; or obtaining the minimum value in the first object set, discarding the group containing values ​​in the second object set that are larger than the minimum value and the data in the group, to obtain the filtered group;

[0049] S105, obtaining the maximum value: based on the maximum value type, comparing the data of the filtered group with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values.

[0050] In S101, the table data and the total data volume TN corresponding to the maximum value query request information are obtained from the database. Specifically, the table data can be forklift-related sales data, forklift operation data, etc., or application data in other fields, which is not specifically limited in this embodiment.

[0051] Specifically, the S102 includes:

[0052] According to the number of pages P obtained, P threads for processing paging are started. The amount of data processed by the first P-1 threads is TN / P, and N maximum values ​​are taken from these data. The amount processed by the Pth thread is TN-(P-1)TN / P, recorded as R. If R<=N, the R data are sorted and all retained, otherwise, the N maximum values ​​are taken from R. Finally, P groups of data are obtained, of which the amount of the first P-1 groups of data is N, and the amount of the Pth group of data is N or R.

[0053] Further, if the maximum value type is to find the maximum value, then the N maximum values ​​of the data processed by each thread are obtained, stored separately, and P groups of data are obtained. If the amount of data processed by the thread is less than N, all the data processed by the thread are stored. If the maximum value type is to find the minimum value, then the N minimum values ​​of the data processed by each thread are obtained, stored separately, and P groups of data are obtained. If the amount of data processed by the thread is less than N, all the data processed by the thread are stored.

[0054] For details, see Figure 2 As shown, the S103 includes:

[0055] First, extract the maximum value and minimum value of each of the P groups in S102, such as A1[max, min], A2[max, min], A3[max, min]…Ap[max, min], and then transfer all the maximum values ​​to two object sets respectively, wherein the P maximum values ​​and their corresponding groups MaxArray[HashMap(Raw_A1, max), HashMap(Raw_A2, max), HashMap(Raw_A3, max)…HashMap(Raw_Ap, max)] are stored in the first object set, and the P minimum values ​​and their corresponding groups MinArray[HashMap(Raw_A1, min), HashMap(Raw_A2, min), HashMap(Raw_A3, min)…HashMap(Raw_Ap, min)] are stored in the second object set to obtain the reference value of the filtered data.

[0056] In one embodiment, see Figure 3 As shown, if the maximum value type is to find the maximum value, then S104 includes:

[0057] S1041, sorting the first object set MaxArray by numerical value to obtain MaxArray_Sort, extracting the minimum value MaxArr_min_n (1≤n≤P-1, first comparison, n=1) in MaxArray_Sort, and recording the corresponding group;

[0058] S1042, sort the second object set MinArray according to the numerical value, and extract the maximum value MinArr_max.

[0059] S1043. Compare the magnitudes of MaxArr_min_n and MinArr_max. If MaxArr_min_n >= MinArr_max, retain the data of all groups. If MaxArr_min_n < MinArr_max, discard all the data of the group corresponding to MaxArr_min_n, and take the second smallest value MaxArr_min_(n + 1) in MaxArray_Sort. Then continue to compare the magnitudes of MaxArr_min_(n + 1) and MinArr_max. If MaxArr_min_(n + 1) >= MinArr_max, retain the data of the remaining groups. Otherwise, discard the data of the group corresponding to MaxArr_min_(n + 1).

[0060] S1044. Let n = n + 1, and repeat S1043 until the comparison between MaxArr_min_n and MinArr_max is completed. MaxArr_min_P must be greater than MinArr_max, so it only goes up to P - 1.

[0061] S1045. For each remaining group after the comparison, extract the N largest values from each group to form a new group, and sort the new group in descending order to obtain the filtered maximum and minimum value group Raw_Ax_max (x is a natural number representing the corresponding group number).

[0062] See Figure 4 As shown, if the maximum and minimum value type is to find the maximum value, then S105 includes:

[0063] S1051. Extract the maximum value Max_ms_1 in MaxArray_Sort in S104, locate the group where it is located, and store Max_ms_1 into the result set, that is, Result_array[Max_ms_1].

[0064] S1052, extract the kth (starting from 2) largest value Max_Ax_k (k>=2) in the group Raw_Ax_max and compare it with the nth (starting from 2) largest value Max_ms_n (n>=2) in MaxArray_Sort, store the larger value between the two in Result_array, and locate the group where this value is located. The next comparison of the value in MaxArray_Sort depends on whether Max_ms_n has been stored in Result_array after the previous comparison. If Max_ms_n has not been stored in Result_array, the k+1th largest value in Raw_Ax_max will be compared with Max_ms_n next time. Otherwise, a new group, i.e. the group where Max_ms_n is located, will be located, and the kth (k=2 at this time) largest value in the new group will be compared with Max_ms_(n+1).

[0065] S1053, let k=k+1, n=n+1, and repeat step S1052 until the number in Result_array is equal to N.

[0066] In another embodiment, see Figure 5 As shown, if the maximum value type is to find the minimum value, then S104 includes:

[0067] S1041, sorting the second object set MinArray by numerical value to obtain MinArray_Sort, extracting the maximum value MinArr_max_n (1≤n≤P-1, first comparison, n=1) in MinArray_Sort, and recording the corresponding group;

[0068] S1042, sort the first object set MaxArray according to numerical values, and extract the minimum value MaxArr_min.

[0069] S1043, compare MaxArr_min with MinArr_max_n. If MinArr_max_n<=MaxArr_min, keep all the data of the group. If MinArr_max_n>MaxArr_min, discard all the data of the group corresponding to MinArr_max_n, and take the second largest value MinArr_max_(n+1) in MinArray_Sort, and continue to compare MinArr_max_(n+1) with MaxArr_min. If MinArr_max_(n+1)<=MaxArr_min, keep all the data of the remaining groups, otherwise discard the data of the group corresponding to MinArr_max_(n+1);

[0070] S1044, set n=n+1, repeat S1043 until MixArr_max_n is compared with MaxArr_min. MinArr_max_P is definitely smaller than MaxArr_min, so it only reaches P-1.

[0071] S1045, for each group remaining after the comparison, extract the N maximum values ​​in each group to form a new group, and arrange the new groups in ascending order to obtain the filtered maximum value group Raw_Ax_min (x is a natural number, indicating the corresponding group number).

[0072] See also Figure 6 As shown, if the maximum value type is to find the minimum value, then S105 includes:

[0073] S1051, extract the minimum value Min_ms_1 in MinArray_Sort in S104, locate it to the group where it belongs, and store Min_ms_1 in the result set, that is, Result_array[Min_ms_1];

[0074] S1052, extract the kth (starting from 2) small value Min_Ax_k (k>=2) in the group Raw_Ax_min and compare it with the nth (starting from 2) small value Min_ms_n (n>=2) in MinArray_Sort, store the smaller value between the two in Result_array, and locate the group where this value is located. The next comparison of the value in MinArray_Sort depends on whether Min_ms_n has been stored in Result_array after the previous comparison. If Min_ms_n has not been stored in Result_array, the next comparison will compare the k+1th small value in Raw_Ax_min with Min_ms_n. Otherwise, the new group where Min_ms_n is located will be located, and the kth (k=2) small value in the new group will be compared with Min_ms_(n+1).

[0075] S1053, let k=k+1, n=n+1, and repeat step S1052 until the number in Result_array is equal to N.

[0076] In this embodiment, the configuration data also includes a sorting type; the sorting type includes ascending or descending; if the sorting type is ascending, the obtained N maximum values ​​are arranged in ascending order; if the sorting type is descending, the obtained N maximum values ​​are arranged in descending order.

[0077] The following is an example of querying the maximum value in a data table. In specific applications, the total amount of data in the table is much larger than the example below. This embodiment is only for ease of understanding.

[0078] If there are 47 records in the current data table, follow the above steps to find the maximum value for these 47 records.

[0079] Original table data in the database:

[0080] Table: [23, 44, 56, 82, 39, 78, 24, 53, 22, 90, 65, 66, 98, 78, 96, 72, 88, 76, 69, 68, 62, 84, 8 7, 51, 29, 10, 16, 5, 88, 84, 21, 29, 56, 58, 54, 62, 19, 17, 35, 64, 3, 13, 71, 120, 0, 874, 342]

[0081] 1. The user inputs P:5; N:6; MP:1, T:-1. That is, the largest 6 values ​​are obtained in 5 pages, 1 means to find the maximum value, and -1 means to sort in descending order;

[0082] Second, obtain the data in the table and the total amount of data TN:47 through the interface.

[0083] Third, start five threads to obtain five sets of data in paging as follows:

[0084] Raw_A1:[23, 44, 56, 82, 39, 78, 24, 53, 22, 90]

[0085] Raw_A2:[65, 66, 98, 78, 96, 72, 88, 76, 69, 68]

[0086] Raw_A3:[62, 84, 87, 51, 29, 10, 16, 5, 88, 84]

[0087] Raw_A4:[21, 29, 56, 58, 54, 62, 19, 17, 35, 64]

[0088] Raw_A5:[3, 13, 71, 120, 0, 874, 342]

[0089] Fourth, construct data filtering reference values ​​based on the results of step 3. First, extract the maximum and minimum values ​​in each group. The results are as follows:

[0090] A1[90, 22], A2[98, 65], A3[88, 5], A4[64, 17], A5[874, 0]. After that, all the maximum and minimum values are respectively stored in two object sets: MaxArray[HashMap(Raw_A1, 90), HashMap(Raw_A2, 98), HashMap(Raw_A3, 88), HashMap(Raw_A4, 64), HashMap(Raw_A5, 874)], MinArray[HashMap(Raw_A1, 22), HashMap(Raw_A2, 65), HashMap(Raw_A3, 5), HashMap(Raw_A4, 17), HashMap(Raw_A5, 3)].

[0091] V. Filter the data, sort MaxArray and MinArray respectively. The results are as follows: MaxArray_Sort[874, 98, 90, 88, 64], MinArray_Sort[65, 22, 17, 5, 3]. Extract the first minimum value in MaxArray_Sort, MaxArr_min_1 = 64. Extract the maximum value in MinArray_Sort, MinArr_max = 65. Since MaxArr_min_1 < MinArr_max, discard the data of the group corresponding to MaxArr_min_1, that is, the Raw_A4 group. Extract the second minimum value in MaxArray_Sort, MaxArr_min_2 = 88. Since MaxArr_min_2 > MinArr_max, keep the data of the remaining groups, that is, Raw_A1, Raw_A2, Raw_A3, Raw_A5.

[0092] VI. Extract the largest six numbers of each group obtained in V, that is:

[0093] Raw_A1_max[90, 82, 78, 56, 53, 44],

[0094] Raw_A2_max[98, 96, 88, 76, 72, 69],

[0095] Raw_A3_max[88, 87, 84, 84, 62, 51],

[0096] Raw_A5_max[874, 342, 120, 71, 13, 3].

[0097] (6.1) Extract the maximum value among the five MaxArray_Sorts, i.e. 874, and locate it in the group where it belongs, i.e. Raw_A5_max, and store 874 in the result set, i.e. Result_array

[874] .

[0098] (6.2) Extract the second largest value 342 in Raw_A5_max and compare it with the second largest value 98 in MaxArray_Sort. 342>98, so 342 is stored in the result set, that is, Result_array[874,342], and continue to locate in the Raw_A5_max group.

[0099] (6.3) Extract the third largest value 120 from Raw_A5_max and compare it with the second largest value 98 in MaxArray_Sort. If 120>98, then store 120 in the result set, i.e., Result_array[874,342,120], and continue to locate in the Raw_A5_max group.

[0100] (6.4) Extract the fourth largest value 71 from Raw_A5_max and compare it with the second largest value 98 in MaxArray_Sort. If 71<98, 98 is stored in the result set, i.e., Result_array[874,342,120,98]. At this time, the group where 98 is located is located, i.e., Raw_A2_max.

[0101] (6.5) Extract the second largest value 96 from Raw_A2_max and compare it with the third largest value 90 in MaxArray_Sort. If 96>90, then store 96 in the result set, i.e., Result_array[874,342,120,98,96], and continue to locate in the Raw_A2_max group.

[0102] (6.6) Extract the third largest value 88 in Raw_A2_max and compare it with the third largest value 90 in MaxArray_Sort. 88<90. Store 90 in the result set, i.e., Result_array[874,342,120,98,96,90]. At this time, the number of items in Result_array has reached the user-configured value N, i.e., 6. The comparison ends and the obtained Result_array is the final result.

[0103] See also Figure 7 As shown, on the other hand, the present invention provides a large data maximum value search system, comprising:

[0104] The data acquisition module 701 is used to receive the maximum value query request information, acquire the configuration data including the maximum value type, the number of pages P and the maximum value number N, and acquire the table data and the total data volume TN corresponding to the maximum value query request information;

[0105] The paging multi-thread processing module 702 is used to start P threads to perform paging processing on the table data, wherein P-1 threads process the same amount of data and another thread processes the remaining data; the data results processed by each thread are stored in an independent group to obtain P groups of data;

[0106] The filter data reference value construction module 703 is used to obtain the maximum value and the minimum value of each group of data in the P groups of data, store the P maximum values ​​and their corresponding groups into the first object set, and store the P minimum values ​​and their corresponding groups into the second object set;

[0107] The data filtering module 704 obtains the maximum value in the second object set based on the maximum value type, discards the group containing values ​​in the first object set that are smaller than the maximum value and the data in the group, and obtains the filtered group; or obtains the minimum value in the first object set, discards the group containing values ​​in the second object set that are larger than the minimum value and the data in the group, and obtains the filtered group;

[0108] The maximum value acquisition module 705 compares the data of the filtered group with the values ​​in the first object set or the values ​​in the second object set in sequence based on the maximum value type to obtain N maximum values.

[0109] A specific implementation of a large data maximum value search system and a large data maximum value search method are described in detail in this embodiment.

[0110] Finally, it should be noted that, in the present embodiment, 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 that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. In addition, the above-mentioned step identification is only for the convenience of reading, and the steps can be adjusted accordingly during the specific implementation.

[0111] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0112] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for finding the maximum value of big data, characterized in that: include: Receive the maximum value query request information, obtain configuration data including the maximum value type, the number of pages P and the maximum value number N, and obtain the table data and the total data volume TN corresponding to the maximum value query request information; Start P threads to perform paging processing on the table data, where P-1 threads process the same amount of data and another thread processes the remaining data; The data results processed by each thread are stored in an independent group to obtain P groups of data; Obtain the maximum value and the minimum value of each group of data in P groups of data, store the P maximum values ​​and their corresponding groups into the first object set, and store the P minimum values ​​and their corresponding groups into the second object set; Based on the maximum value type, obtain the maximum value in the second object set, discard the group and the data in the group where the value in the first object set is smaller than the maximum value, and obtain the filtered group; or; obtain the minimum value in the first object set, discard the group and the data in the group where the value in the second object set is larger than the minimum value, and obtain the filtered group; Based on the maximum value type, the data of the filtered group is compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values.

2. The method for finding the maximum value of large data according to claim 1, characterized in that: If the maximum value type is to find the maximum value, the maximum value in the second object set is obtained, and the group and the data in the group where the value in the first object set is smaller than the maximum value are discarded to obtain the filtered group.

3. The method for finding the maximum value of big data according to claim 2, characterized in that: Obtaining a maximum value in the second object set, discarding the group and the data in the group where the value in the first object set is smaller than the maximum value, and obtaining the filtered group, specifically includes: The first object set and the second object set are sorted according to numerical values, the maximum value MinArr_max in the second object set is obtained, and the values ​​MaxArr_min_p other than the maximum value in the first object set are obtained in ascending order, and MaxArr_min_p is compared with the MinArr_max; if the MaxArr_min_p is greater than or equal to the MinArr_max, the P groups of data are retained; otherwise, the group corresponding to MaxArr_min_p and the data in the group are discarded, and the comparison is continued until the remaining groups are retained or all MaxArr_min_ps are compared.

4. The method for finding the maximum value of large data according to claim 1, characterized in that: If the maximum value type is to find the minimum value, the minimum value in the first object set is obtained, and the group and the data in the group containing the value greater than the minimum value in the second object set are discarded to obtain the filtered group.

5. The method for finding the maximum value of large data according to claim 4, characterized in that: Obtaining the minimum value in the first object set, discarding the group and the data in the group where the value in the second object set is greater than the minimum value, and obtaining the filtered group, specifically includes: Sort the first object set and the second object set by numerical value, obtain the minimum value MaxArr_min in the first object set, and obtain the values ​​MinArr_max_p other than the minimum value in the second object set in descending order, and compare MinArr_max_p with the MaxArr_min; if the MinArr_max_p is less than or equal to the MaxArr_min, retain the P groups of data; otherwise, discard the group corresponding to MinArr_max_p and the data in the group, and continue to compare until the remaining groups are retained or all MinArr_max_ps are compared.

6. The method for finding the maximum value of large data according to claim 1, characterized in that: After obtaining the filtered group, the method further includes: For each group after filtering, extract the N maximum values ​​in the group to form a new group, and obtain the maximum value group after filtering; The step of comparing the data of the filtered group with the values ​​in the first object set or the values ​​in the second object set in sequence based on the maximum value type to obtain N maximum values ​​includes: Based on the extreme value type, the data of the filtered extreme value group are compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N extreme values.

7. The method for finding the maximum value of large data according to claim 1, characterized in that: If the maximum value type is to find the maximum value, the data of the filtered group is compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values, specifically including: Get the maximum value and the corresponding group in the first object set, compare the data in the group corresponding to the values ​​in the first object set except the maximum value with the values ​​in the group corresponding to the current maximum value in order from large to small to obtain N-1 larger values, and store the maximum value and the first N-1 larger values ​​in a result set; the current maximum value refers to the larger value obtained in each round of comparison. When comparing for the first time, the current maximum value is taken as the maximum value in the first object set.

8. The method for finding the maximum value of large data according to claim 1, characterized in that: If the maximum value type is to find the minimum value, the data of the filtered group is compared with the values ​​in the first object set or the values ​​in the second object set in sequence to obtain N maximum values, specifically including: Get the minimum value and the corresponding group in the second object set, compare the data in the group corresponding to the values ​​in the second object set except the minimum value with the values ​​in the group corresponding to the current minimum value in ascending order to obtain N-1 smaller values, and store the minimum value and the first N-1 smaller values ​​in a result set; the current minimum value refers to the smaller value obtained in each round of comparison. When comparing for the first time, the current minimum value is the minimum value in the first object set.

9. The method for finding the maximum value of large data according to claim 1, characterized in that: The configuration data also includes a sorting type; the sorting type includes ascending or descending; if the sorting type is ascending, the obtained N maximum values ​​are arranged in ascending order; if the sorting type is descending, the obtained N maximum values ​​are arranged in descending order.

10. A big data maximum value search system, characterized in that: include: A data acquisition module, used to receive the maximum value query request information, acquire configuration data including the maximum value type, the number of pages P and the maximum value number N, and acquire the table data and the total data volume TN corresponding to the maximum value query request information; A paging multi-thread processing module is used to start P threads to perform paging processing on the table data, wherein P-1 threads process the same amount of data and another thread processes the remaining data; the data results processed by each thread are stored in an independent group to obtain P groups of data; A filter data reference value construction module is used to obtain the maximum value and the minimum value of each group of data in P groups of data, store the P maximum values ​​and their corresponding groups into a first object set, and store the P minimum values ​​and their corresponding groups into a second object set; A data filtering module, based on the maximum value type, obtains the maximum value in the second object set, discards the group and the data in the group where the value in the first object set is smaller than the maximum value, and obtains the filtered group; or obtains the minimum value in the first object set, discards the group and the data in the group where the value in the second object set is larger than the minimum value, and obtains the filtered group; The maximum value acquisition module compares the data of the filtered group with the values ​​in the first object set or the values ​​in the second object set in sequence based on the maximum value type to obtain N maximum values.