Method and device for processing data table and storage medium

By performing aggregation operations in the first sub-storage system, the problem of excessive network resource consumption during data table processing in the distributed storage system is solved, and resource saving is achieved.

CN118733579APending Publication Date: 2024-10-01HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310279323.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When a distributed storage system processes multiple data tables, it needs to read data from sub-storage systems in each region, resulting in excessive consumption of network resources.

Method used

The aggregation operation is performed in the first sub-storage system, and the aggregation results are obtained and sent instead of sending the complete data table to the first device for aggregation operation, thereby reducing the occupation of network resources.

Benefits of technology

By performing aggregation operations in the first sub-storage system, network resource consumption is significantly reduced and network resources are saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733579A_ABST
    Figure CN118733579A_ABST
Patent Text Reader

Abstract

The invention discloses a data table processing method and device and a storage medium, and belongs to the field of communication. The method comprises: a first sub-storage system receiving a query request forwarded by a first device, the query request comprising an aggregation operation, a first identifier of a to-be-queried first data table and a second identifier of a second data table, the plurality of data tables comprising the first data table and the second data table; the first sub-storage system obtains an aggregation result based on the first identifier and the second identifier, the aggregation result is a result obtained by performing the aggregation operation on at least one line of first data belonging to a first region in the first data table and at least one line of second data belonging to the first region in the second data table, and the first region is a region where the first sub-storage system is located; and the first sub-storage system sends a query response to the first device, wherein the query response comprises the aggregation result. According to the invention, network resources can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a method, device and storage medium for processing a data table. Background Art

[0002] A distributed storage system is a data storage technology that can store data in a dispersed manner on multiple devices. With the development of distributed storage technology, the scale of distributed storage systems is getting larger and larger. A distributed storage system can include multiple sub-storage systems distributed in different areas.

[0003] The distributed storage system also includes a first device, which is a global master node of the distributed storage system. The first device can receive a query request, which includes an aggregation operation and identification information of multiple data tables, and read the multiple data tables from the sub-storage system of each region. The aggregation operation is performed on the data in each read data table to obtain an aggregation result, and a query response is sent, which includes the aggregation result.

[0004] However, the first device needs to read multiple data tables from the sub-storage system in each area. The data tables have a large amount of data, which consumes a large amount of network resources. Summary of the invention

[0005] The present application provides a method, device and storage medium for processing a data table to save network resources. The technical solution is as follows:

[0006] In a first aspect, the present application provides a method for processing a data table, the method being applied to a distributed storage system, the distributed storage system comprising a first device and a plurality of sub-storage systems, the first device being used to access the plurality of sub-storage systems, the plurality of sub-storage systems being distributed in a plurality of regions, the plurality of sub-storage systems comprising a first sub-storage system, and the first sub-storage system comprising a plurality of data tables. In the method, the first sub-storage system receives a query request forwarded by the first device, the query request comprising an aggregation operation, a first identifier of a first data table to be queried, and a second identifier of a second data table, the plurality of data tables comprising a first data table and a second data table. The first sub-storage system obtains an aggregation result based on the first identifier and the second identifier, the aggregation result being a result of performing the aggregation operation on at least one row of first data in the first data table belonging to a first region and at least one row of second data in the second data table belonging to the first region, the first region being a region where the first sub-storage system is located. The first sub-storage system sends a query response to the first device, the query response comprising the aggregation result.

[0007] Since the first device sends a query request to the first sub-storage system, the first sub-storage system obtains the aggregation result based on the first identifier and the second identifier, and sends a query response to the first device, and the query response includes the aggregation result. Since the amount of data in the aggregation result is smaller than the amount of data in the first data table and the amount of data in the second data table, compared with the second device sending the first data table and the second data table to the first device, the first device performs the aggregation operation, and the present application can reduce the occupation of network resources, thereby saving network resources.

[0008] In a possible implementation, the first sub-storage system obtains a third data table based on the first identifier and the second identifier, and the third data table includes at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table. The first sub-storage system performs an aggregation operation on each column of data in the third data table to obtain an aggregation calculation result corresponding to each column of data, and the aggregation result includes the aggregation calculation result corresponding to each column of data. In this way, the aggregation operation is performed in the first sub-storage system to obtain the aggregation result.

[0009] In another possible implementation, the query request further includes a join condition, and the join condition is used to indicate that a join operation is performed on the data belonging to the first region in the first data table and the second data table. Based on the join condition, the first sub-storage system obtains at least one row of first data belonging to the first region from the first data table corresponding to the first identifier, and obtains at least one row of second data belonging to the first region from the second data table corresponding to the second identifier. The first sub-storage system performs a join operation on the at least one row of first data and the at least one row of second data to obtain a third data table. In this way, the join operation is performed in the first sub-storage system.

[0010] In another possible implementation, the at least one row of first data includes first data belonging to a first target column and first data belonging to a second target column, the at least one row of second data includes second data belonging to the first target column and second data belonging to a third target column, the first target column is a column with the same column identifier in the first data table and the second data table, the second target column is a column in the first data table other than the first target column, and the third target column is a column in the second data table other than the first target column. The third data table includes a first target column, a second target column, and a third target column, the first target column in the third data table includes first data belonging to the first target column and second data belonging to the first target column, the second target column in the third data table includes first data belonging to the second target column, and the third target column in the third data table includes second data belonging to the third target column. Since the first target column in the third data table includes first data belonging to the first target column and second data belonging to the first target column, the number of columns in the third data table can be reduced.

[0011] In another possible implementation manner, each data table in the multiple data tables is used to store data belonging to the first area.

[0012] In another possible implementation, the first sub-storage system receives M rows of first data belonging to the first region sent by the first device, where M is an integer greater than 0, and the M rows of first data belong to the first data table. The first sub-storage system stores the M rows of first data in the first data table. In this way, the data belonging to the first region is stored in the first sub-storage system.

[0013] In another possible implementation, the first sub-storage system further includes a plurality of storage devices, and the first data table is stored on the plurality of storage devices. The first sub-storage system stores one or more rows of first data in the first data table of each storage device, and the M rows of first data include one or more rows of first data stored in the first data table of each storage device. In this way, the data in the first data table is evenly stored in the plurality of storage devices.

[0014] In a second aspect, the present application provides a device for processing a data table, which is used to execute the method in the first aspect or any possible implementation of the first aspect. Specifically, the device includes a unit for executing the method in the first aspect or any possible implementation of the first aspect.

[0015] In a third aspect, the present application provides a cluster for processing data tables, the cluster comprising at least one computing device, each of the at least one computing device comprising at least one processor and at least one memory, the at least one memory storing computer-readable instructions; the at least one processor executes the computer-readable instructions so that the cluster executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.

[0016] In a fourth aspect, the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the method of the above-mentioned first aspect or any possible implementation method of the first aspect.

[0017] In a fifth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program is loaded by a processor to execute the method of the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0018] In a sixth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to execute the method of the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a structural diagram of a distributed storage system provided in an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of the structure of another distributed storage system provided in an embodiment of the present application;

[0021] Figure 3 is a flow chart of a method for processing a data table provided in an embodiment of the present application;

[0022] Figure 4 is a flow chart of another method for processing a data table provided in an embodiment of the present application;

[0023] Figure 5 It is a structural framework diagram of a processing data table provided in an embodiment of the present application;

[0024] Figure 6 It is a structural framework diagram of another processing data table provided in an embodiment of the present application;

[0025] Figure 7 It is a schematic diagram of the structure of a device for processing a data table provided in an embodiment of the present application;

[0026] Figure 8 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0027] Fig. 9 It is a schematic diagram of the structure of a cluster for processing a data table provided in an embodiment of the present application;

[0028] Fig.10 It is a schematic diagram of the structure of another cluster for processing data tables provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0030] See also Figure 1 The present application provides a distributed storage system 100 , which includes a first device 101 and multiple sub-storage systems 102 . The multiple sub-storage systems 102 are respectively located in multiple areas, and the first device 101 can communicate with each sub-storage system 102 .

[0031] In some embodiments, the first device 101 is a global master node of the distributed storage system 100. The first device 101 and each sub-storage system 102 are connected to a communication network, and the first device 101 communicates with each sub-storage system 102 through the communication network. The first device 101 is used to access each sub-storage system 102, that is, the first device 101 can read and write each sub-storage system 102.

[0032] For any sub-storage system 102, the sub-storage system 102 includes a second device 1021 and multiple data tables 1022. The second device 1021 communicates with the first device 101, and the second device 1021 can access the multiple data tables 1022, that is, the second device 1021 can read and write the multiple data tables 1022. For any data table 1022 in the multiple data tables 1022, the data table 1022 is used to store data belonging to the first area, and the first area is the area where the sub-storage system 102 is located.

[0033] For example, referring to the data table 1022 shown in Table 1 below, the data table 1022 includes a region identification column, each row of data in the data table 1022 includes a region identification of a first region, and the region identification of the first region included in each row of data is located in the region identification column, so that each row of data in the data table 1022 belongs to the first region.

[0034] In some embodiments, each row of data in the data table 1022 is a time series data. In addition to the region identifier of the first region, any row of the data table 1022 also includes different timestamps and data obtained at each timestamp.

[0035] For example, any row in Table 1 below is used to store the temperature collected by the temperature sensor, such as the first row of data (a row of data with sequence number 1) shown in Table 1 below, the first row of data is used to record the temperature collected by a certain temperature sensor at different timestamps. The first row of data includes the region identifier "East China" of the first region, the state of the temperature sensor is in use, the temperature "10" collected by the temperature sensor at timestamp "1", the temperature "20" collected at timestamp "2", the temperature "50" collected at timestamp "3", and the temperature "60" collected at timestamp "4".

[0036] As shown in the second row of data in Table 1 below (a row of data with serial number 2), the second row of data is used to record the temperature collected by another temperature sensor at different time stamps. The second row of data includes the region identifier "East China" of the first region, the state of the other temperature sensor is in use, the temperature "15" collected by the other temperature sensor at timestamp "1", the temperature "20" collected at timestamp "2", the temperature "30" collected at timestamp "3", and the temperature "40" collected at timestamp "4".

[0037] Table 1

[0038] Serial number Area identification state (timestamp, data content) 1 East China Use Status (1,10),(2,20),(3,50),(4,60) 2 East China Use Status (1,15),(2,20),(3,30),(4,40) …… …… …… ……

[0039] In some embodiments, the distributed storage system 100 is applied to the Internet of Things, etc., and the distributed storage system 100 is used to store data generated by devices in the Internet of Things.

[0040] See also Figure 2 For any sub-storage system 102 , the sub-storage system 102 also includes multiple storage devices 1023 , the second device 1021 and the multiple storage devices 1023 are located in the same area, and the second device 1021 can also communicate with each storage device 1023 .

[0041] The multiple data tables 1022 in the sub-storage system 102 are stored on the multiple storage devices 1023 , and the second device 1021 is used to access the data table 1022 on each storage device 1023 , that is, the second device 1021 can read and write the data table 1022 on each storage device 1023 .

[0042] For any data table 1022 , each storage device 1023 includes a portion of the data in the data table 1022 , and the portion of the data belonging to the data table 1022 included in each storage device 1023 is different.

[0043] For example, it is assumed that the sub-storage system 102 includes three storage devices 1023, which are respectively a first storage device 1023, a second storage device 1023, and a third storage device 1023. The data table 1022 includes 100 rows of data, the first storage device 1023 includes 35 rows of data of the data table 1022, the second storage device 1023 includes another 35 rows of data of the data table 1022, and the third storage device 1023 includes the remaining 30 rows of data of the data table 1022. Therefore, the data belonging to the data table 1022 included in the first storage device 1023, the data belonging to the data table 1022 included in the second storage device 1023, and the data belonging to the data table 1022 included in the third storage device 1023 together constitute the data table 1022.

[0044] The second device 1021 is a regional master node of the first region where the first sub-storage system is located, and the second device 1021 and each storage device 1023 in the first sub-storage system are connected to the communication network. The second device 1021 is used to access each storage device 1023, that is, the second device 1021 can read and write each storage device 1023.

[0045] The first device 101 is an interface provided by the distributed storage system 100 to the outside, and a terminal device can access the distributed storage system 100 through the first device 101 .

[0046] For example, the terminal device may send a storage request to the first device 101, the storage request including at least one row of data to be stored, the at least one row of data belonging to a certain area. The first device 101 sends the at least one row of data to the sub-storage system 102 of the area. The second device 1021 included in the sub-storage system 102 of the area receives the at least one row of data and stores the at least one row of data in the storage device 1023 included in the sub-storage system 102. That is, the first device 101 writes the data belonging to each area into the sub-storage system 102 of each area respectively.

[0047] For another example, the terminal device may send a query request to the first device 101, the query request including an aggregation operation, a first identifier of the first data table, and a second identifier of the second data table. The first device 101 receives the query request and sends the query request to the second device 102 included in the sub-storage system of each region. For any region, for the sake of convenience, the region is referred to as the first region, the second device 1021 included in the first sub-storage system 102 in the first region receives the query request, obtains an aggregation result based on the first identifier and the second identifier included in the query request, and the aggregation result is the result of performing the aggregation operation on at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table; and sends a first query response to the first device 101, the first query response including the aggregation result. The first device 101 may receive the first query response sent by the second device 102 in each sub-storage system 102, and send a second query response to the terminal device, the second query response including the aggregation result included in each received first query response.

[0048] See also Figure 3 The present application embodiment provides a method 300 for processing a data table, wherein the method 300 is applied to Figure 1 or Figure 2 The network architecture 100 shown in the figure can store data in a data table in a distributed storage system through the method 300. The method 300 includes the following process from step 301 to step 303.

[0049] Step 301: The first device receives a storage request, which includes a first identifier of a first data table and M rows of first data, the M rows of first data are data belonging to a first region, and the M rows of first data are data that need to be stored in the first data table, and M is an integer greater than 0.

[0050] In step 301, a terminal device belonging to a first region generates the M rows of first data, the M rows of first data include a region identification column, and the region identification of the first region included in each row of first data is located in the region identification column. When the terminal device needs to save the M rows of first data into a first data table, it sends a storage request to a first device of a distributed storage system, the storage request including the first identification of the first data table and the M rows of first data.

[0051] For example, assuming that M=4, the first region is East China, and a terminal device located in East China sends four rows of first data as shown in Table 2 below to the first device. The four columns of first data include three columns of data, the column identifier of the first column is "location", the column identifier of the second column is "field1", and the column identifier of the third column is "field2". The first column is a region identifier column, and each row of data in the first column is the region identifier "East China" of the first region, so that each row of first data in the four rows of first data includes the region identifier "East China" of the first region. When the terminal device needs to save the four rows of first data into the first data table, it sends a storage request to the first device of the distributed storage system, and the storage request includes the first identifier "table1" of the first data table and the four rows of first data as shown in Table 2 below.

[0052] Table 2

[0053] Serial number location field1 field2 1 East China f1 h1 2 East China f1 h2 3 East China f4 h3 4 East China f4 h4

[0054] Step 302: The first device sends the storage request to the second device in the first sub-storage system, where the first sub-storage system is a sub-storage system located in the first area.

[0055] In step 302, the first device obtains the region identifier of the first region from any row of first data included in the storage request, determines the first sub-storage system based on the region identifier of the first region, and sends the storage request to the second device in the first sub-storage system.

[0056] In step 302, the first device may receive data sent from terminal devices in different areas, and send the data of each area to the second device in the sub-storage system in each area, so that the data of different areas are dispersedly stored in the sub-storage systems in different areas. For a sub-storage system in any area, the sub-storage system is used to store the data belonging to the area.

[0057] For example, the storage request includes four lines of first data as shown in Table 2. The first device reads the regional identifier "East China" of the first area from any one of the four lines of first data, determines the first sub-storage system located in the first area based on the regional identifier "East China" of the first area, and sends the storage request to the second device in the first sub-storage system.

[0058] Step 303: The second device receives the storage request and saves one or more rows of first data to the first data table in each storage device in the first sub-storage system. The M rows of first data in the storage request include one or more rows of first data saved in the first data table of each storage device.

[0059] The first sub-storage system includes multiple storage devices, and the first data table in the first sub-storage system is stored on the multiple storage devices, and each storage device stores a portion of the first data table. After receiving the storage request, the second device stores the M rows of first data included in the storage request in the first data tables of the multiple storage devices in a dispersed manner, and each row of first data stored in the first data table of each storage device is different.

[0060] Next, the following two methods are listed to store the M rows of first data in a dispersed manner in the first data tables of the multiple storage devices.

[0061] In a first manner, a hash method is used to save the M rows of first data into multiple storage devices in the first sub-storage system.

[0062] During implementation, for any row of first data in the M rows of first data, the second device performs a hash operation on part or all of the data in the any row of first data to obtain a hash value, determines a storage device for storing any row of first data based on the hash value and the number of storage devices included in the first sub-storage system, and saves the any row of first data into the first data table of the storage device based on the first identifier.

[0063] In some embodiments, a remainder is obtained by performing a modulo operation on the hash value and the number of storage devices included in the first sub-storage system, a storage device numbered equal to the remainder is determined, and any row of first data is saved in a first data table of the storage device.

[0064] For example, assuming that the hash value is hash, and the number of storage devices included in the first sub-storage system is N, hash is divided by N to obtain a remainder, and a storage device whose number is equal to the remainder is determined.

[0065] For example, the first storage system includes four storage devices, that is, N=4. For the first row of first data among the four rows of first data shown in Table 2 (a row of data with a sequence number of 1 in Table 2), a hash operation is performed on the third column data "h1" in the first row of first data in Table 2 to obtain a hash value of 15. The hash value 15 is divided by the number 4 to obtain a remainder of 3. Based on the first identifier included in the storage request, the first row of first data in Table 2 in the first data table in the storage device numbered 3 is sent.

[0066] For the second row of first data among the four rows of first data shown in Table 2 (a row of data with sequence number 2 in Table 2), a hash operation is performed on the third column data "h2" in the second row of first data in Table 2 to obtain a hash value of 16. The hash value 16 is divided by the number 4 to obtain a remainder of 0. Based on the first identifier included in the storage request, the second row of first data in Table 2 in the first data table in the storage device numbered 0 is stored.

[0067] For the first data in the third row of the four rows of first data shown in Table 2 (a row of data with sequence number 3 in Table 2), a hash operation is performed on the third column data "h3" in the first data in the second row of Table 2 to obtain a hash value of 13. The hash value 13 is divided by the number 4 to obtain a remainder of 1. Based on the first identifier included in the storage request, the first data in the second row of Table 2 in the first data table in the storage device numbered 1 is stored.

[0068] For the first data in the fourth row of the four rows of first data shown in Table 2 (a row of data with a sequence number of 4 in Table 2), a hash operation is performed on the third column data "h4" in the first data in the fourth row of Table 2 to obtain a hash value of 14. The hash value 14 is divided by the number 4 to obtain a remainder of 2. Based on the first identifier included in the storage request, the first data in the fourth row of Table 2 is stored in the first data table in the storage device numbered 2.

[0069] In a second manner, the M lines of first data are saved in a plurality of storage devices in the first sub-storage system in a polling manner.

[0070] During implementation, it is assumed that the first sub-storage system includes N storage devices, where N is an integer greater than 1. The second device saves M / N rows of first data in a first data table of each storage device in the N storage devices based on the first identifier, and the M / N rows of first data saved in the first data table of each storage device are different.

[0071] For example, the first row of first data among the M rows of first data is saved in the first storage device in the first sub-storage system, the second row of first data among the M rows of first data is saved in the second storage device in the first sub-storage system, and ..., the Nth row of first data among the M rows of first data is saved in the Nth storage device in the first sub-storage system.

[0072] The N+1th row of first data among the M rows of first data is saved in the first storage device in the first sub-storage system, the N+2th row of first data among the M rows of first data is saved in the second storage device in the first sub-storage system, ..., the 2Nth row of first data among the M rows of first data is saved in the Nth storage device in the first sub-storage system. Repeat the above process until the M rows of first data are saved in the first data tables of the N storage devices.

[0073] In an embodiment of the present application, a first device receives M rows of first data sent by a terminal device belonging to a first area. Since the M rows of first data belong to the first area, the M rows of first data are sent to a second device of a first sub-storage system of the first area. The second device saves the M rows of first data in a data table of the first sub-storage system. In this way, all data saved in the first sub-storage system belongs to the first area. When querying data in the first area, the second device in the first sub-storage system can query the data belonging to the first area from the data table of the first sub-storage system and perform aggregation operations on the data belonging to the first area to obtain an aggregation result, and the second device sends the aggregation result to the first device. The number of the aggregation results is less than the amount of data in the data table, so the second device needs fewer network resources to send the aggregation results to the first device, thereby reducing the occupation of network resources.

[0074] See also Figure 4 The present application embodiment provides a method 400 for processing a data table, wherein the method 400 is applied to Figure 1 or Figure 2 The network architecture 100 shown in the figure can query data from a data table in a distributed storage system through the method 400. The method 400 includes the following process from step 401 to step 405.

[0075] Step 401: A first device receives a query request, where the query request includes an aggregation operation, a first identifier of a first data table, and a second identifier of a second data table.

[0076] Each sub-storage system in the distributed storage system includes a first data table and a second data table. For a first sub-storage system belonging to a first area, the first data table in the first sub-storage area is used to store multiple rows of first data belonging to the first area, and the second data table in the first sub-storage area is used to store multiple rows of first data belonging to the first area.

[0077] The data in the first data table and / or the second data table is obtained by Figure 3 The method 300 shown is saved.

[0078] In some embodiments, the aggregation operation may be an addition calculation or a multiplication calculation, etc.

[0079] In step 401, the terminal device may send a query request to a first device in the distributed storage system. The query request further includes a connection condition, which is used to indicate that at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table are connected (joined).

[0080] In some embodiments, the query request also includes a filtering condition, so that the connection condition is used to prompt a join operation to be performed on at least one row of first data in the first data table that belongs to the first area and satisfies the filtering condition and at least one row of second data in the second data table that belongs to the first area and satisfies the filtering condition.

[0081] Optionally, the query request is a structured query language (SQL) statement. For example, the query request is a SQL statement as shown below.

[0082] SELECT

[0083] sum(*)

[0084] FROM

[0085] table1 inner join table2 on table1.location=table2.location

[0086] WHERE

[0087] table1.field1=f1 and table2.field1=f1

[0088] In the above SQL statement, sum is an aggregation operation, which is an addition calculation, and (*) indicates that an aggregation operation is performed on all columns. "table1" is the first identifier of the first data table, "table2" is the second identifier of the second data table, and "table1 inner join table2 on table1.location=table2.location" is a join condition. This join condition is used to indicate that a join operation is performed on rows with the same region identifier in the first data table and the second data table. Since each row of region identifiers stored in the region identifier column in the first data table is the region identifier of the first region, and each row of region identifiers stored in the region identifier column in the second data table is the region identifier of the first region, this join condition is used to indicate that a join operation is performed on at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table.

[0089] "table1.field1=f1 and table2.field1=f1" is a filtering condition, so that the connection condition is used to indicate a connection (join) operation between at least one row of first data in the first data table belonging to the first area and with the field1 column equal to f1 and at least one row of second data in the second data table belonging to the first area and with the field1 column equal to f1.

[0090] Assume that a first data table as shown in Table 3 below and a second data table as shown in Table 4 below are stored in the first sub-storage system.

[0091] Table 3

[0092] Serial number location field1 field2 1 East China f1 f2 2 East China f1 f2 3 East China f4 f5 4 East China f5 F7

[0093] Table 4

[0094] Serial number location field1 field3 1 East China f1 f3 2 East China f1 f3 3 East China f3 f7 4 East China f3 f7

[0095] Step 402: The first device sends the query request to each sub-storage system in the distributed storage system, where each sub-storage system includes the first sub-storage system.

[0096] The first device and the second device in each sub-storage system are both connected to a communication network, and the first device sends the query request to the second device in each sub-storage system in the distributed storage system through the communication network.

[0097] Step 403: The first sub-storage system receives the query request and obtains an aggregation result based on the first identifier and the second identifier. The aggregation result is a result of performing the aggregation operation on at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table. The first region is the region where the first sub-storage system is located.

[0098] In step 403, the second device may obtain the aggregation result through the following operations 4031-4032.

[0099] 4031: The first sub-storage system obtains a third data table based on the first identifier and the second identifier, where the third data table includes at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table.

[0100] The query request also includes a join condition, which is used to indicate that a join operation is performed on the data in the first data table and the second data table that belong to the same region (the first region). Because the data in the first data table and the data in the second data table both belong to the first region.

[0101] Thus, in 4031, based on the connection condition, the first sub-storage system obtains at least one row of first data belonging to the first region from the first data table corresponding to the first identifier pair, and obtains at least one row of second data belonging to the first region from the second data table corresponding to the second identifier. A join operation is performed on the at least one row of first data and the at least one row of second data to obtain a third data table.

[0102] Among them, since each row of first data in the first data table belongs to the first area, and each row of second data in the second data table belongs to the second area, the at least one row of first data includes each row of first data in the first data table, and the at least one row of second data includes each row of second data in the second data table.

[0103] In some embodiments, the query request further includes a filtering condition, so that in 4031, the first sub-storage system obtains at least one row of first data belonging to the first region and satisfying the filtering condition from the first data table corresponding to the first identifier pair based on the connection condition, and obtains at least one row of second data belonging to the first region and satisfying the filtering condition from the second data table corresponding to the second identifier. A join operation is performed on the at least one row of first data and the at least one row of second data to obtain a third data table.

[0104] For example, the query request received by the first sub-storage device is the above-mentioned SQL statement, and the query request has a connection condition "table1inner join table2 on table1.location=table2.location", and a filter condition "table1.field1=f1 and table2.field1=f1". Thus, the first sub-storage system obtains two rows of first data belonging to the first area and with the field1 column equal to f1 from the first data table corresponding to the first identifier "table1" as shown in Table 3 based on the connection condition "table1 inner join table2 on table1.location=table2.location". The two rows of first data are respectively the first row of first data (a row of data with a sequence number of 1) and the second row of first data (a row of data with a sequence number of 2) in Table 3.

[0105] Furthermore, based on the connection condition "table1 inner join table2 ontable1.location=table2.location", the first sub-storage system obtains two rows of second data belonging to the first area and with the field1 column equal to f1 from the second data table corresponding to the second identifier "table2" as shown in Table 4, and the two rows of second data are respectively the first row of first data (a row of data with serial number 1) and the second row of first data (a row of data with serial number 2) in Table 4.

[0106] The two rows of first data (the first row of first data with sequence number 1 and the second row of first data with sequence number 2 in Table 3) and the two rows of second data (the first row of second data with sequence number 1 and the second row of second data with sequence number 2 in Table 4) are joined to obtain a third data table as shown in Table 5 below.

[0107] Table 5

[0108] location field1 field2 field3 East China f1 f2 East China f1 f2 East China f1 f3 East China f1 f3

[0109] In some embodiments, the at least one row of first data includes first data belonging to a first target column and first data belonging to a second target column, the at least one row of second data includes second data belonging to the first target column and second data belonging to a third target column, the first target column is a column with the same column identifier in the first data table and the second data table, the second target column is a column in the first data table other than the first target column, and the third target column is a column in the second data table other than the first target column. The third data table includes the first target column, the second target column, and the third target column, the first target column in the third data table includes the first data belonging to the first target column and the second data belonging to the first target column, the second target column in the third data table includes the first data belonging to the second target column, and the third target column in the third data table includes the second data belonging to the third target column.

[0110] For example, when the query request is the above SQL statement, the first sub-storage system obtains two rows of first data from the first data table as shown in Table 3, including a first column with a column identifier of "location", a second column with a column identifier of "field1", and a third column with a column identifier of "field2". The two rows of first data obtained from the first data table as shown in Table 3 include a first column with a column identifier of "location", a second column with a column identifier of "field1", and a third column with a column identifier of "field3". After executing the join, the third data table as shown in Table 5 includes a first column with a column identifier of "location", a second column with a column identifier of "field1", a third column with a column identifier of "field2", and a fourth column with a column identifier of "field4".

[0111] The first column in the third data table as shown in Table 5 includes two rows of region identification included in the first column of the two rows of first data and two rows of region identification included in the first column of the two rows of second data. The second column in the third data table as shown in Table 5 includes two rows of "f1" included in the second column of the two rows of first data and two rows of "f1" included in the first column of the two rows of second data. The third column in the third data table as shown in Table 5 includes two rows of "f2" included in the third column of the two rows of first data. The fourth column in the third data table as shown in Table 5 includes two rows of "f3" included in the third column of the two rows of first data.

[0112] See also Figure 5, the above-mentioned operation 4031 can be performed by the second device in the first sub-storage system, that is, the second device performs a join operation. Thus, before executing 4031, after receiving the query request, the second device reads the first data table in each storage device in the first sub-storage system based on the first identifier, and combines the first data tables in each storage device into a complete first data table. Based on the second identifier, the second data table in each storage device in the first sub-storage system is read, and the second data tables in each storage device are combined into a complete second data table. Then, based on the connection condition, the second device obtains at least one row of first data belonging to the first region from the complete first data table, and obtains at least one row of second data belonging to the first region from the complete second data table, and performs a join operation on the at least one row of first data and the at least one row of second data to obtain a third data table. Or,

[0113] See also Figure 6 , the above-mentioned operation 4031 can be performed by the storage device in the first sub-storage system, that is, the storage device performs a join operation. In implementation, the second device receives the query request and sends the query request to each storage device in the first sub-storage system. For any storage device, after receiving the query request, the storage device obtains at least one row of first data belonging to the first area from the first data table in the storage device based on the connection condition, and obtains at least one row of second data belonging to the first area from the second data table in the storage device, performs a join operation on the at least one row of first data and the at least one row of second data, and obtains a connection data table. The third data table includes the connection data table obtained by each storage device.

[0114] 4032: The first sub-storage system performs the aggregation operation on each column of data in the third data table to obtain an aggregation calculation result corresponding to each column of data, where the aggregation result includes the aggregation calculation result corresponding to each column of data.

[0115] In some embodiments, for each column in the third data table, an aggregation operation may be performed on the data included in the column to obtain an aggregate calculation result corresponding to the column data, and the aggregate result includes the aggregate calculation result corresponding to each column data in the third data table.

[0116] For example, the aggregation operation is an addition calculation. The first sub-storage system performs an addition calculation on the data included in each column in the third data table as shown in Table 5 to obtain the addition calculation result corresponding to each column of data in the third data table, that is, to obtain the aggregation result shown in Table 6 below.

[0117] Table 6

[0118] location field1 field2 field3 East China 4*f1 2*f2 2*f3

[0119] See also Figure 5 , the operation of 4032 can be performed by the second device in the first sub-storage system, that is, the second device performs the aggregation operation. After obtaining the third data table, the second device performs the aggregation operation on the data included in each column in the third data table. Or,

[0120] See also Figure 6 , the above-mentioned operation 4032 can be performed by the storage device in the first sub-storage system, that is, the storage device performs the aggregation operation. For any storage device in the first sub-storage system, after obtaining the connection data table, the storage device performs an aggregation operation on the data included in each column in the connection data table, obtains the aggregation calculation result corresponding to each column of the data in the connection data table, and sends the aggregation calculation result corresponding to each column of the data in the connection data table to the second device. The second device receives the aggregation calculation result corresponding to each column of the data in the connection data table sent by each storage device, and forms a third data table with the aggregation calculation result corresponding to each column of the data in each connection data table received. An aggregation operation is performed on the data included in each column in the third data table, and the aggregation calculation result corresponding to each column of the data in the third data table is obtained, and the aggregation result includes the aggregation calculation result corresponding to each column of the data in the third data table.

[0121] Step 404: The first sub-storage system sends a first query response to the first device, where the first query response includes the aggregation result.

[0122] For example, in step 404, the first query response sent by the second device to the first device includes the aggregation result shown in Table 6 above, and the data volume of the aggregation result shown in Table 6 is much smaller than the data volume of the first data table shown in Table 3 and the data volume of the second data table shown in Table 4. The second device sends the first query response to the first device, and the first query response includes the aggregation result shown in Table 6, which greatly reduces the occupation of network resources.

[0123] The second devices in the sub-storage systems other than the first sub-storage system in the distributed storage system obtain the aggregation result according to the above steps like the second device in the first sub-storage system, and send the aggregation result to the first device. That is, the second device in each sub-storage system in the distributed storage system sends the aggregation result to the first device.

[0124] Step 405: The first device receives the first query response sent by each second device, and sends a second query response to the terminal device, where the second query response includes an aggregated result in each first query response received by the first device.

[0125] In an embodiment of the present application, a first device receives a query request sent by a terminal device including a first identifier of a first data table and a second identifier of a second data table, and sends the query request to each second device in the distributed storage system. A second device in the first sub-storage system receives the query request, obtains at least one row of first data belonging to the first area from the first data table corresponding to the first identifier, and obtains at least one row of second data belonging to the first area from the second data table corresponding to the second identifier. At least one row of first data and at least one row of second data are joined into a third data table, and each column of data in the third data table is aggregated and calculated to obtain an aggregate calculation result corresponding to each column of data. The second device sends a first query response to the first device, and the first query response includes an aggregate result, and the aggregate result includes an aggregate calculation result corresponding to each column of data. Since the amount of data of the aggregate calculation result corresponding to each column of data is much smaller than the amount of data in the first data table and the amount of data in the second data table, the network resources required for sending the first query response can be reduced, thereby reducing the occupation of network resources.

[0126] See also Figure 7 The embodiment of the present application provides a device 700 for processing a data table. The device 700 is applied to a distributed storage system. The distributed storage system includes a first device and multiple sub-storage systems. The first device is used to access the multiple sub-storage systems. The multiple sub-storage systems are distributed in multiple areas. The multiple sub-storage systems include the device 700. The device 700 includes multiple data tables. The device 700 can be deployed in Figure 1 or Figure 2 The sub-storage system 102 in the distributed storage system 100 shown in FIG. 1 may be deployed on the sub-storage system 102 in the distributed storage system 100, or the device 700 may be deployed on the sub-storage system 102 in the distributed storage system 100. Figure 3 On the first sub-storage system in the method 300, or the apparatus 700 may be deployed on Figure 4 On the first sub-storage system in the method 400 shown.

[0127] The device 700 further includes:

[0128] A receiving unit 701 is configured to receive a query request forwarded by a first device, the query request including an aggregation operation, a first identifier of a first data table to be queried, and a second identifier of a second data table, wherein the multiple data tables include the first data table and the second data table;

[0129] A processing unit 702 is configured to obtain an aggregation result based on the first identifier and the second identifier, where the aggregation result is a result of performing the aggregation operation on at least one row of first data belonging to a first region in a first data table and at least one row of second data belonging to the first region in a second data table, where the first region is a region where the apparatus 700 is located;

[0130] The sending unit 703 is configured to send a query response to the first device, where the query response includes the aggregation result.

[0131] Optionally, the detailed implementation process of receiving the query request by the receiving unit 701 can be found in Figure 4 The relevant contents of step 403 of the method 400 are not described in detail here.

[0132] Optionally, the detailed implementation process of the processing unit 702 obtaining the aggregation result can be found in Figure 4 The relevant contents of step 403 of the method 400 are not described in detail here.

[0133] Optionally, the detailed implementation process of sending the query response by the sending unit 703 can be found in Figure 4 The relevant contents of step 404 of the method 400 are not described in detail here.

[0134] Optionally, the processing unit 702 is configured to:

[0135] Acquire a third data table based on the first identifier and the second identifier, the third data table including at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table;

[0136] The aggregation operation is performed on each column of data in the third data table to obtain an aggregation calculation result corresponding to each column of data. The aggregation result includes the aggregation calculation result corresponding to each column of data.

[0137] Optionally, the detailed implementation process of the processing unit 702 obtaining the third data table can be found in Figure 4 The relevant contents of step 4031 of the method 400 are not described in detail here.

[0138] Optionally, the detailed implementation process of the processing unit 702 performing the aggregation operation to obtain the aggregation calculation result corresponding to each column of data can be found in Figure 4 The relevant contents of step 4032 of the method 400 are not described in detail here.

[0139] Optionally, the query request further includes a join condition, where the join condition is used to indicate to perform a join operation on the data belonging to the first region in the first data table and the second data table;

[0140] The processing unit 702 is configured to:

[0141] Based on the connection condition, at least one row of first data belonging to the first region is obtained from a first data table corresponding to the first identifier, and at least one row of second data belonging to the first region is obtained from a second data table corresponding to the second identifier;

[0142] A join operation is performed on the at least one row of first data and the at least one row of second data to obtain a third data table.

[0143] Optionally, the detailed implementation process of the processing unit 702 obtaining the at least one row of first data and the at least one row of second data can be found in Figure 4 The relevant contents of step 4031 of the method 400 are not described in detail here.

[0144] Optionally, the detailed implementation process of the processing unit 702 performing the join operation on the at least one row of first data and the at least one row of second data can be found in Figure 4 The relevant contents of step 4031 of the method 400 are not described in detail here.

[0145] Optionally, the at least one row of first data includes first data belonging to a first target column and first data belonging to a second target column, the at least one row of second data includes second data belonging to the first target column and second data belonging to a third target column, the first target column is a column having the same column identifier in the first data table and the second data table, the second target column is a column in the first data table other than the first target column, and the third target column is a column in the second data table other than the first target column;

[0146] The third data table includes a first target column, a second target column and a third target column. The first target column in the third data table includes first data belonging to the first target column and second data belonging to the first target column. The second target column in the third data table includes the first data belonging to the second target column. The third target column in the third data table includes the second data belonging to the third target column.

[0147] Optionally, each data table in the multiple data tables is used to store data belonging to the first area.

[0148] Optionally, the receiving unit 701 is further configured to receive M rows of first data belonging to the first region and sent by the first device, where M is an integer greater than 0, and the M rows of first data belong to the first data table;

[0149] The processing unit 702 is further configured to store the M rows of first data in a first data table.

[0150] Optionally, the detailed implementation process of the receiving unit 701 receiving the M lines of first data can be found in Figure 3 The relevant contents of step 303 of the method 300 are not described in detail here.

[0151] Optionally, the detailed implementation process of the processing unit 702 storing the M rows of first data in the first data table can be found in Figure 3The relevant contents of step 303 of the method 300 are not described in detail here.

[0152] Optionally, the device 700 also includes multiple storage devices, and the first data table is stored on the multiple storage devices. The processing unit 702 is used to store one or more rows of first data in the first data table of each storage device, and the M rows of first data include one or more rows of first data stored in the first data table of each storage device.

[0153] Optionally, the detailed implementation process of the processing unit 702 storing one or more rows of first data in the first data table of each storage device can be found in Figure 3 The relevant contents of step 303 of the method 300 are not described in detail here.

[0154] In an embodiment of the present application, since the receiving unit receives a query request sent by the first device of the distributed storage system, the processing unit obtains an aggregation result based on the first identifier and the second identifier included in the query request, and the sending unit sends a query response to the first device, and the query response includes the aggregation result. Since the amount of data in the aggregation result is less than the amount of data in the first data table and less than the amount of data in the second data table, compared with sending the first data table and the second data table to the first device, the first device performs the aggregation operation, and the present application can reduce the occupation of network resources, thereby saving network resources.

[0155] See also Figure 8 , the present application embodiment provides a computing device 800. The computing device 800 may be Figure 1 or Figure 2 A device (such as a second device or a storage device) in the distributed storage system 100 shown, or Figure 3 The second device in the method 300, or Figure 4 The second device or storage device in the method 640 shown. Figure 8 As shown, the computing device 800 includes: a bus 802, a processor 804, a memory 806, and a communication interface 808. The processor 804, the memory 806, and the communication interface 808 communicate through the bus 802. The computing device 800 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 800.

[0156] The bus 802 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus 802 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 802 may include a path for transmitting information between various components of the computing device 800 (eg, the memory 806, the processor 804, and the communication interface 808).

[0157] The processor 804 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0158] The memory 806 may include a volatile memory, such as a random access memory (RAM). The memory 806 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0159] See also Figure 8 , the memory 806 stores executable program codes, and the processor 804 executes the executable program codes to respectively implement Figure 7 The functions of the receiving unit 701, the processing unit 702 and the sending unit 703 in the device 700 shown in the figure are implemented to implement the method provided by any of the above embodiments. That is, the memory 806 stores instructions for executing the method provided by any of the above embodiments. Or,

[0160] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or communication networks.

[0161] The embodiment of the present application also provides a cluster for processing a data table. The cluster for processing a data table includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0162] like Fig. 9As shown, the cluster for processing data tables includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the cluster for processing data tables may store the same instructions for executing the method provided in any of the above embodiments.

[0163] In some possible implementations, the memory 806 of one or more computing devices 800 in the cluster for processing the data table may also respectively store partial instructions for executing the method for processing the data table. In other words, the combination of one or more computing devices 800 may jointly execute instructions for executing the method provided in any of the above embodiments.

[0164] In some possible implementations, one or more computing devices in a cluster processing a data table may be connected via a network, which may be a wide area network or a local area network. Fig.10 A possible implementation is shown. Fig.10 As shown, two computing devices 800A and 800B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.

[0165] In this type of possible implementation, the memory 806 in the computing device 800A stores the execution Figure 7 Instructions for the functions of the processing unit 702 in the illustrated embodiment. Meanwhile, the memory 806 in the computing device 800B stores instructions for executing the functions of the processing unit 702 in the illustrated embodiment. Figure 7 Instructions for the functions of the receiving unit 701 and / or the sending unit 703 in the illustrated embodiment.

[0166] It should be understood that Fig.10 The functions of the computing device 800A shown in FIG. 8 may also be completed by multiple computing devices 800. Similarly, the functions of the computing device 800B may also be completed by multiple computing devices 800.

[0167] The present application embodiment also provides another cluster for processing data tables. The connection relationship between the computing devices in the cluster for processing data tables can be similarly referred to as Fig.10 The connection mode of the cluster for retrieving data is different in that the memory 806 in one or more computing devices 800 in the cluster for processing the data table may store the same instructions for executing the method provided by any of the above embodiments.

[0168] In some possible implementations, the memory 806 of one or more computing devices 800 in the cluster processing the data table may also store partial instructions for executing the method provided in any of the above embodiments. In other words, the combination of one or more computing devices 800 may jointly execute instructions for executing the method provided in any of the above embodiments.

[0169] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the method provided in any of the above embodiments.

[0170] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the method provided in any of the above embodiments.

[0171] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0172] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for processing a data table, characterized in that: The method is applied to a distributed storage system, the distributed storage system includes a first device and multiple sub-storage systems, the first device is used to access the multiple sub-storage systems, the multiple sub-storage systems are distributed in multiple areas, the multiple sub-storage systems include a first sub-storage system, the first sub-storage system includes multiple data tables, and the method includes: The first sub-storage system receives a query request forwarded by the first device, the query request including an aggregation operation, a first identifier of a first data table to be queried and a second identifier of a second data table, the multiple data tables including the first data table and the second data table; The first sub-storage system acquires an aggregation result based on the first identifier and the second identifier, the aggregation result being a result of performing the aggregation operation on at least one row of first data belonging to a first region in the first data table and at least one row of second data belonging to the first region in the second data table, the first region being a region where the first sub-storage system is located; The first sub-storage system sends a query response to the first device, where the query response includes the aggregated result.

2. The method according to claim 1, characterized in that The first sub-storage system obtains an aggregation result based on the first identifier and the second identifier, including: The first sub-storage system acquires a third data table based on the first identifier and the second identifier, the third data table including at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table; The first sub-storage system performs the aggregation operation on each column of data in the third data table respectively to obtain an aggregation calculation result corresponding to each column of data, wherein the aggregation result includes the aggregation calculation result corresponding to each column of data.

3. The method according to claim 2, characterized in that The query request further includes a join condition, where the join condition is used to indicate that a join operation is performed on the data belonging to the first region in the first data table and the second data table; The first sub-storage system acquires a third data table based on the first identifier and the second identifier, including: The first sub-storage system acquires, based on the connection condition, at least one row of first data belonging to the first region from the first data table corresponding to the first identifier, and acquires at least one row of second data belonging to the first region from the second data table corresponding to the second identifier; The first sub-storage system performs a join operation on the at least one row of first data and the at least one row of second data to obtain the third data table.

4. The method according to claim 3, characterized in that The at least one row of first data includes first data belonging to a first target column and first data belonging to a second target column, the at least one row of second data includes second data belonging to the first target column and second data belonging to a third target column, the first target column is a column with the same column identifier in the first data table and the second data table, the second target column is a column in the first data table other than the first target column, and the third target column is a column in the second data table other than the first target column; The third data table includes the first target column, the second target column and the third target column. The first target column in the third data table includes first data belonging to the first target column and second data belonging to the first target column. The second target column in the third data table includes first data belonging to the second target column. The third target column in the third data table includes second data belonging to the third target column.

5. The method according to any one of claims 1 to 4, characterized in that: Each data table in the plurality of data tables is used to store data belonging to the first area.

6. The method according to claims 1 to 5, characterized in that The method further comprises: The first sub-storage system receives M lines of first data belonging to the first area and sent by the first device, where M is an integer greater than 0, and the M lines of first data belong to the first data table; The first sub-storage system stores the M rows of first data in the first data table.

7. The method according to claim 6, characterized in that The first sub-storage system further includes a plurality of storage devices, the first data table is stored on the plurality of storage devices, and the first sub-storage system stores the M rows of first data in the first data table, including: The first sub-storage system stores one or more rows of first data in the first data table of each storage device, and the M rows of first data include one or more rows of first data stored in the first data table of each storage device.

8. A device for processing a data table, characterized in that: The apparatus is applied to a distributed storage system, the distributed storage system includes a first device and multiple sub-storage systems, the first device is used to access the multiple sub-storage systems, the multiple sub-storage systems are distributed in multiple areas, the multiple sub-storage systems include the apparatus, the apparatus includes multiple data tables, and the apparatus further includes: A receiving unit, configured to receive a query request forwarded by the first device, wherein the query request includes an aggregation operation, a first identifier of a first data table to be queried, and a second identifier of a second data table, wherein the multiple data tables include the first data table and the second data table; a processing unit, configured to obtain an aggregation result based on the first identifier and the second identifier, the aggregation result being a result of performing the aggregation operation on at least one row of first data belonging to a first region in the first data table and at least one row of second data belonging to the first region in the second data table, the first region being a region where the device is located; A sending unit is used to send a query response to the first device, where the query response includes the aggregation result.

9. The device according to claim 8, characterized in that The processing unit is used for: Acquire a third data table based on the first identifier and the second identifier, the third data table including at least one row of first data belonging to the first region in the first data table and at least one row of second data belonging to the first region in the second data table; The aggregation operation is performed on each column of data in the third data table to obtain the aggregation calculation result corresponding to each column of data, and the aggregation result includes the aggregation calculation result corresponding to each column of data.

10. The device according to claim 9, characterized in that The query request further includes a join condition, where the join condition is used to indicate that a join operation is performed on the data belonging to the first region in the first data table and the second data table; The processing unit is used for: Based on the connection condition, acquiring at least one row of first data belonging to the first region from the first data table corresponding to the first identifier, and acquiring at least one row of second data belonging to the first region from the second data table corresponding to the second identifier; A join operation is performed on the at least one row of first data and the at least one row of second data to obtain the third data table.

11. The device according to claim 10, characterized in that The at least one row of first data includes first data belonging to a first target column and first data belonging to a second target column, the at least one row of second data includes second data belonging to the first target column and second data belonging to a third target column, the first target column is a column with the same column identifier in the first data table and the second data table, the second target column is a column in the first data table other than the first target column, and the third target column is a column in the second data table other than the first target column; The third data table includes the first target column, the second target column and the third target column. The first target column in the third data table includes first data belonging to the first target column and second data belonging to the first target column. The second target column in the third data table includes first data belonging to the second target column. The third target column in the third data table includes second data belonging to the third target column.

12. The device according to any one of claims 8 to 11, characterized in that: Each data table in the plurality of data tables is used to store data belonging to the first area.

13. The device according to claims 8-12, characterized in that The receiving unit is further configured to receive M rows of first data belonging to the first region and sent by the first device, where M is an integer greater than 0, and the M rows of first data belong to the first data table; The processing unit is further configured to store the M rows of first data in the first data table.

14. The device according to claim 13, characterized in that The apparatus also includes multiple storage devices, the first data table is stored on the multiple storage devices, and the processing unit is used to store one or more rows of first data in the first data table of each storage device, and the M rows of first data include one or more rows of first data stored in the first data table of each storage device.

15. A cluster for processing a data table, characterized in that: The cluster includes at least one computing device, each of the at least one computing device includes at least one processor and at least one memory, and the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the cluster executes the method according to any one of claims 1 to 7.

16. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data table information processing method and apparatus

    CN106933933A

  • Database cluster data processing method, device and system, medium and electronic equipment

    CN113672641A

  • Database query optimization method, device and equipment and computer readable storage medium

    CN114356969A

  • Node-level sub-queries in distributed databases

    US20100094851A1

  • Distributed Pseudo-Random Subset Generation

    US20220318243A1